Module: Google::Cloud::NetworkSecurity::V1::AddressGroupService::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/network_security/v1/address_group_service/paths.rb
Overview
Path helper methods for the AddressGroupService API.
Instance Method Summary collapse
-
#address_group_path(**args) ⇒ ::String
Create a fully-qualified AddressGroup 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
#address_group_path(project:, location:, address_group:) ⇒ ::String #address_group_path(organization:, location:, address_group:) ⇒ ::String
Create a fully-qualified AddressGroup 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/network_security/v1/address_group_service/paths.rb', line 49 def address_group_path **args resources = { "address_group:location:project" => (proc do |project:, location:, address_group:| raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "projects/#{project}/locations/#{location}/addressGroups/#{address_group}" end), "address_group:location:organization" => (proc do |organization:, location:, address_group:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" "organizations/#{organization}/locations/#{location}/addressGroups/#{address_group}" 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}
81 82 83 84 85 |
# File 'lib/google/cloud/network_security/v1/address_group_service/paths.rb', line 81 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}
98 99 100 101 102 |
# File 'lib/google/cloud/network_security/v1/address_group_service/paths.rb', line 98 def organization_location_path organization:, location: raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/locations/#{location}" end |