module Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Paths

Path helper methods for the SystemPolicy API.

Public Instance Methods

policy_path(**args) click to toggle source

Create a fully-qualified Policy resource string.

@overload policy_path(project:)

The resource will be in the following format:

`projects/{project}/policy`

@param project [String]

@overload policy_path(location:)

The resource will be in the following format:

`locations/{location}/policy`

@param location [String]

@return [::String]

# File lib/google/cloud/binary_authorization/v1/system_policy/paths.rb, line 45
def policy_path **args
  resources = {
    "project" => (proc do |project:|
      "projects/#{project}/policy"
    end),
    "location" => (proc do |location:|
      "locations/#{location}/policy"
    end)
  }

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