Skip to content

update_schema async

update_schema(
    registry_name: __string,
    schema_name: __string,
    *,
    config_overrides: Optional[AsyncschemasClientConfig] = None,
    client_token_id: Optional[__stringMin0Max36] = None,
    content: Optional[__stringMin1Max100000] = None,
    description: Optional[__stringMin0Max256] = None,
    type: Optional[Type] = None,
) -> UpdateSchemaResponse

Updates the schema definition

Inactive schemas will be deleted after two years.

Parameters:

Raises:

Source code in docs_src/capo_schemas/_services/async_schemas.py
async def update_schema(
    self,
    registry_name: "capo_schemas.types.__string.__string",
    schema_name: "capo_schemas.types.__string.__string",
    *,
    config_overrides: Optional[AsyncschemasClientConfig] = None,
    client_token_id: Optional[
        "capo_schemas.types.__string_min0_max36.__stringMin0Max36"
    ] = None,
    content: Optional[
        "capo_schemas.types.__string_min1_max100000.__stringMin1Max100000"
    ] = None,
    description: Optional[
        "capo_schemas.types.__string_min0_max256.__stringMin0Max256"
    ] = None,
    type: Optional["capo_schemas.types.type.Type"] = None,
) -> "capo_schemas.types.update_schema_response.UpdateSchemaResponse":
    """<p>Updates the schema definition</p> <note><p>Inactive schemas will be deleted after two years.</p></note>

    Args:
        client_token_id: <p>The ID of the client token.</p>
        content: <p>The source of the schema definition.</p>
        description: <p>The description of the schema.</p>
        registry_name: <p>The name of the registry.</p>
        schema_name: <p>The name of the schema.</p>
        type: <p>The schema type for the events schema.</p>

    Raises:
        capo_schemas.errors.bad_request_exception.BadRequestException
        capo_schemas.errors.forbidden_exception.ForbiddenException
        capo_schemas.errors.internal_server_error_exception.InternalServerErrorException
        capo_schemas.errors.not_found_exception.NotFoundException
        capo_schemas.errors.service_unavailable_exception.ServiceUnavailableException
        capo_schemas.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_schemas.types.update_schema_request.UpdateSchemaRequest]",
    ) -> AsyncOperationResponse[
        "capo_schemas.types.update_schema_response.UpdateSchemaResponse"
    ]:
        import capo_schemas._operations.schemas.update_schema

        (
            output,
            http_response,
        ) = await capo_schemas._operations.schemas.update_schema.async_update_schema(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSchema")
    )
    input_: capo_schemas.types.update_schema_request.UpdateSchemaRequest = {
        "registry_name": registry_name,
        "schema_name": schema_name,
    }
    if client_token_id is None:
        client_token_id = str(uuid.uuid4())
    input_["client_token_id"] = client_token_id
    if content is not None:
        input_["content"] = content
    if description is not None:
        input_["description"] = description
    if type is not None:
        input_["type"] = type

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output