Module: Google::Cloud::Kms::V1::AutokeyAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/kms/v1/autokey_admin/paths.rb

Overview

Path helper methods for the AutokeyAdmin API.

Instance Method Summary collapse

Instance Method Details

#autokey_config_path(folder:) ⇒ ::String #autokey_config_path(project:) ⇒ ::String

Create a fully-qualified AutokeyConfig resource string.

Overloads:

  • #autokey_config_path(folder:) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/autokeyConfig

    Parameters:

    • folder (String)
  • #autokey_config_path(project:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/autokeyConfig

    Parameters:

    • project (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/google/cloud/kms/v1/autokey_admin/paths.rb', line 45

def autokey_config_path **args
  resources = {
    "folder" => (proc do |folder:|
      "folders/#{folder}/autokeyConfig"
    end),
    "project" => (proc do |project:|
      "projects/#{project}/autokeyConfig"
    end)
  }

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

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


70
71
72
# File 'lib/google/cloud/kms/v1/autokey_admin/paths.rb', line 70

def project_path project:
  "projects/#{project}"
end