google-cloud-storage-control-v2 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,6 +73,11 @@ module Google
73
73
 
74
74
  default_config.timeout = 60.0
75
75
 
76
+ default_config.rpcs.create_folder.timeout = 60.0
77
+ default_config.rpcs.create_folder.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
79
+ }
80
+
76
81
  default_config.rpcs.get_folder.timeout = 60.0
77
82
  default_config.rpcs.get_folder.retry_policy = {
78
83
  initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
@@ -103,6 +108,41 @@ module Google
103
108
  initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
104
109
  }
105
110
 
111
+ default_config.rpcs.create_anywhere_cache.timeout = 60.0
112
+ default_config.rpcs.create_anywhere_cache.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
114
+ }
115
+
116
+ default_config.rpcs.update_anywhere_cache.timeout = 60.0
117
+ default_config.rpcs.update_anywhere_cache.retry_policy = {
118
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
119
+ }
120
+
121
+ default_config.rpcs.disable_anywhere_cache.timeout = 60.0
122
+ default_config.rpcs.disable_anywhere_cache.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
124
+ }
125
+
126
+ default_config.rpcs.pause_anywhere_cache.timeout = 60.0
127
+ default_config.rpcs.pause_anywhere_cache.retry_policy = {
128
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
129
+ }
130
+
131
+ default_config.rpcs.resume_anywhere_cache.timeout = 60.0
132
+ default_config.rpcs.resume_anywhere_cache.retry_policy = {
133
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
134
+ }
135
+
136
+ default_config.rpcs.get_anywhere_cache.timeout = 60.0
137
+ default_config.rpcs.get_anywhere_cache.retry_policy = {
138
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
139
+ }
140
+
141
+ default_config.rpcs.list_anywhere_caches.timeout = 60.0
142
+ default_config.rpcs.list_anywhere_caches.retry_policy = {
143
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
144
+ }
145
+
106
146
  default_config
107
147
  end
108
148
  yield @configure if block_given?
@@ -1262,192 +1302,882 @@ module Google
1262
1302
  end
1263
1303
 
1264
1304
  ##
1265
- # Configuration class for the StorageControl API.
1305
+ # Creates an Anywhere Cache instance.
1266
1306
  #
1267
- # This class represents the configuration for StorageControl,
1268
- # providing control over timeouts, retry behavior, logging, transport
1269
- # parameters, and other low-level controls. Certain parameters can also be
1270
- # applied individually to specific RPCs. See
1271
- # {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration::Rpcs}
1272
- # for a list of RPCs that can be configured independently.
1307
+ # @overload create_anywhere_cache(request, options = nil)
1308
+ # Pass arguments to `create_anywhere_cache` via a request object, either of type
1309
+ # {::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest} or an equivalent Hash.
1273
1310
  #
1274
- # Configuration can be applied globally to all clients, or to a single client
1275
- # on construction.
1311
+ # @param request [::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Hash]
1312
+ # A request object representing the call parameters. Required. To specify no
1313
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1314
+ # @param options [::Gapic::CallOptions, ::Hash]
1315
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1276
1316
  #
1277
- # @example
1317
+ # @overload create_anywhere_cache(parent: nil, anywhere_cache: nil, request_id: nil)
1318
+ # Pass arguments to `create_anywhere_cache` via keyword arguments. Note that at
1319
+ # least one keyword argument is required. To specify no parameters, or to keep all
1320
+ # the default parameter values, pass an empty Hash as a request object (see above).
1278
1321
  #
1279
- # # Modify the global config, setting the timeout for
1280
- # # create_folder to 20 seconds,
1281
- # # and all remaining timeouts to 10 seconds.
1282
- # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config|
1283
- # config.timeout = 10.0
1284
- # config.rpcs.create_folder.timeout = 20.0
1285
- # end
1322
+ # @param parent [::String]
1323
+ # Required. The bucket to which this cache belongs.
1324
+ # Format: `projects/{project}/buckets/{bucket}`
1325
+ # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash]
1326
+ # Required. Properties of the Anywhere Cache instance being created.
1327
+ # The parent bucket name is specified in the `parent` field. Server uses the
1328
+ # default value of `ttl` or `admission_policy` if not specified in
1329
+ # request.
1330
+ # @param request_id [::String]
1331
+ # Optional. A unique identifier for this request. UUID is the recommended
1332
+ # format, but other formats are still accepted. This request is only
1333
+ # idempotent if a `request_id` is provided.
1286
1334
  #
1287
- # # Apply the above configuration only to a new client.
1288
- # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config|
1289
- # config.timeout = 10.0
1290
- # config.rpcs.create_folder.timeout = 20.0
1291
- # end
1335
+ # @yield [response, operation] Access the result along with the RPC operation
1336
+ # @yieldparam response [::Gapic::Operation]
1337
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1292
1338
  #
1293
- # @!attribute [rw] endpoint
1294
- # A custom service endpoint, as a hostname or hostname:port. The default is
1295
- # nil, indicating to use the default endpoint in the current universe domain.
1296
- # @return [::String,nil]
1297
- # @!attribute [rw] credentials
1298
- # Credentials to send with calls. You may provide any of the following types:
1299
- # * (`String`) The path to a service account key file in JSON format
1300
- # * (`Hash`) A service account key as a Hash
1301
- # * (`Google::Auth::Credentials`) A googleauth credentials object
1302
- # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1303
- # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1304
- # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1305
- # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1306
- # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1307
- # * (`nil`) indicating no credentials
1339
+ # @return [::Gapic::Operation]
1308
1340
  #
1309
- # Warning: If you accept a credential configuration (JSON file or Hash) from an
1310
- # external source for authentication to Google Cloud, you must validate it before
1311
- # providing it to a Google API client library. Providing an unvalidated credential
1312
- # configuration to Google APIs can compromise the security of your systems and data.
1313
- # For more information, refer to [Validate credential configurations from external
1314
- # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1315
- # @return [::Object]
1316
- # @!attribute [rw] scope
1317
- # The OAuth scopes
1318
- # @return [::Array<::String>]
1319
- # @!attribute [rw] lib_name
1320
- # The library name as recorded in instrumentation and logging
1321
- # @return [::String]
1322
- # @!attribute [rw] lib_version
1323
- # The library version as recorded in instrumentation and logging
1324
- # @return [::String]
1325
- # @!attribute [rw] channel_args
1326
- # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1327
- # `GRPC::Core::Channel` object is provided as the credential.
1328
- # @return [::Hash]
1329
- # @!attribute [rw] interceptors
1330
- # An array of interceptors that are run before calls are executed.
1331
- # @return [::Array<::GRPC::ClientInterceptor>]
1332
- # @!attribute [rw] timeout
1333
- # The call timeout in seconds.
1334
- # @return [::Numeric]
1335
- # @!attribute [rw] metadata
1336
- # Additional gRPC headers to be sent with the call.
1337
- # @return [::Hash{::Symbol=>::String}]
1338
- # @!attribute [rw] retry_policy
1339
- # The retry policy. The value is a hash with the following keys:
1340
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1341
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1342
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1343
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1344
- # trigger a retry.
1345
- # @return [::Hash]
1346
- # @!attribute [rw] quota_project
1347
- # A separate project against which to charge quota.
1348
- # @return [::String]
1349
- # @!attribute [rw] universe_domain
1350
- # The universe domain within which to make requests. This determines the
1351
- # default endpoint URL. The default value of nil uses the environment
1352
- # universe (usually the default "googleapis.com" universe).
1353
- # @return [::String,nil]
1354
- # @!attribute [rw] logger
1355
- # A custom logger to use for request/response debug logging, or the value
1356
- # `:default` (the default) to construct a default logger, or `nil` to
1357
- # explicitly disable logging.
1358
- # @return [::Logger,:default,nil]
1341
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1359
1342
  #
1360
- class Configuration
1361
- extend ::Gapic::Config
1343
+ # @example Basic example
1344
+ # require "google/cloud/storage/control/v2"
1345
+ #
1346
+ # # Create a client object. The client can be reused for multiple calls.
1347
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1348
+ #
1349
+ # # Create a request. To set request fields, pass in keyword arguments.
1350
+ # request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new
1351
+ #
1352
+ # # Call the create_anywhere_cache method.
1353
+ # result = client.create_anywhere_cache request
1354
+ #
1355
+ # # The returned object is of type Gapic::Operation. You can use it to
1356
+ # # check the status of an operation, cancel it, or wait for results.
1357
+ # # Here is how to wait for a response.
1358
+ # result.wait_until_done! timeout: 60
1359
+ # if result.response?
1360
+ # p result.response
1361
+ # else
1362
+ # puts "No response received."
1363
+ # end
1364
+ #
1365
+ def create_anywhere_cache request, options = nil
1366
+ raise ::ArgumentError, "request must be provided" if request.nil?
1362
1367
 
1363
- # @private
1364
- # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1365
- DEFAULT_ENDPOINT = "storage.googleapis.com"
1368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest
1366
1369
 
1367
- config_attr :endpoint, nil, ::String, nil
1368
- config_attr :credentials, nil do |value|
1369
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1370
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1371
- allowed.any? { |klass| klass === value }
1372
- end
1373
- config_attr :scope, nil, ::String, ::Array, nil
1374
- config_attr :lib_name, nil, ::String, nil
1375
- config_attr :lib_version, nil, ::String, nil
1376
- config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1377
- config_attr :interceptors, nil, ::Array, nil
1378
- config_attr :timeout, nil, ::Numeric, nil
1379
- config_attr :metadata, nil, ::Hash, nil
1380
- config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1381
- config_attr :quota_project, nil, ::String, nil
1382
- config_attr :universe_domain, nil, ::String, nil
1383
- config_attr :logger, :default, ::Logger, nil, :default
1370
+ # Converts hash and nil to an options object
1371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1384
1372
 
1385
- # @private
1386
- def initialize parent_config = nil
1387
- @parent_config = parent_config unless parent_config.nil?
1373
+ # Customize the options with defaults
1374
+ metadata = @config.rpcs.create_anywhere_cache.metadata.to_h
1388
1375
 
1389
- yield self if block_given?
1390
- end
1376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1379
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1391
1382
 
1392
- ##
1393
- # Configurations for individual RPCs
1394
- # @return [Rpcs]
1395
- #
1396
- def rpcs
1397
- @rpcs ||= begin
1398
- parent_rpcs = nil
1399
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1400
- Rpcs.new parent_rpcs
1401
- end
1383
+ header_params = {}
1384
+ if request.parent && !request.parent.empty?
1385
+ header_params["bucket"] = request.parent
1402
1386
  end
1403
1387
 
1404
- ##
1405
- # Configuration for the channel pool
1406
- # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1407
- #
1408
- def channel_pool
1409
- @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1388
+ request_params_header = URI.encode_www_form header_params
1389
+ metadata[:"x-goog-request-params"] ||= request_params_header
1390
+
1391
+ options.apply_defaults timeout: @config.rpcs.create_anywhere_cache.timeout,
1392
+ metadata: metadata,
1393
+ retry_policy: @config.rpcs.create_anywhere_cache.retry_policy
1394
+
1395
+ options.apply_defaults timeout: @config.timeout,
1396
+ metadata: @config.metadata,
1397
+ retry_policy: @config.retry_policy
1398
+
1399
+ @storage_control_stub.call_rpc :create_anywhere_cache, request, options: options do |response, operation|
1400
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1401
+ yield response, operation if block_given?
1402
+ throw :response, response
1410
1403
  end
1404
+ rescue ::GRPC::BadStatus => e
1405
+ raise ::Google::Cloud::Error.from_error(e)
1406
+ end
1411
1407
 
1412
- ##
1413
- # Configuration RPC class for the StorageControl API.
1414
- #
1415
- # Includes fields providing the configuration for each RPC in this service.
1416
- # Each configuration object is of type `Gapic::Config::Method` and includes
1417
- # the following configuration fields:
1418
- #
1419
- # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1420
- # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1421
- # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1422
- # include the following keys:
1423
- # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1424
- # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1425
- # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1426
- # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1427
- # trigger a retry.
1428
- #
1429
- class Rpcs
1430
- ##
1431
- # RPC-specific configuration for `create_folder`
1432
- # @return [::Gapic::Config::Method]
1433
- #
1434
- attr_reader :create_folder
1435
- ##
1436
- # RPC-specific configuration for `delete_folder`
1437
- # @return [::Gapic::Config::Method]
1438
- #
1439
- attr_reader :delete_folder
1440
- ##
1441
- # RPC-specific configuration for `get_folder`
1442
- # @return [::Gapic::Config::Method]
1443
- #
1444
- attr_reader :get_folder
1445
- ##
1446
- # RPC-specific configuration for `list_folders`
1447
- # @return [::Gapic::Config::Method]
1448
- #
1449
- attr_reader :list_folders
1450
- ##
1408
+ ##
1409
+ # Updates an Anywhere Cache instance. Mutable fields include `ttl` and
1410
+ # `admission_policy`.
1411
+ #
1412
+ # @overload update_anywhere_cache(request, options = nil)
1413
+ # Pass arguments to `update_anywhere_cache` via a request object, either of type
1414
+ # {::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest} or an equivalent Hash.
1415
+ #
1416
+ # @param request [::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Hash]
1417
+ # A request object representing the call parameters. Required. To specify no
1418
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1419
+ # @param options [::Gapic::CallOptions, ::Hash]
1420
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1421
+ #
1422
+ # @overload update_anywhere_cache(anywhere_cache: nil, update_mask: nil, request_id: nil)
1423
+ # Pass arguments to `update_anywhere_cache` via keyword arguments. Note that at
1424
+ # least one keyword argument is required. To specify no parameters, or to keep all
1425
+ # the default parameter values, pass an empty Hash as a request object (see above).
1426
+ #
1427
+ # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash]
1428
+ # Required. The Anywhere Cache instance to be updated.
1429
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1430
+ # Required. List of fields to be updated. Mutable fields of AnywhereCache
1431
+ # include `ttl` and `admission_policy`.
1432
+ #
1433
+ # To specify ALL fields, specify a single field with the value `*`. Note: We
1434
+ # recommend against doing this. If a new field is introduced at a later time,
1435
+ # an older client updating with the `*` may accidentally reset the new
1436
+ # field's value.
1437
+ #
1438
+ # Not specifying any fields is an error.
1439
+ # @param request_id [::String]
1440
+ # Optional. A unique identifier for this request. UUID is the recommended
1441
+ # format, but other formats are still accepted. This request is only
1442
+ # idempotent if a `request_id` is provided.
1443
+ #
1444
+ # @yield [response, operation] Access the result along with the RPC operation
1445
+ # @yieldparam response [::Gapic::Operation]
1446
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1447
+ #
1448
+ # @return [::Gapic::Operation]
1449
+ #
1450
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1451
+ #
1452
+ # @example Basic example
1453
+ # require "google/cloud/storage/control/v2"
1454
+ #
1455
+ # # Create a client object. The client can be reused for multiple calls.
1456
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1457
+ #
1458
+ # # Create a request. To set request fields, pass in keyword arguments.
1459
+ # request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new
1460
+ #
1461
+ # # Call the update_anywhere_cache method.
1462
+ # result = client.update_anywhere_cache request
1463
+ #
1464
+ # # The returned object is of type Gapic::Operation. You can use it to
1465
+ # # check the status of an operation, cancel it, or wait for results.
1466
+ # # Here is how to wait for a response.
1467
+ # result.wait_until_done! timeout: 60
1468
+ # if result.response?
1469
+ # p result.response
1470
+ # else
1471
+ # puts "No response received."
1472
+ # end
1473
+ #
1474
+ def update_anywhere_cache request, options = nil
1475
+ raise ::ArgumentError, "request must be provided" if request.nil?
1476
+
1477
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest
1478
+
1479
+ # Converts hash and nil to an options object
1480
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1481
+
1482
+ # Customize the options with defaults
1483
+ metadata = @config.rpcs.update_anywhere_cache.metadata.to_h
1484
+
1485
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1486
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1487
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1488
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1489
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1490
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1491
+
1492
+ header_params = {}
1493
+ if request.anywhere_cache&.name
1494
+ regex_match = %r{^(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.anywhere_cache.name
1495
+ if regex_match
1496
+ header_params["bucket"] = regex_match["bucket".to_s]
1497
+ end
1498
+ end
1499
+
1500
+ request_params_header = URI.encode_www_form header_params
1501
+ metadata[:"x-goog-request-params"] ||= request_params_header
1502
+
1503
+ options.apply_defaults timeout: @config.rpcs.update_anywhere_cache.timeout,
1504
+ metadata: metadata,
1505
+ retry_policy: @config.rpcs.update_anywhere_cache.retry_policy
1506
+
1507
+ options.apply_defaults timeout: @config.timeout,
1508
+ metadata: @config.metadata,
1509
+ retry_policy: @config.retry_policy
1510
+
1511
+ @storage_control_stub.call_rpc :update_anywhere_cache, request, options: options do |response, operation|
1512
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1513
+ yield response, operation if block_given?
1514
+ throw :response, response
1515
+ end
1516
+ rescue ::GRPC::BadStatus => e
1517
+ raise ::Google::Cloud::Error.from_error(e)
1518
+ end
1519
+
1520
+ ##
1521
+ # Disables an Anywhere Cache instance. A disabled instance is read-only. The
1522
+ # disablement could be revoked by calling ResumeAnywhereCache. The cache
1523
+ # instance will be deleted automatically if it remains in the disabled state
1524
+ # for at least one hour.
1525
+ #
1526
+ # @overload disable_anywhere_cache(request, options = nil)
1527
+ # Pass arguments to `disable_anywhere_cache` via a request object, either of type
1528
+ # {::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest} or an equivalent Hash.
1529
+ #
1530
+ # @param request [::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Hash]
1531
+ # A request object representing the call parameters. Required. To specify no
1532
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1533
+ # @param options [::Gapic::CallOptions, ::Hash]
1534
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1535
+ #
1536
+ # @overload disable_anywhere_cache(name: nil, request_id: nil)
1537
+ # Pass arguments to `disable_anywhere_cache` via keyword arguments. Note that at
1538
+ # least one keyword argument is required. To specify no parameters, or to keep all
1539
+ # the default parameter values, pass an empty Hash as a request object (see above).
1540
+ #
1541
+ # @param name [::String]
1542
+ # Required. The name field in the request should be:
1543
+ # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
1544
+ # @param request_id [::String]
1545
+ # Optional. A unique identifier for this request. UUID is the recommended
1546
+ # format, but other formats are still accepted. This request is only
1547
+ # idempotent if a `request_id` is provided.
1548
+ #
1549
+ # @yield [response, operation] Access the result along with the RPC operation
1550
+ # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1551
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1552
+ #
1553
+ # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1554
+ #
1555
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1556
+ #
1557
+ # @example Basic example
1558
+ # require "google/cloud/storage/control/v2"
1559
+ #
1560
+ # # Create a client object. The client can be reused for multiple calls.
1561
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1562
+ #
1563
+ # # Create a request. To set request fields, pass in keyword arguments.
1564
+ # request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new
1565
+ #
1566
+ # # Call the disable_anywhere_cache method.
1567
+ # result = client.disable_anywhere_cache request
1568
+ #
1569
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache.
1570
+ # p result
1571
+ #
1572
+ def disable_anywhere_cache request, options = nil
1573
+ raise ::ArgumentError, "request must be provided" if request.nil?
1574
+
1575
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest
1576
+
1577
+ # Converts hash and nil to an options object
1578
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1579
+
1580
+ # Customize the options with defaults
1581
+ metadata = @config.rpcs.disable_anywhere_cache.metadata.to_h
1582
+
1583
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1584
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1585
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1586
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1587
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1588
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1589
+
1590
+ header_params = {}
1591
+ if request.name
1592
+ regex_match = %r{^(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name
1593
+ if regex_match
1594
+ header_params["bucket"] = regex_match["bucket".to_s]
1595
+ end
1596
+ end
1597
+
1598
+ request_params_header = URI.encode_www_form header_params
1599
+ metadata[:"x-goog-request-params"] ||= request_params_header
1600
+
1601
+ options.apply_defaults timeout: @config.rpcs.disable_anywhere_cache.timeout,
1602
+ metadata: metadata,
1603
+ retry_policy: @config.rpcs.disable_anywhere_cache.retry_policy
1604
+
1605
+ options.apply_defaults timeout: @config.timeout,
1606
+ metadata: @config.metadata,
1607
+ retry_policy: @config.retry_policy
1608
+
1609
+ @storage_control_stub.call_rpc :disable_anywhere_cache, request, options: options do |response, operation|
1610
+ yield response, operation if block_given?
1611
+ end
1612
+ rescue ::GRPC::BadStatus => e
1613
+ raise ::Google::Cloud::Error.from_error(e)
1614
+ end
1615
+
1616
+ ##
1617
+ # Pauses an Anywhere Cache instance.
1618
+ #
1619
+ # @overload pause_anywhere_cache(request, options = nil)
1620
+ # Pass arguments to `pause_anywhere_cache` via a request object, either of type
1621
+ # {::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest} or an equivalent Hash.
1622
+ #
1623
+ # @param request [::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Hash]
1624
+ # A request object representing the call parameters. Required. To specify no
1625
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1626
+ # @param options [::Gapic::CallOptions, ::Hash]
1627
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1628
+ #
1629
+ # @overload pause_anywhere_cache(name: nil, request_id: nil)
1630
+ # Pass arguments to `pause_anywhere_cache` via keyword arguments. Note that at
1631
+ # least one keyword argument is required. To specify no parameters, or to keep all
1632
+ # the default parameter values, pass an empty Hash as a request object (see above).
1633
+ #
1634
+ # @param name [::String]
1635
+ # Required. The name field in the request should be:
1636
+ # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
1637
+ # @param request_id [::String]
1638
+ # Optional. A unique identifier for this request. UUID is the recommended
1639
+ # format, but other formats are still accepted. This request is only
1640
+ # idempotent if a `request_id` is provided.
1641
+ #
1642
+ # @yield [response, operation] Access the result along with the RPC operation
1643
+ # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1644
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1645
+ #
1646
+ # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1647
+ #
1648
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1649
+ #
1650
+ # @example Basic example
1651
+ # require "google/cloud/storage/control/v2"
1652
+ #
1653
+ # # Create a client object. The client can be reused for multiple calls.
1654
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1655
+ #
1656
+ # # Create a request. To set request fields, pass in keyword arguments.
1657
+ # request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new
1658
+ #
1659
+ # # Call the pause_anywhere_cache method.
1660
+ # result = client.pause_anywhere_cache request
1661
+ #
1662
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache.
1663
+ # p result
1664
+ #
1665
+ def pause_anywhere_cache request, options = nil
1666
+ raise ::ArgumentError, "request must be provided" if request.nil?
1667
+
1668
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest
1669
+
1670
+ # Converts hash and nil to an options object
1671
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1672
+
1673
+ # Customize the options with defaults
1674
+ metadata = @config.rpcs.pause_anywhere_cache.metadata.to_h
1675
+
1676
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1677
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1678
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1679
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1680
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1681
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1682
+
1683
+ header_params = {}
1684
+ if request.name
1685
+ regex_match = %r{^(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name
1686
+ if regex_match
1687
+ header_params["bucket"] = regex_match["bucket".to_s]
1688
+ end
1689
+ end
1690
+
1691
+ request_params_header = URI.encode_www_form header_params
1692
+ metadata[:"x-goog-request-params"] ||= request_params_header
1693
+
1694
+ options.apply_defaults timeout: @config.rpcs.pause_anywhere_cache.timeout,
1695
+ metadata: metadata,
1696
+ retry_policy: @config.rpcs.pause_anywhere_cache.retry_policy
1697
+
1698
+ options.apply_defaults timeout: @config.timeout,
1699
+ metadata: @config.metadata,
1700
+ retry_policy: @config.retry_policy
1701
+
1702
+ @storage_control_stub.call_rpc :pause_anywhere_cache, request, options: options do |response, operation|
1703
+ yield response, operation if block_given?
1704
+ end
1705
+ rescue ::GRPC::BadStatus => e
1706
+ raise ::Google::Cloud::Error.from_error(e)
1707
+ end
1708
+
1709
+ ##
1710
+ # Resumes a disabled or paused Anywhere Cache instance.
1711
+ #
1712
+ # @overload resume_anywhere_cache(request, options = nil)
1713
+ # Pass arguments to `resume_anywhere_cache` via a request object, either of type
1714
+ # {::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest} or an equivalent Hash.
1715
+ #
1716
+ # @param request [::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Hash]
1717
+ # A request object representing the call parameters. Required. To specify no
1718
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1719
+ # @param options [::Gapic::CallOptions, ::Hash]
1720
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1721
+ #
1722
+ # @overload resume_anywhere_cache(name: nil, request_id: nil)
1723
+ # Pass arguments to `resume_anywhere_cache` via keyword arguments. Note that at
1724
+ # least one keyword argument is required. To specify no parameters, or to keep all
1725
+ # the default parameter values, pass an empty Hash as a request object (see above).
1726
+ #
1727
+ # @param name [::String]
1728
+ # Required. The name field in the request should be:
1729
+ # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
1730
+ # @param request_id [::String]
1731
+ # Optional. A unique identifier for this request. UUID is the recommended
1732
+ # format, but other formats are still accepted. This request is only
1733
+ # idempotent if a `request_id` is provided.
1734
+ #
1735
+ # @yield [response, operation] Access the result along with the RPC operation
1736
+ # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1737
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1738
+ #
1739
+ # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1740
+ #
1741
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1742
+ #
1743
+ # @example Basic example
1744
+ # require "google/cloud/storage/control/v2"
1745
+ #
1746
+ # # Create a client object. The client can be reused for multiple calls.
1747
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1748
+ #
1749
+ # # Create a request. To set request fields, pass in keyword arguments.
1750
+ # request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new
1751
+ #
1752
+ # # Call the resume_anywhere_cache method.
1753
+ # result = client.resume_anywhere_cache request
1754
+ #
1755
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache.
1756
+ # p result
1757
+ #
1758
+ def resume_anywhere_cache request, options = nil
1759
+ raise ::ArgumentError, "request must be provided" if request.nil?
1760
+
1761
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest
1762
+
1763
+ # Converts hash and nil to an options object
1764
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1765
+
1766
+ # Customize the options with defaults
1767
+ metadata = @config.rpcs.resume_anywhere_cache.metadata.to_h
1768
+
1769
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1770
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1771
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1772
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1773
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1774
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1775
+
1776
+ header_params = {}
1777
+ if request.name
1778
+ regex_match = %r{^(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name
1779
+ if regex_match
1780
+ header_params["bucket"] = regex_match["bucket".to_s]
1781
+ end
1782
+ end
1783
+
1784
+ request_params_header = URI.encode_www_form header_params
1785
+ metadata[:"x-goog-request-params"] ||= request_params_header
1786
+
1787
+ options.apply_defaults timeout: @config.rpcs.resume_anywhere_cache.timeout,
1788
+ metadata: metadata,
1789
+ retry_policy: @config.rpcs.resume_anywhere_cache.retry_policy
1790
+
1791
+ options.apply_defaults timeout: @config.timeout,
1792
+ metadata: @config.metadata,
1793
+ retry_policy: @config.retry_policy
1794
+
1795
+ @storage_control_stub.call_rpc :resume_anywhere_cache, request, options: options do |response, operation|
1796
+ yield response, operation if block_given?
1797
+ end
1798
+ rescue ::GRPC::BadStatus => e
1799
+ raise ::Google::Cloud::Error.from_error(e)
1800
+ end
1801
+
1802
+ ##
1803
+ # Gets an Anywhere Cache instance.
1804
+ #
1805
+ # @overload get_anywhere_cache(request, options = nil)
1806
+ # Pass arguments to `get_anywhere_cache` via a request object, either of type
1807
+ # {::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest} or an equivalent Hash.
1808
+ #
1809
+ # @param request [::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Hash]
1810
+ # A request object representing the call parameters. Required. To specify no
1811
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1812
+ # @param options [::Gapic::CallOptions, ::Hash]
1813
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1814
+ #
1815
+ # @overload get_anywhere_cache(name: nil, request_id: nil)
1816
+ # Pass arguments to `get_anywhere_cache` via keyword arguments. Note that at
1817
+ # least one keyword argument is required. To specify no parameters, or to keep all
1818
+ # the default parameter values, pass an empty Hash as a request object (see above).
1819
+ #
1820
+ # @param name [::String]
1821
+ # Required. The name field in the request should be:
1822
+ # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
1823
+ # @param request_id [::String]
1824
+ # Optional. A unique identifier for this request. UUID is the recommended
1825
+ # format, but other formats are still accepted.
1826
+ #
1827
+ # @yield [response, operation] Access the result along with the RPC operation
1828
+ # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1829
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1830
+ #
1831
+ # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache]
1832
+ #
1833
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1834
+ #
1835
+ # @example Basic example
1836
+ # require "google/cloud/storage/control/v2"
1837
+ #
1838
+ # # Create a client object. The client can be reused for multiple calls.
1839
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1840
+ #
1841
+ # # Create a request. To set request fields, pass in keyword arguments.
1842
+ # request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new
1843
+ #
1844
+ # # Call the get_anywhere_cache method.
1845
+ # result = client.get_anywhere_cache request
1846
+ #
1847
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache.
1848
+ # p result
1849
+ #
1850
+ def get_anywhere_cache request, options = nil
1851
+ raise ::ArgumentError, "request must be provided" if request.nil?
1852
+
1853
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest
1854
+
1855
+ # Converts hash and nil to an options object
1856
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1857
+
1858
+ # Customize the options with defaults
1859
+ metadata = @config.rpcs.get_anywhere_cache.metadata.to_h
1860
+
1861
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1862
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1863
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1864
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1865
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1866
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1867
+
1868
+ header_params = {}
1869
+ if request.name
1870
+ regex_match = %r{^(?<bucket>projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name
1871
+ if regex_match
1872
+ header_params["bucket"] = regex_match["bucket".to_s]
1873
+ end
1874
+ end
1875
+
1876
+ request_params_header = URI.encode_www_form header_params
1877
+ metadata[:"x-goog-request-params"] ||= request_params_header
1878
+
1879
+ options.apply_defaults timeout: @config.rpcs.get_anywhere_cache.timeout,
1880
+ metadata: metadata,
1881
+ retry_policy: @config.rpcs.get_anywhere_cache.retry_policy
1882
+
1883
+ options.apply_defaults timeout: @config.timeout,
1884
+ metadata: @config.metadata,
1885
+ retry_policy: @config.retry_policy
1886
+
1887
+ @storage_control_stub.call_rpc :get_anywhere_cache, request, options: options do |response, operation|
1888
+ yield response, operation if block_given?
1889
+ end
1890
+ rescue ::GRPC::BadStatus => e
1891
+ raise ::Google::Cloud::Error.from_error(e)
1892
+ end
1893
+
1894
+ ##
1895
+ # Lists Anywhere Cache instances for a given bucket.
1896
+ #
1897
+ # @overload list_anywhere_caches(request, options = nil)
1898
+ # Pass arguments to `list_anywhere_caches` via a request object, either of type
1899
+ # {::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest} or an equivalent Hash.
1900
+ #
1901
+ # @param request [::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Hash]
1902
+ # A request object representing the call parameters. Required. To specify no
1903
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1904
+ # @param options [::Gapic::CallOptions, ::Hash]
1905
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1906
+ #
1907
+ # @overload list_anywhere_caches(parent: nil, page_size: nil, page_token: nil, request_id: nil)
1908
+ # Pass arguments to `list_anywhere_caches` via keyword arguments. Note that at
1909
+ # least one keyword argument is required. To specify no parameters, or to keep all
1910
+ # the default parameter values, pass an empty Hash as a request object (see above).
1911
+ #
1912
+ # @param parent [::String]
1913
+ # Required. The bucket to which this cache belongs.
1914
+ # @param page_size [::Integer]
1915
+ # Maximum number of caches to return in a single response.
1916
+ # The service will use this parameter or 1,000 items, whichever is smaller.
1917
+ # @param page_token [::String]
1918
+ # A previously-returned page token representing part of the larger set of
1919
+ # results to view.
1920
+ # @param request_id [::String]
1921
+ # Optional. A unique identifier for this request. UUID is the recommended
1922
+ # format, but other formats are still accepted.
1923
+ #
1924
+ # @yield [response, operation] Access the result along with the RPC operation
1925
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>]
1926
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1927
+ #
1928
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>]
1929
+ #
1930
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1931
+ #
1932
+ # @example Basic example
1933
+ # require "google/cloud/storage/control/v2"
1934
+ #
1935
+ # # Create a client object. The client can be reused for multiple calls.
1936
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new
1937
+ #
1938
+ # # Create a request. To set request fields, pass in keyword arguments.
1939
+ # request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new
1940
+ #
1941
+ # # Call the list_anywhere_caches method.
1942
+ # result = client.list_anywhere_caches request
1943
+ #
1944
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1945
+ # # over elements, and API calls will be issued to fetch pages as needed.
1946
+ # result.each do |item|
1947
+ # # Each element is of type ::Google::Cloud::Storage::Control::V2::AnywhereCache.
1948
+ # p item
1949
+ # end
1950
+ #
1951
+ def list_anywhere_caches request, options = nil
1952
+ raise ::ArgumentError, "request must be provided" if request.nil?
1953
+
1954
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest
1955
+
1956
+ # Converts hash and nil to an options object
1957
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1958
+
1959
+ # Customize the options with defaults
1960
+ metadata = @config.rpcs.list_anywhere_caches.metadata.to_h
1961
+
1962
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1963
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1964
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1965
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION
1966
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1967
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1968
+
1969
+ header_params = {}
1970
+ if request.parent && !request.parent.empty?
1971
+ header_params["bucket"] = request.parent
1972
+ end
1973
+
1974
+ request_params_header = URI.encode_www_form header_params
1975
+ metadata[:"x-goog-request-params"] ||= request_params_header
1976
+
1977
+ options.apply_defaults timeout: @config.rpcs.list_anywhere_caches.timeout,
1978
+ metadata: metadata,
1979
+ retry_policy: @config.rpcs.list_anywhere_caches.retry_policy
1980
+
1981
+ options.apply_defaults timeout: @config.timeout,
1982
+ metadata: @config.metadata,
1983
+ retry_policy: @config.retry_policy
1984
+
1985
+ @storage_control_stub.call_rpc :list_anywhere_caches, request, options: options do |response, operation|
1986
+ response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_anywhere_caches, request, response, operation, options
1987
+ yield response, operation if block_given?
1988
+ throw :response, response
1989
+ end
1990
+ rescue ::GRPC::BadStatus => e
1991
+ raise ::Google::Cloud::Error.from_error(e)
1992
+ end
1993
+
1994
+ ##
1995
+ # Configuration class for the StorageControl API.
1996
+ #
1997
+ # This class represents the configuration for StorageControl,
1998
+ # providing control over timeouts, retry behavior, logging, transport
1999
+ # parameters, and other low-level controls. Certain parameters can also be
2000
+ # applied individually to specific RPCs. See
2001
+ # {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration::Rpcs}
2002
+ # for a list of RPCs that can be configured independently.
2003
+ #
2004
+ # Configuration can be applied globally to all clients, or to a single client
2005
+ # on construction.
2006
+ #
2007
+ # @example
2008
+ #
2009
+ # # Modify the global config, setting the timeout for
2010
+ # # create_folder to 20 seconds,
2011
+ # # and all remaining timeouts to 10 seconds.
2012
+ # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config|
2013
+ # config.timeout = 10.0
2014
+ # config.rpcs.create_folder.timeout = 20.0
2015
+ # end
2016
+ #
2017
+ # # Apply the above configuration only to a new client.
2018
+ # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config|
2019
+ # config.timeout = 10.0
2020
+ # config.rpcs.create_folder.timeout = 20.0
2021
+ # end
2022
+ #
2023
+ # @!attribute [rw] endpoint
2024
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2025
+ # nil, indicating to use the default endpoint in the current universe domain.
2026
+ # @return [::String,nil]
2027
+ # @!attribute [rw] credentials
2028
+ # Credentials to send with calls. You may provide any of the following types:
2029
+ # * (`String`) The path to a service account key file in JSON format
2030
+ # * (`Hash`) A service account key as a Hash
2031
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2032
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2033
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2034
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2035
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2036
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2037
+ # * (`nil`) indicating no credentials
2038
+ #
2039
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
2040
+ # external source for authentication to Google Cloud, you must validate it before
2041
+ # providing it to a Google API client library. Providing an unvalidated credential
2042
+ # configuration to Google APIs can compromise the security of your systems and data.
2043
+ # For more information, refer to [Validate credential configurations from external
2044
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
2045
+ # @return [::Object]
2046
+ # @!attribute [rw] scope
2047
+ # The OAuth scopes
2048
+ # @return [::Array<::String>]
2049
+ # @!attribute [rw] lib_name
2050
+ # The library name as recorded in instrumentation and logging
2051
+ # @return [::String]
2052
+ # @!attribute [rw] lib_version
2053
+ # The library version as recorded in instrumentation and logging
2054
+ # @return [::String]
2055
+ # @!attribute [rw] channel_args
2056
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
2057
+ # `GRPC::Core::Channel` object is provided as the credential.
2058
+ # @return [::Hash]
2059
+ # @!attribute [rw] interceptors
2060
+ # An array of interceptors that are run before calls are executed.
2061
+ # @return [::Array<::GRPC::ClientInterceptor>]
2062
+ # @!attribute [rw] timeout
2063
+ # The call timeout in seconds.
2064
+ # @return [::Numeric]
2065
+ # @!attribute [rw] metadata
2066
+ # Additional gRPC headers to be sent with the call.
2067
+ # @return [::Hash{::Symbol=>::String}]
2068
+ # @!attribute [rw] retry_policy
2069
+ # The retry policy. The value is a hash with the following keys:
2070
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2071
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2072
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2073
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2074
+ # trigger a retry.
2075
+ # @return [::Hash]
2076
+ # @!attribute [rw] quota_project
2077
+ # A separate project against which to charge quota.
2078
+ # @return [::String]
2079
+ # @!attribute [rw] universe_domain
2080
+ # The universe domain within which to make requests. This determines the
2081
+ # default endpoint URL. The default value of nil uses the environment
2082
+ # universe (usually the default "googleapis.com" universe).
2083
+ # @return [::String,nil]
2084
+ # @!attribute [rw] logger
2085
+ # A custom logger to use for request/response debug logging, or the value
2086
+ # `:default` (the default) to construct a default logger, or `nil` to
2087
+ # explicitly disable logging.
2088
+ # @return [::Logger,:default,nil]
2089
+ #
2090
+ class Configuration
2091
+ extend ::Gapic::Config
2092
+
2093
+ # @private
2094
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2095
+ DEFAULT_ENDPOINT = "storage.googleapis.com"
2096
+
2097
+ config_attr :endpoint, nil, ::String, nil
2098
+ config_attr :credentials, nil do |value|
2099
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
2100
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
2101
+ allowed.any? { |klass| klass === value }
2102
+ end
2103
+ config_attr :scope, nil, ::String, ::Array, nil
2104
+ config_attr :lib_name, nil, ::String, nil
2105
+ config_attr :lib_version, nil, ::String, nil
2106
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
2107
+ config_attr :interceptors, nil, ::Array, nil
2108
+ config_attr :timeout, nil, ::Numeric, nil
2109
+ config_attr :metadata, nil, ::Hash, nil
2110
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2111
+ config_attr :quota_project, nil, ::String, nil
2112
+ config_attr :universe_domain, nil, ::String, nil
2113
+ config_attr :logger, :default, ::Logger, nil, :default
2114
+
2115
+ # @private
2116
+ def initialize parent_config = nil
2117
+ @parent_config = parent_config unless parent_config.nil?
2118
+
2119
+ yield self if block_given?
2120
+ end
2121
+
2122
+ ##
2123
+ # Configurations for individual RPCs
2124
+ # @return [Rpcs]
2125
+ #
2126
+ def rpcs
2127
+ @rpcs ||= begin
2128
+ parent_rpcs = nil
2129
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2130
+ Rpcs.new parent_rpcs
2131
+ end
2132
+ end
2133
+
2134
+ ##
2135
+ # Configuration for the channel pool
2136
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
2137
+ #
2138
+ def channel_pool
2139
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
2140
+ end
2141
+
2142
+ ##
2143
+ # Configuration RPC class for the StorageControl API.
2144
+ #
2145
+ # Includes fields providing the configuration for each RPC in this service.
2146
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2147
+ # the following configuration fields:
2148
+ #
2149
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2150
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
2151
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2152
+ # include the following keys:
2153
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2154
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2155
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2156
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2157
+ # trigger a retry.
2158
+ #
2159
+ class Rpcs
2160
+ ##
2161
+ # RPC-specific configuration for `create_folder`
2162
+ # @return [::Gapic::Config::Method]
2163
+ #
2164
+ attr_reader :create_folder
2165
+ ##
2166
+ # RPC-specific configuration for `delete_folder`
2167
+ # @return [::Gapic::Config::Method]
2168
+ #
2169
+ attr_reader :delete_folder
2170
+ ##
2171
+ # RPC-specific configuration for `get_folder`
2172
+ # @return [::Gapic::Config::Method]
2173
+ #
2174
+ attr_reader :get_folder
2175
+ ##
2176
+ # RPC-specific configuration for `list_folders`
2177
+ # @return [::Gapic::Config::Method]
2178
+ #
2179
+ attr_reader :list_folders
2180
+ ##
1451
2181
  # RPC-specific configuration for `rename_folder`
1452
2182
  # @return [::Gapic::Config::Method]
1453
2183
  #
@@ -1477,6 +2207,41 @@ module Google
1477
2207
  # @return [::Gapic::Config::Method]
1478
2208
  #
1479
2209
  attr_reader :list_managed_folders
2210
+ ##
2211
+ # RPC-specific configuration for `create_anywhere_cache`
2212
+ # @return [::Gapic::Config::Method]
2213
+ #
2214
+ attr_reader :create_anywhere_cache
2215
+ ##
2216
+ # RPC-specific configuration for `update_anywhere_cache`
2217
+ # @return [::Gapic::Config::Method]
2218
+ #
2219
+ attr_reader :update_anywhere_cache
2220
+ ##
2221
+ # RPC-specific configuration for `disable_anywhere_cache`
2222
+ # @return [::Gapic::Config::Method]
2223
+ #
2224
+ attr_reader :disable_anywhere_cache
2225
+ ##
2226
+ # RPC-specific configuration for `pause_anywhere_cache`
2227
+ # @return [::Gapic::Config::Method]
2228
+ #
2229
+ attr_reader :pause_anywhere_cache
2230
+ ##
2231
+ # RPC-specific configuration for `resume_anywhere_cache`
2232
+ # @return [::Gapic::Config::Method]
2233
+ #
2234
+ attr_reader :resume_anywhere_cache
2235
+ ##
2236
+ # RPC-specific configuration for `get_anywhere_cache`
2237
+ # @return [::Gapic::Config::Method]
2238
+ #
2239
+ attr_reader :get_anywhere_cache
2240
+ ##
2241
+ # RPC-specific configuration for `list_anywhere_caches`
2242
+ # @return [::Gapic::Config::Method]
2243
+ #
2244
+ attr_reader :list_anywhere_caches
1480
2245
 
1481
2246
  # @private
1482
2247
  def initialize parent_rpcs = nil
@@ -1500,6 +2265,20 @@ module Google
1500
2265
  @get_managed_folder = ::Gapic::Config::Method.new get_managed_folder_config
1501
2266
  list_managed_folders_config = parent_rpcs.list_managed_folders if parent_rpcs.respond_to? :list_managed_folders
1502
2267
  @list_managed_folders = ::Gapic::Config::Method.new list_managed_folders_config
2268
+ create_anywhere_cache_config = parent_rpcs.create_anywhere_cache if parent_rpcs.respond_to? :create_anywhere_cache
2269
+ @create_anywhere_cache = ::Gapic::Config::Method.new create_anywhere_cache_config
2270
+ update_anywhere_cache_config = parent_rpcs.update_anywhere_cache if parent_rpcs.respond_to? :update_anywhere_cache
2271
+ @update_anywhere_cache = ::Gapic::Config::Method.new update_anywhere_cache_config
2272
+ disable_anywhere_cache_config = parent_rpcs.disable_anywhere_cache if parent_rpcs.respond_to? :disable_anywhere_cache
2273
+ @disable_anywhere_cache = ::Gapic::Config::Method.new disable_anywhere_cache_config
2274
+ pause_anywhere_cache_config = parent_rpcs.pause_anywhere_cache if parent_rpcs.respond_to? :pause_anywhere_cache
2275
+ @pause_anywhere_cache = ::Gapic::Config::Method.new pause_anywhere_cache_config
2276
+ resume_anywhere_cache_config = parent_rpcs.resume_anywhere_cache if parent_rpcs.respond_to? :resume_anywhere_cache
2277
+ @resume_anywhere_cache = ::Gapic::Config::Method.new resume_anywhere_cache_config
2278
+ get_anywhere_cache_config = parent_rpcs.get_anywhere_cache if parent_rpcs.respond_to? :get_anywhere_cache
2279
+ @get_anywhere_cache = ::Gapic::Config::Method.new get_anywhere_cache_config
2280
+ list_anywhere_caches_config = parent_rpcs.list_anywhere_caches if parent_rpcs.respond_to? :list_anywhere_caches
2281
+ @list_anywhere_caches = ::Gapic::Config::Method.new list_anywhere_caches_config
1503
2282
 
1504
2283
  yield self if block_given?
1505
2284
  end