Module: Google::Cloud::ManagedKafka::SchemaRegistry::V1::ManagedSchemaRegistry::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb

Overview

Path helper methods for the ManagedSchemaRegistry API.

Instance Method Summary collapse

Instance Method Details

#schema_config_path(project:, location:, schema_registry:) ⇒ ::String #schema_config_path(project:, location:, schema_registry:, subject:) ⇒ ::String #schema_config_path(project:, location:, schema_registry:, context:) ⇒ ::String #schema_config_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

Create a fully-qualified SchemaConfig resource string.

Overloads:

  • #schema_config_path(project:, location:, schema_registry:) ⇒ ::String

    The resource will be in the following format:

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

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
  • #schema_config_path(project:, location:, schema_registry:, subject:) ⇒ ::String

    The resource will be in the following format:

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

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • subject (String)
  • #schema_config_path(project:, location:, schema_registry:, context:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/config

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
  • #schema_config_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/config/{subject}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • subject (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 121

def schema_config_path **args
  resources = {
    "location:project:schema_registry" => (proc do |project:, location:, schema_registry:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/config"
    end),
    "location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/config/#{subject}"
    end),
    "context:location:project:schema_registry" => (proc do |project:, location:, schema_registry:, context:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/config"
    end),
    "context:location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, context:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/config/#{subject}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#schema_context_path(project:, location:, schema_registry:, context:) ⇒ ::String

Create a fully-qualified SchemaContext resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}

Parameters:

  • project (String)
  • location (String)
  • schema_registry (String)
  • context (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


171
172
173
174
175
176
177
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 171

def schema_context_path project:, location:, schema_registry:, context:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

  "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}"
end

#schema_mode_path(project:, location:, schema_registry:) ⇒ ::String #schema_mode_path(project:, location:, schema_registry:, subject:) ⇒ ::String #schema_mode_path(project:, location:, schema_registry:, context:) ⇒ ::String #schema_mode_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

Create a fully-qualified SchemaMode resource string.

Overloads:

  • #schema_mode_path(project:, location:, schema_registry:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
  • #schema_mode_path(project:, location:, schema_registry:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/mode/{subject}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • subject (String)
  • #schema_mode_path(project:, location:, schema_registry:, context:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
  • #schema_mode_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/mode/{subject}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • subject (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 223

def schema_mode_path **args
  resources = {
    "location:project:schema_registry" => (proc do |project:, location:, schema_registry:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/mode"
    end),
    "location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/mode/#{subject}"
    end),
    "context:location:project:schema_registry" => (proc do |project:, location:, schema_registry:, context:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/mode"
    end),
    "context:location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, context:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/mode/#{subject}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#schema_path(project:, location:, schema_registry:, schema:) ⇒ ::String #schema_path(project:, location:, schema_registry:, context:, schema:) ⇒ ::String

Create a fully-qualified Schema resource string.

Overloads:

  • #schema_path(project:, location:, schema_registry:, schema:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/schemas/ids/{schema}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • schema (String)
  • #schema_path(project:, location:, schema_registry:, context:, schema:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/schemas/ids/{schema}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • schema (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 53

def schema_path **args
  resources = {
    "location:project:schema:schema_registry" => (proc do |project:, location:, schema_registry:, schema:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/schemas/ids/#{schema}"
    end),
    "context:location:project:schema:schema_registry" => (proc do |project:, location:, schema_registry:, context:, schema:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/schemas/ids/#{schema}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#schema_registry_path(project:, location:, schema_registry:) ⇒ ::String

Create a fully-qualified SchemaRegistry resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/schemaRegistries/{schema_registry}

Parameters:

  • project (String)
  • location (String)
  • schema_registry (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


272
273
274
275
276
277
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 272

def schema_registry_path project:, location:, schema_registry:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

  "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}"
end

#schema_subject_path(project:, location:, schema_registry:, subject:) ⇒ ::String #schema_subject_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

Create a fully-qualified SchemaSubject resource string.

Overloads:

  • #schema_subject_path(project:, location:, schema_registry:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • subject (String)
  • #schema_subject_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • subject (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 304

def schema_subject_path **args
  resources = {
    "location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/subjects/#{subject}"
    end),
    "context:location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, context:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/subjects/#{subject}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#schema_version_path(project:, location:, schema_registry:, subject:, version:) ⇒ ::String #schema_version_path(project:, location:, schema_registry:, context:, subject:, version:) ⇒ ::String #schema_version_path(project:, location:, schema_registry:, subject:) ⇒ ::String #schema_version_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

Create a fully-qualified SchemaVersion resource string.

Overloads:

  • #schema_version_path(project:, location:, schema_registry:, subject:, version:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/subjects/{subject}/versions/{version}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • subject (String)
    • version (String)
  • #schema_version_path(project:, location:, schema_registry:, context:, subject:, version:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/subjects/{subject}/versions/{version}

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • subject (String)
    • version (String)
  • #schema_version_path(project:, location:, schema_registry:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/compatibility/subjects/{subject}/versions

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • subject (String)
  • #schema_version_path(project:, location:, schema_registry:, context:, subject:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/contexts/{context}/compatibility/subjects/{subject}/versions

    Parameters:

    • project (String)
    • location (String)
    • schema_registry (String)
    • context (String)
    • subject (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/google/cloud/managed_kafka/schema_registry/v1/managed_schema_registry/paths.rb', line 376

def schema_version_path **args
  resources = {
    "location:project:schema_registry:subject:version" => (proc do |project:, location:, schema_registry:, subject:, version:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "subject cannot contain /" if subject.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/subjects/#{subject}/versions/#{version}"
    end),
    "context:location:project:schema_registry:subject:version" => (proc do |project:, location:, schema_registry:, context:, subject:, version:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"
      raise ::ArgumentError, "subject cannot contain /" if subject.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/subjects/#{subject}/versions/#{version}"
    end),
    "location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/compatibility/subjects/#{subject}/versions"
    end),
    "context:location:project:schema_registry:subject" => (proc do |project:, location:, schema_registry:, context:, subject:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "schema_registry cannot contain /" if schema_registry.to_s.include? "/"
      raise ::ArgumentError, "context cannot contain /" if context.to_s.include? "/"

      "projects/#{project}/locations/#{location}/schemaRegistries/#{schema_registry}/contexts/#{context}/compatibility/subjects/#{subject}/versions"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end