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