Class: Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/storage/control/v2/storage_control/rest/client.rb

Overview

REST client for the StorageControl service.

StorageControl service includes selected control plane operations.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#anywhere_cache_path, #bucket_path, #folder_path, #intelligence_config_path, #intelligence_finding_path, #intelligence_finding_revision_path, #location_path, #managed_folder_path, #rapid_cache_path, #storage_layout_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new StorageControl REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the StorageControl client.

Yield Parameters:



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 214

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @storage_control_stub = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @storage_control_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end
end

Instance Attribute Details

#operations_client::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Operations (readonly)

Get the associated client for long-running operations.



268
269
270
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 268

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the StorageControl Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all StorageControl clients
::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Storage", "Control", "V2"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0

    default_config.rpcs.create_folder.timeout = 60.0
    default_config.rpcs.create_folder.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_folder.timeout = 60.0
    default_config.rpcs.get_folder.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.list_folders.timeout = 60.0
    default_config.rpcs.list_folders.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.rename_folder.timeout = 60.0
    default_config.rpcs.rename_folder.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.delete_folder_recursive.timeout = 60.0
    default_config.rpcs.delete_folder_recursive.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_storage_layout.timeout = 60.0
    default_config.rpcs.get_storage_layout.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_project_intelligence_config.timeout = 60.0
    default_config.rpcs.get_project_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.update_project_intelligence_config.timeout = 60.0
    default_config.rpcs.update_project_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_folder_intelligence_config.timeout = 60.0
    default_config.rpcs.get_folder_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.update_folder_intelligence_config.timeout = 60.0
    default_config.rpcs.update_folder_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_organization_intelligence_config.timeout = 60.0
    default_config.rpcs.get_organization_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.update_organization_intelligence_config.timeout = 60.0
    default_config.rpcs.update_organization_intelligence_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_intelligence_finding.timeout = 60.0
    default_config.rpcs.get_intelligence_finding.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.list_intelligence_findings.timeout = 60.0
    default_config.rpcs.list_intelligence_findings.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.summarize_intelligence_findings.timeout = 60.0
    default_config.rpcs.summarize_intelligence_findings.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.get_intelligence_finding_revision.timeout = 60.0
    default_config.rpcs.get_intelligence_finding_revision.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config.rpcs.list_intelligence_finding_revisions.timeout = 60.0
    default_config.rpcs.list_intelligence_finding_revisions.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 13, 2]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the StorageControl Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



184
185
186
187
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 184

def configure
  yield @config if block_given?
  @config
end

#create_folder(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder #create_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new

# Call the create_folder method.
result = client.create_folder request

# The returned object is of type Google::Cloud::Storage::Control::V2::Folder.
p result

Overloads:

  • #create_folder(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

    Pass arguments to create_folder via a request object, either of type CreateFolderRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

    Pass arguments to create_folder via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of the bucket in which the folder will reside. The bucket must be a hierarchical namespace enabled bucket.

    • folder (::Google::Cloud::Storage::Control::V2::Folder, ::Hash) (defaults to: nil)

      Required. Properties of the new folder being created. The bucket and name of the folder are specified in the parent and folder_id fields, respectively. Populating those fields in folder will result in an error.

    • folder_id (::String) (defaults to: nil)

      Required. The full name of a folder, including all its parent folders. Folders use single '/' characters as a delimiter. The folder_id must end with a slash. For example, the folder_id of "books/biographies/" would create a new "biographies/" folder under the "books/" folder.

    • recursive (::Boolean) (defaults to: nil)

      Optional. If true, parent folder doesn't have to be present and all missing ancestor folders will be created atomically.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 343

def create_folder request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateFolderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_folder..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_folder.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_folder.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.create_folder request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_folder(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new

# Call the delete_folder method.
result = client.delete_folder request

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_folder(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_folder via a request object, either of type DeleteFolderRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_folder via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

    • if_metageneration_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the folder's current metageneration matches the given value.

    • if_metageneration_not_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the folder's current metageneration does not match the given value.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 432

def delete_folder request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_folder..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_folder.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_folder.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.delete_folder request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_folder_recursive(request, options = nil) ⇒ ::Gapic::Operation #delete_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a folder recursively. This operation is only applicable to a hierarchical namespace enabled bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new

# Call the delete_folder_recursive method.
result = client.delete_folder_recursive request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #delete_folder_recursive(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_folder_recursive via a request object, either of type DeleteFolderRecursiveRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_folder_recursive via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the folder being deleted, however all of its contents will be deleted too. Format: projects/{project}/buckets/{bucket}/folders/{folder}

    • if_metageneration_match (::Integer) (defaults to: nil)

      Optional. Makes the operation only succeed conditional on whether the root folder's current metageneration matches the given value.

    • if_metageneration_not_match (::Integer) (defaults to: nil)

      Optional. Makes the operation only succeed conditional on whether the root folder's current metageneration does not match the given value.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 833

def delete_folder_recursive request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_folder_recursive..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_folder_recursive.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_folder_recursive.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.delete_folder_recursive request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_folder(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder #get_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new

# Call the get_folder method.
result = client.get_folder request

# The returned object is of type Google::Cloud::Storage::Control::V2::Folder.
p result

Overloads:

  • #get_folder(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

    Pass arguments to get_folder via a request object, either of type GetFolderRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::Folder

    Pass arguments to get_folder via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the folder. Format: projects/{project}/buckets/{bucket}/folders/{folder}

    • if_metageneration_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the folder's current metageneration matches the given value.

    • if_metageneration_not_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the folder's current metageneration does not match the given value.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 521

def get_folder request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_folder..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_folder.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_folder.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_folder request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_folder_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #get_folder_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Returns the Folder scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new

# Call the get_folder_intelligence_config method.
result = client.get_folder_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #get_folder_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_folder_intelligence_config via a request object, either of type GetFolderIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_folder_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_folder_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the IntelligenceConfig resource associated with your folder.

      Format: folders/{id}/locations/global/intelligenceConfig

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1167

def get_folder_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_folder_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_folder_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_folder_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_intelligence_finding(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFinding #get_intelligence_finding(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFinding

Gets the IntelligenceFinding for a project.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest.new

# Call the get_intelligence_finding method.
result = client.get_intelligence_finding request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceFinding.
p result

Overloads:

  • #get_intelligence_finding(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFinding

    Pass arguments to get_intelligence_finding via a request object, either of type GetIntelligenceFindingRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_intelligence_finding(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFinding

    Pass arguments to get_intelligence_finding via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the IntelligenceFinding resource.

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1499

def get_intelligence_finding request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_intelligence_finding..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_intelligence_finding.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_intelligence_finding.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_intelligence_finding request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_intelligence_finding_revision(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision #get_intelligence_finding_revision(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision

Gets the IntelligenceFindingRevision resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest.new

# Call the get_intelligence_finding_revision method.
result = client.get_intelligence_finding_revision request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision.
p result

Overloads:

  • #get_intelligence_finding_revision(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision

    Pass arguments to get_intelligence_finding_revision via a request object, either of type GetIntelligenceFindingRevisionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_intelligence_finding_revision(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision

    Pass arguments to get_intelligence_finding_revision via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the IntelligenceFindingRevision resource.

      Format:

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

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1798

def get_intelligence_finding_revision request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_intelligence_finding_revision..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_intelligence_finding_revision.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_intelligence_finding_revision.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_intelligence_finding_revision request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_organization_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #get_organization_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Returns the Organization scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new

# Call the get_organization_intelligence_config method.
result = client.get_organization_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #get_organization_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_organization_intelligence_config via a request object, either of type GetOrganizationIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_organization_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_organization_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the IntelligenceConfig resource associated with your organization.

      Format: organizations/{org_id}/locations/global/intelligenceConfig

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1333

def get_organization_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_organization_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_organization_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_organization_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_project_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #get_project_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Returns the Project scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new

# Call the get_project_intelligence_config method.
result = client.get_project_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #get_project_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_project_intelligence_config via a request object, either of type GetProjectIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_project_intelligence_config(name: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to get_project_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the IntelligenceConfig resource associated with your project.

      Format: projects/{id}/locations/global/intelligenceConfig

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1001

def get_project_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_project_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_project_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_project_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_storage_layout(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::StorageLayout #get_storage_layout(name: nil, prefix: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::StorageLayout

Returns the storage layout configuration for a given bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new

# Call the get_storage_layout method.
result = client.get_storage_layout request

# The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout.
p result

Overloads:

  • #get_storage_layout(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::StorageLayout

    Pass arguments to get_storage_layout via a request object, either of type GetStorageLayoutRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_storage_layout(name: nil, prefix: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::StorageLayout

    Pass arguments to get_storage_layout via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. The name of the StorageLayout resource. Format: projects/{project}/buckets/{bucket}/storageLayout

    • prefix (::String) (defaults to: nil)

      An optional prefix used for permission check. It is useful when the caller only has limited permissions under a specific prefix.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 920

def get_storage_layout request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_storage_layout..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_storage_layout.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_storage_layout.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.get_storage_layout request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_folders(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder> #list_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>

Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new

# Call the list_folders method.
result = client.list_folders request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Storage::Control::V2::Folder.
  p item
end

Overloads:

  • #list_folders(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>

    Pass arguments to list_folders via a request object, either of type ListFoldersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>

    Pass arguments to list_folders via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. Name of the bucket in which to look for folders. The bucket must be a hierarchical namespace enabled bucket.

    • page_size (::Integer) (defaults to: nil)

      Optional. Maximum number of folders to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.

    • page_token (::String) (defaults to: nil)

      Optional. A previously-returned page token representing part of the larger set of results to view.

    • prefix (::String) (defaults to: nil)

      Optional. Filter results to folders whose names begin with this prefix. If set, the value must either be an empty string or end with a '/'.

    • delimiter (::String) (defaults to: nil)

      Optional. If set, returns results in a directory-like mode. The results will only include folders that either exactly match the above prefix, or are one level below the prefix. The only supported value is '/'.

    • lexicographic_start (::String) (defaults to: nil)

      Optional. Filter results to folders whose names are lexicographically equal to or after lexicographic_start. If lexicographic_end is also set, the folders listed have names between lexicographic_start (inclusive) and lexicographic_end (exclusive).

    • lexicographic_end (::String) (defaults to: nil)

      Optional. Filter results to folders whose names are lexicographically before lexicographic_end. If lexicographic_start is also set, the folders listed have names between lexicographic_start (inclusive) and lexicographic_end (exclusive).

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 631

def list_folders request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListFoldersRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_folders..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_folders.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_folders.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.list_folders request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :list_folders, "folders", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_intelligence_finding_revisions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision> #list_intelligence_finding_revisions(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision>

Lists all the revisions of an IntelligenceFinding resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest.new

# Call the list_intelligence_finding_revisions method.
result = client.list_intelligence_finding_revisions request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision.
  p item
end

Overloads:

  • #list_intelligence_finding_revisions(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision>

    Pass arguments to list_intelligence_finding_revisions via a request object, either of type ListIntelligenceFindingRevisionsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_intelligence_finding_revisions(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision>

    Pass arguments to list_intelligence_finding_revisions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent of the IntelligenceFindingRevision resource.

      Format:

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

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of IntelligenceFindingRevision resources to return.

      The maximum value is 100; values above 100 will be coerced to 100. The default value is 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListIntelligenceFindingRevisions call. Provide this to retrieve the subsequent page.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1893

def list_intelligence_finding_revisions request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_intelligence_finding_revisions..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_intelligence_finding_revisions.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_intelligence_finding_revisions.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.list_intelligence_finding_revisions request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :list_intelligence_finding_revisions, "intelligence_finding_revisions", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_intelligence_findings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding> #list_intelligence_findings(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding>

Lists the IntelligenceFinding resources for the specified the project.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest.new

# Call the list_intelligence_findings method.
result = client.list_intelligence_findings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Storage::Control::V2::IntelligenceFinding.
  p item
end

Overloads:

  • #list_intelligence_findings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding>

    Pass arguments to list_intelligence_findings via a request object, either of type ListIntelligenceFindingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_intelligence_findings(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding>

    Pass arguments to list_intelligence_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The parent of the IntelligenceFinding resource.

      Format: projects/{project}/locations/{location}

    • filter (::String) (defaults to: nil)

      Optional. The filter expression to be applied. Supports filtering by type and associated_resources.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of IntelligenceFinding resources to return.

      The maximum value is 100; values above 100 will be coerced to 100. The default value is 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListIntelligenceFindings call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListIntelligenceFindings must match the call that provided the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1598

def list_intelligence_findings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_intelligence_findings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_intelligence_findings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_intelligence_findings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.list_intelligence_findings request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :list_intelligence_findings, "intelligence_findings", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


275
276
277
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 275

def logger
  @storage_control_stub.logger
end

#rename_folder(request, options = nil) ⇒ ::Gapic::Operation #rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Gapic::Operation

Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new

# Call the rename_folder method.
result = client.rename_folder request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

Overloads:

  • #rename_folder(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to rename_folder via a request object, either of type RenameFolderRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to rename_folder via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the source folder being renamed. Format: projects/{project}/buckets/{bucket}/folders/{folder}

    • destination_folder_id (::String) (defaults to: nil)

      Required. The destination folder ID, e.g. foo/bar/.

    • if_metageneration_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the source folder's current metageneration matches the given value.

    • if_metageneration_not_match (::Integer) (defaults to: nil)

      Makes the operation only succeed conditional on whether the source folder's current metageneration does not match the given value.

    • request_id (::String) (defaults to: nil)

      Optional. A unique identifier for this request. UUID is the recommended format, but other formats are still accepted. This request is only idempotent if a request_id is provided.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)

Returns:

  • (::Gapic::Operation)

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 734

def rename_folder request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::RenameFolderRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rename_folder..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rename_folder.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rename_folder.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.rename_folder request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#summarize_intelligence_findings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary> #summarize_intelligence_findings(parent: nil, resource_scope: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary>

Summarizes the intelligence findings for the specified scope (organization, folder or project).

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest.new

# Call the summarize_intelligence_findings method.
result = client.summarize_intelligence_findings request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Storage::Control::V2::FindingSummary.
  p item
end

Overloads:

  • #summarize_intelligence_findings(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary>

    Pass arguments to summarize_intelligence_findings via a request object, either of type Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #summarize_intelligence_findings(parent: nil, resource_scope: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary>

    Pass arguments to summarize_intelligence_findings via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • parent (::String) (defaults to: nil)

      Required. The scope to summarize the findings for. Format:

      • organizations/{organization}/locations/{location}
      • folders/{folder}/locations/{location}
      • projects/{project}/locations/{location}
    • resource_scope (::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest::ResourceScope) (defaults to: nil)

      Optional. Determines the granularity of the findings when the parent is an organization or folder.

      • PARENT (or not set): A single summary is returned for each insight type, aggregated across the entire parent scope.
      • PROJECT: A separate summary is returned for each insight type for every project within the parent scope.

      The only supported values are PARENT and PROJECT. If no value is specified, the API behaviour defaults to the PARENT.

    • filter (::String) (defaults to: nil)

      Optional. The filter expression, following AIP-160. Supports filtering by FindingType.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of findings to return.

      The maximum value is 100; values above 100 will be coerced to 100. The default value is 100.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous SummarizeIntelligenceFindings call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to SummarizeIntelligenceFindings must match the call that provided the page token.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1715

def summarize_intelligence_findings request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.summarize_intelligence_findings..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.summarize_intelligence_findings.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.summarize_intelligence_findings.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.summarize_intelligence_findings request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :summarize_intelligence_findings, "finding_summaries", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


194
195
196
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 194

def universe_domain
  @storage_control_stub.universe_domain
end

#update_folder_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Updates the Folder scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new

# Call the update_folder_intelligence_config method.
result = client.update_folder_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #update_folder_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_folder_intelligence_config via a request object, either of type UpdateFolderIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_folder_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • intelligence_config (::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash) (defaults to: nil)

      Required. The IntelligenceConfig resource to be updated.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The update_mask that specifies the fields within the IntelligenceConfig resource that should be modified by this update. Only the listed fields are updated.

    • request_id (::String) (defaults to: nil)

      Optional. The ID that uniquely identifies the request, preventing duplicate processing.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1252

def update_folder_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_folder_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_folder_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.update_folder_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_organization_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Updates the Organization scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new

# Call the update_organization_intelligence_config method.
result = client.update_organization_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #update_organization_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_organization_intelligence_config via a request object, either of type UpdateOrganizationIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

  • #update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_organization_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • intelligence_config (::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash) (defaults to: nil)

      Required. The IntelligenceConfig resource to be updated.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The update_mask that specifies the fields within the IntelligenceConfig resource that should be modified by this update. Only the listed fields are updated.

    • request_id (::String) (defaults to: nil)

      Optional. The ID that uniquely identifies the request, preventing duplicate processing.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1418

def update_organization_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_organization_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_organization_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.update_organization_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_project_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig #update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

Updates the Project scoped singleton IntelligenceConfig resource.

Examples:

Basic example

require "google/cloud/storage/control/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new

# Call the update_project_intelligence_config method.
result = client.update_project_intelligence_config request

# The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig.
p result

Overloads:

  • #update_project_intelligence_config(request, options = nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_project_intelligence_config via a request object, either of type UpdateProjectIntelligenceConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash)

      A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.

    • options (::Gapic::CallOptions, ::Hash) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) ⇒ ::Google::Cloud::Storage::Control::V2::IntelligenceConfig

    Pass arguments to update_project_intelligence_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

    • intelligence_config (::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash) (defaults to: nil)

      Required. The IntelligenceConfig resource to be updated.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. The update_mask that specifies the fields within the IntelligenceConfig resource that should be modified by this update. Only the listed fields are updated.

    • request_id (::String) (defaults to: nil)

      Optional. The ID that uniquely identifies the request, preventing duplicate processing.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/google/cloud/storage/control/v2/storage_control/rest/client.rb', line 1086

def update_project_intelligence_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_project_intelligence_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_project_intelligence_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @storage_control_stub.update_project_intelligence_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end