Module: Google::Cloud::CloudSecurityCompliance::V1::Config::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/cloud_security_compliance/v1/config/paths.rb
Overview
Path helper methods for the Config API.
Instance Method Summary collapse
-
#cloud_control_path(**args) ⇒ ::String
Create a fully-qualified CloudControl resource string.
-
#framework_path(**args) ⇒ ::String
Create a fully-qualified Framework resource string.
-
#location_path(project:, location:) ⇒ ::String
Create a fully-qualified Location resource string.
-
#organization_location_path(organization:, location:) ⇒ ::String
Create a fully-qualified OrganizationLocation resource string.
Instance Method Details
#cloud_control_path(organization:, location:, cloud_control:) ⇒ ::String #cloud_control_path(project:, location:, cloud_control:) ⇒ ::String
Create a fully-qualified CloudControl resource string.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/google/cloud/cloud_security_compliance/v1/config/paths.rb', line 49 def cloud_control_path **args resources = { "cloud_control:location:organization" => (proc do |organization:, location:, cloud_control:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "organizations/#{organization}/locations/#{location}/cloudControls/#{cloud_control}" end), "cloud_control:location:project" => (proc do |project:, location:, cloud_control:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/cloudControls/#{cloud_control}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |
#framework_path(organization:, location:, framework:) ⇒ ::String #framework_path(project:, location:, framework:) ⇒ ::String
Create a fully-qualified Framework resource string.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/google/cloud/cloud_security_compliance/v1/config/paths.rb', line 92 def framework_path **args resources = { "framework:location:organization" => (proc do |organization:, location:, framework:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "organizations/#{organization}/locations/#{location}/frameworks/#{framework}" end), "framework:location:project" => (proc do |project:, location:, framework:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/frameworks/#{framework}" 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}
124 125 126 127 128 |
# File 'lib/google/cloud/cloud_security_compliance/v1/config/paths.rb', line 124 def location_path project:, location: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/locations/#{location}" 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}
141 142 143 144 145 |
# File 'lib/google/cloud/cloud_security_compliance/v1/config/paths.rb', line 141 def organization_location_path organization:, location: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/locations/#{location}" end |