module Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Paths
Path helper methods for the ResourceSettingsService
API.
Public Instance Methods
setting_path(**args)
click to toggle source
Create a fully-qualified Setting resource string.
@overload setting_path
(project_number:, setting_name:)
The resource will be in the following format: `projects/{project_number}/settings/{setting_name}` @param project_number [String] @param setting_name [String]
@overload setting_path
(folder:, setting_name:)
The resource will be in the following format: `folders/{folder}/settings/{setting_name}` @param folder [String] @param setting_name [String]
@overload setting_path
(organization:, setting_name:)
The resource will be in the following format: `organizations/{organization}/settings/{setting_name}` @param organization [String] @param setting_name [String]
@return [::String]
# File lib/google/cloud/resource_settings/v1/resource_settings_service/paths.rb, line 55 def setting_path **args resources = { "project_number:setting_name" => (proc do |project_number:, setting_name:| raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" "projects/#{project_number}/settings/#{setting_name}" end), "folder:setting_name" => (proc do |folder:, setting_name:| raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" "folders/#{folder}/settings/#{setting_name}" end), "organization:setting_name" => (proc do |organization:, setting_name:| raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" "organizations/#{organization}/settings/#{setting_name}" end) } resource = resources[args.keys.sort.join(":")] raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? resource.call(**args) end