Module: Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb

Overview

Path helper methods for the FirestoreAdmin API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Backup resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/backups/{backup}

Parameters:

  • project (String)
  • location (String)
  • backup (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 40

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

  "projects/#{project}/locations/#{location}/backups/#{backup}"
end

#backup_schedule_path(project:, database:, backup_schedule:) ⇒ ::String

Create a fully-qualified BackupSchedule resource string.

The resource will be in the following format:

projects/{project}/databases/{database}/backupSchedules/{backup_schedule}

Parameters:

  • project (String)
  • database (String)
  • backup_schedule (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 59

def backup_schedule_path project:, database:, backup_schedule:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"

  "projects/#{project}/databases/#{database}/backupSchedules/#{backup_schedule}"
end

#collection_group_path(project:, database:, collection:) ⇒ ::String

Create a fully-qualified CollectionGroup resource string.

The resource will be in the following format:

projects/{project}/databases/{database}/collectionGroups/{collection}

Parameters:

  • project (String)
  • database (String)
  • collection (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


78
79
80
81
82
83
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 78

def collection_group_path project:, database:, collection:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"

  "projects/#{project}/databases/#{database}/collectionGroups/#{collection}"
end

#database_path(project:, database:) ⇒ ::String

Create a fully-qualified Database resource string.

The resource will be in the following format:

projects/{project}/databases/{database}

Parameters:

  • project (String)
  • database (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


96
97
98
99
100
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 96

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

  "projects/#{project}/databases/#{database}"
end

#field_path(project:, database:, collection:, field:) ⇒ ::String

Create a fully-qualified Field resource string.

The resource will be in the following format:

projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}

Parameters:

  • project (String)
  • database (String)
  • collection (String)
  • field (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


115
116
117
118
119
120
121
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 115

def field_path project:, database:, collection:, field:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"
  raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"

  "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/fields/#{field}"
end

#index_path(project:, database:, collection:, index:) ⇒ ::String

Create a fully-qualified Index resource string.

The resource will be in the following format:

projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}

Parameters:

  • project (String)
  • database (String)
  • collection (String)
  • index (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


136
137
138
139
140
141
142
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 136

def index_path project:, database:, collection:, index:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"
  raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"

  "projects/#{project}/databases/#{database}/collectionGroups/#{collection}/indexes/#{index}"
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


155
156
157
158
159
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 155

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

  "projects/#{project}/locations/#{location}"
end

#operation_path(project:, database:, operation:) ⇒ ::String

Create a fully-qualified Operation resource string.

The resource will be in the following format:

projects/{project}/databases/{database}/operations/{operation}

Parameters:

  • project (String)
  • database (String)
  • operation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


173
174
175
176
177
178
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 173

def operation_path project:, database:, operation:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "database cannot contain /" if database.to_s.include? "/"

  "projects/#{project}/databases/#{database}/operations/#{operation}"
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)


190
191
192
# File 'lib/google/cloud/firestore/admin/v1/firestore_admin/paths.rb', line 190

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