Class ManagedSchemaRegistryAsyncClient (0.1.0)

ManagedSchemaRegistryAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.managedkafka_schemaregistry_v1.services.managed_schema_registry.transports.base.ManagedSchemaRegistryTransport, typing.Callable[[...], google.cloud.managedkafka_schemaregistry_v1.services.managed_schema_registry.transports.base.ManagedSchemaRegistryTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

SchemaRegistry is a service that allows users to manage schemas for their Kafka clusters. It provides APIs to register, list, and delete schemas, as well as to get the schema for a given schema id or a given version id under a subject, to update the global or subject-specific compatibility mode, and to check the compatibility of a schema against a subject or a version. The main resource hierarchy is as follows:

  • SchemaRegistry
  • SchemaRegistry/Context
  • SchemaRegistry/Context/Schema
  • SchemaRegistry/Context/Subject
  • SchemaRegistry/Context/Subject/Version
  • SchemaRegistry/Config
  • SchemaRegistry/Mode

SchemaRegistry is the root resource to represent a schema registry instance. A customer can have multiple schema registry instances in a project.

Context is a context resource that represents a group of schemas, subjects and versions. A schema registry instance can have multiple contexts and always has a 'default' context. Contexts are independent of each other. Context is optional and if not specified, it falls back to the 'default' context.

Schema is a schema resource that represents a unique schema in a context of a schema registry instance. Each schema has a unique schema id, and can be referenced by a version of a subject.

Subject refers to the name under which the schema is registered. A typical subject is the Kafka topic name. A schema registry instance can have multiple subjects.

Version represents a version of a subject. A subject can have multiple versions. Creation of new version of a subject is guarded by the compatibility mode configured globally or for the subject specifically.

Config represents a config at global level cross all registry instances or at subject level. Currently, only compatibility is supported in config.

Mode represents the mode of a schema registry or a specific subject. Three modes are supported:

  • READONLY: The schema registry is in read-only mode, no write operations allowed..
  • READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema.
  • IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.

Properties

api_endpoint

Return the API endpoint used by the client instance.

Returns
Type Description
str The API endpoint used by the client instance.

transport

Returns the transport used by the client instance.

Returns
Type Description
ManagedSchemaRegistryTransport The transport used by the client instance.

universe_domain

Return the universe domain used by the client instance.

Returns
Type Description
str The universe domain used by the client instance.

Methods

ManagedSchemaRegistryAsyncClient

ManagedSchemaRegistryAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.managedkafka_schemaregistry_v1.services.managed_schema_registry.transports.base.ManagedSchemaRegistryTransport, typing.Callable[[...], google.cloud.managedkafka_schemaregistry_v1.services.managed_schema_registry.transports.base.ManagedSchemaRegistryTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)

Instantiates the managed schema registry async client.

Parameters
Name Description
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Optional[Union[str,ManagedSchemaRegistryTransport,Callable[..., ManagedSchemaRegistryTransport]]]

The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the ManagedSchemaRegistryTransport constructor. If set to None, a transport is chosen automatically.

client_options Optional[Union[google.api_core.client_options.ClientOptions, dict]]

Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

Exceptions
Type Description
google.auth.exceptions.MutualTlsChannelError If mutual TLS transport creation failed for any reason.

cancel_operation

cancel_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.CancelOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None

Starts asynchronous cancellation on a long-running operation.

The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.CancelOperationRequest

The request object. Request message for CancelOperation method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

check_compatibility

check_compatibility(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.CheckCompatibilityRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    schema: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.CheckCompatibilityResponse
)

Check compatibility of a schema with all versions or a specific version of a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_check_compatibility():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.CheckCompatibilityRequest(
        name="name_value",
        schema="schema_value",
    )

    # Make the request
    response = await client.check_compatibility(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.CheckCompatibilityRequest, dict]]

The request object. Request for CheckCompatibility.

name str

Required. The name of the resource to check compatibility for. The format is either of following: - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/*/versions: Check compatibility with one or more versions of the specified subject. - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/{subject}/versions/{version}: Check compatibility with a specific version of the subject. This corresponds to the name field on the request instance; if request is provided, this should not be set.

schema str

Required. The schema payload This corresponds to the schema field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.CheckCompatibilityResponse Response for CheckCompatibility.

common_billing_account_path

common_billing_account_path(billing_account: str) -> str

Returns a fully-qualified billing_account string.

common_folder_path

common_folder_path(folder: str) -> str

Returns a fully-qualified folder string.

common_location_path

common_location_path(project: str, location: str) -> str

Returns a fully-qualified location string.

common_organization_path

common_organization_path(organization: str) -> str

Returns a fully-qualified organization string.

common_project_path

common_project_path(project: str) -> str

Returns a fully-qualified project string.

create_schema_registry

create_schema_registry(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.CreateSchemaRegistryRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    schema_registry: typing.Optional[
        google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaRegistry
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaRegistry
)

Create a schema registry instance.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_create_schema_registry():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.CreateSchemaRegistryRequest(
        parent="parent_value",
        schema_registry_id="schema_registry_id_value",
    )

    # Make the request
    response = await client.create_schema_registry(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.CreateSchemaRegistryRequest, dict]]

The request object. Request to create a schema registry instance.

parent str

Required. The parent whose schema registry instance is to be created. Structured like: projects/{project}/locations/{location} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

schema_registry SchemaRegistry

Required. The schema registry instance to create. The name field is ignored. This corresponds to the schema_registry field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaRegistry SchemaRegistry is a schema registry instance.

create_version

create_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.CreateVersionRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    version: typing.Optional[int] = None,
    id: typing.Optional[int] = None,
    schema_type: typing.Optional[
        google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.Schema.SchemaType
    ] = None,
    schema: typing.Optional[str] = None,
    references: typing.Optional[
        typing.MutableSequence[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.Schema.SchemaReference
        ]
    ] = None,
    normalize: typing.Optional[bool] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.CreateVersionResponse
)

Register a new version under a given subject with the given schema.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_create_version():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.CreateVersionRequest(
        parent="parent_value",
        schema="schema_value",
    )

    # Make the request
    response = await client.create_version(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.CreateVersionRequest, dict]]

The request object. Request for CreateVersion.

parent str

Required. The subject to create the version for. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

version int

Optional. The version to create. It is optional. If not specified, the version will be created with the max version ID of the subject increased by 1. If the version ID is specified, it will be used as the new version ID and must not be used by an existing version of the subject. This corresponds to the version field on the request instance; if request is provided, this should not be set.

id int

Optional. The schema ID of the schema. If not specified, the schema ID will be generated by the server. If the schema ID is specified, it must not be used by an existing schema that is different from the schema to be created. This corresponds to the id field on the request instance; if request is provided, this should not be set.

schema_type SchemaType

Optional. The type of the schema. It is optional. If not specified, the schema type will be AVRO. This corresponds to the schema_type field on the request instance; if request is provided, this should not be set.

schema str

Required. The schema payload This corresponds to the schema field on the request instance; if request is provided, this should not be set.

references :class:MutableSequence[google.cloud.managedkafka_schemaregistry_v1.types.Schema.SchemaReference]

Optional. The schema references used by the schema. This corresponds to the references field on the request instance; if request is provided, this should not be set.

normalize bool

Optional. If true, the schema will be normalized before being stored. The default is false. This corresponds to the normalize field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.CreateVersionResponse Response for CreateVersion.

delete_operation

delete_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.DeleteOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None

Deletes a long-running operation.

This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request .operations_pb2.DeleteOperationRequest

The request object. Request message for DeleteOperation method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

delete_schema_config

delete_schema_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.DeleteSchemaConfigRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaConfig
)

Delete schema config for a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_delete_schema_config():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.DeleteSchemaConfigRequest(
        name="name_value",
    )

    # Make the request
    response = await client.delete_schema_config(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.DeleteSchemaConfigRequest, dict]]

The request object. Request for deleting schema config.

name str

Required. The resource name of subject to delete the config for. The format is - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaConfig SchemaConfig represents configuration for a schema registry or a specific subject.

delete_schema_mode

delete_schema_mode(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.DeleteSchemaModeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaMode
)

Delete schema mode for a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_delete_schema_mode():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.DeleteSchemaModeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.delete_schema_mode(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.DeleteSchemaModeRequest, dict]]

The request object. Request for deleting schema mode.

name str

Required. The resource name of subject to delete the mode for. The format is - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject} - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaMode SchemaMode represents the mode of a schema registry or a specific subject. Four modes are supported: \* NONE: deprecated. This was the default mode for a subject, but now the default is unset (which means use the global schema registry setting) \* READONLY: The schema registry is in read-only mode. \* READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema. \* IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.

delete_schema_registry

delete_schema_registry(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.DeleteSchemaRegistryRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> None

Delete a schema registry instance.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_delete_schema_registry():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.DeleteSchemaRegistryRequest(
        name="name_value",
    )

    # Make the request
    await client.delete_schema_registry(request=request)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.DeleteSchemaRegistryRequest, dict]]

The request object. Request for DeleteSchemaRegistry.

name str

Required. The name of the schema registry instance to delete. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

delete_subject

delete_subject(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.DeleteSubjectRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Delete a subject. The response will be an array of versions of the deleted subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_delete_subject():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.DeleteSubjectRequest(
        name="name_value",
    )

    # Make the request
    response = await client.delete_subject(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.DeleteSubjectRequest, dict]]

The request object. Request for DeleteSubject.

name str

Required. The name of the subject to delete. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

delete_version

delete_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.DeleteVersionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Delete a version of a subject. The response will be the deleted version id.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_delete_version():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.DeleteVersionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.delete_version(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.DeleteVersionRequest, dict]]

The request object. Request for DeleteVersion.

name str

Required. The name of the subject version to delete. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
ManagedSchemaRegistryAsyncClient The constructed client.

from_service_account_info

from_service_account_info(info: dict, *args, **kwargs)

Creates an instance of this client using the provided credentials info.

Parameter
Name Description
info dict

The service account private key info.

Returns
Type Description
ManagedSchemaRegistryAsyncClient The constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
Name Description
filename str

The path to the service account private key json file.

Returns
Type Description
ManagedSchemaRegistryAsyncClient The constructed client.

get_context

get_context(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetContextRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.Context
)

Get the context.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_context():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetContextRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_context(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetContextRequest, dict]]

The request object. Request for GetContext

name str

Required. The name of the context to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.Context Context represents an independent schema grouping in a schema registry instance.

get_location

get_location(
    request: typing.Optional[
        google.cloud.location.locations_pb2.GetLocationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.location.locations_pb2.Location

Gets information about a location.

Parameters
Name Description
request .location_pb2.GetLocationRequest

The request object. Request message for GetLocation method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.location_pb2.Location Location object.

get_mtls_endpoint_and_cert_source

get_mtls_endpoint_and_cert_source(
    client_options: typing.Optional[
        google.api_core.client_options.ClientOptions
    ] = None,
)

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114.

Parameter
Name Description
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Exceptions
Type Description
google.auth.exceptions.MutualTLSChannelError If any errors happen.
Returns
Type Description
Tuple[str, Callable[[], Tuple[bytes, bytes]]] returns the API endpoint and the client cert source to use.

get_operation

get_operation(
    request: typing.Optional[
        google.longrunning.operations_pb2.GetOperationRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.longrunning.operations_pb2.Operation

Gets the latest state of a long-running operation.

Parameters
Name Description
request .operations_pb2.GetOperationRequest

The request object. Request message for GetOperation method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.operations_pb2.Operation An Operation object.

get_raw_schema

get_raw_schema(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetSchemaRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Get the schema string for the given schema id. The response will be the schema string.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_raw_schema():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetSchemaRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_raw_schema(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetSchemaRequest, dict]]

The request object. Request for GetSchema.

name str

Required. The name of the schema to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

get_raw_schema_version

get_raw_schema_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetVersionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Get the schema string only for a version of a subject. The response will be the schema string.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_raw_schema_version():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetVersionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_raw_schema_version(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetVersionRequest, dict]]

The request object. Request for GetVersion.

name str

Required. The name of the subject to return versions. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

get_schema

get_schema(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetSchemaRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.Schema

Get the schema for the given schema id.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_schema():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetSchemaRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_schema(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetSchemaRequest, dict]]

The request object. Request for GetSchema.

name str

Required. The name of the schema to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.Schema Schema for a Kafka message.

get_schema_config

get_schema_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetSchemaConfigRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaConfig
)

Get schema config at global level or for a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_schema_config():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetSchemaConfigRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_schema_config(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetSchemaConfigRequest, dict]]

The request object. Request for getting config.

name str

Required. The resource name to get the config for. It can be either of following: - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Get config at global level. - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Get config for a specific subject. This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaConfig SchemaConfig represents configuration for a schema registry or a specific subject.

get_schema_mode

get_schema_mode(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetSchemaModeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaMode
)

Get mode at global level or for a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_schema_mode():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetSchemaModeRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_schema_mode(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetSchemaModeRequest, dict]]

The request object. Request for getting schema registry or subject mode.

name str

Required. The resource name of the mode. The format is - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaMode SchemaMode represents the mode of a schema registry or a specific subject. Four modes are supported: \* NONE: deprecated. This was the default mode for a subject, but now the default is unset (which means use the global schema registry setting) \* READONLY: The schema registry is in read-only mode. \* READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema. \* IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.

get_schema_registry

get_schema_registry(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetSchemaRegistryRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaRegistry
)

Get the schema registry instance.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_schema_registry():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetSchemaRegistryRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_schema_registry(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetSchemaRegistryRequest, dict]]

The request object. Request for GetSchemaRegistry.

name str

Required. The name of the schema registry instance to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaRegistry SchemaRegistry is a schema registry instance.

get_transport_class

get_transport_class(
    label: typing.Optional[str] = None,
) -> typing.Type[
    google.cloud.managedkafka_schemaregistry_v1.services.managed_schema_registry.transports.base.ManagedSchemaRegistryTransport
]

Returns an appropriate transport class.

Parameter
Name Description
label typing.Optional[str]

The name of the desired transport. If none is provided, then the first transport in the registry is used.

get_version

get_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.GetVersionRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaVersion
)

Get a versioned schema (schema with subject/version) of a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_get_version():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.GetVersionRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_version(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.GetVersionRequest, dict]]

The request object. Request for GetVersion.

name str

Required. The name of the subject to return versions. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version} This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaVersion Version of a schema.

list_contexts

list_contexts(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListContextsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

List contexts for a schema registry.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_contexts():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListContextsRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_contexts(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListContextsRequest, dict]]

The request object. Request for ListContexts.

parent str

Required. The parent of the contexts. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_locations

list_locations(
    request: typing.Optional[
        google.cloud.location.locations_pb2.ListLocationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.cloud.location.locations_pb2.ListLocationsResponse

Lists information about the supported locations for this service.

Parameters
Name Description
request .location_pb2.ListLocationsRequest

The request object. Request message for ListLocations method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.location_pb2.ListLocationsResponse Response message for ListLocations method.

list_operations

list_operations(
    request: typing.Optional[
        google.longrunning.operations_pb2.ListOperationsRequest
    ] = None,
    *,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.longrunning.operations_pb2.ListOperationsResponse

Lists operations that match the specified filter in the request.

Parameters
Name Description
request .operations_pb2.ListOperationsRequest

The request object. Request message for ListOperations method.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
.operations_pb2.ListOperationsResponse Response message for ListOperations method.

list_referenced_schemas

list_referenced_schemas(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListReferencedSchemasRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Get a list of IDs of schemas that reference the schema with the given subject and version.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_referenced_schemas():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListReferencedSchemasRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_referenced_schemas(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListReferencedSchemasRequest, dict]]

The request object. Request for ListReferencedSchemas.

parent str

Required. The version to list referenced by. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_schema_registries

list_schema_registries(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSchemaRegistriesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSchemaRegistriesResponse
)

List schema registries.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_schema_registries():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListSchemaRegistriesRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_schema_registries(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListSchemaRegistriesRequest, dict]]

The request object. Request for ListSchemaRegistries.

parent str

Required. The parent whose schema registry instances are to be listed. Structured like: projects/{project}/locations/{location} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.ListSchemaRegistriesResponse Request for ListSchemaRegistries.

list_schema_types

list_schema_types(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSchemaTypesRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

List the supported schema types. The response will be an array of schema types.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_schema_types():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListSchemaTypesRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_schema_types(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListSchemaTypesRequest, dict]]

The request object. Request for ListSchemaTypes.

parent str

Required. The parent schema registry whose schema types are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_schema_versions

list_schema_versions(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSchemaVersionsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

List the schema versions for the given schema id. The response will be an array of subject-version pairs as: [{"subject":"subject1", "version":1}, {"subject":"subject2", "version":2}].

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_schema_versions():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListSchemaVersionsRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_schema_versions(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListSchemaVersionsRequest, dict]]

The request object. Request for ListSchemaVersions.

parent str

Required. The schema whose schema versions are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_subjects

list_subjects(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSubjectsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    subject_prefix: typing.Optional[str] = None,
    deleted: typing.Optional[bool] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

List subjects in the schema registry. The response will be an array of subject names.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_subjects():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListSubjectsRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_subjects(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListSubjectsRequest, dict]]

The request object. Request for listing subjects.

parent str

Required. The parent schema registry/context whose subjects are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

subject_prefix str

Optional. The context to filter the subjects by, in the format of :.{context}:. If unset, all subjects in the registry are returned. Set to empty string or add as '?subjectPrefix=' at the end of this request to list subjects in the default context. This corresponds to the subject_prefix field on the request instance; if request is provided, this should not be set.

deleted bool

Optional. If true, the response will include soft-deleted subjects. The default is false. This corresponds to the deleted field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_subjects_by_schema_id

list_subjects_by_schema_id(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListSubjectsBySchemaIdRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    subject: typing.Optional[str] = None,
    deleted: typing.Optional[bool] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

List subjects which reference a particular schema id. The response will be an array of subject names.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_subjects_by_schema_id():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListSubjectsBySchemaIdRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_subjects_by_schema_id(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListSubjectsBySchemaIdRequest, dict]]

The request object. Request for listing subjects.

parent str

Required. The schema resource whose associated subjects are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

subject str

Optional. The subject to filter the subjects by. This corresponds to the subject field on the request instance; if request is provided, this should not be set.

deleted bool

Optional. If true, the response will include soft-deleted subjects. The default is false. This corresponds to the deleted field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

list_versions

list_versions(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.ListVersionsRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> google.api.httpbody_pb2.HttpBody

Get all versions of a subject. The response will be an array of versions of the subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_list_versions():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.ListVersionsRequest(
        parent="parent_value",
    )

    # Make the request
    response = await client.list_versions(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.ListVersionsRequest, dict]]

The request object. Request for GetVersions.

parent str

Required. The subject whose versions are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.api.httpbody_pb2.HttpBody Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.

lookup_version

lookup_version(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.LookupVersionRequest,
            dict,
        ]
    ] = None,
    *,
    parent: typing.Optional[str] = None,
    schema: typing.Optional[str] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaVersion
)

Lookup a schema under the specified subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_lookup_version():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.LookupVersionRequest(
        parent="parent_value",
        schema="schema_value",
    )

    # Make the request
    response = await client.lookup_version(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.LookupVersionRequest, dict]]

The request object. Request for LookupVersion.

parent str

Required. The subject to lookup the schema in. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject} or projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject} This corresponds to the parent field on the request instance; if request is provided, this should not be set.

schema str

Required. The schema payload This corresponds to the schema field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaVersion Version of a schema.

parse_common_billing_account_path

parse_common_billing_account_path(path: str) -> typing.Dict[str, str]

Parse a billing_account path into its component segments.

parse_common_folder_path

parse_common_folder_path(path: str) -> typing.Dict[str, str]

Parse a folder path into its component segments.

parse_common_location_path

parse_common_location_path(path: str) -> typing.Dict[str, str]

Parse a location path into its component segments.

parse_common_organization_path

parse_common_organization_path(path: str) -> typing.Dict[str, str]

Parse a organization path into its component segments.

parse_common_project_path

parse_common_project_path(path: str) -> typing.Dict[str, str]

Parse a project path into its component segments.

parse_schema_config_path

parse_schema_config_path(path: str) -> typing.Dict[str, str]

Parses a schema_config path into its component segments.

parse_schema_context_path

parse_schema_context_path(path: str) -> typing.Dict[str, str]

Parses a schema_context path into its component segments.

parse_schema_mode_path

parse_schema_mode_path(path: str) -> typing.Dict[str, str]

Parses a schema_mode path into its component segments.

parse_schema_path

parse_schema_path(path: str) -> typing.Dict[str, str]

Parses a schema path into its component segments.

parse_schema_registry_path

parse_schema_registry_path(path: str) -> typing.Dict[str, str]

Parses a schema_registry path into its component segments.

parse_schema_subject_path

parse_schema_subject_path(path: str) -> typing.Dict[str, str]

Parses a schema_subject path into its component segments.

parse_schema_version_path

parse_schema_version_path(path: str) -> typing.Dict[str, str]

Parses a schema_version path into its component segments.

schema_config_path

schema_config_path(project: str, location: str, schema_registry: str) -> str

Returns a fully-qualified schema_config string.

schema_context_path

schema_context_path(
    project: str, location: str, schema_registry: str, context: str
) -> str

Returns a fully-qualified schema_context string.

schema_mode_path

schema_mode_path(project: str, location: str, schema_registry: str) -> str

Returns a fully-qualified schema_mode string.

schema_path

schema_path(project: str, location: str, schema_registry: str, schema: str) -> str

Returns a fully-qualified schema string.

schema_registry_path

schema_registry_path(project: str, location: str, schema_registry: str) -> str

Returns a fully-qualified schema_registry string.

schema_subject_path

schema_subject_path(
    project: str, location: str, schema_registry: str, subject: str
) -> str

Returns a fully-qualified schema_subject string.

schema_version_path

schema_version_path(
    project: str, location: str, schema_registry: str, subject: str, version: str
) -> str

Returns a fully-qualified schema_version string.

update_schema_config

update_schema_config(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.UpdateSchemaConfigRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    compatibility: typing.Optional[
        google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaConfig.CompatibilityType
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaConfig
)

Update config at global level or for a subject. Creates a SchemaSubject-level SchemaConfig if it does not exist.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_update_schema_config():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.UpdateSchemaConfigRequest(
        name="name_value",
    )

    # Make the request
    response = await client.update_schema_config(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.UpdateSchemaConfigRequest, dict]]

The request object. Request for updating schema config. On a SchemaSubject-level SchemaConfig, an unset field will be removed from the SchemaConfig.

name str

Required. The resource name to update the config for. It can be either of following: - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Update config at global level. - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Update config for a specific subject. This corresponds to the name field on the request instance; if request is provided, this should not be set.

compatibility CompatibilityType

Required. The compatibility type of the schemas. Cannot be unset for a SchemaRegistry-level SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the compatibility field for the SchemaConfig. This corresponds to the compatibility field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaConfig SchemaConfig represents configuration for a schema registry or a specific subject.

update_schema_mode

update_schema_mode(
    request: typing.Optional[
        typing.Union[
            google.cloud.managedkafka_schemaregistry_v1.types.schema_registry.UpdateSchemaModeRequest,
            dict,
        ]
    ] = None,
    *,
    name: typing.Optional[str] = None,
    mode: typing.Optional[
        google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaMode.ModeType
    ] = None,
    retry: typing.Optional[
        typing.Union[
            google.api_core.retry.retry_unary_async.AsyncRetry,
            google.api_core.gapic_v1.method._MethodDefault,
        ]
    ] = _MethodDefault._DEFAULT_VALUE,
    timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
    metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()
) -> (
    google.cloud.managedkafka_schemaregistry_v1.types.schema_registry_resources.SchemaMode
)

Update mode at global level or for a subject.

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import managedkafka_schemaregistry_v1

async def sample_update_schema_mode():
    # Create a client
    client = managedkafka_schemaregistry_v1.ManagedSchemaRegistryAsyncClient()

    # Initialize request argument(s)
    request = managedkafka_schemaregistry_v1.UpdateSchemaModeRequest(
        name="name_value",
        mode="IMPORT",
    )

    # Make the request
    response = await client.update_schema_mode(request=request)

    # Handle the response
    print(response)
Parameters
Name Description
request Optional[Union[google.cloud.managedkafka_schemaregistry_v1.types.UpdateSchemaModeRequest, dict]]

The request object. Request for updating schema registry or subject mode.

name str

Required. The resource name of the mode. The format is - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}: mode for a schema registry, or - projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}: mode for a specific subject in a specific context This corresponds to the name field on the request instance; if request is provided, this should not be set.

mode ModeType

Required. The mode type. This corresponds to the mode field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, Union[str, bytes]]]

Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
Type Description
google.cloud.managedkafka_schemaregistry_v1.types.SchemaMode SchemaMode represents the mode of a schema registry or a specific subject. Four modes are supported: \* NONE: deprecated. This was the default mode for a subject, but now the default is unset (which means use the global schema registry setting) \* READONLY: The schema registry is in read-only mode. \* READWRITE: The schema registry is in read-write mode, which allows limited write operations on the schema. \* IMPORT: The schema registry is in import mode, which allows more editing operations on the schema for data importing purposes.