Skip to content

Commit dc24094

Browse files
authored
Merge pull request #30 from codatio/speakeasy-sdk-regen-1708618354
chore: 🐝 Update SDK - Generate Accounting library
2 parents 47418c8 + 91f58f7 commit dc24094

File tree

1,307 files changed

+255847
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,307 files changed

+255847
-22
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+
10+
# This allows generated code to be indexed correctly
11+
*.java linguist-generated=false
12+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
# Ignore Gradle build output directory
4+
build
5+
bin/
6+
# Ignore IDE-specific configs
7+
.project
8+
.settings/
9+
.DS_Store

previous-versions/accounting/.speakeasy/gen.lock

Lines changed: 1327 additions & 0 deletions
Large diffs are not rendered by default.

previous-versions/accounting/README.md

Lines changed: 620 additions & 9 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
## 2024-02-22 16:12:31
4+
### Changes
5+
Based on:
6+
- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Accounting.yaml
7+
- Speakeasy CLI 1.190.0 (2.268.0) https://github.com/speakeasy-api/speakeasy
8+
### Generated
9+
- [java v0.1.0] previous-versions/accounting
10+
### Releases
11+
- [Maven Central v0.1.0] https://central.sonatype.com/artifact/io.codat/accounting/0.1.0 - previous-versions/accounting
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!-- Start SDK Example Usage [usage] -->
2+
```java
3+
package hello.world;
4+
5+
import io.codat.accounting.CodatAccounting;
6+
import io.codat.accounting.models.components.*;
7+
import io.codat.accounting.models.components.Security;
8+
import io.codat.accounting.models.operations.*;
9+
import io.codat.accounting.models.operations.GetAccountTransactionRequest;
10+
import io.codat.accounting.models.operations.GetAccountTransactionResponse;
11+
import java.time.LocalDate;
12+
import java.time.OffsetDateTime;
13+
import java.util.Optional;
14+
import static java.util.Map.entry;
15+
16+
public class Application {
17+
18+
public static void main(String[] args) {
19+
try {
20+
CodatAccounting sdk = CodatAccounting.builder()
21+
.authHeader("Basic BASE_64_ENCODED(API_KEY)")
22+
.build();
23+
24+
GetAccountTransactionRequest req = GetAccountTransactionRequest.builder()
25+
.accountTransactionId("<value>")
26+
.companyId("8a210b68-6988-11ed-a1eb-0242ac120002")
27+
.connectionId("2e9d2c44-f675-40ba-8049-353bfcb5e171")
28+
.build();
29+
30+
GetAccountTransactionResponse res = sdk.accountTransactions().get()
31+
.request(req)
32+
.call();
33+
34+
if (res.accountTransaction().isPresent()) {
35+
// handle response
36+
}
37+
} catch (io.codat.accounting.models.errors.SDKError e) {
38+
// handle exception
39+
} catch (Exception e) {
40+
// handle exception
41+
}
42+
}
43+
}
44+
```
45+
<!-- End SDK Example Usage [usage] -->
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
2+
plugins {
3+
// Apply the java-library plugin for API and implementation separation.
4+
id 'java-library'
5+
id 'maven-publish'
6+
id 'signing'
7+
id 'cl.franciscosolis.sonatype-central-upload' version '1.0.0'
8+
}
9+
10+
compileJava.options.encoding = "UTF-8"
11+
compileTestJava.options.encoding = "UTF-8"
12+
13+
repositories {
14+
// Use Maven Central for resolving dependencies.
15+
mavenCentral()
16+
}
17+
java {
18+
sourceCompatibility = JavaVersion.VERSION_11
19+
targetCompatibility = JavaVersion.VERSION_11
20+
withSourcesJar()
21+
withJavadocJar()
22+
}
23+
24+
model {
25+
tasks.generatePomFileForMavenPublication {
26+
destination = file("$buildDir/pom.xml")
27+
}
28+
}
29+
30+
jar {
31+
dependsOn(":generatePomFileForMavenPublication")
32+
archiveBaseName = "accounting"
33+
34+
into("META-INF/maven/io.codat/accounting") {
35+
from("$buildDir/pom.xml")
36+
}
37+
}
38+
39+
javadoc {
40+
options.encoding = "UTF-8"
41+
42+
if(JavaVersion.current().isJava9Compatible()) {
43+
options.addBooleanOption('html5', true)
44+
}
45+
options.addStringOption('Xdoclint:none', '-quiet')
46+
}
47+
48+
49+
tasks.withType(Javadoc) {
50+
failOnError false
51+
options.addStringOption('Xdoclint:none', '-quiet')
52+
}
53+
group = "io.codat"
54+
version = "0.1.0"
55+
56+
sourcesJar {
57+
archiveBaseName = "accounting"
58+
}
59+
60+
javadocJar {
61+
archiveBaseName = "accounting"
62+
}
63+
64+
sonatypeCentralUpload {
65+
// This is your Sonatype generated username
66+
username = System.getenv("SONATYPE_USERNAME")
67+
// This is your sonatype generated password
68+
password = System.getenv("SONATYPE_PASSWORD")
69+
70+
// This is a list of files to upload. Ideally you would point to your jar file, source and javadoc jar (required by central)
71+
archives = files(
72+
"$buildDir/libs/accounting-${version}.jar",
73+
"$buildDir/libs/accounting-${version}-sources.jar",
74+
"$buildDir/libs/accounting-${version}-javadoc.jar"
75+
)
76+
77+
// This is the pom file to upload. This is required by central
78+
pom = file("$buildDir/pom.xml")
79+
80+
// This is your PGP private key. This is required to sign your files
81+
signingKey = System.getenv("SONATYPE_SIGNING_KEY")
82+
// This is your PGP private key passphrase to decrypt your private key
83+
signingKeyPassphrase = System.getenv("SIGNING_KEY_PASSPHRASE")
84+
}
85+
publishing {
86+
87+
publications {
88+
maven(MavenPublication) {
89+
groupId = 'io.codat'
90+
artifactId = 'accounting'
91+
version = '0.1.0'
92+
93+
from components.java
94+
95+
pom {
96+
name = 'Codat Java SDK'
97+
description = 'SDK enabling Java developers to easily integrate with the Codat API.'
98+
url = 'https://github.com/codatio/client-sdk-java/previous-versions/accounting'
99+
scm {
100+
url = 'github.com/codatio/client-sdk-java/previous-versions/accounting'
101+
connection = 'scm:git:ssh://git@github.com/codatio/client-sdk-java/previous-versions/accounting.git'
102+
}
103+
licenses {
104+
license {
105+
name = 'The MIT License (MIT)'
106+
url = 'https://mit-license.org/'
107+
}
108+
}
109+
developers {
110+
developer {
111+
name = 'Codat'
112+
organization = 'Codat'
113+
email = 'support@codat.io'
114+
}
115+
}
116+
organization {
117+
name = 'Codat'
118+
url = 'https://www.codat.io/'
119+
}
120+
}
121+
}
122+
}
123+
}
124+
125+
if (!project.hasProperty('skip.signing')) {
126+
signing {
127+
def signingKey = findProperty("signingKey")
128+
def signingPassphrase = findProperty("signingPassphrase")
129+
useInMemoryPgpKeys(signingKey, signingPassphrase)
130+
sign publishing.publications.maven
131+
}
132+
}
133+
134+
dependencies {
135+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
136+
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1'
137+
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.16.1'
138+
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
139+
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
140+
implementation 'org.apache.httpcomponents:httpmime:4.5.14'
141+
implementation 'com.jayway.jsonpath:json-path:2.9.0'
142+
implementation 'commons-io:commons-io:2.15.1'
143+
}
144+

0 commit comments

Comments
 (0)