Skip to content

list_schema_versions

list_schema_versions(
    type: SchemaVersionType,
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    schema_id: Optional[SchemaId] = None,
    namespace: Optional[SchemaVersionNamespaceName] = None,
    visibility: Optional[SchemaVersionVisibility] = None,
    semantic_version: Optional[SchemaVersionVersion] = None,
) -> ListSchemaVersionsResponse

Lists schema versions with the provided information.

Parameters:

Raises:

Examples:

ListSchemaVersions happy path for an example schema version.

>>> client.list_schema_versions(schema_id='example.ColorControl', type='capability')
ListSchemaVersions by version.
>>> client.list_schema_versions(type='capability', semantic_version='34.56')
ListSchemaVersions error  for invalid input.
>>> client.list_schema_versions(schema_id='example.ColorControl', type='capability', namespace='matter')
Source code in docs_src/capo_iot_managed_integrations/_services/io_t_managed_integrations.py
def list_schema_versions(
    self,
    type: "capo_iot_managed_integrations.types.schema_version_type.SchemaVersionType",
    *,
    config_overrides: Optional[IoTManagedIntegrationsClientConfig] = None,
    max_results: Optional[
        "capo_iot_managed_integrations.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_iot_managed_integrations.types.next_token.NextToken"
    ] = None,
    schema_id: Optional[
        "capo_iot_managed_integrations.types.schema_id.SchemaId"
    ] = None,
    namespace: Optional[
        "capo_iot_managed_integrations.types.schema_version_namespace_name.SchemaVersionNamespaceName"
    ] = None,
    visibility: Optional[
        "capo_iot_managed_integrations.types.schema_version_visibility.SchemaVersionVisibility"
    ] = None,
    semantic_version: Optional[
        "capo_iot_managed_integrations.types.schema_version_version.SchemaVersionVersion"
    ] = None,
) -> "capo_iot_managed_integrations.types.list_schema_versions_response.ListSchemaVersionsResponse":
    """<p>Lists schema versions with the provided information.</p>

    Args:
        type: <p>Filter on the type of schema version.</p>
        max_results: <p>The maximum number of results to return at one time.</p>
        next_token: <p>A token that can be used to retrieve the next set of results.</p>
        schema_id: <p>Filter on the id of the schema version.</p>
        namespace: <p>Filter on the name of the schema version.</p>
        visibility: <p>The visibility of the schema version.</p>
        semantic_version: <p>The schema version. If this is left blank, it defaults to the latest version.</p>

    Raises:
        capo_iot_managed_integrations.errors.access_denied_exception.AccessDeniedException: <p>User is not authorized.</p>
        capo_iot_managed_integrations.errors.conflict_exception.ConflictException: <p>There is a conflict with the request.</p>
        capo_iot_managed_integrations.errors.internal_server_exception.InternalServerException: <p>Internal error from the service that indicates an unexpected error or that the service is unavailable.</p>
        capo_iot_managed_integrations.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is temporarily unavailable.</p>
        capo_iot_managed_integrations.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot_managed_integrations.errors.validation_exception.ValidationException: <p>A validation error occurred when performing the API request.</p>
        capo_iot_managed_integrations.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        ListSchemaVersions happy path for an example schema version.

        >>> client.list_schema_versions(schema_id='example.ColorControl', type='capability')
        ListSchemaVersions by version.

        >>> client.list_schema_versions(type='capability', semantic_version='34.56')
        ListSchemaVersions error  for invalid input.

        >>> client.list_schema_versions(schema_id='example.ColorControl', type='capability', namespace='matter')
    """

    def _handler(
        req: "OperationRequest[capo_iot_managed_integrations.types.list_schema_versions_request.ListSchemaVersionsRequest]",
    ) -> OperationResponse[
        "capo_iot_managed_integrations.types.list_schema_versions_response.ListSchemaVersionsResponse"
    ]:
        import capo_iot_managed_integrations._operations.iot_managed_integrations.list_schema_versions

        output, http_response = (
            capo_iot_managed_integrations._operations.iot_managed_integrations.list_schema_versions.list_schema_versions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSchemaVersions")
    )
    input_: capo_iot_managed_integrations.types.list_schema_versions_request.ListSchemaVersionsRequest = {
        "type": type
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if schema_id is not None:
        input_["schema_id"] = schema_id
    if namespace is not None:
        input_["namespace"] = namespace
    if visibility is not None:
        input_["visibility"] = visibility
    if semantic_version is not None:
        input_["semantic_version"] = semantic_version

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output