Class: Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb

Overview

REST client for the ManagedSchemaRegistry service.

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.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#schema_config_path, #schema_context_path, #schema_mode_path, #schema_path, #schema_registry_path, #schema_subject_path, #schema_version_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ManagedSchemaRegistry REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the ManagedSchemaRegistry client.

Yield Parameters:



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 176

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @managed_schema_registry_stub = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @managed_schema_registry_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @managed_schema_registry_stub.endpoint
    config.universe_domain = @managed_schema_registry_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @managed_schema_registry_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


232
233
234
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 232

def location_client
  @location_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ManagedSchemaRegistry Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ManagedSchemaRegistry clients
::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 114

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ManagedKafka", "SchemaRegistry", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#check_compatibility(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse #check_compatibility(name: nil, schema_type: nil, schema: nil, references: nil, verbose: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest.new

# Call the check_compatibility method.
result = client.check_compatibility request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse.
p result

Overloads:

  • #check_compatibility(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse

    Pass arguments to check_compatibility via a request object, either of type CheckCompatibilityRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #check_compatibility(name: nil, schema_type: nil, schema: nil, references: nil, verbose: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse

    Pass arguments to check_compatibility via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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.
    • schema_type (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType) (defaults to: nil)

      Optional. The schema type of the schema.

    • schema (::String) (defaults to: nil)

      Required. The schema payload

    • references (::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>) (defaults to: nil)

      Optional. The schema references used by the schema.

    • verbose (::Boolean) (defaults to: nil)

      Optional. If true, the response will contain the compatibility check result with reasons for failed checks. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2012

def check_compatibility request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.check_compatibility..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.check_compatibility.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.check_compatibility.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.check_compatibility request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#configure {|config| ... } ⇒ Client::Configuration

Configure the ManagedSchemaRegistry Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



146
147
148
149
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 146

def configure
  yield @config if block_given?
  @config
end

#create_schema_registry(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry #create_schema_registry(parent: nil, schema_registry_id: nil, schema_registry: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

Create a schema registry instance.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest.new

# Call the create_schema_registry method.
result = client.create_schema_registry request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry.
p result

Overloads:

  • #create_schema_registry(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

    Pass arguments to create_schema_registry via a request object, either of type CreateSchemaRegistryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_schema_registry(parent: nil, schema_registry_id: nil, schema_registry: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

    Pass arguments to create_schema_registry via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent whose schema registry instance is to be created. Structured like: projects/{project}/locations/{location}

    • schema_registry_id (::String) (defaults to: nil)

      Required. The schema registry instance ID to use for this schema registry. The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores (-). The maximum length is 63 characters. The ID must not start with a number.

    • schema_registry (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry, ::Hash) (defaults to: nil)

      Required. The schema registry instance to create. The name field is ignored.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 456

def create_schema_registry request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_schema_registry..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_schema_registry.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_schema_registry.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.create_schema_registry request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse #create_version(parent: nil, version: nil, id: nil, schema_type: nil, schema: nil, references: nil, normalize: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest.new

# Call the create_version method.
result = client.create_version request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse.
p result

Overloads:

  • #create_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse

    Pass arguments to create_version via a request object, either of type CreateVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_version(parent: nil, version: nil, id: nil, schema_type: nil, schema: nil, references: nil, normalize: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse

    Pass arguments to create_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • version (::Integer) (defaults to: nil)

      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.

    • id (::Integer) (defaults to: nil)

      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.

    • schema_type (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType) (defaults to: nil)

      Optional. The type of the schema. It is optional. If not specified, the schema type will be AVRO.

    • schema (::String) (defaults to: nil)

      Required. The schema payload

    • references (::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>) (defaults to: nil)

      Optional. The schema references used by the schema.

    • normalize (::Boolean) (defaults to: nil)

      Optional. If true, the schema will be normalized before being stored. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1749

def create_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.create_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig #delete_schema_config(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

Delete schema config for a subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest.new

# Call the delete_schema_config method.
result = client.delete_schema_config request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
p result

Overloads:

  • #delete_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to delete_schema_config via a request object, either of type DeleteSchemaConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_schema_config(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to delete_schema_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The resource name of subject to delete the config for. The format is

      • projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2268

def delete_schema_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_schema_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_schema_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_schema_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.delete_schema_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode #delete_schema_mode(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

Delete schema mode for a subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest.new

# Call the delete_schema_mode method.
result = client.delete_schema_mode request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
p result

Overloads:

  • #delete_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to delete_schema_mode via a request object, either of type DeleteSchemaModeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_schema_mode(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to delete_schema_mode via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2511

def delete_schema_mode request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_schema_mode..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_schema_mode.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_schema_mode.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.delete_schema_mode request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_schema_registry(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_schema_registry(name: nil) ⇒ ::Google::Protobuf::Empty

Delete a schema registry instance.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest.new

# Call the delete_schema_registry method.
result = client.delete_schema_registry request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_schema_registry(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_schema_registry via a request object, either of type DeleteSchemaRegistryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_schema_registry(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_schema_registry via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the schema registry instance to delete. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 536

def delete_schema_registry request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_schema_registry..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_schema_registry.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_schema_registry.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.delete_schema_registry request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_subject(request, options = nil) ⇒ ::Google::Api::HttpBody #delete_subject(name: nil, permanent: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest.new

# Call the delete_subject method.
result = client.delete_subject request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #delete_subject(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to delete_subject via a request object, either of type DeleteSubjectRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_subject(name: nil, permanent: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to delete_subject via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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}

    • permanent (::Boolean) (defaults to: nil)

      Optional. If true, the subject and all associated metadata including the schema ID will be deleted permanently. Otherwise, only the subject is soft-deleted. The default is false. Soft-deleted subjects can still be searched in ListSubjects API call with deleted=true query parameter. A soft-delete of a subject must be performed before a hard-delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1299

def delete_subject request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_subject..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_subject.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_subject.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.delete_subject request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_version(request, options = nil) ⇒ ::Google::Api::HttpBody #delete_version(name: nil, permanent: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest.new

# Call the delete_version method.
result = client.delete_version request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #delete_version(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to delete_version via a request object, either of type DeleteVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_version(name: nil, permanent: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to delete_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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}

    • permanent (::Boolean) (defaults to: nil)

      Optional. If true, both the version and the referenced schema ID will be permanently deleted. The default is false. If false, the version will be deleted but the schema ID will be retained. Soft-deleted versions can still be searched in ListVersions API call with deleted=true query parameter. A soft-delete of a version must be performed before a hard-delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1837

def delete_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.delete_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_context(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context #get_context(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context

Get the context.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest.new

# Call the get_context method.
result = client.get_context request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context.
p result

Overloads:

  • #get_context(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context

    Pass arguments to get_context via a request object, either of type GetContextRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_context(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context

    Pass arguments to get_context via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the context to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 615

def get_context request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_context..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_context.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_context.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_context request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_raw_schema(request, options = nil) ⇒ ::Google::Api::HttpBody #get_raw_schema(name: nil, subject: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest.new

# Call the get_raw_schema method.
result = client.get_raw_schema request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #get_raw_schema(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to get_raw_schema via a request object, either of type GetSchemaRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_raw_schema(name: nil, subject: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to get_raw_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the schema to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}

    • subject (::String) (defaults to: nil)

      Optional. Used to limit the search for the schema ID to a specific subject, otherwise the schema ID will be searched for in all subjects in the given specified context.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 861

def get_raw_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_raw_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_raw_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_raw_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_raw_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_raw_schema_version(request, options = nil) ⇒ ::Google::Api::HttpBody #get_raw_schema_version(name: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest.new

# Call the get_raw_schema_version method.
result = client.get_raw_schema_version request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #get_raw_schema_version(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to get_raw_schema_version via a request object, either of type GetVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_raw_schema_version(name: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to get_raw_schema_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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}

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, no matter if the subject/version is soft-deleted or not, it returns the version details. If false, it returns NOT_FOUND error if the subject/version is soft-deleted. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1564

def get_raw_schema_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_raw_schema_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_raw_schema_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_raw_schema_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_raw_schema_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_schema(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema #get_schema(name: nil, subject: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema

Get the schema for the given schema id.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest.new

# Call the get_schema method.
result = client.get_schema request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema.
p result

Overloads:

  • #get_schema(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema

    Pass arguments to get_schema via a request object, either of type GetSchemaRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_schema(name: nil, subject: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema

    Pass arguments to get_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the schema to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}

    • subject (::String) (defaults to: nil)

      Optional. Used to limit the search for the schema ID to a specific subject, otherwise the schema ID will be searched for in all subjects in the given specified context.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 777

def get_schema request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_schema..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_schema.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_schema.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_schema request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig #get_schema_config(name: nil, default_to_global: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

Get schema config at global level or for a subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest.new

# Call the get_schema_config method.
result = client.get_schema_config request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
p result

Overloads:

  • #get_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to get_schema_config via a request object, either of type GetSchemaConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_schema_config(name: nil, default_to_global: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to get_schema_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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.
    • default_to_global (::Boolean) (defaults to: nil)

      Optional. If true, the config will fall back to the config at the global level if no subject level config is found.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2096

def get_schema_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_schema_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_schema_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_schema_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_schema_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode #get_schema_mode(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

Get mode at global level or for a subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest.new

# Call the get_schema_mode method.
result = client.get_schema_mode request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
p result

Overloads:

  • #get_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to get_schema_mode via a request object, either of type GetSchemaModeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_schema_mode(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to get_schema_mode via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2348

def get_schema_mode request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_schema_mode..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_schema_mode.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_schema_mode.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_schema_mode request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_schema_registry(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry #get_schema_registry(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

Get the schema registry instance.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest.new

# Call the get_schema_registry method.
result = client.get_schema_registry request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry.
p result

Overloads:

  • #get_schema_registry(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

    Pass arguments to get_schema_registry via a request object, either of type GetSchemaRegistryRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_schema_registry(name: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry

    Pass arguments to get_schema_registry via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the schema registry instance to return. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 290

def get_schema_registry request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_schema_registry..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_schema_registry.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_schema_registry.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_schema_registry request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion #get_version(name: nil, deleted: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest.new

# Call the get_version method.
result = client.get_version request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion.
p result

Overloads:

  • #get_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

    Pass arguments to get_version via a request object, either of type GetVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_version(name: nil, deleted: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

    Pass arguments to get_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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}

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, no matter if the subject/version is soft-deleted or not, it returns the version details. If false, it returns NOT_FOUND error if the subject/version is soft-deleted. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1478

def get_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.get_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_contexts(request, options = nil) ⇒ ::Google::Api::HttpBody #list_contexts(parent: nil) ⇒ ::Google::Api::HttpBody

List contexts for a schema registry.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest.new

# Call the list_contexts method.
result = client.list_contexts request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_contexts(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_contexts via a request object, either of type ListContextsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_contexts(parent: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_contexts via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent of the contexts. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 694

def list_contexts request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_contexts..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_contexts.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_contexts.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_contexts request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_referenced_schemas(request, options = nil) ⇒ ::Google::Api::HttpBody #list_referenced_schemas(parent: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest.new

# Call the list_referenced_schemas method.
result = client.list_referenced_schemas request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_referenced_schemas(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_referenced_schemas via a request object, either of type ListReferencedSchemasRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_referenced_schemas(parent: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_referenced_schemas via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1919

def list_referenced_schemas request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_referenced_schemas..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_referenced_schemas.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_referenced_schemas.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_referenced_schemas request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_schema_registries(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse #list_schema_registries(parent: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse

List schema registries.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest.new

# Call the list_schema_registries method.
result = client.list_schema_registries request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse.
p result

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 369

def list_schema_registries request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_schema_registries..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_schema_registries.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_schema_registries.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_schema_registries request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_schema_types(request, options = nil) ⇒ ::Google::Api::HttpBody #list_schema_types(parent: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest.new

# Call the list_schema_types method.
result = client.list_schema_types request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_schema_types(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_schema_types via a request object, either of type ListSchemaTypesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_schema_types(parent: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_schema_types via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent schema registry whose schema types are to be listed. Structured like: projects/{project}/locations/{location}/schemaRegistries/{schema_registry}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1031

def list_schema_types request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_schema_types..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_schema_types.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_schema_types.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_schema_types request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_schema_versions(request, options = nil) ⇒ ::Google::Api::HttpBody #list_schema_versions(parent: nil, subject: nil, deleted: nil) ⇒ ::Google::Api::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}].

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest.new

# Call the list_schema_versions method.
result = client.list_schema_versions request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_schema_versions(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_schema_versions via a request object, either of type ListSchemaVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_schema_versions(parent: nil, subject: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_schema_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • subject (::String) (defaults to: nil)

      Optional. The subject to filter the subjects by.

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, the response will include soft-deleted versions of the schema, even if the subject is soft-deleted. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 950

def list_schema_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_schema_versions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_schema_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_schema_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_schema_versions request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_subjects(request, options = nil) ⇒ ::Google::Api::HttpBody #list_subjects(parent: nil, subject_prefix: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest.new

# Call the list_subjects method.
result = client.list_subjects request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_subjects(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_subjects via a request object, either of type ListSubjectsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_subjects(parent: nil, subject_prefix: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_subjects via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • subject_prefix (::String) (defaults to: nil)

      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.

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, the response will include soft-deleted subjects. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1123

def list_subjects request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_subjects..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_subjects.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_subjects.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_subjects request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_subjects_by_schema_id(request, options = nil) ⇒ ::Google::Api::HttpBody #list_subjects_by_schema_id(parent: nil, subject: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest.new

# Call the list_subjects_by_schema_id method.
result = client.list_subjects_by_schema_id request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_subjects_by_schema_id(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_subjects_by_schema_id via a request object, either of type ListSubjectsBySchemaIdRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_subjects_by_schema_id(parent: nil, subject: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_subjects_by_schema_id via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • subject (::String) (defaults to: nil)

      Optional. The subject to filter the subjects by.

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, the response will include soft-deleted subjects. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1211

def list_subjects_by_schema_id request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_subjects_by_schema_id..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_subjects_by_schema_id.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_subjects_by_schema_id.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_subjects_by_schema_id request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_versions(request, options = nil) ⇒ ::Google::Api::HttpBody #list_versions(parent: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest.new

# Call the list_versions method.
result = client.list_versions request

# The returned object is of type Google::Api::HttpBody.
p result

Overloads:

  • #list_versions(request, options = nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_versions via a request object, either of type ListVersionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_versions(parent: nil, deleted: nil) ⇒ ::Google::Api::HttpBody

    Pass arguments to list_versions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, the response will include soft-deleted versions of an active or soft-deleted subject. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1649

def list_versions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_versions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_versions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_versions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.list_versions request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


239
240
241
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 239

def logger
  @managed_schema_registry_stub.logger
end

#lookup_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion #lookup_version(parent: nil, schema_type: nil, schema: nil, references: nil, normalize: nil, deleted: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

Lookup a schema under the specified subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest.new

# Call the lookup_version method.
result = client.lookup_version request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion.
p result

Overloads:

  • #lookup_version(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

    Pass arguments to lookup_version via a request object, either of type LookupVersionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #lookup_version(parent: nil, schema_type: nil, schema: nil, references: nil, normalize: nil, deleted: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion

    Pass arguments to lookup_version via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      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}

    • schema_type (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType) (defaults to: nil)

      Optional. The schema type of the schema.

    • schema (::String) (defaults to: nil)

      Required. The schema payload

    • references (::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>) (defaults to: nil)

      Optional. The schema references used by the schema.

    • normalize (::Boolean) (defaults to: nil)

      Optional. If true, the schema will be normalized before being looked up. The default is false.

    • deleted (::Boolean) (defaults to: nil)

      Optional. If true, soft-deleted versions will be included in lookup, no matter if the subject is active or soft-deleted. If false, soft-deleted versions will be excluded. The default is false.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 1393

def lookup_version request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.lookup_version..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.lookup_version.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.lookup_version.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.lookup_version request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


156
157
158
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 156

def universe_domain
  @managed_schema_registry_stub.universe_domain
end

#update_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig #update_schema_config(name: nil, compatibility: nil, normalize: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

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

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest.new

# Call the update_schema_config method.
result = client.update_schema_config request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
p result

Overloads:

  • #update_schema_config(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to update_schema_config via a request object, either of type UpdateSchemaConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_schema_config(name: nil, compatibility: nil, normalize: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig

    Pass arguments to update_schema_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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.
    • compatibility (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig::CompatibilityType) (defaults to: nil)

      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.

    • normalize (::Boolean) (defaults to: nil)

      Optional. If true, the schema will be normalized before being stored or looked up. The default is false. Cannot be unset for a SchemaRegistry-level SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the normalize field for the SchemaConfig.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2188

def update_schema_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_schema_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_schema_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_schema_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.update_schema_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode #update_schema_mode(name: nil, mode: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

Update mode at global level or for a subject.

Examples:

Basic example

require "google/cloud/managed_kafka/schema_registry/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest.new

# Call the update_schema_mode method.
result = client.update_schema_mode request

# The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
p result

Overloads:

  • #update_schema_mode(request, options = nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to update_schema_mode via a request object, either of type UpdateSchemaModeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_schema_mode(name: nil, mode: nil) ⇒ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode

    Pass arguments to update_schema_mode via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      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
    • mode (::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode::ModeType) (defaults to: nil)

      Required. The mode type.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb', line 2430

def update_schema_mode request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_schema_mode..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_schema_mode.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_schema_mode.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @managed_schema_registry_stub.update_schema_mode request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end