Module: Google::Cloud::PolicySimulator::V1::OrgPolicyViolationsPreviewService::Paths
- Extended by:
- Paths
- Included in:
- Client, Paths, Rest::Client
- Defined in:
- lib/google/cloud/policy_simulator/v1/org_policy_violations_preview_service/paths.rb
Overview
Path helper methods for the OrgPolicyViolationsPreviewService API.
Instance Method Summary collapse
-
#custom_constraint_path(organization:, custom_constraint:) ⇒ ::String
Create a fully-qualified CustomConstraint resource string.
-
#org_policy_violations_preview_path(organization:, location:, org_policy_violations_preview:) ⇒ ::String
Create a fully-qualified OrgPolicyViolationsPreview resource string.
-
#organization_location_path(organization:, location:) ⇒ ::String
Create a fully-qualified OrganizationLocation resource string.
-
#policy_path(**args) ⇒ ::String
Create a fully-qualified Policy resource string.
Instance Method Details
#custom_constraint_path(organization:, custom_constraint:) ⇒ ::String
Create a fully-qualified CustomConstraint resource string.
The resource will be in the following format:
organizations/{organization}/customConstraints/{custom_constraint}
38 39 40 41 42 |
# File 'lib/google/cloud/policy_simulator/v1/org_policy_violations_preview_service/paths.rb', line 38 def custom_constraint_path organization:, custom_constraint: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/customConstraints/#{custom_constraint}" end |
#org_policy_violations_preview_path(organization:, location:, org_policy_violations_preview:) ⇒ ::String
Create a fully-qualified OrgPolicyViolationsPreview resource string.
The resource will be in the following format:
organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{org_policy_violations_preview}
56 57 58 59 60 61 |
# File 'lib/google/cloud/policy_simulator/v1/org_policy_violations_preview_service/paths.rb', line 56 def org_policy_violations_preview_path organization:, location:, org_policy_violations_preview: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "organizations/#{organization}/locations/#{location}/orgPolicyViolationsPreviews/#{org_policy_violations_preview}" 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}
74 75 76 77 78 |
# File 'lib/google/cloud/policy_simulator/v1/org_policy_violations_preview_service/paths.rb', line 74 def organization_location_path organization:, location: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/locations/#{location}" end |
#policy_path(project:, policy:) ⇒ ::String #policy_path(folder:, policy:) ⇒ ::String #policy_path(organization:, policy:) ⇒ ::String
Create a fully-qualified Policy resource string.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/google/cloud/policy_simulator/v1/org_policy_violations_preview_service/paths.rb', line 108 def policy_path **args resources = { "policy:project" => (proc do |project:, policy:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/policies/#{policy}" end), "folder:policy" => (proc do |folder:, policy:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/policies/#{policy}" end), "organization:policy" => (proc do |organization:, policy:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/policies/#{policy}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end |