Module: Google::Cloud::Storage::Control::V2::StorageControl::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/storage/control/v2/storage_control/paths.rb

Overview

Path helper methods for the StorageControl API.

Instance Method Summary collapse

Instance Method Details

#anywhere_cache_path(project:, bucket:, anywhere_cache:) ⇒ ::String

Create a fully-qualified AnywhereCache resource string.

The resource will be in the following format:

projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}

Parameters:

  • project (String)
  • bucket (String)
  • anywhere_cache (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 40

def anywhere_cache_path project:, bucket:, anywhere_cache:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"

  "projects/#{project}/buckets/#{bucket}/anywhereCaches/#{anywhere_cache}"
end

#bucket_path(project:, bucket:) ⇒ ::String

Create a fully-qualified Bucket resource string.

The resource will be in the following format:

projects/{project}/buckets/{bucket}

Parameters:

  • project (String)
  • bucket (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


58
59
60
61
62
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 58

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=**}

Parameters:

  • project (String)
  • bucket (String)
  • folder (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


76
77
78
79
80
81
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 76

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

#intelligence_config_path(folder:, location:) ⇒ ::String #intelligence_config_path(org:, location:) ⇒ ::String #intelligence_config_path(project:, location:) ⇒ ::String

Create a fully-qualified IntelligenceConfig resource string.

Overloads:

  • #intelligence_config_path(folder:, location:) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/locations/{location}/intelligenceConfig

    Parameters:

    • folder (String)
    • location (String)
  • #intelligence_config_path(org:, location:) ⇒ ::String

    The resource will be in the following format:

    organizations/{org}/locations/{location}/intelligenceConfig

    Parameters:

    • org (String)
    • location (String)
  • #intelligence_config_path(project:, location:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/intelligenceConfig

    Parameters:

    • project (String)
    • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 111

def intelligence_config_path **args
  resources = {
    "folder:location" => (proc do |folder:, location:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"

      "folders/#{folder}/locations/#{location}/intelligenceConfig"
    end),
    "location:org" => (proc do |org:, location:|
      raise ::ArgumentError, "org cannot contain /" if org.to_s.include? "/"

      "organizations/#{org}/locations/#{location}/intelligenceConfig"
    end),
    "location:project" => (proc do |project:, location:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

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

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

#intelligence_finding_path(project:, location:, intelligence_finding:) ⇒ ::String

Create a fully-qualified IntelligenceFinding resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}

Parameters:

  • project (String)
  • location (String)
  • intelligence_finding (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


147
148
149
150
151
152
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 147

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

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

#intelligence_finding_revision_path(project:, location:, intelligence_finding:, revision:) ⇒ ::String

Create a fully-qualified IntelligenceFindingRevision resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}

Parameters:

  • project (String)
  • location (String)
  • intelligence_finding (String)
  • revision (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


167
168
169
170
171
172
173
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 167

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

  "projects/#{project}/locations/#{location}/intelligenceFindings/#{intelligence_finding}/revisions/#{revision}"
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)


186
187
188
189
190
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 186

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

  "projects/#{project}/locations/#{location}"
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=**}

Parameters:

  • project (String)
  • bucket (String)
  • managed_folder (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


204
205
206
207
208
209
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 204

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

Parameters:

  • project (String)
  • bucket (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


222
223
224
225
226
# File 'lib/google/cloud/storage/control/v2/storage_control/paths.rb', line 222

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

  "projects/#{project}/buckets/#{bucket}/storageLayout"
end