Skip to content

Commit ccbcb19

Browse files
committed
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.252.0
1 parent 7935d40 commit ccbcb19

Some content is hidden

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

74 files changed

+2405
-559
lines changed

document/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.py linguist-generated=false

document/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
venv/
2+
src/*.egg-info/
3+
__pycache__/
4+
.pytest_cache/
5+
.python-version
6+
.DS_Store

document/.speakeasy/gen.lock

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
lockVersion: 2.0.0
2+
id: 9a4ef259-cfdc-4b1d-8700-53f45f47ce9c
3+
management:
4+
docChecksum: d94722927c616215809260501d67dfb6
5+
docVersion: 1.0.0
6+
speakeasyVersion: 1.252.0
7+
generationVersion: 2.306.0
8+
releaseVersion: 1.3.0
9+
configChecksum: e4e4b353fc1a0a99b83a67b72ca061a3
10+
repoURL: https://github.com/epilot-dev/sdk-python.git
11+
repoSubDirectory: document
12+
installationURL: https://github.com/epilot-dev/sdk-python.git#subdirectory=document
13+
features:
14+
python:
15+
additionalProperties: 0.1.0
16+
constsAndDefaults: 0.1.3
17+
core: 4.6.4
18+
flattening: 2.81.1
19+
globalSecurity: 2.83.5
20+
globalServerURLs: 2.82.2
21+
responseFormat: 0.1.0
22+
generatedFiles:
23+
- src/epilot/sdkconfiguration.py
24+
- src/epilot/documents.py
25+
- src/epilot/sdk.py
26+
- py.typed
27+
- pylintrc
28+
- setup.py
29+
- src/epilot/__init__.py
30+
- src/epilot/utils/__init__.py
31+
- src/epilot/utils/retries.py
32+
- src/epilot/utils/utils.py
33+
- src/epilot/models/errors/sdkerror.py
34+
- tests/helpers.py
35+
- src/epilot/models/operations/convertdocument.py
36+
- src/epilot/models/operations/generatedocumentv2.py
37+
- src/epilot/models/components/httpmetadata.py
38+
- src/epilot/models/components/convertdocumentresponse.py
39+
- src/epilot/models/components/s3reference.py
40+
- src/epilot/models/components/convertdocumentrequest.py
41+
- src/epilot/models/components/documentgenerationv2response.py
42+
- src/epilot/models/components/templatesettings.py
43+
- src/epilot/models/components/erroroutput.py
44+
- src/epilot/models/components/invalidcustomvariableerrordetail.py
45+
- src/epilot/models/components/errorcode.py
46+
- src/epilot/models/components/documentgenerationv2request.py
47+
- src/epilot/models/components/security.py
48+
- src/epilot/models/__init__.py
49+
- src/epilot/models/errors/__init__.py
50+
- src/epilot/models/operations/__init__.py
51+
- src/epilot/models/components/__init__.py
52+
- docs/models/operations/convertdocumentresponse.md
53+
- docs/models/operations/mode.md
54+
- docs/models/operations/generatedocumentv2request.md
55+
- docs/models/operations/generatedocumentv2response.md
56+
- docs/models/components/httpmetadata.md
57+
- docs/models/components/outputdocument.md
58+
- docs/models/components/convertdocumentresponse.md
59+
- docs/models/components/s3reference.md
60+
- docs/models/components/inputdocument.md
61+
- docs/models/components/outputformat.md
62+
- docs/models/components/convertdocumentrequest.md
63+
- docs/models/components/documentgenerationv2responseoutputdocument.md
64+
- docs/models/components/docxoutput.md
65+
- docs/models/components/jobstatus.md
66+
- docs/models/components/documentgenerationv2responseschemasoutputdocument.md
67+
- docs/models/components/pdfoutput.md
68+
- docs/models/components/documentgenerationv2responsevariablepayload.md
69+
- docs/models/components/documentgenerationv2response.md
70+
- docs/models/components/custommargins.md
71+
- docs/models/components/suggestedmargins.md
72+
- docs/models/components/templatesettings.md
73+
- docs/models/components/erroroutput.md
74+
- docs/models/components/invalidvariables.md
75+
- docs/models/components/context.md
76+
- docs/models/components/invalidcustomvariableerrordetail.md
77+
- docs/models/components/errorcode.md
78+
- docs/models/components/templatedocument.md
79+
- docs/models/components/variablepayload.md
80+
- docs/models/components/documentgenerationv2request.md
81+
- docs/models/components/security.md
82+
- docs/sdks/epilot/README.md
83+
- docs/sdks/documents/README.md
84+
- USAGE.md
85+
- .gitattributes
86+
- src/epilot/_hooks/sdkhooks.py
87+
- src/epilot/_hooks/types.py
88+
- src/epilot/_hooks/__init__.py

document/README.md

Lines changed: 202 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,231 @@
11
# epilot-document
22

3-
<!-- Start SDK Installation -->
3+
<!-- Start SDK Installation [installation] -->
44
## SDK Installation
55

66
```bash
77
pip install git+https://github.com/epilot-dev/sdk-python.git#subdirectory=document
88
```
9-
<!-- End SDK Installation -->
9+
<!-- End SDK Installation [installation] -->
1010

11+
<!-- Start SDK Example Usage [usage] -->
1112
## SDK Example Usage
12-
<!-- Start SDK Example Usage -->
13+
14+
### Example
15+
16+
```python
17+
import epilot
18+
from epilot.models import components
19+
20+
s = epilot.Epilot(
21+
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
22+
)
23+
24+
req = components.ConvertDocumentRequest(
25+
input_document=components.InputDocument(
26+
s3ref=components.S3Reference(
27+
bucket='document-api-prod',
28+
key='uploads/my-template.pdf',
29+
),
30+
),
31+
output_format=components.OutputFormat.PDF,
32+
output_filename='converted.pdf',
33+
)
34+
35+
res = s.documents.convert_document(req)
36+
37+
if res.convert_document_response is not None:
38+
# handle response
39+
pass
40+
41+
```
42+
<!-- End SDK Example Usage [usage] -->
43+
44+
<!-- Start Available Resources and Operations [operations] -->
45+
## Available Resources and Operations
46+
47+
### [documents](docs/sdks/documents/README.md)
48+
49+
* [convert_document](docs/sdks/documents/README.md#convert_document) - convertDocument
50+
* [generate_document_v2](docs/sdks/documents/README.md#generate_document_v2) - generateDocumentV2
51+
<!-- End Available Resources and Operations [operations] -->
52+
53+
<!-- Start Error Handling [errors] -->
54+
## Error Handling
55+
56+
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 raise the appropriate Error type.
57+
58+
| Error Object | Status Code | Content Type |
59+
| --------------- | --------------- | --------------- |
60+
| errors.SDKError | 4xx-5xx | */* |
61+
62+
### Example
63+
64+
```python
65+
import epilot
66+
from epilot.models import components, errors
67+
68+
s = epilot.Epilot(
69+
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
70+
)
71+
72+
req = components.ConvertDocumentRequest(
73+
input_document=components.InputDocument(
74+
s3ref=components.S3Reference(
75+
bucket='document-api-prod',
76+
key='uploads/my-template.pdf',
77+
),
78+
),
79+
output_format=components.OutputFormat.PDF,
80+
output_filename='converted.pdf',
81+
)
82+
83+
res = None
84+
try:
85+
res = s.documents.convert_document(req)
86+
except errors.SDKError as e:
87+
# handle exception
88+
raise(e)
89+
90+
if res.convert_document_response is not None:
91+
# handle response
92+
pass
93+
94+
```
95+
<!-- End Error Handling [errors] -->
96+
97+
<!-- Start Server Selection [server] -->
98+
## Server Selection
99+
100+
### Select Server by Index
101+
102+
You can override the default server globally by passing a server index to the `server_idx: int` optional parameter 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:
103+
104+
| # | Server | Variables |
105+
| - | ------ | --------- |
106+
| 0 | `https://document.sls.epilot.io` | None |
107+
108+
#### Example
109+
13110
```python
14111
import epilot
15-
from epilot.models import operations, shared
112+
from epilot.models import components
16113

17114
s = epilot.Epilot(
18-
security=shared.Security(
19-
epilot_auth="Bearer YOUR_BEARER_TOKEN_HERE",
115+
server_idx=0,
116+
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
117+
)
118+
119+
req = components.ConvertDocumentRequest(
120+
input_document=components.InputDocument(
121+
s3ref=components.S3Reference(
122+
bucket='document-api-prod',
123+
key='uploads/my-template.pdf',
124+
),
20125
),
126+
output_format=components.OutputFormat.PDF,
127+
output_filename='converted.pdf',
21128
)
22129

130+
res = s.documents.convert_document(req)
131+
132+
if res.convert_document_response is not None:
133+
# handle response
134+
pass
135+
136+
```
137+
138+
139+
### Override Server URL Per-Client
140+
141+
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
142+
```python
143+
import epilot
144+
from epilot.models import components
145+
146+
s = epilot.Epilot(
147+
server_url="https://document.sls.epilot.io",
148+
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
149+
)
23150

24-
req = operations.GenerateDocumentRequestBody(
25-
context_entity_id="bcd0aab9-b544-42b0-8bfb-6d449d02eacc",
26-
language="de",
27-
template_document=operations.GenerateDocumentRequestBodyTemplateDocument(
28-
filename="my-template-{{order.order_number}}.docx",
29-
s3ref=shared.S3Reference(
30-
bucket="document-api-prod",
31-
key="uploads/my-template.pdf",
151+
req = components.ConvertDocumentRequest(
152+
input_document=components.InputDocument(
153+
s3ref=components.S3Reference(
154+
bucket='document-api-prod',
155+
key='uploads/my-template.pdf',
32156
),
33157
),
34-
user_id="100321",
158+
output_format=components.OutputFormat.PDF,
159+
output_filename='converted.pdf',
35160
)
36-
37-
res = s.documents.generate_document(req)
38161

39-
if res.generate_document_200_application_json_object is not None:
162+
res = s.documents.convert_document(req)
163+
164+
if res.convert_document_response is not None:
40165
# handle response
166+
pass
167+
41168
```
42-
<!-- End SDK Example Usage -->
169+
<!-- End Server Selection [server] -->
170+
171+
<!-- Start Custom HTTP Client [http-client] -->
172+
## Custom HTTP Client
173+
174+
The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object.
43175

44-
<!-- Start SDK Available Operations -->
45-
## SDK Available Operations
176+
For example, you could specify a header for every request that this sdk makes as follows:
177+
```python
178+
import epilot
179+
import requests
180+
181+
http_client = requests.Session()
182+
http_client.headers.update({'x-custom-header': 'someValue'})
183+
s = epilot.Epilot(client=http_client)
184+
```
185+
<!-- End Custom HTTP Client [http-client] -->
186+
187+
<!-- Start Authentication [security] -->
188+
## Authentication
189+
190+
### Per-Client Security Schemes
191+
192+
This SDK supports the following security scheme globally:
193+
194+
| Name | Type | Scheme |
195+
| ------------- | ------------- | ------------- |
196+
| `epilot_auth` | http | HTTP Bearer |
197+
198+
To authenticate with the API the `epilot_auth` parameter must be set when initializing the SDK client instance. For example:
199+
```python
200+
import epilot
201+
from epilot.models import components
202+
203+
s = epilot.Epilot(
204+
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
205+
)
206+
207+
req = components.ConvertDocumentRequest(
208+
input_document=components.InputDocument(
209+
s3ref=components.S3Reference(
210+
bucket='document-api-prod',
211+
key='uploads/my-template.pdf',
212+
),
213+
),
214+
output_format=components.OutputFormat.PDF,
215+
output_filename='converted.pdf',
216+
)
217+
218+
res = s.documents.convert_document(req)
219+
220+
if res.convert_document_response is not None:
221+
# handle response
222+
pass
223+
224+
```
225+
<!-- End Authentication [security] -->
46226

227+
<!-- Placeholder for Future Speakeasy SDK Sections -->
47228

48-
### documents
49229

50-
* `generate_document` - generateDocument
51-
<!-- End SDK Available Operations -->
52230

53231
### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)

document/RELEASES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,12 @@ Based on:
3434
### Changes
3535
Based on:
3636
- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/document.yaml
37-
- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy
37+
- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy
38+
39+
## 2024-04-15 02:30:21
40+
### Changes
41+
Based on:
42+
- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/document.yaml
43+
- Speakeasy CLI 1.252.0 (2.306.0) https://github.com/speakeasy-api/speakeasy
44+
### Generated
45+
- [python v1.3.0] document

0 commit comments

Comments
 (0)