Skip to content

Commit b84316f

Browse files
authored
Merge pull request #11 from codatio/speakeasy-sdk-regen-1707403508
chore: 🐝 Update SDK - Generate Platform library
2 parents 2a32514 + 967256c commit b84316f

File tree

447 files changed

+56167
-24
lines changed

Some content is hidden

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

447 files changed

+56167
-24
lines changed

platform/.gitattributes

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+

platform/.gitignore

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

platform/.speakeasy/gen.lock

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

platform/README.md

Lines changed: 358 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,367 @@
44
Manage the building blocks of Codat, including companies, connections, and more.
55
<!-- End Codat Library Description -->
66

7-
<!-- Start SDK Installation -->
8-
replace me
9-
<!-- End SDK Installation -->
7+
<!-- Start SDK Installation [installation] -->
8+
## SDK Installation
9+
10+
### Gradle
11+
12+
```groovy
13+
implementation 'io.codat.platform:openapi:0.1.0'
14+
```
15+
<!-- End SDK Installation [installation] -->
1016

1117
## Example Usage
12-
<!-- Start SDK Example Usage -->
13-
replace me
14-
<!-- End SDK Example Usage -->
18+
<!-- Start SDK Example Usage [usage] -->
19+
## SDK Example Usage
20+
21+
### Example
22+
23+
```java
24+
package hello.world;
25+
26+
import io.codat.platform.CodatPlatform;
27+
import io.codat.platform.models.operations.*;
28+
import io.codat.platform.models.operations.CreateApiKeyResponse;
29+
import io.codat.platform.models.shared.*;
30+
import io.codat.platform.models.shared.CreateApiKey;
31+
import io.codat.platform.models.shared.Security;
32+
import java.time.LocalDate;
33+
import java.time.OffsetDateTime;
34+
import static java.util.Map.entry;
35+
36+
public class Application {
37+
38+
public static void main(String[] args) {
39+
try {
40+
CodatPlatform sdk = CodatPlatform.builder()
41+
.security(Security.builder()
42+
.authHeader("<YOUR_API_KEY_HERE>")
43+
.build())
44+
.build();
45+
46+
CreateApiKey req = CreateApiKey.builder()
47+
.name("azure-invoice-finance-processor")
48+
.build();
49+
50+
CreateApiKeyResponse res = sdk.settings().createApiKey()
51+
.request(req)
52+
.call();
53+
54+
if (res.apiKeyDetails().isPresent()) {
55+
// handle response
56+
}
57+
58+
} catch (io.codat.platform.models.errors.SDKError e) {
59+
// handle exception
60+
} catch (Exception e) {
61+
// handle exception
62+
}
63+
}
64+
}
65+
```
66+
<!-- End SDK Example Usage [usage] -->
67+
68+
<!-- Start Available Resources and Operations [operations] -->
69+
## Available Resources and Operations
70+
71+
### [settings()](docs/sdks/settings/README.md)
72+
73+
* [createApiKey](docs/sdks/settings/README.md#createapikey) - Create API key
74+
* [deleteApiKey](docs/sdks/settings/README.md#deleteapikey) - Delete API key
75+
* [getProfile](docs/sdks/settings/README.md#getprofile) - Get profile
76+
* [getSyncSettings](docs/sdks/settings/README.md#getsyncsettings) - Get sync settings
77+
* [listApiKeys](docs/sdks/settings/README.md#listapikeys) - List API keys
78+
* [updateProfile](docs/sdks/settings/README.md#updateprofile) - Update profile
79+
* [updateSyncSettings](docs/sdks/settings/README.md#updatesyncsettings) - Update all sync settings
80+
81+
### [companies()](docs/sdks/companies/README.md)
82+
83+
* [create](docs/sdks/companies/README.md#create) - Create company
84+
* [delete](docs/sdks/companies/README.md#delete) - Delete a company
85+
* [get](docs/sdks/companies/README.md#get) - Get company
86+
* [list](docs/sdks/companies/README.md#list) - List companies
87+
* [update](docs/sdks/companies/README.md#update) - Update company
88+
89+
### [connections()](docs/sdks/connections/README.md)
90+
91+
* [create](docs/sdks/connections/README.md#create) - Create connection
92+
* [delete](docs/sdks/connections/README.md#delete) - Delete connection
93+
* [get](docs/sdks/connections/README.md#get) - Get connection
94+
* [list](docs/sdks/connections/README.md#list) - List connections
95+
* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection
96+
* [updateAuthorization](docs/sdks/connections/README.md#updateauthorization) - Update authorization
97+
98+
### [customDataType()](docs/sdks/customdatatype/README.md)
99+
100+
* [configure](docs/sdks/customdatatype/README.md#configure) - Configure custom data type
101+
* [getConfiguration](docs/sdks/customdatatype/README.md#getconfiguration) - Get custom data configuration
102+
* [list](docs/sdks/customdatatype/README.md#list) - List custom data type records
103+
* [refresh](docs/sdks/customdatatype/README.md#refresh) - Refresh custom data type
104+
105+
### [pushData()](docs/sdks/pushdata/README.md)
106+
107+
* [getModelOptions](docs/sdks/pushdata/README.md#getmodeloptions) - Get push options
108+
* [getOperation](docs/sdks/pushdata/README.md#getoperation) - Get push operation
109+
* [listOperations](docs/sdks/pushdata/README.md#listoperations) - List push operations
110+
111+
### [refreshData()](docs/sdks/refreshdata/README.md)
112+
113+
* [all](docs/sdks/refreshdata/README.md#all) - Refresh all data
114+
* [byDataType](docs/sdks/refreshdata/README.md#bydatatype) - Refresh data type
115+
* [get](docs/sdks/refreshdata/README.md#get) - Get data status
116+
* [getPullOperation](docs/sdks/refreshdata/README.md#getpulloperation) - Get pull operation
117+
* [listPullOperations](docs/sdks/refreshdata/README.md#listpulloperations) - List pull operations
118+
119+
### [groups()](docs/sdks/groups/README.md)
120+
121+
* [addCompany](docs/sdks/groups/README.md#addcompany) - Add company
122+
* [create](docs/sdks/groups/README.md#create) - Create group
123+
* [list](docs/sdks/groups/README.md#list) - List groups
124+
* [removeCompany](docs/sdks/groups/README.md#removecompany) - Remove company
125+
126+
### [integrations()](docs/sdks/integrations/README.md)
127+
128+
* [get](docs/sdks/integrations/README.md#get) - Get integration
129+
* [getBranding](docs/sdks/integrations/README.md#getbranding) - Get branding
130+
* [list](docs/sdks/integrations/README.md#list) - List integrations
131+
132+
### [supplementalData()](docs/sdks/supplementaldata/README.md)
133+
134+
* [configure](docs/sdks/supplementaldata/README.md#configure) - Configure
135+
* [getConfiguration](docs/sdks/supplementaldata/README.md#getconfiguration) - Get configuration
136+
137+
### [webhooks()](docs/sdks/webhooks/README.md)
138+
139+
* [create](docs/sdks/webhooks/README.md#create) - Create webhook
140+
* [get](docs/sdks/webhooks/README.md#get) - Get webhook
141+
* [list](docs/sdks/webhooks/README.md#list) - List webhooks
142+
<!-- End Available Resources and Operations [operations] -->
143+
144+
<!-- Start Error Handling [errors] -->
145+
## Error Handling
146+
147+
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Exception type.
148+
149+
| Error Object | Status Code | Content Type |
150+
| --------------------- | --------------------- | --------------------- |
151+
| models/errorsSDKError | 4xx-5xx | */* |
152+
153+
### Example
154+
155+
```java
156+
package hello.world;
157+
158+
import io.codat.platform.CodatPlatform;
159+
import io.codat.platform.models.operations.*;
160+
import io.codat.platform.models.operations.CreateApiKeyResponse;
161+
import io.codat.platform.models.shared.*;
162+
import io.codat.platform.models.shared.CreateApiKey;
163+
import io.codat.platform.models.shared.Security;
164+
import java.time.LocalDate;
165+
import java.time.OffsetDateTime;
166+
import static java.util.Map.entry;
167+
168+
public class Application {
169+
170+
public static void main(String[] args) {
171+
try {
172+
CodatPlatform sdk = CodatPlatform.builder()
173+
.security(Security.builder()
174+
.authHeader("<YOUR_API_KEY_HERE>")
175+
.build())
176+
.build();
177+
178+
CreateApiKey req = CreateApiKey.builder()
179+
.name("azure-invoice-finance-processor")
180+
.build();
181+
182+
CreateApiKeyResponse res = sdk.settings().createApiKey()
183+
.request(req)
184+
.call();
185+
186+
if (res.apiKeyDetails().isPresent()) {
187+
// handle response
188+
}
189+
190+
} catch (io.codat.platform.models.errors.SDKError e) {
191+
// handle exception
192+
} catch (Exception e) {
193+
// handle exception
194+
}
195+
}
196+
}
197+
```
198+
<!-- End Error Handling [errors] -->
199+
200+
<!-- Start Server Selection [server] -->
201+
## Server Selection
202+
203+
### Select Server by Index
204+
205+
You can override the default server globally by passing a server index to the `serverIndex` builder method when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
206+
207+
| # | Server | Variables |
208+
| - | ------ | --------- |
209+
| 0 | `https://api.codat.io` | None |
210+
211+
#### Example
212+
213+
```java
214+
package hello.world;
215+
216+
import io.codat.platform.CodatPlatform;
217+
import io.codat.platform.models.operations.*;
218+
import io.codat.platform.models.operations.CreateApiKeyResponse;
219+
import io.codat.platform.models.shared.*;
220+
import io.codat.platform.models.shared.CreateApiKey;
221+
import io.codat.platform.models.shared.Security;
222+
import java.time.LocalDate;
223+
import java.time.OffsetDateTime;
224+
import static java.util.Map.entry;
225+
226+
public class Application {
227+
228+
public static void main(String[] args) {
229+
try {
230+
CodatPlatform sdk = CodatPlatform.builder()
231+
.serverIndex(0)
232+
.security(Security.builder()
233+
.authHeader("<YOUR_API_KEY_HERE>")
234+
.build())
235+
.build();
236+
237+
CreateApiKey req = CreateApiKey.builder()
238+
.name("azure-invoice-finance-processor")
239+
.build();
240+
241+
CreateApiKeyResponse res = sdk.settings().createApiKey()
242+
.request(req)
243+
.call();
244+
245+
if (res.apiKeyDetails().isPresent()) {
246+
// handle response
247+
}
248+
249+
} catch (io.codat.platform.models.errors.SDKError e) {
250+
// handle exception
251+
} catch (Exception e) {
252+
// handle exception
253+
}
254+
}
255+
}
256+
```
257+
258+
259+
### Override Server URL Per-Client
260+
261+
The default server can also be overridden globally by passing a URL to the `serverURL` builder method when initializing the SDK client instance. For example:
262+
```java
263+
package hello.world;
264+
265+
import io.codat.platform.CodatPlatform;
266+
import io.codat.platform.models.operations.*;
267+
import io.codat.platform.models.operations.CreateApiKeyResponse;
268+
import io.codat.platform.models.shared.*;
269+
import io.codat.platform.models.shared.CreateApiKey;
270+
import io.codat.platform.models.shared.Security;
271+
import java.time.LocalDate;
272+
import java.time.OffsetDateTime;
273+
import static java.util.Map.entry;
274+
275+
public class Application {
276+
277+
public static void main(String[] args) {
278+
try {
279+
CodatPlatform sdk = CodatPlatform.builder()
280+
.serverURL("https://api.codat.io")
281+
.security(Security.builder()
282+
.authHeader("<YOUR_API_KEY_HERE>")
283+
.build())
284+
.build();
285+
286+
CreateApiKey req = CreateApiKey.builder()
287+
.name("azure-invoice-finance-processor")
288+
.build();
289+
290+
CreateApiKeyResponse res = sdk.settings().createApiKey()
291+
.request(req)
292+
.call();
293+
294+
if (res.apiKeyDetails().isPresent()) {
295+
// handle response
296+
}
297+
298+
} catch (io.codat.platform.models.errors.SDKError e) {
299+
// handle exception
300+
} catch (Exception e) {
301+
// handle exception
302+
}
303+
}
304+
}
305+
```
306+
<!-- End Server Selection [server] -->
307+
308+
<!-- Start Authentication [security] -->
309+
## Authentication
310+
311+
### Per-Client Security Schemes
312+
313+
This SDK supports the following security scheme globally:
314+
315+
| Name | Type | Scheme |
316+
| ------------ | ------------ | ------------ |
317+
| `authHeader` | apiKey | API key |
318+
319+
You can set the security parameters through the `security` builder method when initializing the SDK client instance. For example:
320+
```java
321+
package hello.world;
322+
323+
import io.codat.platform.CodatPlatform;
324+
import io.codat.platform.models.operations.*;
325+
import io.codat.platform.models.operations.CreateApiKeyResponse;
326+
import io.codat.platform.models.shared.*;
327+
import io.codat.platform.models.shared.CreateApiKey;
328+
import io.codat.platform.models.shared.Security;
329+
import java.time.LocalDate;
330+
import java.time.OffsetDateTime;
331+
import static java.util.Map.entry;
332+
333+
public class Application {
334+
335+
public static void main(String[] args) {
336+
try {
337+
CodatPlatform sdk = CodatPlatform.builder()
338+
.security(Security.builder()
339+
.authHeader("<YOUR_API_KEY_HERE>")
340+
.build())
341+
.build();
342+
343+
CreateApiKey req = CreateApiKey.builder()
344+
.name("azure-invoice-finance-processor")
345+
.build();
346+
347+
CreateApiKeyResponse res = sdk.settings().createApiKey()
348+
.request(req)
349+
.call();
350+
351+
if (res.apiKeyDetails().isPresent()) {
352+
// handle response
353+
}
354+
355+
} catch (io.codat.platform.models.errors.SDKError e) {
356+
// handle exception
357+
} catch (Exception e) {
358+
// handle exception
359+
}
360+
}
361+
}
362+
```
363+
<!-- End Authentication [security] -->
364+
365+
<!-- Placeholder for Future Speakeasy SDK Sections -->
366+
15367

16-
<!-- Start SDK Available Operations -->
17-
replace me
18-
<!-- End SDK Available Operations -->
19368
<!-- Start Codat Support Notes -->
20369
### Support
21370

0 commit comments

Comments
 (0)