Class: Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb

Overview

REST client for the StorageInsights service.

Service describing handlers for resources

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#dataset_config_path, #location_path, #report_config_path, #report_detail_path

Constructor Details

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

Create a new StorageInsights REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the StorageInsights client.

Yield Parameters:



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 179

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::StorageInsights::V1::StorageInsights::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_insights_stub = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @storage_insights_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

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @storage_insights_stub.endpoint
    config.universe_domain = @storage_insights_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @storage_insights_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

Get the associated client for mix-in of the Locations.

Returns:

  • (Google::Cloud::Location::Locations::Rest::Client)


249
250
251
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 249

def location_client
  @location_client
end

#operations_client::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Operations (readonly)

Get the associated client for long-running operations.



242
243
244
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 242

def operations_client
  @operations_client
end

Class Method Details

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

Configure the StorageInsights Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all StorageInsights clients
::Google::Cloud::StorageInsights::V1::StorageInsights::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
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "StorageInsights", "V1"]
    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.list_report_configs.timeout = 60.0
    default_config.rpcs.list_report_configs.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_report_config.timeout = 60.0
    default_config.rpcs.get_report_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_report_details.timeout = 60.0
    default_config.rpcs.list_report_details.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.get_report_detail.timeout = 60.0
    default_config.rpcs.get_report_detail.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.list_dataset_configs.timeout = 60.0
    default_config.rpcs.list_dataset_configs.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.create_dataset_config.timeout = 60.0
    default_config.rpcs.create_dataset_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.update_dataset_config.timeout = 60.0
    default_config.rpcs.update_dataset_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.delete_dataset_config.timeout = 60.0
    default_config.rpcs.delete_dataset_config.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.link_dataset.timeout = 60.0
    default_config.rpcs.link_dataset.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.unlink_dataset.timeout = 60.0
    default_config.rpcs.unlink_dataset.retry_policy = {
      initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

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

Configure the StorageInsights 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:



149
150
151
152
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 149

def configure
  yield @config if block_given?
  @config
end

#create_dataset_config(request, options = nil) ⇒ ::Gapic::Operation #create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a dataset configuration in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new

# Call the create_dataset_config method.
result = client.create_dataset_config 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:

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

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::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_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_dataset_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:

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

      Required. Value for parent.

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

      Required. ID of the requesting object. If auto-generating ID is enabled on the server-side, remove this field and dataset_config_id from the method_signature of Create RPC Note: The value should not contain any hyphens.

    • dataset_config (::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash) (defaults to: nil)

      Required. The resource being created

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

      Optional. A unique identifier for your request. Specify the request ID if you need to retry the request. If you retry the request with the same ID within 60 minutes, the server ignores the request if it has already completed the original request.

      For example, if your initial request times out and you retry the request using the same request ID, the server recognizes the original request and does not process the new request.

      The request ID must be a valid UUID and cannot be a zero UUID (00000000-0000-0000-0000-000000000000).

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.



1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1130

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest

  # 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_dataset_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::StorageInsights::V1::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_dataset_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_dataset_config.retry_policy

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

  @storage_insights_stub.create_dataset_config 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

#create_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig #create_report_config(parent: nil, report_config: nil, request_id: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

Creates a new ReportConfig in a given project and location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::CreateReportConfigRequest.new

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

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result

Overloads:

  • #create_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest, ::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_report_config(parent: nil, report_config: nil, request_id: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

    Pass arguments to create_report_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:

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

      Required. Value for parent.

    • report_config (::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash) (defaults to: nil)

      Required. The resource being created

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 492

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateReportConfigRequest

  # 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_report_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::StorageInsights::V1::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_report_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_report_config.retry_policy

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

  @storage_insights_stub.create_report_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

#delete_dataset_config(request, options = nil) ⇒ ::Gapic::Operation #delete_dataset_config(name: nil, request_id: nil) ⇒ ::Gapic::Operation

Deletes a dataset configuration in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new

# Call the delete_dataset_config method.
result = client.delete_dataset_config 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_dataset_config(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::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_dataset_config(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_dataset_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. Name of the resource

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

      Optional. A unique identifier for your request. Specify the request ID if you need to retry the request. If you retry the request with the same ID within 60 minutes, the server ignores the request if it has already completed the original request.

      For example, if your initial request times out and you retry the request using the same request ID, the server recognizes the original request and does not process the new request.

      The request ID must be a valid UUID and cannot be a zero UUID (00000000-0000-0000-0000-000000000000).

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.



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
1367
1368
1369
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1334

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest

  # 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_dataset_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::StorageInsights::V1::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_dataset_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_dataset_config.retry_policy

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

  @storage_insights_stub.delete_dataset_config 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

#delete_report_config(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_report_config(name: nil, force: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

Deletes a single ReportConfig.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest.new

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest, ::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_report_config(name: nil, force: nil, request_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_report_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. Name of the resource

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

      Optional. If set, all ReportDetails for this ReportConfig will be deleted.

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 684

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteReportConfigRequest

  # 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_report_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::StorageInsights::V1::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_report_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_report_config.retry_policy

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

  @storage_insights_stub.delete_report_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_dataset_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::DatasetConfig #get_dataset_config(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::DatasetConfig

Gets the dataset configuration in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new

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

# The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig.
p result

Overloads:

  • #get_dataset_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::DatasetConfig

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::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_dataset_config(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::DatasetConfig

    Pass arguments to get_dataset_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. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1026

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest

  # 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_dataset_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::StorageInsights::V1::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_dataset_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_dataset_config.retry_policy

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

  @storage_insights_stub.get_dataset_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_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig #get_report_config(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

Gets details of a single ReportConfig.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::GetReportConfigRequest.new

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

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result

Overloads:

  • #get_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::GetReportConfigRequest, ::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_report_config(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

    Pass arguments to get_report_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. Name of the resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 398

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportConfigRequest

  # 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_report_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::StorageInsights::V1::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_report_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_report_config.retry_policy

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

  @storage_insights_stub.get_report_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_report_detail(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportDetail #get_report_detail(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportDetail

Gets details of a single ReportDetail.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::GetReportDetailRequest.new

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

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportDetail.
p result

Overloads:

  • #get_report_detail(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportDetail

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::GetReportDetailRequest, ::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_report_detail(name: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportDetail

    Pass arguments to get_report_detail 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 resource

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 855

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetReportDetailRequest

  # 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_report_detail..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::StorageInsights::V1::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_report_detail.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_report_detail.retry_policy

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

  @storage_insights_stub.get_report_detail 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

Links a dataset to BigQuery in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new

# Call the link_dataset method.
result = client.link_dataset 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:

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

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::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.

  • #link_dataset(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to link_dataset 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 resource

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.



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
1452
1453
1454
1455
1456
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1421

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest

  # 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.link_dataset..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::StorageInsights::V1::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.link_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.link_dataset.retry_policy

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

  @storage_insights_stub.link_dataset 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

#list_dataset_configs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig> #list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>

Lists the dataset configurations in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new

# Call the list_dataset_configs method.
result = client.list_dataset_configs 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::StorageInsights::V1::DatasetConfig.
  p item
end

Overloads:

  • #list_dataset_configs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::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_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>

    Pass arguments to list_dataset_configs 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. Parent value for ListDatasetConfigsRequest

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

      Requested page size. Server might return fewer items than requested. If unspecified, server picks an appropriate default.

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

      A token identifying a page of results the server should return.

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

      Filtering results

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

      Hint for how to order the results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 946

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest

  # 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_dataset_configs..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::StorageInsights::V1::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_dataset_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_dataset_configs.retry_policy

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

  @storage_insights_stub.list_dataset_configs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, "dataset_configs", 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_report_configs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig> #list_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>

Lists ReportConfigs in a given project and location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::ListReportConfigsRequest.new

# Call the list_report_configs method.
result = client.list_report_configs 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::StorageInsights::V1::ReportConfig.
  p item
end

Overloads:

  • #list_report_configs(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest, ::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_report_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportConfig>

    Pass arguments to list_report_configs 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. Parent value for ListReportConfigsRequest

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

      Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

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

      A token identifying a page of results the server should return.

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

      Filtering results

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

      Hint for how to order the results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 318

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportConfigsRequest

  # 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_report_configs..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::StorageInsights::V1::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_report_configs.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_report_configs.retry_policy

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

  @storage_insights_stub.list_report_configs request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_configs, "report_configs", 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_report_details(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail> #list_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>

Lists ReportDetails in a given project and location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::ListReportDetailsRequest.new

# Call the list_report_details method.
result = client.list_report_details 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::StorageInsights::V1::ReportDetail.
  p item
end

Overloads:

  • #list_report_details(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest, ::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_report_details(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::ReportDetail>

    Pass arguments to list_report_details 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. Parent value for ListReportDetailsRequest

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

      Requested page size. Server may return fewer items than requested. If unspecified, server will pick an appropriate default.

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

      A token identifying a page of results the server should return.

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

      Filtering results

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

      Hint for how to order the results

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 775

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListReportDetailsRequest

  # 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_report_details..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::StorageInsights::V1::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_report_details.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_report_details.retry_policy

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

  @storage_insights_stub.list_report_details request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_report_details, "report_details", 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)


256
257
258
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 256

def logger
  @storage_insights_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


159
160
161
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 159

def universe_domain
  @storage_insights_stub.universe_domain
end

Unlinks a dataset from BigQuery in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new

# Call the unlink_dataset method.
result = client.unlink_dataset 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:

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

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::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.

  • #unlink_dataset(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to unlink_dataset 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 resource

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.



1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1509

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest

  # 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.unlink_dataset..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::StorageInsights::V1::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.unlink_dataset.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.unlink_dataset.retry_policy

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

  @storage_insights_stub.unlink_dataset 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

#update_dataset_config(request, options = nil) ⇒ ::Gapic::Operation #update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates a dataset configuration in a given project for a given location.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new

# Call the update_dataset_config method.
result = client.update_dataset_config 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:

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

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::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_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_dataset_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:

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

      Required. Field mask is used to specify the fields to be overwritten in the DatasetConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask then it returns an "Invalid Argument" error.

    • dataset_config (::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash) (defaults to: nil)

      Required. The resource being updated

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

      Optional. A unique identifier for your request. Specify the request ID if you need to retry the request. If you retry the request with the same ID within 60 minutes, the server ignores the request if it has already completed the original request.

      For example, if your initial request times out and you retry the request using the same request ID, the server recognizes the original request and does not process the new request.

      The request ID must be a valid UUID and cannot be a zero UUID (00000000-0000-0000-0000-000000000000).

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.



1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 1235

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest

  # 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_dataset_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::StorageInsights::V1::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_dataset_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_dataset_config.retry_policy

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

  @storage_insights_stub.update_dataset_config 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

#update_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig #update_report_config(update_mask: nil, report_config: nil, request_id: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

Updates the parameters of a single ReportConfig.

Examples:

Basic example

require "google/cloud/storage_insights/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest.new

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

# The returned object is of type Google::Cloud::StorageInsights::V1::ReportConfig.
p result

Overloads:

  • #update_report_config(request, options = nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

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

    Parameters:

    • request (::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest, ::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_report_config(update_mask: nil, report_config: nil, request_id: nil) ⇒ ::Google::Cloud::StorageInsights::V1::ReportConfig

    Pass arguments to update_report_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:

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

      Required. Field mask is used to specify the fields to be overwritten in the ReportConfig resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

    • report_config (::Google::Cloud::StorageInsights::V1::ReportConfig, ::Hash) (defaults to: nil)

      Required. The resource being updated

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

      For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

      The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# File 'lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb', line 590

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateReportConfigRequest

  # 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_report_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::StorageInsights::V1::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_report_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_report_config.retry_policy

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

  @storage_insights_stub.update_report_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