(schemas)
REST APIs for managing Schema entities
- delete_schema - Delete a particular schema revision for an Api.
- download_schema - Download the latest schema for a particular apiID.
- download_schema_revision - Download a particular schema revision for an Api.
- get_schema - Get information about the latest schema.
- get_schema_diff - Get a diff of two schema revisions for an Api.
- get_schema_revision - Get information about a particular schema revision for an Api.
- get_schemas - Get information about all schemas associated with a particular apiID.
- register_schema - Register a schema.
Delete a particular schema revision for an Api.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.delete_schema(request={
"api_id": "<value>",
"version_id": "<value>",
"revision_id": "<value>",
})
if res is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteSchemaRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DeleteSchemaResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Download the latest schema for a particular apiID.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.download_schema(request={
"api_id": "<value>",
"version_id": "<value>",
})
if res.two_hundred_application_json_schema is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DownloadSchemaRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DownloadSchemaResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Download a particular schema revision for an Api.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.download_schema_revision(request={
"api_id": "<value>",
"version_id": "<value>",
"revision_id": "<value>",
})
if res.two_hundred_application_json_schema is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DownloadSchemaRevisionRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.DownloadSchemaRevisionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns information about the last uploaded schema for a particular API version. This won't include the schema itself, that can be retrieved via the downloadSchema operation.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.get_schema(request={
"api_id": "<value>",
"version_id": "<value>",
})
if res.schema_ is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetSchemaRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get a diff of two schema revisions for an Api.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.get_schema_diff(request={
"api_id": "<value>",
"version_id": "<value>",
"base_revision_id": "<value>",
"target_revision_id": "<value>",
})
if res.schema_diff is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetSchemaDiffRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetSchemaDiffResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns information about the last uploaded schema for a particular schema revision. This won't include the schema itself, that can be retrieved via the downloadSchema operation.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.get_schema_revision(request={
"api_id": "<value>",
"version_id": "<value>",
"revision_id": "<value>",
})
if res.schema_ is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetSchemaRevisionRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.GetSchemaRevisionResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns information the schemas associated with a particular apiID. This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.get_schemas(request={
"api_id": "<value>",
"version_id": "<value>",
})
if res.classes is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetSchemasRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Allows uploading a schema for a particular API version. This will be used to populate ApiEndpoints and used as a base for any schema generation if present.
from speakeasy_client_sdk_python import Speakeasy
from speakeasy_client_sdk_python.models import shared
s = Speakeasy(
security=shared.Security(
api_key="<YOUR_API_KEY_HERE>",
),
)
res = s.schemas.register_schema(request={
"api_id": "<value>",
"version_id": "<value>",
"request_body": {
"file": {
"content": open("<file_path>", "rb"),
"file_name": "your_file_here",
},
},
})
if res is not None:
# handle response
pass
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.RegisterSchemaRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
operations.RegisterSchemaResponse
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |