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

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

Overview

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 client object.

Examples:


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

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

Yields:

  • (config)

    Configure the ManagedSchemaRegistry client.

Yield Parameters:



174
175
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
226
227
228
229
230
231
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 174

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/managedkafka/schemaregistry/v1/schema_registry_services_pb"

  # 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 = ::Gapic::ServiceStub.new(
    ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool,
    logger: @config.logger
  )

  @managed_schema_registry_stub.stub_logger&.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::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.logger = @managed_schema_registry_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

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

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

Returns:

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


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

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::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2159

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :check_compatibility, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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:



144
145
146
147
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 144

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 477

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_schema_registry, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1875

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_version, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2436

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_schema_config, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2700

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_schema_mode, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 564

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_schema_registry, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1390
1391
1392
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
1427
1428
1429
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1390

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_subject, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1970

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_version, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 650

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_context, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 917

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_raw_schema, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1676

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_raw_schema_version, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 826

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_schema, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2250

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_schema_config, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2523

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_schema_mode, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 297

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_schema_registry, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1583

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_version, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 736

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_contexts, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2059

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_referenced_schemas, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 383

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_schema_registries, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1101

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_schema_types, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1013

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_schema_versions, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
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
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1200

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_subjects, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1295
1296
1297
1298
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
1333
1334
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1295

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_subjects_by_schema_id, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1768

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_versions, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


245
246
247
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 245

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 1491

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :lookup_version, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


154
155
156
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 154

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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
2382
2383
2384
2385
2386
2387
2388
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2349

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_schema_config, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => 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::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb', line 2612

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
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_schema_mode, request, options: options do |response, operation|
    yield response, operation if block_given?
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end