Module: Google::Cloud::Sql::V1::SqlBackupsService::Paths

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

Overview

Path helper methods for the SqlBackupsService API.

Instance Method Summary collapse

Instance Method Details

#backup_path(project:, backup:) ⇒ ::String

Create a fully-qualified Backup resource string.

The resource will be in the following format:

projects/{project}/backups/{backup}

Parameters:

  • project (String)
  • backup (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/sql/v1/sql_backups_service/paths.rb', line 38

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

  "projects/#{project}/backups/#{backup}"
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)


54
55
56
# File 'lib/google/cloud/sql/v1/sql_backups_service/paths.rb', line 54

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