Module: Google::Cloud::Logging::V2::ConfigService::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/logging/v2/config_service/paths.rb

Overview

Path helper methods for the ConfigService API.

Instance Method Summary collapse

Instance Method Details

#billing_account_location_path(billing_account:, location:) ⇒ ::String

Create a fully-qualified BillingAccountLocation resource string.

The resource will be in the following format:

billingAccounts/{billing_account}/locations/{location}

Parameters:

  • billing_account (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


52
53
54
55
56
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 52

def  billing_account:, location:
  raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"

  "billingAccounts/#{}/locations/#{location}"
end

#billing_account_path(billing_account:) ⇒ ::String

Create a fully-qualified BillingAccount resource string.

The resource will be in the following format:

billingAccounts/{billing_account}

Parameters:

  • billing_account (String)

Returns:

  • (::String)


37
38
39
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 37

def  billing_account:
  "billingAccounts/#{}"
end

#cmek_settings_path(project: ) ⇒ ::String #cmek_settings_path(organization: ) ⇒ ::String #cmek_settings_path(folder: ) ⇒ ::String #cmek_settings_path(billing_account: ) ⇒ ::String

Create a fully-qualified CmekSettings resource string.

Overloads:

  • #cmek_settings_path(project: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/cmekSettings

    Parameters:

    • project (String) (defaults to: )
  • #cmek_settings_path(organization: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/cmekSettings

    Parameters:

    • organization (String) (defaults to: )
  • #cmek_settings_path(folder: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/cmekSettings

    Parameters:

    • folder (String) (defaults to: )
  • #cmek_settings_path(billing_account: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/cmekSettings

    Parameters:

    • billing_account (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 90

def cmek_settings_path **args
  resources = {
    "project" => (proc do |project:|
      "projects/#{project}/cmekSettings"
    end),
    "organization" => (proc do |organization:|
      "organizations/#{organization}/cmekSettings"
    end),
    "folder" => (proc do |folder:|
      "folders/#{folder}/cmekSettings"
    end),
    "billing_account" => (proc do |billing_account:|
      "billingAccounts/#{}/cmekSettings"
    end)
  }

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

#folder_location_path(folder:, location:) ⇒ ::String

Create a fully-qualified FolderLocation resource string.

The resource will be in the following format:

folders/{folder}/locations/{location}

Parameters:

  • folder (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


136
137
138
139
140
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 136

def folder_location_path folder:, location:
  raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"

  "folders/#{folder}/locations/#{location}"
end

#folder_path(folder:) ⇒ ::String

Create a fully-qualified Folder resource string.

The resource will be in the following format:

folders/{folder}

Parameters:

  • folder (String)

Returns:

  • (::String)


121
122
123
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 121

def folder_path folder:
  "folders/#{folder}"
end

Create a fully-qualified Link resource string.

Overloads:

  • #link_path(project: , location: , bucket: , link: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/buckets/{bucket}/links/{link}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • link (String) (defaults to: )
  • #link_path(organization: , location: , bucket: , link: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}

    Parameters:

    • organization (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • link (String) (defaults to: )
  • #link_path(folder: , location: , bucket: , link: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}

    Parameters:

    • folder (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • link (String) (defaults to: )
  • #link_path(billing_account: , location: , bucket: , link: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}

    Parameters:

    • billing_account (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • link (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 186

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

      "projects/#{project}/locations/#{location}/buckets/#{bucket}/links/#{link}"
    end),
    "bucket:link:location:organization" => (proc do |organization:, location:, bucket:, link:|
      raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "organizations/#{organization}/locations/#{location}/buckets/#{bucket}/links/#{link}"
    end),
    "bucket:folder:link:location" => (proc do |folder:, location:, bucket:, link:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "folders/#{folder}/locations/#{location}/buckets/#{bucket}/links/#{link}"
    end),
    "billing_account:bucket:link:location" => (proc do |billing_account:, location:, bucket:, link:|
      raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "billingAccounts/#{}/locations/#{location}/buckets/#{bucket}/links/#{link}"
    end)
  }

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

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


234
235
236
237
238
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 234

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

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

#log_bucket_path(project: , location: , bucket: ) ⇒ ::String #log_bucket_path(organization: , location: , bucket: ) ⇒ ::String #log_bucket_path(folder: , location: , bucket: ) ⇒ ::String #log_bucket_path(billing_account: , location: , bucket: ) ⇒ ::String

Create a fully-qualified LogBucket resource string.

Overloads:

  • #log_bucket_path(project: , location: , bucket: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/buckets/{bucket}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
  • #log_bucket_path(organization: , location: , bucket: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/locations/{location}/buckets/{bucket}

    Parameters:

    • organization (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
  • #log_bucket_path(folder: , location: , bucket: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/locations/{location}/buckets/{bucket}

    Parameters:

    • folder (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
  • #log_bucket_path(billing_account: , location: , bucket: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}

    Parameters:

    • billing_account (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 280

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

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

      "organizations/#{organization}/locations/#{location}/buckets/#{bucket}"
    end),
    "bucket:folder:location" => (proc do |folder:, location:, bucket:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "folders/#{folder}/locations/#{location}/buckets/#{bucket}"
    end),
    "billing_account:bucket:location" => (proc do |billing_account:, location:, bucket:|
      raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "billingAccounts/#{}/locations/#{location}/buckets/#{bucket}"
    end)
  }

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

#log_exclusion_path(project: , exclusion: ) ⇒ ::String #log_exclusion_path(organization: , exclusion: ) ⇒ ::String #log_exclusion_path(folder: , exclusion: ) ⇒ ::String #log_exclusion_path(billing_account: , exclusion: ) ⇒ ::String

Create a fully-qualified LogExclusion resource string.

Overloads:

  • #log_exclusion_path(project: , exclusion: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/exclusions/{exclusion}

    Parameters:

    • project (String) (defaults to: )
    • exclusion (String) (defaults to: )
  • #log_exclusion_path(organization: , exclusion: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/exclusions/{exclusion}

    Parameters:

    • organization (String) (defaults to: )
    • exclusion (String) (defaults to: )
  • #log_exclusion_path(folder: , exclusion: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/exclusions/{exclusion}

    Parameters:

    • folder (String) (defaults to: )
    • exclusion (String) (defaults to: )
  • #log_exclusion_path(billing_account: , exclusion: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/exclusions/{exclusion}

    Parameters:

    • billing_account (String) (defaults to: )
    • exclusion (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 349

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

      "projects/#{project}/exclusions/#{exclusion}"
    end),
    "exclusion:organization" => (proc do |organization:, exclusion:|
      raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

      "organizations/#{organization}/exclusions/#{exclusion}"
    end),
    "exclusion:folder" => (proc do |folder:, exclusion:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"

      "folders/#{folder}/exclusions/#{exclusion}"
    end),
    "billing_account:exclusion" => (proc do |billing_account:, exclusion:|
      raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"

      "billingAccounts/#{}/exclusions/#{exclusion}"
    end)
  }

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

#log_sink_path(project: , sink: ) ⇒ ::String #log_sink_path(organization: , sink: ) ⇒ ::String #log_sink_path(folder: , sink: ) ⇒ ::String #log_sink_path(billing_account: , sink: ) ⇒ ::String

Create a fully-qualified LogSink resource string.

Overloads:

  • #log_sink_path(project: , sink: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/sinks/{sink}

    Parameters:

    • project (String) (defaults to: )
    • sink (String) (defaults to: )
  • #log_sink_path(organization: , sink: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/sinks/{sink}

    Parameters:

    • organization (String) (defaults to: )
    • sink (String) (defaults to: )
  • #log_sink_path(folder: , sink: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/sinks/{sink}

    Parameters:

    • folder (String) (defaults to: )
    • sink (String) (defaults to: )
  • #log_sink_path(billing_account: , sink: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/sinks/{sink}

    Parameters:

    • billing_account (String) (defaults to: )
    • sink (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 414

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

      "projects/#{project}/sinks/#{sink}"
    end),
    "organization:sink" => (proc do |organization:, sink:|
      raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

      "organizations/#{organization}/sinks/#{sink}"
    end),
    "folder:sink" => (proc do |folder:, sink:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"

      "folders/#{folder}/sinks/#{sink}"
    end),
    "billing_account:sink" => (proc do |billing_account:, sink:|
      raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"

      "billingAccounts/#{}/sinks/#{sink}"
    end)
  }

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

#log_view_path(project: , location: , bucket: , view: ) ⇒ ::String #log_view_path(organization: , location: , bucket: , view: ) ⇒ ::String #log_view_path(folder: , location: , bucket: , view: ) ⇒ ::String #log_view_path(billing_account: , location: , bucket: , view: ) ⇒ ::String

Create a fully-qualified LogView resource string.

Overloads:

  • #log_view_path(project: , location: , bucket: , view: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/buckets/{bucket}/views/{view}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • view (String) (defaults to: )
  • #log_view_path(organization: , location: , bucket: , view: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}

    Parameters:

    • organization (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • view (String) (defaults to: )
  • #log_view_path(folder: , location: , bucket: , view: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}

    Parameters:

    • folder (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • view (String) (defaults to: )
  • #log_view_path(billing_account: , location: , bucket: , view: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}

    Parameters:

    • billing_account (String) (defaults to: )
    • location (String) (defaults to: )
    • bucket (String) (defaults to: )
    • view (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 487

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

      "projects/#{project}/locations/#{location}/buckets/#{bucket}/views/#{view}"
    end),
    "bucket:location:organization:view" => (proc do |organization:, location:, bucket:, view:|
      raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "organizations/#{organization}/locations/#{location}/buckets/#{bucket}/views/#{view}"
    end),
    "bucket:folder:location:view" => (proc do |folder:, location:, bucket:, view:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "folders/#{folder}/locations/#{location}/buckets/#{bucket}/views/#{view}"
    end),
    "billing_account:bucket:location:view" => (proc do |billing_account:, location:, bucket:, view:|
      raise ::ArgumentError, "billing_account cannot contain /" if .to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

      "billingAccounts/#{}/locations/#{location}/buckets/#{bucket}/views/#{view}"
    end)
  }

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

#organization_location_path(organization:, location:) ⇒ ::String

Create a fully-qualified OrganizationLocation resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}

Parameters:

  • organization (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


549
550
551
552
553
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 549

def organization_location_path organization:, location:
  raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

  "organizations/#{organization}/locations/#{location}"
end

#organization_path(organization:) ⇒ ::String

Create a fully-qualified Organization resource string.

The resource will be in the following format:

organizations/{organization}

Parameters:

  • organization (String)

Returns:

  • (::String)


534
535
536
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 534

def organization_path organization:
  "organizations/#{organization}"
end

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


565
566
567
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 565

def project_path project:
  "projects/#{project}"
end

#settings_path(project: ) ⇒ ::String #settings_path(organization: ) ⇒ ::String #settings_path(folder: ) ⇒ ::String #settings_path(billing_account: ) ⇒ ::String

Create a fully-qualified Settings resource string.

Overloads:

  • #settings_path(project: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/settings

    Parameters:

    • project (String) (defaults to: )
  • #settings_path(organization: ) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/settings

    Parameters:

    • organization (String) (defaults to: )
  • #settings_path(folder: ) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/settings

    Parameters:

    • folder (String) (defaults to: )
  • #settings_path(billing_account: ) ⇒ ::String

    The resource will be in the following format:

    billingAccounts/{billing_account}/settings

    Parameters:

    • billing_account (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/google/cloud/logging/v2/config_service/paths.rb', line 601

def settings_path **args
  resources = {
    "project" => (proc do |project:|
      "projects/#{project}/settings"
    end),
    "organization" => (proc do |organization:|
      "organizations/#{organization}/settings"
    end),
    "folder" => (proc do |folder:|
      "folders/#{folder}/settings"
    end),
    "billing_account" => (proc do |billing_account:|
      "billingAccounts/#{}/settings"
    end)
  }

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