Skip to content

Latest commit

 

History

History
392 lines (268 loc) · 18.5 KB

File metadata and controls

392 lines (268 loc) · 18.5 KB

Schemas

(schemas)

Overview

REST APIs for managing Schema entities

Available Operations

delete_schema

Delete a particular schema revision for an Api.

Example Usage

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

Parameters

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.

Response

operations.DeleteSchemaResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

download_schema

Download the latest schema for a particular apiID.

Example Usage

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

Parameters

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.

Response

operations.DownloadSchemaResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

download_schema_revision

Download a particular schema revision for an Api.

Example Usage

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

Parameters

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.

Response

operations.DownloadSchemaRevisionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_schema

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.

Example Usage

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

Parameters

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.

Response

operations.GetSchemaResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_schema_diff

Get a diff of two schema revisions for an Api.

Example Usage

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

Parameters

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.

Response

operations.GetSchemaDiffResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_schema_revision

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.

Example Usage

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

Parameters

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.

Response

operations.GetSchemaRevisionResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_schemas

Returns information the schemas associated with a particular apiID. This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.

Example Usage

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

Parameters

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.

Response

operations.GetSchemasResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

register_schema

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.

Example Usage

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

Parameters

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.

Response

operations.RegisterSchemaResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /