google-cloud-managed_kafka-schema_registry-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +153 -8
  5. data/lib/google/cloud/managed_kafka/schema_registry/v1/bindings_override.rb +77 -0
  6. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/client.rb +3110 -0
  7. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/credentials.rb +49 -0
  8. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb +424 -0
  9. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/client.rb +2903 -0
  10. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest/service_stub.rb +1888 -0
  11. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/rest.rb +103 -0
  12. data/lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry.rb +105 -0
  13. data/lib/google/cloud/managed_kafka/schema_registry/v1/rest.rb +40 -0
  14. data/lib/google/cloud/managed_kafka/schema_registry/v1/version.rb +7 -2
  15. data/lib/google/cloud/managed_kafka/schema_registry/v1.rb +47 -0
  16. data/lib/google/cloud/managedkafka/schemaregistry/v1/schema_registry_pb.rb +80 -0
  17. data/lib/google/cloud/managedkafka/schemaregistry/v1/schema_registry_resources_pb.rb +57 -0
  18. data/lib/google/cloud/managedkafka/schemaregistry/v1/schema_registry_services_pb.rb +160 -0
  19. data/lib/google-cloud-managed_kafka-schema_registry-v1.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/client.rb +473 -0
  22. data/proto_docs/google/api/field_behavior.rb +85 -0
  23. data/proto_docs/google/api/httpbody.rb +80 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/api/resource.rb +227 -0
  26. data/proto_docs/google/cloud/managedkafka/schemaregistry/v1/schema_registry.rb +488 -0
  27. data/proto_docs/google/cloud/managedkafka/schemaregistry/v1/schema_registry_resources.rb +236 -0
  28. data/proto_docs/google/protobuf/any.rb +145 -0
  29. data/proto_docs/google/protobuf/duration.rb +98 -0
  30. data/proto_docs/google/protobuf/empty.rb +34 -0
  31. metadata +77 -9
@@ -0,0 +1,3110 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/managedkafka/schemaregistry/v1/schema_registry_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module ManagedKafka
26
+ module SchemaRegistry
27
+ module V1
28
+ module ManagedSchemaRegistry
29
+ ##
30
+ # Client for the ManagedSchemaRegistry service.
31
+ #
32
+ # SchemaRegistry is a service that allows users to manage schemas for their
33
+ # Kafka clusters. It provides APIs to register, list, and delete schemas, as
34
+ # well as to get the schema for a given schema id or a given version id under a
35
+ # subject, to update the global or subject-specific compatibility mode, and to
36
+ # check the compatibility of a schema against a subject or a version. The main
37
+ # resource hierarchy is as follows:
38
+ #
39
+ # * SchemaRegistry
40
+ # * SchemaRegistry/Context
41
+ # * SchemaRegistry/Context/Schema
42
+ # * SchemaRegistry/Context/Subject
43
+ # * SchemaRegistry/Context/Subject/Version
44
+ # * SchemaRegistry/Config
45
+ # * SchemaRegistry/Mode
46
+ #
47
+ # **SchemaRegistry** is the root resource to represent a schema registry
48
+ # instance. A customer can have multiple schema registry instances in a
49
+ # project.
50
+ #
51
+ # **Context** is a context resource that represents a group of
52
+ # schemas, subjects and versions. A schema registry instance can have multiple
53
+ # contexts and always has a 'default' context. Contexts are independent of each
54
+ # other. Context is optional and if not specified, it falls back to the
55
+ # 'default' context.
56
+ #
57
+ # **Schema** is a schema resource that represents a unique schema in a context
58
+ # of a schema registry instance. Each schema has a unique schema id, and can be
59
+ # referenced by a version of a subject.
60
+ #
61
+ # **Subject** refers to the name under which the schema is registered. A
62
+ # typical subject is the Kafka topic name. A schema registry instance can have
63
+ # multiple subjects.
64
+ #
65
+ # **Version** represents a version of a subject. A subject can have multiple
66
+ # versions. Creation of new version of a subject is guarded by the
67
+ # compatibility mode configured globally or for the subject specifically.
68
+ #
69
+ # **Config** represents a config at global level cross all registry
70
+ # instances or at subject level. Currently, only compatibility is supported in
71
+ # config.
72
+ #
73
+ # **Mode** represents the mode of a schema registry or a specific subject.
74
+ # Three modes are supported:
75
+ # * READONLY: The schema registry is in read-only mode, no write operations
76
+ # allowed..
77
+ # * READWRITE: The schema registry is in read-write mode, which allows limited
78
+ # write operations on the schema.
79
+ # * IMPORT: The schema registry is in import mode, which allows more editing
80
+ # operations on the schema for data importing purposes.
81
+ #
82
+ class Client
83
+ # @private
84
+ API_VERSION = ""
85
+
86
+ # @private
87
+ DEFAULT_ENDPOINT_TEMPLATE = "managedkafka.$UNIVERSE_DOMAIN$"
88
+
89
+ include Paths
90
+
91
+ # @private
92
+ attr_reader :managed_schema_registry_stub
93
+
94
+ ##
95
+ # Configure the ManagedSchemaRegistry Client class.
96
+ #
97
+ # See {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client::Configuration}
98
+ # for a description of the configuration fields.
99
+ #
100
+ # @example
101
+ #
102
+ # # Modify the configuration for all ManagedSchemaRegistry clients
103
+ # ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.configure do |config|
104
+ # config.timeout = 10.0
105
+ # end
106
+ #
107
+ # @yield [config] Configure the Client client.
108
+ # @yieldparam config [Client::Configuration]
109
+ #
110
+ # @return [Client::Configuration]
111
+ #
112
+ def self.configure
113
+ @configure ||= begin
114
+ namespace = ["Google", "Cloud", "ManagedKafka", "SchemaRegistry", "V1"]
115
+ parent_config = while namespace.any?
116
+ parent_name = namespace.join "::"
117
+ parent_const = const_get parent_name
118
+ break parent_const.configure if parent_const.respond_to? :configure
119
+ namespace.pop
120
+ end
121
+ default_config = Client::Configuration.new parent_config
122
+
123
+ default_config
124
+ end
125
+ yield @configure if block_given?
126
+ @configure
127
+ end
128
+
129
+ ##
130
+ # Configure the ManagedSchemaRegistry Client instance.
131
+ #
132
+ # The configuration is set to the derived mode, meaning that values can be changed,
133
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
134
+ # should be made on {Client.configure}.
135
+ #
136
+ # See {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client::Configuration}
137
+ # for a description of the configuration fields.
138
+ #
139
+ # @yield [config] Configure the Client client.
140
+ # @yieldparam config [Client::Configuration]
141
+ #
142
+ # @return [Client::Configuration]
143
+ #
144
+ def configure
145
+ yield @config if block_given?
146
+ @config
147
+ end
148
+
149
+ ##
150
+ # The effective universe domain
151
+ #
152
+ # @return [String]
153
+ #
154
+ def universe_domain
155
+ @managed_schema_registry_stub.universe_domain
156
+ end
157
+
158
+ ##
159
+ # Create a new ManagedSchemaRegistry client object.
160
+ #
161
+ # @example
162
+ #
163
+ # # Create a client using the default configuration
164
+ # client = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
165
+ #
166
+ # # Create a client using a custom configuration
167
+ # client = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new do |config|
168
+ # config.timeout = 10.0
169
+ # end
170
+ #
171
+ # @yield [config] Configure the ManagedSchemaRegistry client.
172
+ # @yieldparam config [Client::Configuration]
173
+ #
174
+ def initialize
175
+ # These require statements are intentionally placed here to initialize
176
+ # the gRPC module only when it's required.
177
+ # See https://github.com/googleapis/toolkit/issues/446
178
+ require "gapic/grpc"
179
+ require "google/cloud/managedkafka/schemaregistry/v1/schema_registry_services_pb"
180
+
181
+ # Create the configuration object
182
+ @config = Configuration.new Client.configure
183
+
184
+ # Yield the configuration if needed
185
+ yield @config if block_given?
186
+
187
+ # Create credentials
188
+ credentials = @config.credentials
189
+ # Use self-signed JWT if the endpoint is unchanged from default,
190
+ # but only if the default endpoint does not have a region prefix.
191
+ enable_self_signed_jwt = @config.endpoint.nil? ||
192
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
193
+ !@config.endpoint.split(".").first.include?("-"))
194
+ credentials ||= Credentials.default scope: @config.scope,
195
+ enable_self_signed_jwt: enable_self_signed_jwt
196
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
197
+ credentials = Credentials.new credentials, scope: @config.scope
198
+ end
199
+ @quota_project_id = @config.quota_project
200
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
201
+
202
+ @managed_schema_registry_stub = ::Gapic::ServiceStub.new(
203
+ ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Stub,
204
+ credentials: credentials,
205
+ endpoint: @config.endpoint,
206
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
207
+ universe_domain: @config.universe_domain,
208
+ channel_args: @config.channel_args,
209
+ interceptors: @config.interceptors,
210
+ channel_pool_config: @config.channel_pool,
211
+ logger: @config.logger
212
+ )
213
+
214
+ @managed_schema_registry_stub.stub_logger&.info do |entry|
215
+ entry.set_system_name
216
+ entry.set_service
217
+ entry.message = "Created client for #{entry.service}"
218
+ entry.set_credentials_fields credentials
219
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
220
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
221
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
222
+ end
223
+
224
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
225
+ config.credentials = credentials
226
+ config.quota_project = @quota_project_id
227
+ config.endpoint = @managed_schema_registry_stub.endpoint
228
+ config.universe_domain = @managed_schema_registry_stub.universe_domain
229
+ config.logger = @managed_schema_registry_stub.logger if config.respond_to? :logger=
230
+ end
231
+ end
232
+
233
+ ##
234
+ # Get the associated client for mix-in of the Locations.
235
+ #
236
+ # @return [Google::Cloud::Location::Locations::Client]
237
+ #
238
+ attr_reader :location_client
239
+
240
+ ##
241
+ # The logger used for request/response debug logging.
242
+ #
243
+ # @return [Logger]
244
+ #
245
+ def logger
246
+ @managed_schema_registry_stub.logger
247
+ end
248
+
249
+ # Service calls
250
+
251
+ ##
252
+ # Get the schema registry instance.
253
+ #
254
+ # @overload get_schema_registry(request, options = nil)
255
+ # Pass arguments to `get_schema_registry` via a request object, either of type
256
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest} or an equivalent Hash.
257
+ #
258
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest, ::Hash]
259
+ # A request object representing the call parameters. Required. To specify no
260
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
261
+ # @param options [::Gapic::CallOptions, ::Hash]
262
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
263
+ #
264
+ # @overload get_schema_registry(name: nil)
265
+ # Pass arguments to `get_schema_registry` via keyword arguments. Note that at
266
+ # least one keyword argument is required. To specify no parameters, or to keep all
267
+ # the default parameter values, pass an empty Hash as a request object (see above).
268
+ #
269
+ # @param name [::String]
270
+ # Required. The name of the schema registry instance to return. Structured
271
+ # like:
272
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}`
273
+ #
274
+ # @yield [response, operation] Access the result along with the RPC operation
275
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry]
276
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
277
+ #
278
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry]
279
+ #
280
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
281
+ #
282
+ # @example Basic example
283
+ # require "google/cloud/managed_kafka/schema_registry/v1"
284
+ #
285
+ # # Create a client object. The client can be reused for multiple calls.
286
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
287
+ #
288
+ # # Create a request. To set request fields, pass in keyword arguments.
289
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest.new
290
+ #
291
+ # # Call the get_schema_registry method.
292
+ # result = client.get_schema_registry request
293
+ #
294
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry.
295
+ # p result
296
+ #
297
+ def get_schema_registry request, options = nil
298
+ raise ::ArgumentError, "request must be provided" if request.nil?
299
+
300
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRegistryRequest
301
+
302
+ # Converts hash and nil to an options object
303
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
304
+
305
+ # Customize the options with defaults
306
+ metadata = @config.rpcs.get_schema_registry.metadata.to_h
307
+
308
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
309
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
310
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
311
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
312
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
313
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
314
+
315
+ header_params = {}
316
+ if request.name
317
+ header_params["name"] = request.name
318
+ end
319
+
320
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
321
+ metadata[:"x-goog-request-params"] ||= request_params_header
322
+
323
+ options.apply_defaults timeout: @config.rpcs.get_schema_registry.timeout,
324
+ metadata: metadata,
325
+ retry_policy: @config.rpcs.get_schema_registry.retry_policy
326
+
327
+ options.apply_defaults timeout: @config.timeout,
328
+ metadata: @config.metadata,
329
+ retry_policy: @config.retry_policy
330
+
331
+ @managed_schema_registry_stub.call_rpc :get_schema_registry, request, options: options do |response, operation|
332
+ yield response, operation if block_given?
333
+ end
334
+ rescue ::GRPC::BadStatus => e
335
+ raise ::Google::Cloud::Error.from_error(e)
336
+ end
337
+
338
+ ##
339
+ # List schema registries.
340
+ #
341
+ # @overload list_schema_registries(request, options = nil)
342
+ # Pass arguments to `list_schema_registries` via a request object, either of type
343
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest} or an equivalent Hash.
344
+ #
345
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest, ::Hash]
346
+ # A request object representing the call parameters. Required. To specify no
347
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
348
+ # @param options [::Gapic::CallOptions, ::Hash]
349
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
350
+ #
351
+ # @overload list_schema_registries(parent: nil)
352
+ # Pass arguments to `list_schema_registries` via keyword arguments. Note that at
353
+ # least one keyword argument is required. To specify no parameters, or to keep all
354
+ # the default parameter values, pass an empty Hash as a request object (see above).
355
+ #
356
+ # @param parent [::String]
357
+ # Required. The parent whose schema registry instances are to be listed.
358
+ # Structured like: `projects/{project}/locations/{location}`
359
+ #
360
+ # @yield [response, operation] Access the result along with the RPC operation
361
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse]
362
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
363
+ #
364
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse]
365
+ #
366
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
367
+ #
368
+ # @example Basic example
369
+ # require "google/cloud/managed_kafka/schema_registry/v1"
370
+ #
371
+ # # Create a client object. The client can be reused for multiple calls.
372
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
373
+ #
374
+ # # Create a request. To set request fields, pass in keyword arguments.
375
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest.new
376
+ #
377
+ # # Call the list_schema_registries method.
378
+ # result = client.list_schema_registries request
379
+ #
380
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesResponse.
381
+ # p result
382
+ #
383
+ def list_schema_registries request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaRegistriesRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.list_schema_registries.metadata.to_h
393
+
394
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
398
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ header_params = {}
402
+ if request.parent
403
+ header_params["parent"] = request.parent
404
+ end
405
+
406
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
407
+ metadata[:"x-goog-request-params"] ||= request_params_header
408
+
409
+ options.apply_defaults timeout: @config.rpcs.list_schema_registries.timeout,
410
+ metadata: metadata,
411
+ retry_policy: @config.rpcs.list_schema_registries.retry_policy
412
+
413
+ options.apply_defaults timeout: @config.timeout,
414
+ metadata: @config.metadata,
415
+ retry_policy: @config.retry_policy
416
+
417
+ @managed_schema_registry_stub.call_rpc :list_schema_registries, request, options: options do |response, operation|
418
+ yield response, operation if block_given?
419
+ end
420
+ rescue ::GRPC::BadStatus => e
421
+ raise ::Google::Cloud::Error.from_error(e)
422
+ end
423
+
424
+ ##
425
+ # Create a schema registry instance.
426
+ #
427
+ # @overload create_schema_registry(request, options = nil)
428
+ # Pass arguments to `create_schema_registry` via a request object, either of type
429
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest} or an equivalent Hash.
430
+ #
431
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest, ::Hash]
432
+ # A request object representing the call parameters. Required. To specify no
433
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
434
+ # @param options [::Gapic::CallOptions, ::Hash]
435
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
436
+ #
437
+ # @overload create_schema_registry(parent: nil, schema_registry_id: nil, schema_registry: nil)
438
+ # Pass arguments to `create_schema_registry` via keyword arguments. Note that at
439
+ # least one keyword argument is required. To specify no parameters, or to keep all
440
+ # the default parameter values, pass an empty Hash as a request object (see above).
441
+ #
442
+ # @param parent [::String]
443
+ # Required. The parent whose schema registry instance is to be created.
444
+ # Structured like: `projects/{project}/locations/{location}`
445
+ # @param schema_registry_id [::String]
446
+ # Required. The schema registry instance ID to use for this schema registry.
447
+ # The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores
448
+ # (-). The maximum length is 63 characters.
449
+ # The ID must not start with a number.
450
+ # @param schema_registry [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry, ::Hash]
451
+ # Required. The schema registry instance to create.
452
+ # The name field is ignored.
453
+ #
454
+ # @yield [response, operation] Access the result along with the RPC operation
455
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry]
456
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
457
+ #
458
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry]
459
+ #
460
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
461
+ #
462
+ # @example Basic example
463
+ # require "google/cloud/managed_kafka/schema_registry/v1"
464
+ #
465
+ # # Create a client object. The client can be reused for multiple calls.
466
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
467
+ #
468
+ # # Create a request. To set request fields, pass in keyword arguments.
469
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest.new
470
+ #
471
+ # # Call the create_schema_registry method.
472
+ # result = client.create_schema_registry request
473
+ #
474
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaRegistry.
475
+ # p result
476
+ #
477
+ def create_schema_registry request, options = nil
478
+ raise ::ArgumentError, "request must be provided" if request.nil?
479
+
480
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateSchemaRegistryRequest
481
+
482
+ # Converts hash and nil to an options object
483
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
484
+
485
+ # Customize the options with defaults
486
+ metadata = @config.rpcs.create_schema_registry.metadata.to_h
487
+
488
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
489
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
490
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
491
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
492
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
493
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
494
+
495
+ header_params = {}
496
+ if request.parent
497
+ header_params["parent"] = request.parent
498
+ end
499
+
500
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
501
+ metadata[:"x-goog-request-params"] ||= request_params_header
502
+
503
+ options.apply_defaults timeout: @config.rpcs.create_schema_registry.timeout,
504
+ metadata: metadata,
505
+ retry_policy: @config.rpcs.create_schema_registry.retry_policy
506
+
507
+ options.apply_defaults timeout: @config.timeout,
508
+ metadata: @config.metadata,
509
+ retry_policy: @config.retry_policy
510
+
511
+ @managed_schema_registry_stub.call_rpc :create_schema_registry, request, options: options do |response, operation|
512
+ yield response, operation if block_given?
513
+ end
514
+ rescue ::GRPC::BadStatus => e
515
+ raise ::Google::Cloud::Error.from_error(e)
516
+ end
517
+
518
+ ##
519
+ # Delete a schema registry instance.
520
+ #
521
+ # @overload delete_schema_registry(request, options = nil)
522
+ # Pass arguments to `delete_schema_registry` via a request object, either of type
523
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest} or an equivalent Hash.
524
+ #
525
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest, ::Hash]
526
+ # A request object representing the call parameters. Required. To specify no
527
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
528
+ # @param options [::Gapic::CallOptions, ::Hash]
529
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
530
+ #
531
+ # @overload delete_schema_registry(name: nil)
532
+ # Pass arguments to `delete_schema_registry` via keyword arguments. Note that at
533
+ # least one keyword argument is required. To specify no parameters, or to keep all
534
+ # the default parameter values, pass an empty Hash as a request object (see above).
535
+ #
536
+ # @param name [::String]
537
+ # Required. The name of the schema registry instance to delete. Structured
538
+ # like:
539
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}`
540
+ #
541
+ # @yield [response, operation] Access the result along with the RPC operation
542
+ # @yieldparam response [::Google::Protobuf::Empty]
543
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
544
+ #
545
+ # @return [::Google::Protobuf::Empty]
546
+ #
547
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
548
+ #
549
+ # @example Basic example
550
+ # require "google/cloud/managed_kafka/schema_registry/v1"
551
+ #
552
+ # # Create a client object. The client can be reused for multiple calls.
553
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
554
+ #
555
+ # # Create a request. To set request fields, pass in keyword arguments.
556
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest.new
557
+ #
558
+ # # Call the delete_schema_registry method.
559
+ # result = client.delete_schema_registry request
560
+ #
561
+ # # The returned object is of type Google::Protobuf::Empty.
562
+ # p result
563
+ #
564
+ def delete_schema_registry request, options = nil
565
+ raise ::ArgumentError, "request must be provided" if request.nil?
566
+
567
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaRegistryRequest
568
+
569
+ # Converts hash and nil to an options object
570
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
571
+
572
+ # Customize the options with defaults
573
+ metadata = @config.rpcs.delete_schema_registry.metadata.to_h
574
+
575
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
576
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
577
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
578
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
579
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
580
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
581
+
582
+ header_params = {}
583
+ if request.name
584
+ header_params["name"] = request.name
585
+ end
586
+
587
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
588
+ metadata[:"x-goog-request-params"] ||= request_params_header
589
+
590
+ options.apply_defaults timeout: @config.rpcs.delete_schema_registry.timeout,
591
+ metadata: metadata,
592
+ retry_policy: @config.rpcs.delete_schema_registry.retry_policy
593
+
594
+ options.apply_defaults timeout: @config.timeout,
595
+ metadata: @config.metadata,
596
+ retry_policy: @config.retry_policy
597
+
598
+ @managed_schema_registry_stub.call_rpc :delete_schema_registry, request, options: options do |response, operation|
599
+ yield response, operation if block_given?
600
+ end
601
+ rescue ::GRPC::BadStatus => e
602
+ raise ::Google::Cloud::Error.from_error(e)
603
+ end
604
+
605
+ ##
606
+ # Get the context.
607
+ #
608
+ # @overload get_context(request, options = nil)
609
+ # Pass arguments to `get_context` via a request object, either of type
610
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest} or an equivalent Hash.
611
+ #
612
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest, ::Hash]
613
+ # A request object representing the call parameters. Required. To specify no
614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
615
+ # @param options [::Gapic::CallOptions, ::Hash]
616
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
617
+ #
618
+ # @overload get_context(name: nil)
619
+ # Pass arguments to `get_context` via keyword arguments. Note that at
620
+ # least one keyword argument is required. To specify no parameters, or to keep all
621
+ # the default parameter values, pass an empty Hash as a request object (see above).
622
+ #
623
+ # @param name [::String]
624
+ # Required. The name of the context to return. Structured like:
625
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}`
626
+ #
627
+ # @yield [response, operation] Access the result along with the RPC operation
628
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context]
629
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
630
+ #
631
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context]
632
+ #
633
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
634
+ #
635
+ # @example Basic example
636
+ # require "google/cloud/managed_kafka/schema_registry/v1"
637
+ #
638
+ # # Create a client object. The client can be reused for multiple calls.
639
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
640
+ #
641
+ # # Create a request. To set request fields, pass in keyword arguments.
642
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest.new
643
+ #
644
+ # # Call the get_context method.
645
+ # result = client.get_context request
646
+ #
647
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::Context.
648
+ # p result
649
+ #
650
+ def get_context request, options = nil
651
+ raise ::ArgumentError, "request must be provided" if request.nil?
652
+
653
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetContextRequest
654
+
655
+ # Converts hash and nil to an options object
656
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
657
+
658
+ # Customize the options with defaults
659
+ metadata = @config.rpcs.get_context.metadata.to_h
660
+
661
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
662
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
663
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
664
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
665
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
666
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
667
+
668
+ header_params = {}
669
+ if request.name
670
+ header_params["name"] = request.name
671
+ end
672
+
673
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
674
+ metadata[:"x-goog-request-params"] ||= request_params_header
675
+
676
+ options.apply_defaults timeout: @config.rpcs.get_context.timeout,
677
+ metadata: metadata,
678
+ retry_policy: @config.rpcs.get_context.retry_policy
679
+
680
+ options.apply_defaults timeout: @config.timeout,
681
+ metadata: @config.metadata,
682
+ retry_policy: @config.retry_policy
683
+
684
+ @managed_schema_registry_stub.call_rpc :get_context, request, options: options do |response, operation|
685
+ yield response, operation if block_given?
686
+ end
687
+ rescue ::GRPC::BadStatus => e
688
+ raise ::Google::Cloud::Error.from_error(e)
689
+ end
690
+
691
+ ##
692
+ # List contexts for a schema registry.
693
+ #
694
+ # @overload list_contexts(request, options = nil)
695
+ # Pass arguments to `list_contexts` via a request object, either of type
696
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest} or an equivalent Hash.
697
+ #
698
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest, ::Hash]
699
+ # A request object representing the call parameters. Required. To specify no
700
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
701
+ # @param options [::Gapic::CallOptions, ::Hash]
702
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
703
+ #
704
+ # @overload list_contexts(parent: nil)
705
+ # Pass arguments to `list_contexts` via keyword arguments. Note that at
706
+ # least one keyword argument is required. To specify no parameters, or to keep all
707
+ # the default parameter values, pass an empty Hash as a request object (see above).
708
+ #
709
+ # @param parent [::String]
710
+ # Required. The parent of the contexts. Structured like:
711
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}`
712
+ #
713
+ # @yield [response, operation] Access the result along with the RPC operation
714
+ # @yieldparam response [::Google::Api::HttpBody]
715
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
716
+ #
717
+ # @return [::Google::Api::HttpBody]
718
+ #
719
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
720
+ #
721
+ # @example Basic example
722
+ # require "google/cloud/managed_kafka/schema_registry/v1"
723
+ #
724
+ # # Create a client object. The client can be reused for multiple calls.
725
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
726
+ #
727
+ # # Create a request. To set request fields, pass in keyword arguments.
728
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest.new
729
+ #
730
+ # # Call the list_contexts method.
731
+ # result = client.list_contexts request
732
+ #
733
+ # # The returned object is of type Google::Api::HttpBody.
734
+ # p result
735
+ #
736
+ def list_contexts request, options = nil
737
+ raise ::ArgumentError, "request must be provided" if request.nil?
738
+
739
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListContextsRequest
740
+
741
+ # Converts hash and nil to an options object
742
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
743
+
744
+ # Customize the options with defaults
745
+ metadata = @config.rpcs.list_contexts.metadata.to_h
746
+
747
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
748
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
749
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
750
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
751
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
752
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
753
+
754
+ header_params = {}
755
+ if request.parent
756
+ header_params["parent"] = request.parent
757
+ end
758
+
759
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
760
+ metadata[:"x-goog-request-params"] ||= request_params_header
761
+
762
+ options.apply_defaults timeout: @config.rpcs.list_contexts.timeout,
763
+ metadata: metadata,
764
+ retry_policy: @config.rpcs.list_contexts.retry_policy
765
+
766
+ options.apply_defaults timeout: @config.timeout,
767
+ metadata: @config.metadata,
768
+ retry_policy: @config.retry_policy
769
+
770
+ @managed_schema_registry_stub.call_rpc :list_contexts, request, options: options do |response, operation|
771
+ yield response, operation if block_given?
772
+ end
773
+ rescue ::GRPC::BadStatus => e
774
+ raise ::Google::Cloud::Error.from_error(e)
775
+ end
776
+
777
+ ##
778
+ # Get the schema for the given schema id.
779
+ #
780
+ # @overload get_schema(request, options = nil)
781
+ # Pass arguments to `get_schema` via a request object, either of type
782
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest} or an equivalent Hash.
783
+ #
784
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest, ::Hash]
785
+ # A request object representing the call parameters. Required. To specify no
786
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
787
+ # @param options [::Gapic::CallOptions, ::Hash]
788
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
789
+ #
790
+ # @overload get_schema(name: nil, subject: nil)
791
+ # Pass arguments to `get_schema` via keyword arguments. Note that at
792
+ # least one keyword argument is required. To specify no parameters, or to keep all
793
+ # the default parameter values, pass an empty Hash as a request object (see above).
794
+ #
795
+ # @param name [::String]
796
+ # Required. The name of the schema to return. Structured like:
797
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}`
798
+ # @param subject [::String]
799
+ # Optional. Used to limit the search for the schema ID to a specific subject,
800
+ # otherwise the schema ID will be searched for in all subjects in the given
801
+ # specified context.
802
+ #
803
+ # @yield [response, operation] Access the result along with the RPC operation
804
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema]
805
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
806
+ #
807
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema]
808
+ #
809
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
810
+ #
811
+ # @example Basic example
812
+ # require "google/cloud/managed_kafka/schema_registry/v1"
813
+ #
814
+ # # Create a client object. The client can be reused for multiple calls.
815
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
816
+ #
817
+ # # Create a request. To set request fields, pass in keyword arguments.
818
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest.new
819
+ #
820
+ # # Call the get_schema method.
821
+ # result = client.get_schema request
822
+ #
823
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema.
824
+ # p result
825
+ #
826
+ def get_schema request, options = nil
827
+ raise ::ArgumentError, "request must be provided" if request.nil?
828
+
829
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest
830
+
831
+ # Converts hash and nil to an options object
832
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
833
+
834
+ # Customize the options with defaults
835
+ metadata = @config.rpcs.get_schema.metadata.to_h
836
+
837
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
838
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
839
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
840
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
841
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
842
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
843
+
844
+ header_params = {}
845
+ if request.name
846
+ header_params["name"] = request.name
847
+ end
848
+
849
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
850
+ metadata[:"x-goog-request-params"] ||= request_params_header
851
+
852
+ options.apply_defaults timeout: @config.rpcs.get_schema.timeout,
853
+ metadata: metadata,
854
+ retry_policy: @config.rpcs.get_schema.retry_policy
855
+
856
+ options.apply_defaults timeout: @config.timeout,
857
+ metadata: @config.metadata,
858
+ retry_policy: @config.retry_policy
859
+
860
+ @managed_schema_registry_stub.call_rpc :get_schema, request, options: options do |response, operation|
861
+ yield response, operation if block_given?
862
+ end
863
+ rescue ::GRPC::BadStatus => e
864
+ raise ::Google::Cloud::Error.from_error(e)
865
+ end
866
+
867
+ ##
868
+ # Get the schema string for the given schema id.
869
+ # The response will be the schema string.
870
+ #
871
+ # @overload get_raw_schema(request, options = nil)
872
+ # Pass arguments to `get_raw_schema` via a request object, either of type
873
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest} or an equivalent Hash.
874
+ #
875
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest, ::Hash]
876
+ # A request object representing the call parameters. Required. To specify no
877
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
878
+ # @param options [::Gapic::CallOptions, ::Hash]
879
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
880
+ #
881
+ # @overload get_raw_schema(name: nil, subject: nil)
882
+ # Pass arguments to `get_raw_schema` via keyword arguments. Note that at
883
+ # least one keyword argument is required. To specify no parameters, or to keep all
884
+ # the default parameter values, pass an empty Hash as a request object (see above).
885
+ #
886
+ # @param name [::String]
887
+ # Required. The name of the schema to return. Structured like:
888
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}`
889
+ # @param subject [::String]
890
+ # Optional. Used to limit the search for the schema ID to a specific subject,
891
+ # otherwise the schema ID will be searched for in all subjects in the given
892
+ # specified context.
893
+ #
894
+ # @yield [response, operation] Access the result along with the RPC operation
895
+ # @yieldparam response [::Google::Api::HttpBody]
896
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
897
+ #
898
+ # @return [::Google::Api::HttpBody]
899
+ #
900
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
901
+ #
902
+ # @example Basic example
903
+ # require "google/cloud/managed_kafka/schema_registry/v1"
904
+ #
905
+ # # Create a client object. The client can be reused for multiple calls.
906
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
907
+ #
908
+ # # Create a request. To set request fields, pass in keyword arguments.
909
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest.new
910
+ #
911
+ # # Call the get_raw_schema method.
912
+ # result = client.get_raw_schema request
913
+ #
914
+ # # The returned object is of type Google::Api::HttpBody.
915
+ # p result
916
+ #
917
+ def get_raw_schema request, options = nil
918
+ raise ::ArgumentError, "request must be provided" if request.nil?
919
+
920
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaRequest
921
+
922
+ # Converts hash and nil to an options object
923
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
924
+
925
+ # Customize the options with defaults
926
+ metadata = @config.rpcs.get_raw_schema.metadata.to_h
927
+
928
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
929
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
930
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
931
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
932
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
933
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
934
+
935
+ header_params = {}
936
+ if request.name
937
+ header_params["name"] = request.name
938
+ end
939
+
940
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
941
+ metadata[:"x-goog-request-params"] ||= request_params_header
942
+
943
+ options.apply_defaults timeout: @config.rpcs.get_raw_schema.timeout,
944
+ metadata: metadata,
945
+ retry_policy: @config.rpcs.get_raw_schema.retry_policy
946
+
947
+ options.apply_defaults timeout: @config.timeout,
948
+ metadata: @config.metadata,
949
+ retry_policy: @config.retry_policy
950
+
951
+ @managed_schema_registry_stub.call_rpc :get_raw_schema, request, options: options do |response, operation|
952
+ yield response, operation if block_given?
953
+ end
954
+ rescue ::GRPC::BadStatus => e
955
+ raise ::Google::Cloud::Error.from_error(e)
956
+ end
957
+
958
+ ##
959
+ # List the schema versions for the given schema id.
960
+ # The response will be an array of subject-version pairs as:
961
+ # [\\{"subject":"subject1", "version":1}, \\{"subject":"subject2", "version":2}].
962
+ #
963
+ # @overload list_schema_versions(request, options = nil)
964
+ # Pass arguments to `list_schema_versions` via a request object, either of type
965
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest} or an equivalent Hash.
966
+ #
967
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest, ::Hash]
968
+ # A request object representing the call parameters. Required. To specify no
969
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
970
+ # @param options [::Gapic::CallOptions, ::Hash]
971
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
972
+ #
973
+ # @overload list_schema_versions(parent: nil, subject: nil, deleted: nil)
974
+ # Pass arguments to `list_schema_versions` via keyword arguments. Note that at
975
+ # least one keyword argument is required. To specify no parameters, or to keep all
976
+ # the default parameter values, pass an empty Hash as a request object (see above).
977
+ #
978
+ # @param parent [::String]
979
+ # Required. The schema whose schema versions are to be listed. Structured
980
+ # like:
981
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}`
982
+ # or
983
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}`
984
+ # @param subject [::String]
985
+ # Optional. The subject to filter the subjects by.
986
+ # @param deleted [::Boolean]
987
+ # Optional. If true, the response will include soft-deleted versions of the
988
+ # schema, even if the subject is soft-deleted. The default is false.
989
+ #
990
+ # @yield [response, operation] Access the result along with the RPC operation
991
+ # @yieldparam response [::Google::Api::HttpBody]
992
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
993
+ #
994
+ # @return [::Google::Api::HttpBody]
995
+ #
996
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
997
+ #
998
+ # @example Basic example
999
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1000
+ #
1001
+ # # Create a client object. The client can be reused for multiple calls.
1002
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1003
+ #
1004
+ # # Create a request. To set request fields, pass in keyword arguments.
1005
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest.new
1006
+ #
1007
+ # # Call the list_schema_versions method.
1008
+ # result = client.list_schema_versions request
1009
+ #
1010
+ # # The returned object is of type Google::Api::HttpBody.
1011
+ # p result
1012
+ #
1013
+ def list_schema_versions request, options = nil
1014
+ raise ::ArgumentError, "request must be provided" if request.nil?
1015
+
1016
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaVersionsRequest
1017
+
1018
+ # Converts hash and nil to an options object
1019
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1020
+
1021
+ # Customize the options with defaults
1022
+ metadata = @config.rpcs.list_schema_versions.metadata.to_h
1023
+
1024
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1025
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1026
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1027
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1028
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1029
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1030
+
1031
+ header_params = {}
1032
+ if request.parent
1033
+ header_params["parent"] = request.parent
1034
+ end
1035
+
1036
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1037
+ metadata[:"x-goog-request-params"] ||= request_params_header
1038
+
1039
+ options.apply_defaults timeout: @config.rpcs.list_schema_versions.timeout,
1040
+ metadata: metadata,
1041
+ retry_policy: @config.rpcs.list_schema_versions.retry_policy
1042
+
1043
+ options.apply_defaults timeout: @config.timeout,
1044
+ metadata: @config.metadata,
1045
+ retry_policy: @config.retry_policy
1046
+
1047
+ @managed_schema_registry_stub.call_rpc :list_schema_versions, request, options: options do |response, operation|
1048
+ yield response, operation if block_given?
1049
+ end
1050
+ rescue ::GRPC::BadStatus => e
1051
+ raise ::Google::Cloud::Error.from_error(e)
1052
+ end
1053
+
1054
+ ##
1055
+ # List the supported schema types.
1056
+ # The response will be an array of schema types.
1057
+ #
1058
+ # @overload list_schema_types(request, options = nil)
1059
+ # Pass arguments to `list_schema_types` via a request object, either of type
1060
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest} or an equivalent Hash.
1061
+ #
1062
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest, ::Hash]
1063
+ # A request object representing the call parameters. Required. To specify no
1064
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1065
+ # @param options [::Gapic::CallOptions, ::Hash]
1066
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1067
+ #
1068
+ # @overload list_schema_types(parent: nil)
1069
+ # Pass arguments to `list_schema_types` via keyword arguments. Note that at
1070
+ # least one keyword argument is required. To specify no parameters, or to keep all
1071
+ # the default parameter values, pass an empty Hash as a request object (see above).
1072
+ #
1073
+ # @param parent [::String]
1074
+ # Required. The parent schema registry whose schema types are to be listed.
1075
+ # Structured like:
1076
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}`
1077
+ #
1078
+ # @yield [response, operation] Access the result along with the RPC operation
1079
+ # @yieldparam response [::Google::Api::HttpBody]
1080
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1081
+ #
1082
+ # @return [::Google::Api::HttpBody]
1083
+ #
1084
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1085
+ #
1086
+ # @example Basic example
1087
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1088
+ #
1089
+ # # Create a client object. The client can be reused for multiple calls.
1090
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1091
+ #
1092
+ # # Create a request. To set request fields, pass in keyword arguments.
1093
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest.new
1094
+ #
1095
+ # # Call the list_schema_types method.
1096
+ # result = client.list_schema_types request
1097
+ #
1098
+ # # The returned object is of type Google::Api::HttpBody.
1099
+ # p result
1100
+ #
1101
+ def list_schema_types request, options = nil
1102
+ raise ::ArgumentError, "request must be provided" if request.nil?
1103
+
1104
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSchemaTypesRequest
1105
+
1106
+ # Converts hash and nil to an options object
1107
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1108
+
1109
+ # Customize the options with defaults
1110
+ metadata = @config.rpcs.list_schema_types.metadata.to_h
1111
+
1112
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1113
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1114
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1115
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1116
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1117
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1118
+
1119
+ header_params = {}
1120
+ if request.parent
1121
+ header_params["parent"] = request.parent
1122
+ end
1123
+
1124
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1125
+ metadata[:"x-goog-request-params"] ||= request_params_header
1126
+
1127
+ options.apply_defaults timeout: @config.rpcs.list_schema_types.timeout,
1128
+ metadata: metadata,
1129
+ retry_policy: @config.rpcs.list_schema_types.retry_policy
1130
+
1131
+ options.apply_defaults timeout: @config.timeout,
1132
+ metadata: @config.metadata,
1133
+ retry_policy: @config.retry_policy
1134
+
1135
+ @managed_schema_registry_stub.call_rpc :list_schema_types, request, options: options do |response, operation|
1136
+ yield response, operation if block_given?
1137
+ end
1138
+ rescue ::GRPC::BadStatus => e
1139
+ raise ::Google::Cloud::Error.from_error(e)
1140
+ end
1141
+
1142
+ ##
1143
+ # List subjects in the schema registry.
1144
+ # The response will be an array of subject names.
1145
+ #
1146
+ # @overload list_subjects(request, options = nil)
1147
+ # Pass arguments to `list_subjects` via a request object, either of type
1148
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest} or an equivalent Hash.
1149
+ #
1150
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest, ::Hash]
1151
+ # A request object representing the call parameters. Required. To specify no
1152
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1153
+ # @param options [::Gapic::CallOptions, ::Hash]
1154
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1155
+ #
1156
+ # @overload list_subjects(parent: nil, subject_prefix: nil, deleted: nil)
1157
+ # Pass arguments to `list_subjects` via keyword arguments. Note that at
1158
+ # least one keyword argument is required. To specify no parameters, or to keep all
1159
+ # the default parameter values, pass an empty Hash as a request object (see above).
1160
+ #
1161
+ # @param parent [::String]
1162
+ # Required. The parent schema registry/context whose subjects are to be
1163
+ # listed. Structured like:
1164
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}`
1165
+ # or
1166
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}`
1167
+ # @param subject_prefix [::String]
1168
+ # Optional. The context to filter the subjects by, in the format of
1169
+ # `:.{context}:`. If unset, all subjects in the registry are returned. Set to
1170
+ # empty string or add as
1171
+ # '?subjectPrefix=' at the end of this request to list subjects in the
1172
+ # default context.
1173
+ # @param deleted [::Boolean]
1174
+ # Optional. If true, the response will include soft-deleted subjects. The
1175
+ # default is false.
1176
+ #
1177
+ # @yield [response, operation] Access the result along with the RPC operation
1178
+ # @yieldparam response [::Google::Api::HttpBody]
1179
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1180
+ #
1181
+ # @return [::Google::Api::HttpBody]
1182
+ #
1183
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1184
+ #
1185
+ # @example Basic example
1186
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1187
+ #
1188
+ # # Create a client object. The client can be reused for multiple calls.
1189
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1190
+ #
1191
+ # # Create a request. To set request fields, pass in keyword arguments.
1192
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest.new
1193
+ #
1194
+ # # Call the list_subjects method.
1195
+ # result = client.list_subjects request
1196
+ #
1197
+ # # The returned object is of type Google::Api::HttpBody.
1198
+ # p result
1199
+ #
1200
+ def list_subjects request, options = nil
1201
+ raise ::ArgumentError, "request must be provided" if request.nil?
1202
+
1203
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsRequest
1204
+
1205
+ # Converts hash and nil to an options object
1206
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1207
+
1208
+ # Customize the options with defaults
1209
+ metadata = @config.rpcs.list_subjects.metadata.to_h
1210
+
1211
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1212
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1213
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1214
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1215
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1216
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1217
+
1218
+ header_params = {}
1219
+ if request.parent
1220
+ header_params["parent"] = request.parent
1221
+ end
1222
+
1223
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1224
+ metadata[:"x-goog-request-params"] ||= request_params_header
1225
+
1226
+ options.apply_defaults timeout: @config.rpcs.list_subjects.timeout,
1227
+ metadata: metadata,
1228
+ retry_policy: @config.rpcs.list_subjects.retry_policy
1229
+
1230
+ options.apply_defaults timeout: @config.timeout,
1231
+ metadata: @config.metadata,
1232
+ retry_policy: @config.retry_policy
1233
+
1234
+ @managed_schema_registry_stub.call_rpc :list_subjects, request, options: options do |response, operation|
1235
+ yield response, operation if block_given?
1236
+ end
1237
+ rescue ::GRPC::BadStatus => e
1238
+ raise ::Google::Cloud::Error.from_error(e)
1239
+ end
1240
+
1241
+ ##
1242
+ # List subjects which reference a particular schema id.
1243
+ # The response will be an array of subject names.
1244
+ #
1245
+ # @overload list_subjects_by_schema_id(request, options = nil)
1246
+ # Pass arguments to `list_subjects_by_schema_id` via a request object, either of type
1247
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest} or an equivalent Hash.
1248
+ #
1249
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest, ::Hash]
1250
+ # A request object representing the call parameters. Required. To specify no
1251
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1252
+ # @param options [::Gapic::CallOptions, ::Hash]
1253
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1254
+ #
1255
+ # @overload list_subjects_by_schema_id(parent: nil, subject: nil, deleted: nil)
1256
+ # Pass arguments to `list_subjects_by_schema_id` via keyword arguments. Note that at
1257
+ # least one keyword argument is required. To specify no parameters, or to keep all
1258
+ # the default parameter values, pass an empty Hash as a request object (see above).
1259
+ #
1260
+ # @param parent [::String]
1261
+ # Required. The schema resource whose associated subjects are to be listed.
1262
+ # Structured like:
1263
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}`
1264
+ # or
1265
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}`
1266
+ # @param subject [::String]
1267
+ # Optional. The subject to filter the subjects by.
1268
+ # @param deleted [::Boolean]
1269
+ # Optional. If true, the response will include soft-deleted subjects. The
1270
+ # default is false.
1271
+ #
1272
+ # @yield [response, operation] Access the result along with the RPC operation
1273
+ # @yieldparam response [::Google::Api::HttpBody]
1274
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1275
+ #
1276
+ # @return [::Google::Api::HttpBody]
1277
+ #
1278
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1279
+ #
1280
+ # @example Basic example
1281
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1282
+ #
1283
+ # # Create a client object. The client can be reused for multiple calls.
1284
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1285
+ #
1286
+ # # Create a request. To set request fields, pass in keyword arguments.
1287
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest.new
1288
+ #
1289
+ # # Call the list_subjects_by_schema_id method.
1290
+ # result = client.list_subjects_by_schema_id request
1291
+ #
1292
+ # # The returned object is of type Google::Api::HttpBody.
1293
+ # p result
1294
+ #
1295
+ def list_subjects_by_schema_id request, options = nil
1296
+ raise ::ArgumentError, "request must be provided" if request.nil?
1297
+
1298
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListSubjectsBySchemaIdRequest
1299
+
1300
+ # Converts hash and nil to an options object
1301
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1302
+
1303
+ # Customize the options with defaults
1304
+ metadata = @config.rpcs.list_subjects_by_schema_id.metadata.to_h
1305
+
1306
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1307
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1308
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1309
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1310
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1311
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1312
+
1313
+ header_params = {}
1314
+ if request.parent
1315
+ header_params["parent"] = request.parent
1316
+ end
1317
+
1318
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1319
+ metadata[:"x-goog-request-params"] ||= request_params_header
1320
+
1321
+ options.apply_defaults timeout: @config.rpcs.list_subjects_by_schema_id.timeout,
1322
+ metadata: metadata,
1323
+ retry_policy: @config.rpcs.list_subjects_by_schema_id.retry_policy
1324
+
1325
+ options.apply_defaults timeout: @config.timeout,
1326
+ metadata: @config.metadata,
1327
+ retry_policy: @config.retry_policy
1328
+
1329
+ @managed_schema_registry_stub.call_rpc :list_subjects_by_schema_id, request, options: options do |response, operation|
1330
+ yield response, operation if block_given?
1331
+ end
1332
+ rescue ::GRPC::BadStatus => e
1333
+ raise ::Google::Cloud::Error.from_error(e)
1334
+ end
1335
+
1336
+ ##
1337
+ # Delete a subject.
1338
+ # The response will be an array of versions of the deleted subject.
1339
+ #
1340
+ # @overload delete_subject(request, options = nil)
1341
+ # Pass arguments to `delete_subject` via a request object, either of type
1342
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest} or an equivalent Hash.
1343
+ #
1344
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest, ::Hash]
1345
+ # A request object representing the call parameters. Required. To specify no
1346
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1347
+ # @param options [::Gapic::CallOptions, ::Hash]
1348
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1349
+ #
1350
+ # @overload delete_subject(name: nil, permanent: nil)
1351
+ # Pass arguments to `delete_subject` via keyword arguments. Note that at
1352
+ # least one keyword argument is required. To specify no parameters, or to keep all
1353
+ # the default parameter values, pass an empty Hash as a request object (see above).
1354
+ #
1355
+ # @param name [::String]
1356
+ # Required. The name of the subject to delete. Structured like:
1357
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}`
1358
+ # or
1359
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}`
1360
+ # @param permanent [::Boolean]
1361
+ # Optional. If true, the subject and all associated metadata including the
1362
+ # schema ID will be deleted permanently. Otherwise, only the subject is
1363
+ # soft-deleted. The default is false. Soft-deleted subjects can still be
1364
+ # searched in ListSubjects API call with deleted=true query parameter. A
1365
+ # soft-delete of a subject must be performed before a hard-delete.
1366
+ #
1367
+ # @yield [response, operation] Access the result along with the RPC operation
1368
+ # @yieldparam response [::Google::Api::HttpBody]
1369
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1370
+ #
1371
+ # @return [::Google::Api::HttpBody]
1372
+ #
1373
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1374
+ #
1375
+ # @example Basic example
1376
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1377
+ #
1378
+ # # Create a client object. The client can be reused for multiple calls.
1379
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1380
+ #
1381
+ # # Create a request. To set request fields, pass in keyword arguments.
1382
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest.new
1383
+ #
1384
+ # # Call the delete_subject method.
1385
+ # result = client.delete_subject request
1386
+ #
1387
+ # # The returned object is of type Google::Api::HttpBody.
1388
+ # p result
1389
+ #
1390
+ def delete_subject request, options = nil
1391
+ raise ::ArgumentError, "request must be provided" if request.nil?
1392
+
1393
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSubjectRequest
1394
+
1395
+ # Converts hash and nil to an options object
1396
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1397
+
1398
+ # Customize the options with defaults
1399
+ metadata = @config.rpcs.delete_subject.metadata.to_h
1400
+
1401
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1402
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1403
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1404
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1405
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1406
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1407
+
1408
+ header_params = {}
1409
+ if request.name
1410
+ header_params["name"] = request.name
1411
+ end
1412
+
1413
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1414
+ metadata[:"x-goog-request-params"] ||= request_params_header
1415
+
1416
+ options.apply_defaults timeout: @config.rpcs.delete_subject.timeout,
1417
+ metadata: metadata,
1418
+ retry_policy: @config.rpcs.delete_subject.retry_policy
1419
+
1420
+ options.apply_defaults timeout: @config.timeout,
1421
+ metadata: @config.metadata,
1422
+ retry_policy: @config.retry_policy
1423
+
1424
+ @managed_schema_registry_stub.call_rpc :delete_subject, request, options: options do |response, operation|
1425
+ yield response, operation if block_given?
1426
+ end
1427
+ rescue ::GRPC::BadStatus => e
1428
+ raise ::Google::Cloud::Error.from_error(e)
1429
+ end
1430
+
1431
+ ##
1432
+ # Lookup a schema under the specified subject.
1433
+ #
1434
+ # @overload lookup_version(request, options = nil)
1435
+ # Pass arguments to `lookup_version` via a request object, either of type
1436
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest} or an equivalent Hash.
1437
+ #
1438
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest, ::Hash]
1439
+ # A request object representing the call parameters. Required. To specify no
1440
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1441
+ # @param options [::Gapic::CallOptions, ::Hash]
1442
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1443
+ #
1444
+ # @overload lookup_version(parent: nil, schema_type: nil, schema: nil, references: nil, normalize: nil, deleted: nil)
1445
+ # Pass arguments to `lookup_version` via keyword arguments. Note that at
1446
+ # least one keyword argument is required. To specify no parameters, or to keep all
1447
+ # the default parameter values, pass an empty Hash as a request object (see above).
1448
+ #
1449
+ # @param parent [::String]
1450
+ # Required. The subject to lookup the schema in. Structured like:
1451
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}`
1452
+ # or
1453
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}`
1454
+ # @param schema_type [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType]
1455
+ # Optional. The schema type of the schema.
1456
+ # @param schema [::String]
1457
+ # Required. The schema payload
1458
+ # @param references [::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>]
1459
+ # Optional. The schema references used by the schema.
1460
+ # @param normalize [::Boolean]
1461
+ # Optional. If true, the schema will be normalized before being looked up.
1462
+ # The default is false.
1463
+ # @param deleted [::Boolean]
1464
+ # Optional. If true, soft-deleted versions will be included in lookup, no
1465
+ # matter if the subject is active or soft-deleted. If false, soft-deleted
1466
+ # versions will be excluded. The default is false.
1467
+ #
1468
+ # @yield [response, operation] Access the result along with the RPC operation
1469
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion]
1470
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1471
+ #
1472
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion]
1473
+ #
1474
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1475
+ #
1476
+ # @example Basic example
1477
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1478
+ #
1479
+ # # Create a client object. The client can be reused for multiple calls.
1480
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1481
+ #
1482
+ # # Create a request. To set request fields, pass in keyword arguments.
1483
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest.new
1484
+ #
1485
+ # # Call the lookup_version method.
1486
+ # result = client.lookup_version request
1487
+ #
1488
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion.
1489
+ # p result
1490
+ #
1491
+ def lookup_version request, options = nil
1492
+ raise ::ArgumentError, "request must be provided" if request.nil?
1493
+
1494
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::LookupVersionRequest
1495
+
1496
+ # Converts hash and nil to an options object
1497
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1498
+
1499
+ # Customize the options with defaults
1500
+ metadata = @config.rpcs.lookup_version.metadata.to_h
1501
+
1502
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1503
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1504
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1505
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1506
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1507
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1508
+
1509
+ header_params = {}
1510
+ if request.parent
1511
+ header_params["parent"] = request.parent
1512
+ end
1513
+
1514
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1515
+ metadata[:"x-goog-request-params"] ||= request_params_header
1516
+
1517
+ options.apply_defaults timeout: @config.rpcs.lookup_version.timeout,
1518
+ metadata: metadata,
1519
+ retry_policy: @config.rpcs.lookup_version.retry_policy
1520
+
1521
+ options.apply_defaults timeout: @config.timeout,
1522
+ metadata: @config.metadata,
1523
+ retry_policy: @config.retry_policy
1524
+
1525
+ @managed_schema_registry_stub.call_rpc :lookup_version, request, options: options do |response, operation|
1526
+ yield response, operation if block_given?
1527
+ end
1528
+ rescue ::GRPC::BadStatus => e
1529
+ raise ::Google::Cloud::Error.from_error(e)
1530
+ end
1531
+
1532
+ ##
1533
+ # Get a versioned schema (schema with subject/version) of a subject.
1534
+ #
1535
+ # @overload get_version(request, options = nil)
1536
+ # Pass arguments to `get_version` via a request object, either of type
1537
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest} or an equivalent Hash.
1538
+ #
1539
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest, ::Hash]
1540
+ # A request object representing the call parameters. Required. To specify no
1541
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1542
+ # @param options [::Gapic::CallOptions, ::Hash]
1543
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1544
+ #
1545
+ # @overload get_version(name: nil, deleted: nil)
1546
+ # Pass arguments to `get_version` via keyword arguments. Note that at
1547
+ # least one keyword argument is required. To specify no parameters, or to keep all
1548
+ # the default parameter values, pass an empty Hash as a request object (see above).
1549
+ #
1550
+ # @param name [::String]
1551
+ # Required. The name of the subject to return versions. Structured like:
1552
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
1553
+ # or
1554
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
1555
+ # @param deleted [::Boolean]
1556
+ # Optional. If true, no matter if the subject/version is soft-deleted or not,
1557
+ # it returns the version details. If false, it returns NOT_FOUND error if the
1558
+ # subject/version is soft-deleted. The default is false.
1559
+ #
1560
+ # @yield [response, operation] Access the result along with the RPC operation
1561
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion]
1562
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1563
+ #
1564
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion]
1565
+ #
1566
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1567
+ #
1568
+ # @example Basic example
1569
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1570
+ #
1571
+ # # Create a client object. The client can be reused for multiple calls.
1572
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1573
+ #
1574
+ # # Create a request. To set request fields, pass in keyword arguments.
1575
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest.new
1576
+ #
1577
+ # # Call the get_version method.
1578
+ # result = client.get_version request
1579
+ #
1580
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaVersion.
1581
+ # p result
1582
+ #
1583
+ def get_version request, options = nil
1584
+ raise ::ArgumentError, "request must be provided" if request.nil?
1585
+
1586
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest
1587
+
1588
+ # Converts hash and nil to an options object
1589
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1590
+
1591
+ # Customize the options with defaults
1592
+ metadata = @config.rpcs.get_version.metadata.to_h
1593
+
1594
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1595
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1596
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1597
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1598
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1599
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1600
+
1601
+ header_params = {}
1602
+ if request.name
1603
+ header_params["name"] = request.name
1604
+ end
1605
+
1606
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1607
+ metadata[:"x-goog-request-params"] ||= request_params_header
1608
+
1609
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
1610
+ metadata: metadata,
1611
+ retry_policy: @config.rpcs.get_version.retry_policy
1612
+
1613
+ options.apply_defaults timeout: @config.timeout,
1614
+ metadata: @config.metadata,
1615
+ retry_policy: @config.retry_policy
1616
+
1617
+ @managed_schema_registry_stub.call_rpc :get_version, request, options: options do |response, operation|
1618
+ yield response, operation if block_given?
1619
+ end
1620
+ rescue ::GRPC::BadStatus => e
1621
+ raise ::Google::Cloud::Error.from_error(e)
1622
+ end
1623
+
1624
+ ##
1625
+ # Get the schema string only for a version of a subject.
1626
+ # The response will be the schema string.
1627
+ #
1628
+ # @overload get_raw_schema_version(request, options = nil)
1629
+ # Pass arguments to `get_raw_schema_version` via a request object, either of type
1630
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest} or an equivalent Hash.
1631
+ #
1632
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest, ::Hash]
1633
+ # A request object representing the call parameters. Required. To specify no
1634
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1635
+ # @param options [::Gapic::CallOptions, ::Hash]
1636
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1637
+ #
1638
+ # @overload get_raw_schema_version(name: nil, deleted: nil)
1639
+ # Pass arguments to `get_raw_schema_version` via keyword arguments. Note that at
1640
+ # least one keyword argument is required. To specify no parameters, or to keep all
1641
+ # the default parameter values, pass an empty Hash as a request object (see above).
1642
+ #
1643
+ # @param name [::String]
1644
+ # Required. The name of the subject to return versions. Structured like:
1645
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
1646
+ # or
1647
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
1648
+ # @param deleted [::Boolean]
1649
+ # Optional. If true, no matter if the subject/version is soft-deleted or not,
1650
+ # it returns the version details. If false, it returns NOT_FOUND error if the
1651
+ # subject/version is soft-deleted. The default is false.
1652
+ #
1653
+ # @yield [response, operation] Access the result along with the RPC operation
1654
+ # @yieldparam response [::Google::Api::HttpBody]
1655
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1656
+ #
1657
+ # @return [::Google::Api::HttpBody]
1658
+ #
1659
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1660
+ #
1661
+ # @example Basic example
1662
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1663
+ #
1664
+ # # Create a client object. The client can be reused for multiple calls.
1665
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1666
+ #
1667
+ # # Create a request. To set request fields, pass in keyword arguments.
1668
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest.new
1669
+ #
1670
+ # # Call the get_raw_schema_version method.
1671
+ # result = client.get_raw_schema_version request
1672
+ #
1673
+ # # The returned object is of type Google::Api::HttpBody.
1674
+ # p result
1675
+ #
1676
+ def get_raw_schema_version request, options = nil
1677
+ raise ::ArgumentError, "request must be provided" if request.nil?
1678
+
1679
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetVersionRequest
1680
+
1681
+ # Converts hash and nil to an options object
1682
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1683
+
1684
+ # Customize the options with defaults
1685
+ metadata = @config.rpcs.get_raw_schema_version.metadata.to_h
1686
+
1687
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1688
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1689
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1690
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1691
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1692
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1693
+
1694
+ header_params = {}
1695
+ if request.name
1696
+ header_params["name"] = request.name
1697
+ end
1698
+
1699
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1700
+ metadata[:"x-goog-request-params"] ||= request_params_header
1701
+
1702
+ options.apply_defaults timeout: @config.rpcs.get_raw_schema_version.timeout,
1703
+ metadata: metadata,
1704
+ retry_policy: @config.rpcs.get_raw_schema_version.retry_policy
1705
+
1706
+ options.apply_defaults timeout: @config.timeout,
1707
+ metadata: @config.metadata,
1708
+ retry_policy: @config.retry_policy
1709
+
1710
+ @managed_schema_registry_stub.call_rpc :get_raw_schema_version, request, options: options do |response, operation|
1711
+ yield response, operation if block_given?
1712
+ end
1713
+ rescue ::GRPC::BadStatus => e
1714
+ raise ::Google::Cloud::Error.from_error(e)
1715
+ end
1716
+
1717
+ ##
1718
+ # Get all versions of a subject.
1719
+ # The response will be an array of versions of the subject.
1720
+ #
1721
+ # @overload list_versions(request, options = nil)
1722
+ # Pass arguments to `list_versions` via a request object, either of type
1723
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest} or an equivalent Hash.
1724
+ #
1725
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest, ::Hash]
1726
+ # A request object representing the call parameters. Required. To specify no
1727
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1728
+ # @param options [::Gapic::CallOptions, ::Hash]
1729
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1730
+ #
1731
+ # @overload list_versions(parent: nil, deleted: nil)
1732
+ # Pass arguments to `list_versions` via keyword arguments. Note that at
1733
+ # least one keyword argument is required. To specify no parameters, or to keep all
1734
+ # the default parameter values, pass an empty Hash as a request object (see above).
1735
+ #
1736
+ # @param parent [::String]
1737
+ # Required. The subject whose versions are to be listed. Structured like:
1738
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}`
1739
+ # or
1740
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}`
1741
+ # @param deleted [::Boolean]
1742
+ # Optional. If true, the response will include soft-deleted versions of an
1743
+ # active or soft-deleted subject. The default is false.
1744
+ #
1745
+ # @yield [response, operation] Access the result along with the RPC operation
1746
+ # @yieldparam response [::Google::Api::HttpBody]
1747
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1748
+ #
1749
+ # @return [::Google::Api::HttpBody]
1750
+ #
1751
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1752
+ #
1753
+ # @example Basic example
1754
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1755
+ #
1756
+ # # Create a client object. The client can be reused for multiple calls.
1757
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1758
+ #
1759
+ # # Create a request. To set request fields, pass in keyword arguments.
1760
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest.new
1761
+ #
1762
+ # # Call the list_versions method.
1763
+ # result = client.list_versions request
1764
+ #
1765
+ # # The returned object is of type Google::Api::HttpBody.
1766
+ # p result
1767
+ #
1768
+ def list_versions request, options = nil
1769
+ raise ::ArgumentError, "request must be provided" if request.nil?
1770
+
1771
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListVersionsRequest
1772
+
1773
+ # Converts hash and nil to an options object
1774
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1775
+
1776
+ # Customize the options with defaults
1777
+ metadata = @config.rpcs.list_versions.metadata.to_h
1778
+
1779
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1780
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1781
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1782
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1783
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1784
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1785
+
1786
+ header_params = {}
1787
+ if request.parent
1788
+ header_params["parent"] = request.parent
1789
+ end
1790
+
1791
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1792
+ metadata[:"x-goog-request-params"] ||= request_params_header
1793
+
1794
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
1795
+ metadata: metadata,
1796
+ retry_policy: @config.rpcs.list_versions.retry_policy
1797
+
1798
+ options.apply_defaults timeout: @config.timeout,
1799
+ metadata: @config.metadata,
1800
+ retry_policy: @config.retry_policy
1801
+
1802
+ @managed_schema_registry_stub.call_rpc :list_versions, request, options: options do |response, operation|
1803
+ yield response, operation if block_given?
1804
+ end
1805
+ rescue ::GRPC::BadStatus => e
1806
+ raise ::Google::Cloud::Error.from_error(e)
1807
+ end
1808
+
1809
+ ##
1810
+ # Register a new version under a given subject with the given schema.
1811
+ #
1812
+ # @overload create_version(request, options = nil)
1813
+ # Pass arguments to `create_version` via a request object, either of type
1814
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest} or an equivalent Hash.
1815
+ #
1816
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest, ::Hash]
1817
+ # A request object representing the call parameters. Required. To specify no
1818
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1819
+ # @param options [::Gapic::CallOptions, ::Hash]
1820
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1821
+ #
1822
+ # @overload create_version(parent: nil, version: nil, id: nil, schema_type: nil, schema: nil, references: nil, normalize: nil)
1823
+ # Pass arguments to `create_version` via keyword arguments. Note that at
1824
+ # least one keyword argument is required. To specify no parameters, or to keep all
1825
+ # the default parameter values, pass an empty Hash as a request object (see above).
1826
+ #
1827
+ # @param parent [::String]
1828
+ # Required. The subject to create the version for. Structured like:
1829
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}`
1830
+ # or
1831
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}`
1832
+ # @param version [::Integer]
1833
+ # Optional. The version to create. It is optional. If not specified, the
1834
+ # version will be created with the max version ID of the subject increased
1835
+ # by 1. If the version ID is specified, it will be used as the new version ID
1836
+ # and must not be used by an existing version of the subject.
1837
+ # @param id [::Integer]
1838
+ # Optional. The schema ID of the schema. If not specified, the schema ID will
1839
+ # be generated by the server. If the schema ID is specified, it must not be
1840
+ # used by an existing schema that is different from the schema to be created.
1841
+ # @param schema_type [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType]
1842
+ # Optional. The type of the schema. It is optional. If not specified, the
1843
+ # schema type will be AVRO.
1844
+ # @param schema [::String]
1845
+ # Required. The schema payload
1846
+ # @param references [::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>]
1847
+ # Optional. The schema references used by the schema.
1848
+ # @param normalize [::Boolean]
1849
+ # Optional. If true, the schema will be normalized before being stored. The
1850
+ # default is false.
1851
+ #
1852
+ # @yield [response, operation] Access the result along with the RPC operation
1853
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse]
1854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1855
+ #
1856
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse]
1857
+ #
1858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1859
+ #
1860
+ # @example Basic example
1861
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1862
+ #
1863
+ # # Create a client object. The client can be reused for multiple calls.
1864
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1865
+ #
1866
+ # # Create a request. To set request fields, pass in keyword arguments.
1867
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest.new
1868
+ #
1869
+ # # Call the create_version method.
1870
+ # result = client.create_version request
1871
+ #
1872
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionResponse.
1873
+ # p result
1874
+ #
1875
+ def create_version request, options = nil
1876
+ raise ::ArgumentError, "request must be provided" if request.nil?
1877
+
1878
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CreateVersionRequest
1879
+
1880
+ # Converts hash and nil to an options object
1881
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1882
+
1883
+ # Customize the options with defaults
1884
+ metadata = @config.rpcs.create_version.metadata.to_h
1885
+
1886
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1887
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1888
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1889
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1890
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1891
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1892
+
1893
+ header_params = {}
1894
+ if request.parent
1895
+ header_params["parent"] = request.parent
1896
+ end
1897
+
1898
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1899
+ metadata[:"x-goog-request-params"] ||= request_params_header
1900
+
1901
+ options.apply_defaults timeout: @config.rpcs.create_version.timeout,
1902
+ metadata: metadata,
1903
+ retry_policy: @config.rpcs.create_version.retry_policy
1904
+
1905
+ options.apply_defaults timeout: @config.timeout,
1906
+ metadata: @config.metadata,
1907
+ retry_policy: @config.retry_policy
1908
+
1909
+ @managed_schema_registry_stub.call_rpc :create_version, request, options: options do |response, operation|
1910
+ yield response, operation if block_given?
1911
+ end
1912
+ rescue ::GRPC::BadStatus => e
1913
+ raise ::Google::Cloud::Error.from_error(e)
1914
+ end
1915
+
1916
+ ##
1917
+ # Delete a version of a subject.
1918
+ # The response will be the deleted version id.
1919
+ #
1920
+ # @overload delete_version(request, options = nil)
1921
+ # Pass arguments to `delete_version` via a request object, either of type
1922
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest} or an equivalent Hash.
1923
+ #
1924
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest, ::Hash]
1925
+ # A request object representing the call parameters. Required. To specify no
1926
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1927
+ # @param options [::Gapic::CallOptions, ::Hash]
1928
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1929
+ #
1930
+ # @overload delete_version(name: nil, permanent: nil)
1931
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
1932
+ # least one keyword argument is required. To specify no parameters, or to keep all
1933
+ # the default parameter values, pass an empty Hash as a request object (see above).
1934
+ #
1935
+ # @param name [::String]
1936
+ # Required. The name of the subject version to delete. Structured like:
1937
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
1938
+ # or
1939
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
1940
+ # @param permanent [::Boolean]
1941
+ # Optional. If true, both the version and the referenced schema ID will be
1942
+ # permanently deleted. The default is false. If false, the version will be
1943
+ # deleted but the schema ID will be retained. Soft-deleted versions can still
1944
+ # be searched in ListVersions API call with deleted=true query parameter. A
1945
+ # soft-delete of a version must be performed before a hard-delete.
1946
+ #
1947
+ # @yield [response, operation] Access the result along with the RPC operation
1948
+ # @yieldparam response [::Google::Api::HttpBody]
1949
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1950
+ #
1951
+ # @return [::Google::Api::HttpBody]
1952
+ #
1953
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1954
+ #
1955
+ # @example Basic example
1956
+ # require "google/cloud/managed_kafka/schema_registry/v1"
1957
+ #
1958
+ # # Create a client object. The client can be reused for multiple calls.
1959
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
1960
+ #
1961
+ # # Create a request. To set request fields, pass in keyword arguments.
1962
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest.new
1963
+ #
1964
+ # # Call the delete_version method.
1965
+ # result = client.delete_version request
1966
+ #
1967
+ # # The returned object is of type Google::Api::HttpBody.
1968
+ # p result
1969
+ #
1970
+ def delete_version request, options = nil
1971
+ raise ::ArgumentError, "request must be provided" if request.nil?
1972
+
1973
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteVersionRequest
1974
+
1975
+ # Converts hash and nil to an options object
1976
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1977
+
1978
+ # Customize the options with defaults
1979
+ metadata = @config.rpcs.delete_version.metadata.to_h
1980
+
1981
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1982
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1983
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1984
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
1985
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1986
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1987
+
1988
+ header_params = {}
1989
+ if request.name
1990
+ header_params["name"] = request.name
1991
+ end
1992
+
1993
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1994
+ metadata[:"x-goog-request-params"] ||= request_params_header
1995
+
1996
+ options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
1997
+ metadata: metadata,
1998
+ retry_policy: @config.rpcs.delete_version.retry_policy
1999
+
2000
+ options.apply_defaults timeout: @config.timeout,
2001
+ metadata: @config.metadata,
2002
+ retry_policy: @config.retry_policy
2003
+
2004
+ @managed_schema_registry_stub.call_rpc :delete_version, request, options: options do |response, operation|
2005
+ yield response, operation if block_given?
2006
+ end
2007
+ rescue ::GRPC::BadStatus => e
2008
+ raise ::Google::Cloud::Error.from_error(e)
2009
+ end
2010
+
2011
+ ##
2012
+ # Get a list of IDs of schemas that reference the schema with the given
2013
+ # subject and version.
2014
+ #
2015
+ # @overload list_referenced_schemas(request, options = nil)
2016
+ # Pass arguments to `list_referenced_schemas` via a request object, either of type
2017
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest} or an equivalent Hash.
2018
+ #
2019
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest, ::Hash]
2020
+ # A request object representing the call parameters. Required. To specify no
2021
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2022
+ # @param options [::Gapic::CallOptions, ::Hash]
2023
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2024
+ #
2025
+ # @overload list_referenced_schemas(parent: nil)
2026
+ # Pass arguments to `list_referenced_schemas` via keyword arguments. Note that at
2027
+ # least one keyword argument is required. To specify no parameters, or to keep all
2028
+ # the default parameter values, pass an empty Hash as a request object (see above).
2029
+ #
2030
+ # @param parent [::String]
2031
+ # Required. The version to list referenced by. Structured like:
2032
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}`
2033
+ # or
2034
+ # `projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}`
2035
+ #
2036
+ # @yield [response, operation] Access the result along with the RPC operation
2037
+ # @yieldparam response [::Google::Api::HttpBody]
2038
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2039
+ #
2040
+ # @return [::Google::Api::HttpBody]
2041
+ #
2042
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2043
+ #
2044
+ # @example Basic example
2045
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2046
+ #
2047
+ # # Create a client object. The client can be reused for multiple calls.
2048
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2049
+ #
2050
+ # # Create a request. To set request fields, pass in keyword arguments.
2051
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest.new
2052
+ #
2053
+ # # Call the list_referenced_schemas method.
2054
+ # result = client.list_referenced_schemas request
2055
+ #
2056
+ # # The returned object is of type Google::Api::HttpBody.
2057
+ # p result
2058
+ #
2059
+ def list_referenced_schemas request, options = nil
2060
+ raise ::ArgumentError, "request must be provided" if request.nil?
2061
+
2062
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ListReferencedSchemasRequest
2063
+
2064
+ # Converts hash and nil to an options object
2065
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2066
+
2067
+ # Customize the options with defaults
2068
+ metadata = @config.rpcs.list_referenced_schemas.metadata.to_h
2069
+
2070
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2071
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2072
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2073
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2074
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2075
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2076
+
2077
+ header_params = {}
2078
+ if request.parent
2079
+ header_params["parent"] = request.parent
2080
+ end
2081
+
2082
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2083
+ metadata[:"x-goog-request-params"] ||= request_params_header
2084
+
2085
+ options.apply_defaults timeout: @config.rpcs.list_referenced_schemas.timeout,
2086
+ metadata: metadata,
2087
+ retry_policy: @config.rpcs.list_referenced_schemas.retry_policy
2088
+
2089
+ options.apply_defaults timeout: @config.timeout,
2090
+ metadata: @config.metadata,
2091
+ retry_policy: @config.retry_policy
2092
+
2093
+ @managed_schema_registry_stub.call_rpc :list_referenced_schemas, request, options: options do |response, operation|
2094
+ yield response, operation if block_given?
2095
+ end
2096
+ rescue ::GRPC::BadStatus => e
2097
+ raise ::Google::Cloud::Error.from_error(e)
2098
+ end
2099
+
2100
+ ##
2101
+ # Check compatibility of a schema with all versions or a specific version of
2102
+ # a subject.
2103
+ #
2104
+ # @overload check_compatibility(request, options = nil)
2105
+ # Pass arguments to `check_compatibility` via a request object, either of type
2106
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest} or an equivalent Hash.
2107
+ #
2108
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest, ::Hash]
2109
+ # A request object representing the call parameters. Required. To specify no
2110
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2111
+ # @param options [::Gapic::CallOptions, ::Hash]
2112
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2113
+ #
2114
+ # @overload check_compatibility(name: nil, schema_type: nil, schema: nil, references: nil, verbose: nil)
2115
+ # Pass arguments to `check_compatibility` via keyword arguments. Note that at
2116
+ # least one keyword argument is required. To specify no parameters, or to keep all
2117
+ # the default parameter values, pass an empty Hash as a request object (see above).
2118
+ #
2119
+ # @param name [::String]
2120
+ # Required. The name of the resource to check compatibility for. The format
2121
+ # is either of following:
2122
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/compatibility/subjects/*/versions: Check compatibility with one or
2123
+ # more versions of the specified subject.
2124
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/compatibility/subjects/\\{subject}/versions/\\{version}: Check
2125
+ # compatibility with a specific version of the subject.
2126
+ # @param schema_type [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaType]
2127
+ # Optional. The schema type of the schema.
2128
+ # @param schema [::String]
2129
+ # Required. The schema payload
2130
+ # @param references [::Array<::Google::Cloud::ManagedKafka::SchemaRegistry::V1::Schema::SchemaReference, ::Hash>]
2131
+ # Optional. The schema references used by the schema.
2132
+ # @param verbose [::Boolean]
2133
+ # Optional. If true, the response will contain the compatibility check result
2134
+ # with reasons for failed checks. The default is false.
2135
+ #
2136
+ # @yield [response, operation] Access the result along with the RPC operation
2137
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse]
2138
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2139
+ #
2140
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse]
2141
+ #
2142
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2143
+ #
2144
+ # @example Basic example
2145
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2146
+ #
2147
+ # # Create a client object. The client can be reused for multiple calls.
2148
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2149
+ #
2150
+ # # Create a request. To set request fields, pass in keyword arguments.
2151
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest.new
2152
+ #
2153
+ # # Call the check_compatibility method.
2154
+ # result = client.check_compatibility request
2155
+ #
2156
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityResponse.
2157
+ # p result
2158
+ #
2159
+ def check_compatibility request, options = nil
2160
+ raise ::ArgumentError, "request must be provided" if request.nil?
2161
+
2162
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::CheckCompatibilityRequest
2163
+
2164
+ # Converts hash and nil to an options object
2165
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2166
+
2167
+ # Customize the options with defaults
2168
+ metadata = @config.rpcs.check_compatibility.metadata.to_h
2169
+
2170
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2171
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2172
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2173
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2174
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2175
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2176
+
2177
+ header_params = {}
2178
+ if request.name
2179
+ header_params["name"] = request.name
2180
+ end
2181
+
2182
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2183
+ metadata[:"x-goog-request-params"] ||= request_params_header
2184
+
2185
+ options.apply_defaults timeout: @config.rpcs.check_compatibility.timeout,
2186
+ metadata: metadata,
2187
+ retry_policy: @config.rpcs.check_compatibility.retry_policy
2188
+
2189
+ options.apply_defaults timeout: @config.timeout,
2190
+ metadata: @config.metadata,
2191
+ retry_policy: @config.retry_policy
2192
+
2193
+ @managed_schema_registry_stub.call_rpc :check_compatibility, request, options: options do |response, operation|
2194
+ yield response, operation if block_given?
2195
+ end
2196
+ rescue ::GRPC::BadStatus => e
2197
+ raise ::Google::Cloud::Error.from_error(e)
2198
+ end
2199
+
2200
+ ##
2201
+ # Get schema config at global level or for a subject.
2202
+ #
2203
+ # @overload get_schema_config(request, options = nil)
2204
+ # Pass arguments to `get_schema_config` via a request object, either of type
2205
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest} or an equivalent Hash.
2206
+ #
2207
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest, ::Hash]
2208
+ # A request object representing the call parameters. Required. To specify no
2209
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2210
+ # @param options [::Gapic::CallOptions, ::Hash]
2211
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2212
+ #
2213
+ # @overload get_schema_config(name: nil, default_to_global: nil)
2214
+ # Pass arguments to `get_schema_config` via keyword arguments. Note that at
2215
+ # least one keyword argument is required. To specify no parameters, or to keep all
2216
+ # the default parameter values, pass an empty Hash as a request object (see above).
2217
+ #
2218
+ # @param name [::String]
2219
+ # Required. The resource name to get the config for. It can be either of
2220
+ # following:
2221
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/config: Get config at global level.
2222
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/config/\\{subject}: Get config for a specific subject.
2223
+ # @param default_to_global [::Boolean]
2224
+ # Optional. If true, the config will fall back to the config at the global
2225
+ # level if no subject level config is found.
2226
+ #
2227
+ # @yield [response, operation] Access the result along with the RPC operation
2228
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2229
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2230
+ #
2231
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2232
+ #
2233
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2234
+ #
2235
+ # @example Basic example
2236
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2237
+ #
2238
+ # # Create a client object. The client can be reused for multiple calls.
2239
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2240
+ #
2241
+ # # Create a request. To set request fields, pass in keyword arguments.
2242
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest.new
2243
+ #
2244
+ # # Call the get_schema_config method.
2245
+ # result = client.get_schema_config request
2246
+ #
2247
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
2248
+ # p result
2249
+ #
2250
+ def get_schema_config request, options = nil
2251
+ raise ::ArgumentError, "request must be provided" if request.nil?
2252
+
2253
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaConfigRequest
2254
+
2255
+ # Converts hash and nil to an options object
2256
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2257
+
2258
+ # Customize the options with defaults
2259
+ metadata = @config.rpcs.get_schema_config.metadata.to_h
2260
+
2261
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2262
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2263
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2264
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2265
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2266
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2267
+
2268
+ header_params = {}
2269
+ if request.name
2270
+ header_params["name"] = request.name
2271
+ end
2272
+
2273
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2274
+ metadata[:"x-goog-request-params"] ||= request_params_header
2275
+
2276
+ options.apply_defaults timeout: @config.rpcs.get_schema_config.timeout,
2277
+ metadata: metadata,
2278
+ retry_policy: @config.rpcs.get_schema_config.retry_policy
2279
+
2280
+ options.apply_defaults timeout: @config.timeout,
2281
+ metadata: @config.metadata,
2282
+ retry_policy: @config.retry_policy
2283
+
2284
+ @managed_schema_registry_stub.call_rpc :get_schema_config, request, options: options do |response, operation|
2285
+ yield response, operation if block_given?
2286
+ end
2287
+ rescue ::GRPC::BadStatus => e
2288
+ raise ::Google::Cloud::Error.from_error(e)
2289
+ end
2290
+
2291
+ ##
2292
+ # Update config at global level or for a subject.
2293
+ # Creates a SchemaSubject-level SchemaConfig if it does not exist.
2294
+ #
2295
+ # @overload update_schema_config(request, options = nil)
2296
+ # Pass arguments to `update_schema_config` via a request object, either of type
2297
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest} or an equivalent Hash.
2298
+ #
2299
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest, ::Hash]
2300
+ # A request object representing the call parameters. Required. To specify no
2301
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2302
+ # @param options [::Gapic::CallOptions, ::Hash]
2303
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2304
+ #
2305
+ # @overload update_schema_config(name: nil, compatibility: nil, normalize: nil)
2306
+ # Pass arguments to `update_schema_config` via keyword arguments. Note that at
2307
+ # least one keyword argument is required. To specify no parameters, or to keep all
2308
+ # the default parameter values, pass an empty Hash as a request object (see above).
2309
+ #
2310
+ # @param name [::String]
2311
+ # Required. The resource name to update the config for. It can be either of
2312
+ # following:
2313
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/config: Update config at global level.
2314
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/config/\\{subject}: Update config for a specific subject.
2315
+ # @param compatibility [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig::CompatibilityType]
2316
+ # Required. The compatibility type of the schemas.
2317
+ # Cannot be unset for a SchemaRegistry-level SchemaConfig.
2318
+ # If unset on a SchemaSubject-level SchemaConfig, removes the compatibility
2319
+ # field for the SchemaConfig.
2320
+ # @param normalize [::Boolean]
2321
+ # Optional. If true, the schema will be normalized before being stored or
2322
+ # looked up. The default is false. Cannot be unset for a SchemaRegistry-level
2323
+ # SchemaConfig. If unset on a SchemaSubject-level SchemaConfig, removes the
2324
+ # normalize field for the SchemaConfig.
2325
+ #
2326
+ # @yield [response, operation] Access the result along with the RPC operation
2327
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2328
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2329
+ #
2330
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2331
+ #
2332
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2333
+ #
2334
+ # @example Basic example
2335
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2336
+ #
2337
+ # # Create a client object. The client can be reused for multiple calls.
2338
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2339
+ #
2340
+ # # Create a request. To set request fields, pass in keyword arguments.
2341
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest.new
2342
+ #
2343
+ # # Call the update_schema_config method.
2344
+ # result = client.update_schema_config request
2345
+ #
2346
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
2347
+ # p result
2348
+ #
2349
+ def update_schema_config request, options = nil
2350
+ raise ::ArgumentError, "request must be provided" if request.nil?
2351
+
2352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaConfigRequest
2353
+
2354
+ # Converts hash and nil to an options object
2355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2356
+
2357
+ # Customize the options with defaults
2358
+ metadata = @config.rpcs.update_schema_config.metadata.to_h
2359
+
2360
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2361
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2363
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2364
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2365
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2366
+
2367
+ header_params = {}
2368
+ if request.name
2369
+ header_params["name"] = request.name
2370
+ end
2371
+
2372
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2373
+ metadata[:"x-goog-request-params"] ||= request_params_header
2374
+
2375
+ options.apply_defaults timeout: @config.rpcs.update_schema_config.timeout,
2376
+ metadata: metadata,
2377
+ retry_policy: @config.rpcs.update_schema_config.retry_policy
2378
+
2379
+ options.apply_defaults timeout: @config.timeout,
2380
+ metadata: @config.metadata,
2381
+ retry_policy: @config.retry_policy
2382
+
2383
+ @managed_schema_registry_stub.call_rpc :update_schema_config, request, options: options do |response, operation|
2384
+ yield response, operation if block_given?
2385
+ end
2386
+ rescue ::GRPC::BadStatus => e
2387
+ raise ::Google::Cloud::Error.from_error(e)
2388
+ end
2389
+
2390
+ ##
2391
+ # Delete schema config for a subject.
2392
+ #
2393
+ # @overload delete_schema_config(request, options = nil)
2394
+ # Pass arguments to `delete_schema_config` via a request object, either of type
2395
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest} or an equivalent Hash.
2396
+ #
2397
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest, ::Hash]
2398
+ # A request object representing the call parameters. Required. To specify no
2399
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2400
+ # @param options [::Gapic::CallOptions, ::Hash]
2401
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2402
+ #
2403
+ # @overload delete_schema_config(name: nil)
2404
+ # Pass arguments to `delete_schema_config` via keyword arguments. Note that at
2405
+ # least one keyword argument is required. To specify no parameters, or to keep all
2406
+ # the default parameter values, pass an empty Hash as a request object (see above).
2407
+ #
2408
+ # @param name [::String]
2409
+ # Required. The resource name of subject to delete the config for. The format
2410
+ # is
2411
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/config/\\{subject}
2412
+ #
2413
+ # @yield [response, operation] Access the result along with the RPC operation
2414
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2415
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2416
+ #
2417
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig]
2418
+ #
2419
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2420
+ #
2421
+ # @example Basic example
2422
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2423
+ #
2424
+ # # Create a client object. The client can be reused for multiple calls.
2425
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2426
+ #
2427
+ # # Create a request. To set request fields, pass in keyword arguments.
2428
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest.new
2429
+ #
2430
+ # # Call the delete_schema_config method.
2431
+ # result = client.delete_schema_config request
2432
+ #
2433
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaConfig.
2434
+ # p result
2435
+ #
2436
+ def delete_schema_config request, options = nil
2437
+ raise ::ArgumentError, "request must be provided" if request.nil?
2438
+
2439
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaConfigRequest
2440
+
2441
+ # Converts hash and nil to an options object
2442
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2443
+
2444
+ # Customize the options with defaults
2445
+ metadata = @config.rpcs.delete_schema_config.metadata.to_h
2446
+
2447
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2448
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2449
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2450
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2451
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2452
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2453
+
2454
+ header_params = {}
2455
+ if request.name
2456
+ header_params["name"] = request.name
2457
+ end
2458
+
2459
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2460
+ metadata[:"x-goog-request-params"] ||= request_params_header
2461
+
2462
+ options.apply_defaults timeout: @config.rpcs.delete_schema_config.timeout,
2463
+ metadata: metadata,
2464
+ retry_policy: @config.rpcs.delete_schema_config.retry_policy
2465
+
2466
+ options.apply_defaults timeout: @config.timeout,
2467
+ metadata: @config.metadata,
2468
+ retry_policy: @config.retry_policy
2469
+
2470
+ @managed_schema_registry_stub.call_rpc :delete_schema_config, request, options: options do |response, operation|
2471
+ yield response, operation if block_given?
2472
+ end
2473
+ rescue ::GRPC::BadStatus => e
2474
+ raise ::Google::Cloud::Error.from_error(e)
2475
+ end
2476
+
2477
+ ##
2478
+ # Get mode at global level or for a subject.
2479
+ #
2480
+ # @overload get_schema_mode(request, options = nil)
2481
+ # Pass arguments to `get_schema_mode` via a request object, either of type
2482
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest} or an equivalent Hash.
2483
+ #
2484
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest, ::Hash]
2485
+ # A request object representing the call parameters. Required. To specify no
2486
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2487
+ # @param options [::Gapic::CallOptions, ::Hash]
2488
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2489
+ #
2490
+ # @overload get_schema_mode(name: nil)
2491
+ # Pass arguments to `get_schema_mode` via keyword arguments. Note that at
2492
+ # least one keyword argument is required. To specify no parameters, or to keep all
2493
+ # the default parameter values, pass an empty Hash as a request object (see above).
2494
+ #
2495
+ # @param name [::String]
2496
+ # Required. The resource name of the mode. The format is
2497
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/mode/\\{subject}: mode for a schema registry, or
2498
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/contexts/\\{context}/mode/\\{subject}: mode for a specific subject in a specific context
2499
+ #
2500
+ # @yield [response, operation] Access the result along with the RPC operation
2501
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2502
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2503
+ #
2504
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2505
+ #
2506
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2507
+ #
2508
+ # @example Basic example
2509
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2510
+ #
2511
+ # # Create a client object. The client can be reused for multiple calls.
2512
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2513
+ #
2514
+ # # Create a request. To set request fields, pass in keyword arguments.
2515
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest.new
2516
+ #
2517
+ # # Call the get_schema_mode method.
2518
+ # result = client.get_schema_mode request
2519
+ #
2520
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
2521
+ # p result
2522
+ #
2523
+ def get_schema_mode request, options = nil
2524
+ raise ::ArgumentError, "request must be provided" if request.nil?
2525
+
2526
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::GetSchemaModeRequest
2527
+
2528
+ # Converts hash and nil to an options object
2529
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2530
+
2531
+ # Customize the options with defaults
2532
+ metadata = @config.rpcs.get_schema_mode.metadata.to_h
2533
+
2534
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2535
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2536
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2537
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2538
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2539
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2540
+
2541
+ header_params = {}
2542
+ if request.name
2543
+ header_params["name"] = request.name
2544
+ end
2545
+
2546
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2547
+ metadata[:"x-goog-request-params"] ||= request_params_header
2548
+
2549
+ options.apply_defaults timeout: @config.rpcs.get_schema_mode.timeout,
2550
+ metadata: metadata,
2551
+ retry_policy: @config.rpcs.get_schema_mode.retry_policy
2552
+
2553
+ options.apply_defaults timeout: @config.timeout,
2554
+ metadata: @config.metadata,
2555
+ retry_policy: @config.retry_policy
2556
+
2557
+ @managed_schema_registry_stub.call_rpc :get_schema_mode, request, options: options do |response, operation|
2558
+ yield response, operation if block_given?
2559
+ end
2560
+ rescue ::GRPC::BadStatus => e
2561
+ raise ::Google::Cloud::Error.from_error(e)
2562
+ end
2563
+
2564
+ ##
2565
+ # Update mode at global level or for a subject.
2566
+ #
2567
+ # @overload update_schema_mode(request, options = nil)
2568
+ # Pass arguments to `update_schema_mode` via a request object, either of type
2569
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest} or an equivalent Hash.
2570
+ #
2571
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest, ::Hash]
2572
+ # A request object representing the call parameters. Required. To specify no
2573
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2574
+ # @param options [::Gapic::CallOptions, ::Hash]
2575
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2576
+ #
2577
+ # @overload update_schema_mode(name: nil, mode: nil)
2578
+ # Pass arguments to `update_schema_mode` via keyword arguments. Note that at
2579
+ # least one keyword argument is required. To specify no parameters, or to keep all
2580
+ # the default parameter values, pass an empty Hash as a request object (see above).
2581
+ #
2582
+ # @param name [::String]
2583
+ # Required. The resource name of the mode. The format is
2584
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/mode/\\{subject}: mode for a schema registry, or
2585
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/contexts/\\{context}/mode/\\{subject}: mode for a specific subject in a specific context
2586
+ # @param mode [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode::ModeType]
2587
+ # Required. The mode type.
2588
+ #
2589
+ # @yield [response, operation] Access the result along with the RPC operation
2590
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2591
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2592
+ #
2593
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2594
+ #
2595
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2596
+ #
2597
+ # @example Basic example
2598
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2599
+ #
2600
+ # # Create a client object. The client can be reused for multiple calls.
2601
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2602
+ #
2603
+ # # Create a request. To set request fields, pass in keyword arguments.
2604
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest.new
2605
+ #
2606
+ # # Call the update_schema_mode method.
2607
+ # result = client.update_schema_mode request
2608
+ #
2609
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
2610
+ # p result
2611
+ #
2612
+ def update_schema_mode request, options = nil
2613
+ raise ::ArgumentError, "request must be provided" if request.nil?
2614
+
2615
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::UpdateSchemaModeRequest
2616
+
2617
+ # Converts hash and nil to an options object
2618
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2619
+
2620
+ # Customize the options with defaults
2621
+ metadata = @config.rpcs.update_schema_mode.metadata.to_h
2622
+
2623
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2624
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2625
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2626
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2627
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2628
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2629
+
2630
+ header_params = {}
2631
+ if request.name
2632
+ header_params["name"] = request.name
2633
+ end
2634
+
2635
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2636
+ metadata[:"x-goog-request-params"] ||= request_params_header
2637
+
2638
+ options.apply_defaults timeout: @config.rpcs.update_schema_mode.timeout,
2639
+ metadata: metadata,
2640
+ retry_policy: @config.rpcs.update_schema_mode.retry_policy
2641
+
2642
+ options.apply_defaults timeout: @config.timeout,
2643
+ metadata: @config.metadata,
2644
+ retry_policy: @config.retry_policy
2645
+
2646
+ @managed_schema_registry_stub.call_rpc :update_schema_mode, request, options: options do |response, operation|
2647
+ yield response, operation if block_given?
2648
+ end
2649
+ rescue ::GRPC::BadStatus => e
2650
+ raise ::Google::Cloud::Error.from_error(e)
2651
+ end
2652
+
2653
+ ##
2654
+ # Delete schema mode for a subject.
2655
+ #
2656
+ # @overload delete_schema_mode(request, options = nil)
2657
+ # Pass arguments to `delete_schema_mode` via a request object, either of type
2658
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest} or an equivalent Hash.
2659
+ #
2660
+ # @param request [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest, ::Hash]
2661
+ # A request object representing the call parameters. Required. To specify no
2662
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2663
+ # @param options [::Gapic::CallOptions, ::Hash]
2664
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2665
+ #
2666
+ # @overload delete_schema_mode(name: nil)
2667
+ # Pass arguments to `delete_schema_mode` via keyword arguments. Note that at
2668
+ # least one keyword argument is required. To specify no parameters, or to keep all
2669
+ # the default parameter values, pass an empty Hash as a request object (see above).
2670
+ #
2671
+ # @param name [::String]
2672
+ # Required. The resource name of subject to delete the mode for. The format
2673
+ # is
2674
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/mode/\\{subject}
2675
+ # * projects/\\{project}/locations/\\{location}/schemaRegistries/\\{schema_registry}/contexts/\\{context}/mode/\\{subject}
2676
+ #
2677
+ # @yield [response, operation] Access the result along with the RPC operation
2678
+ # @yieldparam response [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2679
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2680
+ #
2681
+ # @return [::Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode]
2682
+ #
2683
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2684
+ #
2685
+ # @example Basic example
2686
+ # require "google/cloud/managed_kafka/schema_registry/v1"
2687
+ #
2688
+ # # Create a client object. The client can be reused for multiple calls.
2689
+ # client = Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new
2690
+ #
2691
+ # # Create a request. To set request fields, pass in keyword arguments.
2692
+ # request = Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest.new
2693
+ #
2694
+ # # Call the delete_schema_mode method.
2695
+ # result = client.delete_schema_mode request
2696
+ #
2697
+ # # The returned object is of type Google::Cloud::ManagedKafka::SchemaRegistry::V1::SchemaMode.
2698
+ # p result
2699
+ #
2700
+ def delete_schema_mode request, options = nil
2701
+ raise ::ArgumentError, "request must be provided" if request.nil?
2702
+
2703
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::DeleteSchemaModeRequest
2704
+
2705
+ # Converts hash and nil to an options object
2706
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2707
+
2708
+ # Customize the options with defaults
2709
+ metadata = @config.rpcs.delete_schema_mode.metadata.to_h
2710
+
2711
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2712
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2713
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2714
+ gapic_version: ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::VERSION
2715
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2716
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2717
+
2718
+ header_params = {}
2719
+ if request.name
2720
+ header_params["name"] = request.name
2721
+ end
2722
+
2723
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2724
+ metadata[:"x-goog-request-params"] ||= request_params_header
2725
+
2726
+ options.apply_defaults timeout: @config.rpcs.delete_schema_mode.timeout,
2727
+ metadata: metadata,
2728
+ retry_policy: @config.rpcs.delete_schema_mode.retry_policy
2729
+
2730
+ options.apply_defaults timeout: @config.timeout,
2731
+ metadata: @config.metadata,
2732
+ retry_policy: @config.retry_policy
2733
+
2734
+ @managed_schema_registry_stub.call_rpc :delete_schema_mode, request, options: options do |response, operation|
2735
+ yield response, operation if block_given?
2736
+ end
2737
+ rescue ::GRPC::BadStatus => e
2738
+ raise ::Google::Cloud::Error.from_error(e)
2739
+ end
2740
+
2741
+ ##
2742
+ # Configuration class for the ManagedSchemaRegistry API.
2743
+ #
2744
+ # This class represents the configuration for ManagedSchemaRegistry,
2745
+ # providing control over timeouts, retry behavior, logging, transport
2746
+ # parameters, and other low-level controls. Certain parameters can also be
2747
+ # applied individually to specific RPCs. See
2748
+ # {::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client::Configuration::Rpcs}
2749
+ # for a list of RPCs that can be configured independently.
2750
+ #
2751
+ # Configuration can be applied globally to all clients, or to a single client
2752
+ # on construction.
2753
+ #
2754
+ # @example
2755
+ #
2756
+ # # Modify the global config, setting the timeout for
2757
+ # # get_schema_registry to 20 seconds,
2758
+ # # and all remaining timeouts to 10 seconds.
2759
+ # ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.configure do |config|
2760
+ # config.timeout = 10.0
2761
+ # config.rpcs.get_schema_registry.timeout = 20.0
2762
+ # end
2763
+ #
2764
+ # # Apply the above configuration only to a new client.
2765
+ # client = ::Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Client.new do |config|
2766
+ # config.timeout = 10.0
2767
+ # config.rpcs.get_schema_registry.timeout = 20.0
2768
+ # end
2769
+ #
2770
+ # @!attribute [rw] endpoint
2771
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2772
+ # nil, indicating to use the default endpoint in the current universe domain.
2773
+ # @return [::String,nil]
2774
+ # @!attribute [rw] credentials
2775
+ # Credentials to send with calls. You may provide any of the following types:
2776
+ # * (`String`) The path to a service account key file in JSON format
2777
+ # * (`Hash`) A service account key as a Hash
2778
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2779
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2780
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2781
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2782
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2783
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2784
+ # * (`nil`) indicating no credentials
2785
+ #
2786
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2787
+ # external source for authentication to Google Cloud, you must validate it before
2788
+ # providing it to a Google API client library. Providing an unvalidated credential
2789
+ # configuration to Google APIs can compromise the security of your systems and data.
2790
+ # For more information, refer to [Validate credential configurations from external
2791
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2792
+ # @return [::Object]
2793
+ # @!attribute [rw] scope
2794
+ # The OAuth scopes
2795
+ # @return [::Array<::String>]
2796
+ # @!attribute [rw] lib_name
2797
+ # The library name as recorded in instrumentation and logging
2798
+ # @return [::String]
2799
+ # @!attribute [rw] lib_version
2800
+ # The library version as recorded in instrumentation and logging
2801
+ # @return [::String]
2802
+ # @!attribute [rw] channel_args
2803
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2804
+ # `GRPC::Core::Channel` object is provided as the credential.
2805
+ # @return [::Hash]
2806
+ # @!attribute [rw] interceptors
2807
+ # An array of interceptors that are run before calls are executed.
2808
+ # @return [::Array<::GRPC::ClientInterceptor>]
2809
+ # @!attribute [rw] timeout
2810
+ # The call timeout in seconds.
2811
+ # @return [::Numeric]
2812
+ # @!attribute [rw] metadata
2813
+ # Additional gRPC headers to be sent with the call.
2814
+ # @return [::Hash{::Symbol=>::String}]
2815
+ # @!attribute [rw] retry_policy
2816
+ # The retry policy. The value is a hash with the following keys:
2817
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2818
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2819
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2820
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2821
+ # trigger a retry.
2822
+ # @return [::Hash]
2823
+ # @!attribute [rw] quota_project
2824
+ # A separate project against which to charge quota.
2825
+ # @return [::String]
2826
+ # @!attribute [rw] universe_domain
2827
+ # The universe domain within which to make requests. This determines the
2828
+ # default endpoint URL. The default value of nil uses the environment
2829
+ # universe (usually the default "googleapis.com" universe).
2830
+ # @return [::String,nil]
2831
+ # @!attribute [rw] logger
2832
+ # A custom logger to use for request/response debug logging, or the value
2833
+ # `:default` (the default) to construct a default logger, or `nil` to
2834
+ # explicitly disable logging.
2835
+ # @return [::Logger,:default,nil]
2836
+ #
2837
+ class Configuration
2838
+ extend ::Gapic::Config
2839
+
2840
+ # @private
2841
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2842
+ DEFAULT_ENDPOINT = "managedkafka.googleapis.com"
2843
+
2844
+ config_attr :endpoint, nil, ::String, nil
2845
+ config_attr :credentials, nil do |value|
2846
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
2847
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
2848
+ allowed.any? { |klass| klass === value }
2849
+ end
2850
+ config_attr :scope, nil, ::String, ::Array, nil
2851
+ config_attr :lib_name, nil, ::String, nil
2852
+ config_attr :lib_version, nil, ::String, nil
2853
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2854
+ config_attr :interceptors, nil, ::Array, nil
2855
+ config_attr :timeout, nil, ::Numeric, nil
2856
+ config_attr :metadata, nil, ::Hash, nil
2857
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2858
+ config_attr :quota_project, nil, ::String, nil
2859
+ config_attr :universe_domain, nil, ::String, nil
2860
+ config_attr :logger, :default, ::Logger, nil, :default
2861
+
2862
+ # @private
2863
+ def initialize parent_config = nil
2864
+ @parent_config = parent_config unless parent_config.nil?
2865
+
2866
+ yield self if block_given?
2867
+ end
2868
+
2869
+ ##
2870
+ # Configurations for individual RPCs
2871
+ # @return [Rpcs]
2872
+ #
2873
+ def rpcs
2874
+ @rpcs ||= begin
2875
+ parent_rpcs = nil
2876
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2877
+ Rpcs.new parent_rpcs
2878
+ end
2879
+ end
2880
+
2881
+ ##
2882
+ # Configuration for the channel pool
2883
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2884
+ #
2885
+ def channel_pool
2886
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2887
+ end
2888
+
2889
+ ##
2890
+ # Configuration RPC class for the ManagedSchemaRegistry API.
2891
+ #
2892
+ # Includes fields providing the configuration for each RPC in this service.
2893
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2894
+ # the following configuration fields:
2895
+ #
2896
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2897
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2898
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2899
+ # include the following keys:
2900
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2901
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2902
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2903
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2904
+ # trigger a retry.
2905
+ #
2906
+ class Rpcs
2907
+ ##
2908
+ # RPC-specific configuration for `get_schema_registry`
2909
+ # @return [::Gapic::Config::Method]
2910
+ #
2911
+ attr_reader :get_schema_registry
2912
+ ##
2913
+ # RPC-specific configuration for `list_schema_registries`
2914
+ # @return [::Gapic::Config::Method]
2915
+ #
2916
+ attr_reader :list_schema_registries
2917
+ ##
2918
+ # RPC-specific configuration for `create_schema_registry`
2919
+ # @return [::Gapic::Config::Method]
2920
+ #
2921
+ attr_reader :create_schema_registry
2922
+ ##
2923
+ # RPC-specific configuration for `delete_schema_registry`
2924
+ # @return [::Gapic::Config::Method]
2925
+ #
2926
+ attr_reader :delete_schema_registry
2927
+ ##
2928
+ # RPC-specific configuration for `get_context`
2929
+ # @return [::Gapic::Config::Method]
2930
+ #
2931
+ attr_reader :get_context
2932
+ ##
2933
+ # RPC-specific configuration for `list_contexts`
2934
+ # @return [::Gapic::Config::Method]
2935
+ #
2936
+ attr_reader :list_contexts
2937
+ ##
2938
+ # RPC-specific configuration for `get_schema`
2939
+ # @return [::Gapic::Config::Method]
2940
+ #
2941
+ attr_reader :get_schema
2942
+ ##
2943
+ # RPC-specific configuration for `get_raw_schema`
2944
+ # @return [::Gapic::Config::Method]
2945
+ #
2946
+ attr_reader :get_raw_schema
2947
+ ##
2948
+ # RPC-specific configuration for `list_schema_versions`
2949
+ # @return [::Gapic::Config::Method]
2950
+ #
2951
+ attr_reader :list_schema_versions
2952
+ ##
2953
+ # RPC-specific configuration for `list_schema_types`
2954
+ # @return [::Gapic::Config::Method]
2955
+ #
2956
+ attr_reader :list_schema_types
2957
+ ##
2958
+ # RPC-specific configuration for `list_subjects`
2959
+ # @return [::Gapic::Config::Method]
2960
+ #
2961
+ attr_reader :list_subjects
2962
+ ##
2963
+ # RPC-specific configuration for `list_subjects_by_schema_id`
2964
+ # @return [::Gapic::Config::Method]
2965
+ #
2966
+ attr_reader :list_subjects_by_schema_id
2967
+ ##
2968
+ # RPC-specific configuration for `delete_subject`
2969
+ # @return [::Gapic::Config::Method]
2970
+ #
2971
+ attr_reader :delete_subject
2972
+ ##
2973
+ # RPC-specific configuration for `lookup_version`
2974
+ # @return [::Gapic::Config::Method]
2975
+ #
2976
+ attr_reader :lookup_version
2977
+ ##
2978
+ # RPC-specific configuration for `get_version`
2979
+ # @return [::Gapic::Config::Method]
2980
+ #
2981
+ attr_reader :get_version
2982
+ ##
2983
+ # RPC-specific configuration for `get_raw_schema_version`
2984
+ # @return [::Gapic::Config::Method]
2985
+ #
2986
+ attr_reader :get_raw_schema_version
2987
+ ##
2988
+ # RPC-specific configuration for `list_versions`
2989
+ # @return [::Gapic::Config::Method]
2990
+ #
2991
+ attr_reader :list_versions
2992
+ ##
2993
+ # RPC-specific configuration for `create_version`
2994
+ # @return [::Gapic::Config::Method]
2995
+ #
2996
+ attr_reader :create_version
2997
+ ##
2998
+ # RPC-specific configuration for `delete_version`
2999
+ # @return [::Gapic::Config::Method]
3000
+ #
3001
+ attr_reader :delete_version
3002
+ ##
3003
+ # RPC-specific configuration for `list_referenced_schemas`
3004
+ # @return [::Gapic::Config::Method]
3005
+ #
3006
+ attr_reader :list_referenced_schemas
3007
+ ##
3008
+ # RPC-specific configuration for `check_compatibility`
3009
+ # @return [::Gapic::Config::Method]
3010
+ #
3011
+ attr_reader :check_compatibility
3012
+ ##
3013
+ # RPC-specific configuration for `get_schema_config`
3014
+ # @return [::Gapic::Config::Method]
3015
+ #
3016
+ attr_reader :get_schema_config
3017
+ ##
3018
+ # RPC-specific configuration for `update_schema_config`
3019
+ # @return [::Gapic::Config::Method]
3020
+ #
3021
+ attr_reader :update_schema_config
3022
+ ##
3023
+ # RPC-specific configuration for `delete_schema_config`
3024
+ # @return [::Gapic::Config::Method]
3025
+ #
3026
+ attr_reader :delete_schema_config
3027
+ ##
3028
+ # RPC-specific configuration for `get_schema_mode`
3029
+ # @return [::Gapic::Config::Method]
3030
+ #
3031
+ attr_reader :get_schema_mode
3032
+ ##
3033
+ # RPC-specific configuration for `update_schema_mode`
3034
+ # @return [::Gapic::Config::Method]
3035
+ #
3036
+ attr_reader :update_schema_mode
3037
+ ##
3038
+ # RPC-specific configuration for `delete_schema_mode`
3039
+ # @return [::Gapic::Config::Method]
3040
+ #
3041
+ attr_reader :delete_schema_mode
3042
+
3043
+ # @private
3044
+ def initialize parent_rpcs = nil
3045
+ get_schema_registry_config = parent_rpcs.get_schema_registry if parent_rpcs.respond_to? :get_schema_registry
3046
+ @get_schema_registry = ::Gapic::Config::Method.new get_schema_registry_config
3047
+ list_schema_registries_config = parent_rpcs.list_schema_registries if parent_rpcs.respond_to? :list_schema_registries
3048
+ @list_schema_registries = ::Gapic::Config::Method.new list_schema_registries_config
3049
+ create_schema_registry_config = parent_rpcs.create_schema_registry if parent_rpcs.respond_to? :create_schema_registry
3050
+ @create_schema_registry = ::Gapic::Config::Method.new create_schema_registry_config
3051
+ delete_schema_registry_config = parent_rpcs.delete_schema_registry if parent_rpcs.respond_to? :delete_schema_registry
3052
+ @delete_schema_registry = ::Gapic::Config::Method.new delete_schema_registry_config
3053
+ get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context
3054
+ @get_context = ::Gapic::Config::Method.new get_context_config
3055
+ list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts
3056
+ @list_contexts = ::Gapic::Config::Method.new list_contexts_config
3057
+ get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema
3058
+ @get_schema = ::Gapic::Config::Method.new get_schema_config
3059
+ get_raw_schema_config = parent_rpcs.get_raw_schema if parent_rpcs.respond_to? :get_raw_schema
3060
+ @get_raw_schema = ::Gapic::Config::Method.new get_raw_schema_config
3061
+ list_schema_versions_config = parent_rpcs.list_schema_versions if parent_rpcs.respond_to? :list_schema_versions
3062
+ @list_schema_versions = ::Gapic::Config::Method.new list_schema_versions_config
3063
+ list_schema_types_config = parent_rpcs.list_schema_types if parent_rpcs.respond_to? :list_schema_types
3064
+ @list_schema_types = ::Gapic::Config::Method.new list_schema_types_config
3065
+ list_subjects_config = parent_rpcs.list_subjects if parent_rpcs.respond_to? :list_subjects
3066
+ @list_subjects = ::Gapic::Config::Method.new list_subjects_config
3067
+ list_subjects_by_schema_id_config = parent_rpcs.list_subjects_by_schema_id if parent_rpcs.respond_to? :list_subjects_by_schema_id
3068
+ @list_subjects_by_schema_id = ::Gapic::Config::Method.new list_subjects_by_schema_id_config
3069
+ delete_subject_config = parent_rpcs.delete_subject if parent_rpcs.respond_to? :delete_subject
3070
+ @delete_subject = ::Gapic::Config::Method.new delete_subject_config
3071
+ lookup_version_config = parent_rpcs.lookup_version if parent_rpcs.respond_to? :lookup_version
3072
+ @lookup_version = ::Gapic::Config::Method.new lookup_version_config
3073
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
3074
+ @get_version = ::Gapic::Config::Method.new get_version_config
3075
+ get_raw_schema_version_config = parent_rpcs.get_raw_schema_version if parent_rpcs.respond_to? :get_raw_schema_version
3076
+ @get_raw_schema_version = ::Gapic::Config::Method.new get_raw_schema_version_config
3077
+ list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
3078
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
3079
+ create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version
3080
+ @create_version = ::Gapic::Config::Method.new create_version_config
3081
+ delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
3082
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
3083
+ list_referenced_schemas_config = parent_rpcs.list_referenced_schemas if parent_rpcs.respond_to? :list_referenced_schemas
3084
+ @list_referenced_schemas = ::Gapic::Config::Method.new list_referenced_schemas_config
3085
+ check_compatibility_config = parent_rpcs.check_compatibility if parent_rpcs.respond_to? :check_compatibility
3086
+ @check_compatibility = ::Gapic::Config::Method.new check_compatibility_config
3087
+ get_schema_config_config = parent_rpcs.get_schema_config if parent_rpcs.respond_to? :get_schema_config
3088
+ @get_schema_config = ::Gapic::Config::Method.new get_schema_config_config
3089
+ update_schema_config_config = parent_rpcs.update_schema_config if parent_rpcs.respond_to? :update_schema_config
3090
+ @update_schema_config = ::Gapic::Config::Method.new update_schema_config_config
3091
+ delete_schema_config_config = parent_rpcs.delete_schema_config if parent_rpcs.respond_to? :delete_schema_config
3092
+ @delete_schema_config = ::Gapic::Config::Method.new delete_schema_config_config
3093
+ get_schema_mode_config = parent_rpcs.get_schema_mode if parent_rpcs.respond_to? :get_schema_mode
3094
+ @get_schema_mode = ::Gapic::Config::Method.new get_schema_mode_config
3095
+ update_schema_mode_config = parent_rpcs.update_schema_mode if parent_rpcs.respond_to? :update_schema_mode
3096
+ @update_schema_mode = ::Gapic::Config::Method.new update_schema_mode_config
3097
+ delete_schema_mode_config = parent_rpcs.delete_schema_mode if parent_rpcs.respond_to? :delete_schema_mode
3098
+ @delete_schema_mode = ::Gapic::Config::Method.new delete_schema_mode_config
3099
+
3100
+ yield self if block_given?
3101
+ end
3102
+ end
3103
+ end
3104
+ end
3105
+ end
3106
+ end
3107
+ end
3108
+ end
3109
+ end
3110
+ end