Module: Google::Cloud::OsLogin::V1beta::OsLoginService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/os_login/v1beta/os_login_service/paths.rb

Overview

Path helper methods for the OsLoginService API.

Instance Method Summary collapse

Instance Method Details

#posix_account_path(user:, project:) ⇒ ::String

Create a fully-qualified PosixAccount resource string.

The resource will be in the following format:

users/{user}/projects/{project}

Parameters:

  • user (String)
  • project (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/os_login/v1beta/os_login_service/paths.rb', line 38

def  user:, project:
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

  "users/#{user}/projects/#{project}"
end

#ssh_public_key_path(user:, fingerprint:) ⇒ ::String

Create a fully-qualified SshPublicKey resource string.

The resource will be in the following format:

users/{user}/sshPublicKeys/{fingerprint}

Parameters:

  • user (String)
  • fingerprint (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


55
56
57
58
59
# File 'lib/google/cloud/os_login/v1beta/os_login_service/paths.rb', line 55

def ssh_public_key_path user:, fingerprint:
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"

  "users/#{user}/sshPublicKeys/#{fingerprint}"
end

#user_path(user:) ⇒ ::String

Create a fully-qualified User resource string.

The resource will be in the following format:

users/{user}

Parameters:

  • user (String)

Returns:

  • (::String)


71
72
73
# File 'lib/google/cloud/os_login/v1beta/os_login_service/paths.rb', line 71

def user_path user:
  "users/#{user}"
end