Module: Google::Cloud::Storage::Control::V2::StorageControl::Paths
- Extended by:
- Paths
- Defined in:
- lib/google/cloud/storage/control/v2/storage_control/paths.rb
Overview
Path helper methods for the StorageControl API.
Instance Method Summary collapse
-
#bucket_path(project:, bucket:) ⇒ ::String
Create a fully-qualified Bucket resource string.
-
#folder_path(project:, bucket:, folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
-
#managed_folder_path(project:, bucket:, managed_folder:) ⇒ ::String
Create a fully-qualified ManagedFolder resource string.
-
#storage_layout_path(project:, bucket:) ⇒ ::String
Create a fully-qualified StorageLayout resource string.
Instance Method Details
#bucket_path(project:, bucket:) ⇒ ::String
Create a fully-qualified Bucket resource string.
The resource will be in the following format:
projects/{project}/buckets/{bucket}
39 40 41 42 43 |
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 39 def bucket_path project:, bucket: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/buckets/#{bucket}" end |
#folder_path(project:, bucket:, folder:) ⇒ ::String
Create a fully-qualified Folder resource string.
The resource will be in the following format:
projects/{project}/buckets/{bucket}/folders/{folder=**}
57 58 59 60 61 62 |
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 57 def folder_path project:, bucket:, folder: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "projects/#{project}/buckets/#{bucket}/folders/#{folder}" end |
#managed_folder_path(project:, bucket:, managed_folder:) ⇒ ::String
Create a fully-qualified ManagedFolder resource string.
The resource will be in the following format:
projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}
76 77 78 79 80 81 |
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 76 def managed_folder_path project:, bucket:, managed_folder: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" "projects/#{project}/buckets/#{bucket}/managedFolders/#{managed_folder}" end |
#storage_layout_path(project:, bucket:) ⇒ ::String
Create a fully-qualified StorageLayout resource string.
The resource will be in the following format:
projects/{project}/buckets/{bucket}/storageLayout
94 95 96 97 98 |
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 94 def storage_layout_path project:, bucket: raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" "projects/#{project}/buckets/#{bucket}/storageLayout" end |