google-cloud-asset-v1 0.2.2 → 0.4.2

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +6 -6
  3. data/README.md +1 -1
  4. data/lib/google/cloud/asset/v1.rb +1 -1
  5. data/lib/google/cloud/asset/v1/asset_service.rb +1 -1
  6. data/lib/google/cloud/asset/v1/asset_service/client.rb +449 -170
  7. data/lib/google/cloud/asset/v1/asset_service/credentials.rb +1 -1
  8. data/lib/google/cloud/asset/v1/asset_service/operations.rb +108 -102
  9. data/lib/google/cloud/asset/v1/asset_service/paths.rb +5 -5
  10. data/lib/google/cloud/asset/v1/asset_service_pb.rb +26 -0
  11. data/lib/google/cloud/asset/v1/asset_service_services_pb.rb +13 -2
  12. data/lib/google/cloud/asset/v1/assets_pb.rb +29 -1
  13. data/lib/google/cloud/asset/v1/version.rb +1 -1
  14. data/proto_docs/google/api/resource.rb +12 -12
  15. data/proto_docs/google/cloud/asset/v1/asset_service.rb +235 -74
  16. data/proto_docs/google/cloud/asset/v1/assets.rb +225 -36
  17. data/proto_docs/google/cloud/orgpolicy/v1/orgpolicy.rb +21 -21
  18. data/proto_docs/google/iam/v1/policy.rb +26 -26
  19. data/proto_docs/google/identity/accesscontextmanager/v1/access_level.rb +37 -37
  20. data/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb +8 -8
  21. data/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb +21 -21
  22. data/proto_docs/google/longrunning/operations.rb +30 -30
  23. data/proto_docs/google/protobuf/any.rb +4 -4
  24. data/proto_docs/google/protobuf/empty.rb +2 -2
  25. data/proto_docs/google/protobuf/field_mask.rb +3 -3
  26. data/proto_docs/google/protobuf/struct.rb +18 -18
  27. data/proto_docs/google/protobuf/timestamp.rb +4 -4
  28. data/proto_docs/google/rpc/status.rb +6 -6
  29. data/proto_docs/google/type/expr.rb +6 -6
  30. metadata +32 -5
  31. data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c2278758d36757611d0a833458788bc61fd46807be38c663ff7f152d2f7041a
4
- data.tar.gz: b9a657ef1abd9fdab0e77a3d882a288eb8938a546d5850b0007008f84d59f3a3
3
+ metadata.gz: d2dae0a0f584cc4a8e5b3796112c2b5e3c185d30cad1c5ec242fc6109a387bb5
4
+ data.tar.gz: 12a332498c801aa4dcb030a449d78ea6d62fc106e96ddc60aab622b9a990b736
5
5
  SHA512:
6
- metadata.gz: 5aa70ed50058396f5d94c1779eeb4ccd2eabca4bae4088641e5c30f0e6d5788d9cfcea904003148d16ec885c94f7a4aba0db68525d942d5da1f7723a9a7011d6
7
- data.tar.gz: 29f0f6afbede29419b51bea5b821eede1f2334102067172caf74d75c4e40753f1af6f0d8389b7fd93198facf1952d712d237a3a33765e275a5c580d0ca123704
6
+ metadata.gz: 1e5a027c31ffc3fc2bdcecec5c7e2e0b9c5e9e17ade508e5156101a1a8836e62af572ae7ff87158c17716aa9f8df583c63c8284be096066fb04d4654299c4d72
7
+ data.tar.gz: e010d1a622102885d23307c8007b8ed8ff7a95a6bbdee291a744295ed88a5b08d42d47f8a327d397283be4b6bdeea77bc8f5a95bfd0b3ceb3a6ab082839b21e4
@@ -27,7 +27,7 @@ export ASSET_CREDENTIALS=path/to/keyfile.json
27
27
  ```ruby
28
28
  require "google/cloud/asset/v1"
29
29
 
30
- client = Google::Cloud::Asset::V1::AssetService::Client.new
30
+ client = ::Google::Cloud::Asset::V1::AssetService::Client.new
31
31
  ```
32
32
 
33
33
  ## Credential Lookup
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
64
64
 
65
65
  The environment variables that google-cloud-asset-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
- {Google::Cloud::Asset::V1::AssetService::Credentials}):
67
+ {::Google::Cloud::Asset::V1::AssetService::Credentials}):
68
68
 
69
69
  1. `ASSET_CREDENTIALS` - Path to JSON file, or JSON contents
70
70
  2. `ASSET_KEYFILE` - Path to JSON file, or JSON contents
@@ -77,7 +77,7 @@ require "google/cloud/asset/v1"
77
77
 
78
78
  ENV["ASSET_CREDENTIALS"] = "path/to/keyfile.json"
79
79
 
80
- client = Google::Cloud::Asset::V1::AssetService::Client.new
80
+ client = ::Google::Cloud::Asset::V1::AssetService::Client.new
81
81
  ```
82
82
 
83
83
  ### Configuration
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
88
88
  ```ruby
89
89
  require "google/cloud/asset/v1"
90
90
 
91
- client = Google::Cloud::Asset::V1::AssetService::Client.new do |config|
91
+ client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
92
92
  config.credentials = "path/to/keyfile.json"
93
93
  end
94
94
  ```
@@ -98,11 +98,11 @@ Or configured globally for all clients:
98
98
  ```ruby
99
99
  require "google/cloud/asset/v1"
100
100
 
101
- Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
101
+ ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
102
102
  config.credentials = "path/to/keyfile.json"
103
103
  end
104
104
 
105
- client = Google::Cloud::Asset::V1::AssetService::Client.new
105
+ client = ::Google::Cloud::Asset::V1::AssetService::Client.new
106
106
  ```
107
107
 
108
108
  ### Cloud SDK
data/README.md CHANGED
@@ -25,7 +25,7 @@ In order to use this library, you first need to go through the following steps:
25
25
  ```ruby
26
26
  require "google/cloud/asset/v1"
27
27
 
28
- client = Google::Cloud::Asset::V1::AssetService::Client.new
28
+ client = ::Google::Cloud::Asset::V1::AssetService::Client.new
29
29
  request = my_create_request
30
30
  response = client.export_assets request
31
31
  ```
@@ -26,7 +26,7 @@ module Google
26
26
  # To load this package, including all its services, and instantiate a client:
27
27
  #
28
28
  # require "google/cloud/asset/v1"
29
- # client = Google::Cloud::Asset::V1::AssetService::Client.new
29
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new
30
30
  #
31
31
  module V1
32
32
  end
@@ -37,7 +37,7 @@ module Google
37
37
  # To load this service and instantiate a client:
38
38
  #
39
39
  # require "google/cloud/asset/v1/asset_service"
40
- # client = Google::Cloud::Asset::V1::AssetService::Client.new
40
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new
41
41
  #
42
42
  module AssetService
43
43
  end
@@ -38,15 +38,15 @@ module Google
38
38
  ##
39
39
  # Configure the AssetService Client class.
40
40
  #
41
- # See {Google::Cloud::Asset::V1::AssetService::Client::Configuration}
41
+ # See {::Google::Cloud::Asset::V1::AssetService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
44
  # ## Example
45
45
  #
46
46
  # To modify the configuration for all AssetService clients:
47
47
  #
48
- # Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
49
- # config.timeout = 10_000
48
+ # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
49
+ # config.timeout = 10.0
50
50
  # end
51
51
  #
52
52
  # @yield [config] Configure the Client client.
@@ -75,6 +75,22 @@ module Google
75
75
  retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
76
76
  }
77
77
 
78
+ default_config.rpcs.search_all_resources.timeout = 15.0
79
+ default_config.rpcs.search_all_resources.retry_policy = {
80
+ initial_delay: 0.1,
81
+ max_delay: 60.0,
82
+ multiplier: 1.3,
83
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
84
+ }
85
+
86
+ default_config.rpcs.search_all_iam_policies.timeout = 15.0
87
+ default_config.rpcs.search_all_iam_policies.retry_policy = {
88
+ initial_delay: 0.1,
89
+ max_delay: 60.0,
90
+ multiplier: 1.3,
91
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
92
+ }
93
+
78
94
  default_config
79
95
  end
80
96
  yield @configure if block_given?
@@ -88,7 +104,7 @@ module Google
88
104
  # but structural changes (adding new fields, etc.) are not allowed. Structural changes
89
105
  # should be made on {Client.configure}.
90
106
  #
91
- # See {Google::Cloud::Asset::V1::AssetService::Client::Configuration}
107
+ # See {::Google::Cloud::Asset::V1::AssetService::Client::Configuration}
92
108
  # for a description of the configuration fields.
93
109
  #
94
110
  # @yield [config] Configure the Client client.
@@ -109,13 +125,13 @@ module Google
109
125
  # To create a new AssetService client with the default
110
126
  # configuration:
111
127
  #
112
- # client = Google::Cloud::Asset::V1::AssetService::Client.new
128
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new
113
129
  #
114
130
  # To create a new AssetService client with a custom
115
131
  # configuration:
116
132
  #
117
- # client = Google::Cloud::Asset::V1::AssetService::Client.new do |config|
118
- # config.timeout = 10_000
133
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
134
+ # config.timeout = 10.0
119
135
  # end
120
136
  #
121
137
  # @yield [config] Configure the AssetService client.
@@ -140,15 +156,16 @@ module Google
140
156
  if credentials.is_a?(String) || credentials.is_a?(Hash)
141
157
  credentials = Credentials.new credentials, scope: @config.scope
142
158
  end
143
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
144
161
 
145
162
  @operations_client = Operations.new do |config|
146
163
  config.credentials = credentials
147
164
  config.endpoint = @config.endpoint
148
165
  end
149
166
 
150
- @asset_service_stub = Gapic::ServiceStub.new(
151
- Google::Cloud::Asset::V1::AssetService::Stub,
167
+ @asset_service_stub = ::Gapic::ServiceStub.new(
168
+ ::Google::Cloud::Asset::V1::AssetService::Stub,
152
169
  credentials: credentials,
153
170
  endpoint: @config.endpoint,
154
171
  channel_args: @config.channel_args,
@@ -159,7 +176,7 @@ module Google
159
176
  ##
160
177
  # Get the associated client for long-running operations.
161
178
  #
162
- # @return [Google::Cloud::Asset::V1::AssetService::Operations]
179
+ # @return [::Google::Cloud::Asset::V1::AssetService::Operations]
163
180
  #
164
181
  attr_reader :operations_client
165
182
 
@@ -168,17 +185,18 @@ module Google
168
185
  ##
169
186
  # Exports assets with time and resource types to a given Cloud Storage
170
187
  # location. The output format is newline-delimited JSON.
171
- # This API implements the {Google::Longrunning::Operation google.longrunning.Operation} API allowing you
172
- # to keep track of the export.
188
+ # This API implements the
189
+ # {::Google::Longrunning::Operation google.longrunning.Operation} API allowing
190
+ # you to keep track of the export.
173
191
  #
174
192
  # @overload export_assets(request, options = nil)
175
193
  # Pass arguments to `export_assets` via a request object, either of type
176
- # {Google::Cloud::Asset::V1::ExportAssetsRequest} or an equivalent Hash.
194
+ # {::Google::Cloud::Asset::V1::ExportAssetsRequest} or an equivalent Hash.
177
195
  #
178
- # @param request [Google::Cloud::Asset::V1::ExportAssetsRequest, Hash]
196
+ # @param request [::Google::Cloud::Asset::V1::ExportAssetsRequest, ::Hash]
179
197
  # A request object representing the call parameters. Required. To specify no
180
198
  # parameters, or to keep all the default parameter values, pass an empty Hash.
181
- # @param options [Gapic::CallOptions, Hash]
199
+ # @param options [::Gapic::CallOptions, ::Hash]
182
200
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
183
201
  #
184
202
  # @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil)
@@ -186,51 +204,51 @@ module Google
186
204
  # least one keyword argument is required. To specify no parameters, or to keep all
187
205
  # the default parameter values, pass an empty Hash as a request object (see above).
188
206
  #
189
- # @param parent [String]
207
+ # @param parent [::String]
190
208
  # Required. The relative name of the root asset. This can only be an
191
209
  # organization number (such as "organizations/123"), a project ID (such as
192
210
  # "projects/my-project-id"), or a project number (such as "projects/12345"),
193
211
  # or a folder number (such as "folders/123").
194
- # @param read_time [Google::Protobuf::Timestamp, Hash]
212
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
195
213
  # Timestamp to take an asset snapshot. This can only be set to a timestamp
196
214
  # between the current time and the current time minus 35 days (inclusive).
197
215
  # If not specified, the current time will be used. Due to delays in resource
198
216
  # data collection and indexing, there is a volatile window during which
199
217
  # running the same query may get different results.
200
- # @param asset_types [Array<String>]
218
+ # @param asset_types [::Array<::String>]
201
219
  # A list of asset types of which to take a snapshot for. For example:
202
220
  # "compute.googleapis.com/Disk". If specified, only matching assets will be
203
221
  # returned. See [Introduction to Cloud Asset
204
222
  # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
205
223
  # for all supported asset types.
206
- # @param content_type [Google::Cloud::Asset::V1::ContentType]
224
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
207
225
  # Asset content type. If not specified, no content but the asset name will be
208
226
  # returned.
209
- # @param output_config [Google::Cloud::Asset::V1::OutputConfig, Hash]
227
+ # @param output_config [::Google::Cloud::Asset::V1::OutputConfig, ::Hash]
210
228
  # Required. Output configuration indicating where the results will be output
211
229
  # to. All results will be in newline delimited JSON format.
212
230
  #
213
231
  # @yield [response, operation] Access the result along with the RPC operation
214
- # @yieldparam response [Gapic::Operation]
215
- # @yieldparam operation [GRPC::ActiveCall::Operation]
232
+ # @yieldparam response [::Gapic::Operation]
233
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
216
234
  #
217
- # @return [Gapic::Operation]
235
+ # @return [::Gapic::Operation]
218
236
  #
219
- # @raise [Google::Cloud::Error] if the RPC is aborted.
237
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
220
238
  #
221
239
  def export_assets request, options = nil
222
- raise ArgumentError, "request must be provided" if request.nil?
240
+ raise ::ArgumentError, "request must be provided" if request.nil?
223
241
 
224
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::ExportAssetsRequest
242
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ExportAssetsRequest
225
243
 
226
244
  # Converts hash and nil to an options object
227
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
245
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
228
246
 
229
247
  # Customize the options with defaults
230
248
  metadata = @config.rpcs.export_assets.metadata.to_h
231
249
 
232
250
  # Set x-goog-api-client and x-goog-user-project headers
233
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
251
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
234
252
  lib_name: @config.lib_name, lib_version: @config.lib_version,
235
253
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
236
254
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -248,12 +266,12 @@ module Google
248
266
  retry_policy: @config.retry_policy
249
267
 
250
268
  @asset_service_stub.call_rpc :export_assets, request, options: options do |response, operation|
251
- response = Gapic::Operation.new response, @operations_client, options: options
269
+ response = ::Gapic::Operation.new response, @operations_client, options: options
252
270
  yield response, operation if block_given?
253
271
  return response
254
272
  end
255
- rescue GRPC::BadStatus => e
256
- raise Google::Cloud::Error.from_error(e)
273
+ rescue ::GRPC::BadStatus => e
274
+ raise ::Google::Cloud::Error.from_error(e)
257
275
  end
258
276
 
259
277
  ##
@@ -267,12 +285,12 @@ module Google
267
285
  #
268
286
  # @overload batch_get_assets_history(request, options = nil)
269
287
  # Pass arguments to `batch_get_assets_history` via a request object, either of type
270
- # {Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
288
+ # {::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest} or an equivalent Hash.
271
289
  #
272
- # @param request [Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest, Hash]
290
+ # @param request [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest, ::Hash]
273
291
  # A request object representing the call parameters. Required. To specify no
274
292
  # parameters, or to keep all the default parameter values, pass an empty Hash.
275
- # @param options [Gapic::CallOptions, Hash]
293
+ # @param options [::Gapic::CallOptions, ::Hash]
276
294
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
277
295
  #
278
296
  # @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil)
@@ -280,11 +298,11 @@ module Google
280
298
  # least one keyword argument is required. To specify no parameters, or to keep all
281
299
  # the default parameter values, pass an empty Hash as a request object (see above).
282
300
  #
283
- # @param parent [String]
301
+ # @param parent [::String]
284
302
  # Required. The relative name of the root asset. It can only be an
285
303
  # organization number (such as "organizations/123"), a project ID (such as
286
304
  # "projects/my-project-id")", or a project number (such as "projects/12345").
287
- # @param asset_names [Array<String>]
305
+ # @param asset_names [::Array<::String>]
288
306
  # A list of the full names of the assets. For example:
289
307
  # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
290
308
  # See [Resource
@@ -295,9 +313,9 @@ module Google
295
313
  #
296
314
  # The request becomes a no-op if the asset name list is empty, and the max
297
315
  # size of the asset name list is 100 in one request.
298
- # @param content_type [Google::Cloud::Asset::V1::ContentType]
316
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
299
317
  # Optional. The content type.
300
- # @param read_time_window [Google::Cloud::Asset::V1::TimeWindow, Hash]
318
+ # @param read_time_window [::Google::Cloud::Asset::V1::TimeWindow, ::Hash]
301
319
  # Optional. The time window for the asset history. Both start_time and
302
320
  # end_time are optional and if set, it must be after the current time minus
303
321
  # 35 days. If end_time is not set, it is default to current timestamp.
@@ -306,26 +324,26 @@ module Google
306
324
  # window overlap with read_time_window.
307
325
  #
308
326
  # @yield [response, operation] Access the result along with the RPC operation
309
- # @yieldparam response [Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
310
- # @yieldparam operation [GRPC::ActiveCall::Operation]
327
+ # @yieldparam response [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
328
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
311
329
  #
312
- # @return [Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
330
+ # @return [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
313
331
  #
314
- # @raise [Google::Cloud::Error] if the RPC is aborted.
332
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
333
  #
316
334
  def batch_get_assets_history request, options = nil
317
- raise ArgumentError, "request must be provided" if request.nil?
335
+ raise ::ArgumentError, "request must be provided" if request.nil?
318
336
 
319
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest
337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest
320
338
 
321
339
  # Converts hash and nil to an options object
322
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
323
341
 
324
342
  # Customize the options with defaults
325
343
  metadata = @config.rpcs.batch_get_assets_history.metadata.to_h
326
344
 
327
345
  # Set x-goog-api-client and x-goog-user-project headers
328
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
346
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
329
347
  lib_name: @config.lib_name, lib_version: @config.lib_version,
330
348
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
331
349
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -346,8 +364,8 @@ module Google
346
364
  yield response, operation if block_given?
347
365
  return response
348
366
  end
349
- rescue GRPC::BadStatus => e
350
- raise Google::Cloud::Error.from_error(e)
367
+ rescue ::GRPC::BadStatus => e
368
+ raise ::Google::Cloud::Error.from_error(e)
351
369
  end
352
370
 
353
371
  ##
@@ -356,12 +374,12 @@ module Google
356
374
  #
357
375
  # @overload create_feed(request, options = nil)
358
376
  # Pass arguments to `create_feed` via a request object, either of type
359
- # {Google::Cloud::Asset::V1::CreateFeedRequest} or an equivalent Hash.
377
+ # {::Google::Cloud::Asset::V1::CreateFeedRequest} or an equivalent Hash.
360
378
  #
361
- # @param request [Google::Cloud::Asset::V1::CreateFeedRequest, Hash]
379
+ # @param request [::Google::Cloud::Asset::V1::CreateFeedRequest, ::Hash]
362
380
  # A request object representing the call parameters. Required. To specify no
363
381
  # parameters, or to keep all the default parameter values, pass an empty Hash.
364
- # @param options [Gapic::CallOptions, Hash]
382
+ # @param options [::Gapic::CallOptions, ::Hash]
365
383
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
366
384
  #
367
385
  # @overload create_feed(parent: nil, feed_id: nil, feed: nil)
@@ -369,43 +387,42 @@ module Google
369
387
  # least one keyword argument is required. To specify no parameters, or to keep all
370
388
  # the default parameter values, pass an empty Hash as a request object (see above).
371
389
  #
372
- # @param parent [String]
390
+ # @param parent [::String]
373
391
  # Required. The name of the project/folder/organization where this feed
374
392
  # should be created in. It can only be an organization number (such as
375
393
  # "organizations/123"), a folder number (such as "folders/123"), a project ID
376
394
  # (such as "projects/my-project-id")", or a project number (such as
377
395
  # "projects/12345").
378
- # @param feed_id [String]
396
+ # @param feed_id [::String]
379
397
  # Required. This is the client-assigned asset feed identifier and it needs to
380
398
  # be unique under a specific parent project/folder/organization.
381
- # @param feed [Google::Cloud::Asset::V1::Feed, Hash]
382
- # Required. The feed details. The field `name` must be empty and it will be generated
383
- # in the format of:
384
- # projects/project_number/feeds/feed_id
399
+ # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
400
+ # Required. The feed details. The field `name` must be empty and it will be
401
+ # generated in the format of: projects/project_number/feeds/feed_id
385
402
  # folders/folder_number/feeds/feed_id
386
403
  # organizations/organization_number/feeds/feed_id
387
404
  #
388
405
  # @yield [response, operation] Access the result along with the RPC operation
389
- # @yieldparam response [Google::Cloud::Asset::V1::Feed]
390
- # @yieldparam operation [GRPC::ActiveCall::Operation]
406
+ # @yieldparam response [::Google::Cloud::Asset::V1::Feed]
407
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
391
408
  #
392
- # @return [Google::Cloud::Asset::V1::Feed]
409
+ # @return [::Google::Cloud::Asset::V1::Feed]
393
410
  #
394
- # @raise [Google::Cloud::Error] if the RPC is aborted.
411
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
395
412
  #
396
413
  def create_feed request, options = nil
397
- raise ArgumentError, "request must be provided" if request.nil?
414
+ raise ::ArgumentError, "request must be provided" if request.nil?
398
415
 
399
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::CreateFeedRequest
416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::CreateFeedRequest
400
417
 
401
418
  # Converts hash and nil to an options object
402
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
403
420
 
404
421
  # Customize the options with defaults
405
422
  metadata = @config.rpcs.create_feed.metadata.to_h
406
423
 
407
424
  # Set x-goog-api-client and x-goog-user-project headers
408
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
425
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
409
426
  lib_name: @config.lib_name, lib_version: @config.lib_version,
410
427
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
411
428
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -426,8 +443,8 @@ module Google
426
443
  yield response, operation if block_given?
427
444
  return response
428
445
  end
429
- rescue GRPC::BadStatus => e
430
- raise Google::Cloud::Error.from_error(e)
446
+ rescue ::GRPC::BadStatus => e
447
+ raise ::Google::Cloud::Error.from_error(e)
431
448
  end
432
449
 
433
450
  ##
@@ -435,12 +452,12 @@ module Google
435
452
  #
436
453
  # @overload get_feed(request, options = nil)
437
454
  # Pass arguments to `get_feed` via a request object, either of type
438
- # {Google::Cloud::Asset::V1::GetFeedRequest} or an equivalent Hash.
455
+ # {::Google::Cloud::Asset::V1::GetFeedRequest} or an equivalent Hash.
439
456
  #
440
- # @param request [Google::Cloud::Asset::V1::GetFeedRequest, Hash]
457
+ # @param request [::Google::Cloud::Asset::V1::GetFeedRequest, ::Hash]
441
458
  # A request object representing the call parameters. Required. To specify no
442
459
  # parameters, or to keep all the default parameter values, pass an empty Hash.
443
- # @param options [Gapic::CallOptions, Hash]
460
+ # @param options [::Gapic::CallOptions, ::Hash]
444
461
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
445
462
  #
446
463
  # @overload get_feed(name: nil)
@@ -448,33 +465,33 @@ module Google
448
465
  # least one keyword argument is required. To specify no parameters, or to keep all
449
466
  # the default parameter values, pass an empty Hash as a request object (see above).
450
467
  #
451
- # @param name [String]
468
+ # @param name [::String]
452
469
  # Required. The name of the Feed and it must be in the format of:
453
470
  # projects/project_number/feeds/feed_id
454
471
  # folders/folder_number/feeds/feed_id
455
472
  # organizations/organization_number/feeds/feed_id
456
473
  #
457
474
  # @yield [response, operation] Access the result along with the RPC operation
458
- # @yieldparam response [Google::Cloud::Asset::V1::Feed]
459
- # @yieldparam operation [GRPC::ActiveCall::Operation]
475
+ # @yieldparam response [::Google::Cloud::Asset::V1::Feed]
476
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
460
477
  #
461
- # @return [Google::Cloud::Asset::V1::Feed]
478
+ # @return [::Google::Cloud::Asset::V1::Feed]
462
479
  #
463
- # @raise [Google::Cloud::Error] if the RPC is aborted.
480
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
464
481
  #
465
482
  def get_feed request, options = nil
466
- raise ArgumentError, "request must be provided" if request.nil?
483
+ raise ::ArgumentError, "request must be provided" if request.nil?
467
484
 
468
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::GetFeedRequest
485
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::GetFeedRequest
469
486
 
470
487
  # Converts hash and nil to an options object
471
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
472
489
 
473
490
  # Customize the options with defaults
474
491
  metadata = @config.rpcs.get_feed.metadata.to_h
475
492
 
476
493
  # Set x-goog-api-client and x-goog-user-project headers
477
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
494
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
478
495
  lib_name: @config.lib_name, lib_version: @config.lib_version,
479
496
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
480
497
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -495,8 +512,8 @@ module Google
495
512
  yield response, operation if block_given?
496
513
  return response
497
514
  end
498
- rescue GRPC::BadStatus => e
499
- raise Google::Cloud::Error.from_error(e)
515
+ rescue ::GRPC::BadStatus => e
516
+ raise ::Google::Cloud::Error.from_error(e)
500
517
  end
501
518
 
502
519
  ##
@@ -504,12 +521,12 @@ module Google
504
521
  #
505
522
  # @overload list_feeds(request, options = nil)
506
523
  # Pass arguments to `list_feeds` via a request object, either of type
507
- # {Google::Cloud::Asset::V1::ListFeedsRequest} or an equivalent Hash.
524
+ # {::Google::Cloud::Asset::V1::ListFeedsRequest} or an equivalent Hash.
508
525
  #
509
- # @param request [Google::Cloud::Asset::V1::ListFeedsRequest, Hash]
526
+ # @param request [::Google::Cloud::Asset::V1::ListFeedsRequest, ::Hash]
510
527
  # A request object representing the call parameters. Required. To specify no
511
528
  # parameters, or to keep all the default parameter values, pass an empty Hash.
512
- # @param options [Gapic::CallOptions, Hash]
529
+ # @param options [::Gapic::CallOptions, ::Hash]
513
530
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
514
531
  #
515
532
  # @overload list_feeds(parent: nil)
@@ -517,32 +534,32 @@ module Google
517
534
  # least one keyword argument is required. To specify no parameters, or to keep all
518
535
  # the default parameter values, pass an empty Hash as a request object (see above).
519
536
  #
520
- # @param parent [String]
537
+ # @param parent [::String]
521
538
  # Required. The parent project/folder/organization whose feeds are to be
522
539
  # listed. It can only be using project/folder/organization number (such as
523
540
  # "folders/12345")", or a project ID (such as "projects/my-project-id").
524
541
  #
525
542
  # @yield [response, operation] Access the result along with the RPC operation
526
- # @yieldparam response [Google::Cloud::Asset::V1::ListFeedsResponse]
527
- # @yieldparam operation [GRPC::ActiveCall::Operation]
543
+ # @yieldparam response [::Google::Cloud::Asset::V1::ListFeedsResponse]
544
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
528
545
  #
529
- # @return [Google::Cloud::Asset::V1::ListFeedsResponse]
546
+ # @return [::Google::Cloud::Asset::V1::ListFeedsResponse]
530
547
  #
531
- # @raise [Google::Cloud::Error] if the RPC is aborted.
548
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
532
549
  #
533
550
  def list_feeds request, options = nil
534
- raise ArgumentError, "request must be provided" if request.nil?
551
+ raise ::ArgumentError, "request must be provided" if request.nil?
535
552
 
536
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::ListFeedsRequest
553
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListFeedsRequest
537
554
 
538
555
  # Converts hash and nil to an options object
539
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
556
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
540
557
 
541
558
  # Customize the options with defaults
542
559
  metadata = @config.rpcs.list_feeds.metadata.to_h
543
560
 
544
561
  # Set x-goog-api-client and x-goog-user-project headers
545
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
562
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
546
563
  lib_name: @config.lib_name, lib_version: @config.lib_version,
547
564
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
548
565
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -563,8 +580,8 @@ module Google
563
580
  yield response, operation if block_given?
564
581
  return response
565
582
  end
566
- rescue GRPC::BadStatus => e
567
- raise Google::Cloud::Error.from_error(e)
583
+ rescue ::GRPC::BadStatus => e
584
+ raise ::Google::Cloud::Error.from_error(e)
568
585
  end
569
586
 
570
587
  ##
@@ -572,12 +589,12 @@ module Google
572
589
  #
573
590
  # @overload update_feed(request, options = nil)
574
591
  # Pass arguments to `update_feed` via a request object, either of type
575
- # {Google::Cloud::Asset::V1::UpdateFeedRequest} or an equivalent Hash.
592
+ # {::Google::Cloud::Asset::V1::UpdateFeedRequest} or an equivalent Hash.
576
593
  #
577
- # @param request [Google::Cloud::Asset::V1::UpdateFeedRequest, Hash]
594
+ # @param request [::Google::Cloud::Asset::V1::UpdateFeedRequest, ::Hash]
578
595
  # A request object representing the call parameters. Required. To specify no
579
596
  # parameters, or to keep all the default parameter values, pass an empty Hash.
580
- # @param options [Gapic::CallOptions, Hash]
597
+ # @param options [::Gapic::CallOptions, ::Hash]
581
598
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
582
599
  #
583
600
  # @overload update_feed(feed: nil, update_mask: nil)
@@ -585,38 +602,38 @@ module Google
585
602
  # least one keyword argument is required. To specify no parameters, or to keep all
586
603
  # the default parameter values, pass an empty Hash as a request object (see above).
587
604
  #
588
- # @param feed [Google::Cloud::Asset::V1::Feed, Hash]
589
- # Required. The new values of feed details. It must match an existing feed and the
590
- # field `name` must be in the format of:
605
+ # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
606
+ # Required. The new values of feed details. It must match an existing feed
607
+ # and the field `name` must be in the format of:
591
608
  # projects/project_number/feeds/feed_id or
592
609
  # folders/folder_number/feeds/feed_id or
593
610
  # organizations/organization_number/feeds/feed_id.
594
- # @param update_mask [Google::Protobuf::FieldMask, Hash]
611
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
595
612
  # Required. Only updates the `feed` fields indicated by this mask.
596
613
  # The field mask must not be empty, and it must not contain fields that
597
614
  # are immutable or only set by the server.
598
615
  #
599
616
  # @yield [response, operation] Access the result along with the RPC operation
600
- # @yieldparam response [Google::Cloud::Asset::V1::Feed]
601
- # @yieldparam operation [GRPC::ActiveCall::Operation]
617
+ # @yieldparam response [::Google::Cloud::Asset::V1::Feed]
618
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
602
619
  #
603
- # @return [Google::Cloud::Asset::V1::Feed]
620
+ # @return [::Google::Cloud::Asset::V1::Feed]
604
621
  #
605
- # @raise [Google::Cloud::Error] if the RPC is aborted.
622
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
606
623
  #
607
624
  def update_feed request, options = nil
608
- raise ArgumentError, "request must be provided" if request.nil?
625
+ raise ::ArgumentError, "request must be provided" if request.nil?
609
626
 
610
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::UpdateFeedRequest
627
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::UpdateFeedRequest
611
628
 
612
629
  # Converts hash and nil to an options object
613
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
614
631
 
615
632
  # Customize the options with defaults
616
633
  metadata = @config.rpcs.update_feed.metadata.to_h
617
634
 
618
635
  # Set x-goog-api-client and x-goog-user-project headers
619
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
636
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
620
637
  lib_name: @config.lib_name, lib_version: @config.lib_version,
621
638
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
622
639
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -637,8 +654,8 @@ module Google
637
654
  yield response, operation if block_given?
638
655
  return response
639
656
  end
640
- rescue GRPC::BadStatus => e
641
- raise Google::Cloud::Error.from_error(e)
657
+ rescue ::GRPC::BadStatus => e
658
+ raise ::Google::Cloud::Error.from_error(e)
642
659
  end
643
660
 
644
661
  ##
@@ -646,12 +663,12 @@ module Google
646
663
  #
647
664
  # @overload delete_feed(request, options = nil)
648
665
  # Pass arguments to `delete_feed` via a request object, either of type
649
- # {Google::Cloud::Asset::V1::DeleteFeedRequest} or an equivalent Hash.
666
+ # {::Google::Cloud::Asset::V1::DeleteFeedRequest} or an equivalent Hash.
650
667
  #
651
- # @param request [Google::Cloud::Asset::V1::DeleteFeedRequest, Hash]
668
+ # @param request [::Google::Cloud::Asset::V1::DeleteFeedRequest, ::Hash]
652
669
  # A request object representing the call parameters. Required. To specify no
653
670
  # parameters, or to keep all the default parameter values, pass an empty Hash.
654
- # @param options [Gapic::CallOptions, Hash]
671
+ # @param options [::Gapic::CallOptions, ::Hash]
655
672
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
656
673
  #
657
674
  # @overload delete_feed(name: nil)
@@ -659,33 +676,33 @@ module Google
659
676
  # least one keyword argument is required. To specify no parameters, or to keep all
660
677
  # the default parameter values, pass an empty Hash as a request object (see above).
661
678
  #
662
- # @param name [String]
679
+ # @param name [::String]
663
680
  # Required. The name of the feed and it must be in the format of:
664
681
  # projects/project_number/feeds/feed_id
665
682
  # folders/folder_number/feeds/feed_id
666
683
  # organizations/organization_number/feeds/feed_id
667
684
  #
668
685
  # @yield [response, operation] Access the result along with the RPC operation
669
- # @yieldparam response [Google::Protobuf::Empty]
670
- # @yieldparam operation [GRPC::ActiveCall::Operation]
686
+ # @yieldparam response [::Google::Protobuf::Empty]
687
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
671
688
  #
672
- # @return [Google::Protobuf::Empty]
689
+ # @return [::Google::Protobuf::Empty]
673
690
  #
674
- # @raise [Google::Cloud::Error] if the RPC is aborted.
691
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
675
692
  #
676
693
  def delete_feed request, options = nil
677
- raise ArgumentError, "request must be provided" if request.nil?
694
+ raise ::ArgumentError, "request must be provided" if request.nil?
678
695
 
679
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Asset::V1::DeleteFeedRequest
696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::DeleteFeedRequest
680
697
 
681
698
  # Converts hash and nil to an options object
682
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
683
700
 
684
701
  # Customize the options with defaults
685
702
  metadata = @config.rpcs.delete_feed.metadata.to_h
686
703
 
687
704
  # Set x-goog-api-client and x-goog-user-project headers
688
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
705
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
689
706
  lib_name: @config.lib_name, lib_version: @config.lib_version,
690
707
  gapic_version: ::Google::Cloud::Asset::V1::VERSION
691
708
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -706,8 +723,252 @@ module Google
706
723
  yield response, operation if block_given?
707
724
  return response
708
725
  end
709
- rescue GRPC::BadStatus => e
710
- raise Google::Cloud::Error.from_error(e)
726
+ rescue ::GRPC::BadStatus => e
727
+ raise ::Google::Cloud::Error.from_error(e)
728
+ end
729
+
730
+ ##
731
+ # Searches all the resources within the given accessible scope (e.g., a
732
+ # project, a folder or an organization). Callers should have
733
+ # cloud.assets.SearchAllResources permission upon the requested scope,
734
+ # otherwise the request will be rejected.
735
+ #
736
+ # @overload search_all_resources(request, options = nil)
737
+ # Pass arguments to `search_all_resources` via a request object, either of type
738
+ # {::Google::Cloud::Asset::V1::SearchAllResourcesRequest} or an equivalent Hash.
739
+ #
740
+ # @param request [::Google::Cloud::Asset::V1::SearchAllResourcesRequest, ::Hash]
741
+ # A request object representing the call parameters. Required. To specify no
742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
743
+ # @param options [::Gapic::CallOptions, ::Hash]
744
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
745
+ #
746
+ # @overload search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil)
747
+ # Pass arguments to `search_all_resources` via keyword arguments. Note that at
748
+ # least one keyword argument is required. To specify no parameters, or to keep all
749
+ # the default parameter values, pass an empty Hash as a request object (see above).
750
+ #
751
+ # @param scope [::String]
752
+ # Required. A scope can be a project, a folder or an organization. The search
753
+ # is limited to the resources within the `scope`.
754
+ #
755
+ # The allowed values are:
756
+ #
757
+ # * projects/\\{PROJECT_ID}
758
+ # * projects/\\{PROJECT_NUMBER}
759
+ # * folders/\\{FOLDER_NUMBER}
760
+ # * organizations/\\{ORGANIZATION_NUMBER}
761
+ # @param query [::String]
762
+ # Optional. The query statement. An empty query can be specified to search
763
+ # all the resources of certain `asset_types` within the given `scope`.
764
+ #
765
+ # Examples:
766
+ #
767
+ # * `name : "Important"` to find Cloud resources whose name contains
768
+ # "Important" as a word.
769
+ # * `displayName : "Impor*"` to find Cloud resources whose display name
770
+ # contains "Impor" as a word prefix.
771
+ # * `description : "*por*"` to find Cloud resources whose description
772
+ # contains "por" as a substring.
773
+ # * `location : "us-west*"` to find Cloud resources whose location is
774
+ # prefixed with "us-west".
775
+ # * `labels : "prod"` to find Cloud resources whose labels contain "prod" as
776
+ # a key or value.
777
+ # * `labels.env : "prod"` to find Cloud resources which have a label "env"
778
+ # and its value is "prod".
779
+ # * `labels.env : *` to find Cloud resources which have a label "env".
780
+ # * `"Important"` to find Cloud resources which contain "Important" as a word
781
+ # in any of the searchable fields.
782
+ # * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix
783
+ # in any of the searchable fields.
784
+ # * `"*por*"` to find Cloud resources which contain "por" as a substring in
785
+ # any of the searchable fields.
786
+ # * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud
787
+ # resources which contain "Important" as a word in any of the searchable
788
+ # fields and are also located in the "us-west1" region or the "global"
789
+ # location.
790
+ #
791
+ # See [how to construct a
792
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
793
+ # for more details.
794
+ # @param asset_types [::Array<::String>]
795
+ # Optional. A list of asset types that this request searches for. If empty,
796
+ # it will search all the [searchable asset
797
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
798
+ # @param page_size [::Integer]
799
+ # Optional. The page size for search result pagination. Page size is capped
800
+ # at 500 even if a larger value is given. If set to zero, server will pick an
801
+ # appropriate default. Returned results may be fewer than requested. When
802
+ # this happens, there could be more results as long as `next_page_token` is
803
+ # returned.
804
+ # @param page_token [::String]
805
+ # Optional. If present, then retrieve the next batch of results from the
806
+ # preceding call to this method. `page_token` must be the value of
807
+ # `next_page_token` from the previous response. The values of all other
808
+ # method parameters, must be identical to those in the previous call.
809
+ # @param order_by [::String]
810
+ # Optional. A comma separated list of fields specifying the sorting order of
811
+ # the results. The default order is ascending. Add " DESC" after the field
812
+ # name to indicate descending order. Redundant space characters are ignored.
813
+ # Example: "location DESC, name". See [supported resource metadata
814
+ # fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields)
815
+ # for more details.
816
+ #
817
+ # @yield [response, operation] Access the result along with the RPC operation
818
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
819
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
820
+ #
821
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
822
+ #
823
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
824
+ #
825
+ def search_all_resources request, options = nil
826
+ raise ::ArgumentError, "request must be provided" if request.nil?
827
+
828
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllResourcesRequest
829
+
830
+ # Converts hash and nil to an options object
831
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
832
+
833
+ # Customize the options with defaults
834
+ metadata = @config.rpcs.search_all_resources.metadata.to_h
835
+
836
+ # Set x-goog-api-client and x-goog-user-project headers
837
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
838
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
839
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
840
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
841
+
842
+ header_params = {
843
+ "scope" => request.scope
844
+ }
845
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
846
+ metadata[:"x-goog-request-params"] ||= request_params_header
847
+
848
+ options.apply_defaults timeout: @config.rpcs.search_all_resources.timeout,
849
+ metadata: metadata,
850
+ retry_policy: @config.rpcs.search_all_resources.retry_policy
851
+ options.apply_defaults metadata: @config.metadata,
852
+ retry_policy: @config.retry_policy
853
+
854
+ @asset_service_stub.call_rpc :search_all_resources, request, options: options do |response, operation|
855
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_resources, request, response, operation, options
856
+ yield response, operation if block_given?
857
+ return response
858
+ end
859
+ rescue ::GRPC::BadStatus => e
860
+ raise ::Google::Cloud::Error.from_error(e)
861
+ end
862
+
863
+ ##
864
+ # Searches all the IAM policies within the given accessible scope (e.g., a
865
+ # project, a folder or an organization). Callers should have
866
+ # cloud.assets.SearchAllIamPolicies permission upon the requested scope,
867
+ # otherwise the request will be rejected.
868
+ #
869
+ # @overload search_all_iam_policies(request, options = nil)
870
+ # Pass arguments to `search_all_iam_policies` via a request object, either of type
871
+ # {::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest} or an equivalent Hash.
872
+ #
873
+ # @param request [::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest, ::Hash]
874
+ # A request object representing the call parameters. Required. To specify no
875
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
876
+ # @param options [::Gapic::CallOptions, ::Hash]
877
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
878
+ #
879
+ # @overload search_all_iam_policies(scope: nil, query: nil, page_size: nil, page_token: nil)
880
+ # Pass arguments to `search_all_iam_policies` via keyword arguments. Note that at
881
+ # least one keyword argument is required. To specify no parameters, or to keep all
882
+ # the default parameter values, pass an empty Hash as a request object (see above).
883
+ #
884
+ # @param scope [::String]
885
+ # Required. A scope can be a project, a folder or an organization. The search
886
+ # is limited to the IAM policies within the `scope`.
887
+ #
888
+ # The allowed values are:
889
+ #
890
+ # * projects/\\{PROJECT_ID}
891
+ # * projects/\\{PROJECT_NUMBER}
892
+ # * folders/\\{FOLDER_NUMBER}
893
+ # * organizations/\\{ORGANIZATION_NUMBER}
894
+ # @param query [::String]
895
+ # Optional. The query statement. An empty query can be specified to search
896
+ # all the IAM policies within the given `scope`.
897
+ #
898
+ # Examples:
899
+ #
900
+ # * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that
901
+ # specify user "amy@gmail.com".
902
+ # * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that
903
+ # specify the Compute Admin role.
904
+ # * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM
905
+ # policy bindings that specify a role containing "storage.buckets.update"
906
+ # permission.
907
+ # * `resource : "organizations/123"` to find Cloud IAM policy bindings that
908
+ # are set on "organizations/123".
909
+ # * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")`
910
+ # to find Cloud IAM policy bindings that are set on "organizations/123" or
911
+ # "folders/1234", and also specify user "amy".
912
+ #
913
+ # See [how to construct a
914
+ # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
915
+ # for more details.
916
+ # @param page_size [::Integer]
917
+ # Optional. The page size for search result pagination. Page size is capped
918
+ # at 500 even if a larger value is given. If set to zero, server will pick an
919
+ # appropriate default. Returned results may be fewer than requested. When
920
+ # this happens, there could be more results as long as `next_page_token` is
921
+ # returned.
922
+ # @param page_token [::String]
923
+ # Optional. If present, retrieve the next batch of results from the preceding
924
+ # call to this method. `page_token` must be the value of `next_page_token`
925
+ # from the previous response. The values of all other method parameters must
926
+ # be identical to those in the previous call.
927
+ #
928
+ # @yield [response, operation] Access the result along with the RPC operation
929
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
930
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
931
+ #
932
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
933
+ #
934
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
935
+ #
936
+ def search_all_iam_policies request, options = nil
937
+ raise ::ArgumentError, "request must be provided" if request.nil?
938
+
939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest
940
+
941
+ # Converts hash and nil to an options object
942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
943
+
944
+ # Customize the options with defaults
945
+ metadata = @config.rpcs.search_all_iam_policies.metadata.to_h
946
+
947
+ # Set x-goog-api-client and x-goog-user-project headers
948
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
950
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
951
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
952
+
953
+ header_params = {
954
+ "scope" => request.scope
955
+ }
956
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
957
+ metadata[:"x-goog-request-params"] ||= request_params_header
958
+
959
+ options.apply_defaults timeout: @config.rpcs.search_all_iam_policies.timeout,
960
+ metadata: metadata,
961
+ retry_policy: @config.rpcs.search_all_iam_policies.retry_policy
962
+ options.apply_defaults metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @asset_service_stub.call_rpc :search_all_iam_policies, request, options: options do |response, operation|
966
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, request, response, operation, options
967
+ yield response, operation if block_given?
968
+ return response
969
+ end
970
+ rescue ::GRPC::BadStatus => e
971
+ raise ::Google::Cloud::Error.from_error(e)
711
972
  end
712
973
 
713
974
  ##
@@ -717,7 +978,7 @@ module Google
717
978
  # providing control over timeouts, retry behavior, logging, transport
718
979
  # parameters, and other low-level controls. Certain parameters can also be
719
980
  # applied individually to specific RPCs. See
720
- # {Google::Cloud::Asset::V1::AssetService::Client::Configuration::Rpcs}
981
+ # {::Google::Cloud::Asset::V1::AssetService::Client::Configuration::Rpcs}
721
982
  # for a list of RPCs that can be configured independently.
722
983
  #
723
984
  # Configuration can be applied globally to all clients, or to a single client
@@ -728,22 +989,22 @@ module Google
728
989
  # To modify the global config, setting the timeout for export_assets
729
990
  # to 20 seconds, and all remaining timeouts to 10 seconds:
730
991
  #
731
- # Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
732
- # config.timeout = 10_000
733
- # config.rpcs.export_assets.timeout = 20_000
992
+ # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
993
+ # config.timeout = 10.0
994
+ # config.rpcs.export_assets.timeout = 20.0
734
995
  # end
735
996
  #
736
997
  # To apply the above configuration only to a new client:
737
998
  #
738
- # client = Google::Cloud::Asset::V1::AssetService::Client.new do |config|
739
- # config.timeout = 10_000
740
- # config.rpcs.export_assets.timeout = 20_000
999
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
1000
+ # config.timeout = 10.0
1001
+ # config.rpcs.export_assets.timeout = 20.0
741
1002
  # end
742
1003
  #
743
1004
  # @!attribute [rw] endpoint
744
1005
  # The hostname or hostname:port of the service endpoint.
745
1006
  # Defaults to `"cloudasset.googleapis.com"`.
746
- # @return [String]
1007
+ # @return [::String]
747
1008
  # @!attribute [rw] credentials
748
1009
  # Credentials to send with calls. You may provide any of the following types:
749
1010
  # * (`String`) The path to a service account key file in JSON format
@@ -755,29 +1016,29 @@ module Google
755
1016
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
756
1017
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
757
1018
  # * (`nil`) indicating no credentials
758
- # @return [Object]
1019
+ # @return [::Object]
759
1020
  # @!attribute [rw] scope
760
1021
  # The OAuth scopes
761
- # @return [Array<String>]
1022
+ # @return [::Array<::String>]
762
1023
  # @!attribute [rw] lib_name
763
1024
  # The library name as recorded in instrumentation and logging
764
- # @return [String]
1025
+ # @return [::String]
765
1026
  # @!attribute [rw] lib_version
766
1027
  # The library version as recorded in instrumentation and logging
767
- # @return [String]
1028
+ # @return [::String]
768
1029
  # @!attribute [rw] channel_args
769
1030
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
770
1031
  # `GRPC::Core::Channel` object is provided as the credential.
771
- # @return [Hash]
1032
+ # @return [::Hash]
772
1033
  # @!attribute [rw] interceptors
773
1034
  # An array of interceptors that are run before calls are executed.
774
- # @return [Array<GRPC::ClientInterceptor>]
1035
+ # @return [::Array<::GRPC::ClientInterceptor>]
775
1036
  # @!attribute [rw] timeout
776
- # The call timeout in milliseconds.
777
- # @return [Numeric]
1037
+ # The call timeout in seconds.
1038
+ # @return [::Numeric]
778
1039
  # @!attribute [rw] metadata
779
1040
  # Additional gRPC headers to be sent with the call.
780
- # @return [Hash{Symbol=>String}]
1041
+ # @return [::Hash{::Symbol=>::String}]
781
1042
  # @!attribute [rw] retry_policy
782
1043
  # The retry policy. The value is a hash with the following keys:
783
1044
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -785,25 +1046,29 @@ module Google
785
1046
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
786
1047
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
787
1048
  # trigger a retry.
788
- # @return [Hash]
1049
+ # @return [::Hash]
1050
+ # @!attribute [rw] quota_project
1051
+ # A separate project against which to charge quota.
1052
+ # @return [::String]
789
1053
  #
790
1054
  class Configuration
791
- extend Gapic::Config
1055
+ extend ::Gapic::Config
792
1056
 
793
- config_attr :endpoint, "cloudasset.googleapis.com", String
794
- config_attr :credentials, nil do |value|
1057
+ config_attr :endpoint, "cloudasset.googleapis.com", ::String
1058
+ config_attr :credentials, nil do |value|
795
1059
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
796
1060
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
797
1061
  allowed.any? { |klass| klass === value }
798
1062
  end
799
- config_attr :scope, nil, String, Array, nil
800
- config_attr :lib_name, nil, String, nil
801
- config_attr :lib_version, nil, String, nil
802
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
803
- config_attr :interceptors, nil, Array, nil
804
- config_attr :timeout, nil, Numeric, nil
805
- config_attr :metadata, nil, Hash, nil
806
- config_attr :retry_policy, nil, Hash, Proc, nil
1063
+ config_attr :scope, nil, ::String, ::Array, nil
1064
+ config_attr :lib_name, nil, ::String, nil
1065
+ config_attr :lib_version, nil, ::String, nil
1066
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1067
+ config_attr :interceptors, nil, ::Array, nil
1068
+ config_attr :timeout, nil, ::Numeric, nil
1069
+ config_attr :metadata, nil, ::Hash, nil
1070
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1071
+ config_attr :quota_project, nil, ::String, nil
807
1072
 
808
1073
  # @private
809
1074
  def initialize parent_config = nil
@@ -844,56 +1109,70 @@ module Google
844
1109
  class Rpcs
845
1110
  ##
846
1111
  # RPC-specific configuration for `export_assets`
847
- # @return [Gapic::Config::Method]
1112
+ # @return [::Gapic::Config::Method]
848
1113
  #
849
1114
  attr_reader :export_assets
850
1115
  ##
851
1116
  # RPC-specific configuration for `batch_get_assets_history`
852
- # @return [Gapic::Config::Method]
1117
+ # @return [::Gapic::Config::Method]
853
1118
  #
854
1119
  attr_reader :batch_get_assets_history
855
1120
  ##
856
1121
  # RPC-specific configuration for `create_feed`
857
- # @return [Gapic::Config::Method]
1122
+ # @return [::Gapic::Config::Method]
858
1123
  #
859
1124
  attr_reader :create_feed
860
1125
  ##
861
1126
  # RPC-specific configuration for `get_feed`
862
- # @return [Gapic::Config::Method]
1127
+ # @return [::Gapic::Config::Method]
863
1128
  #
864
1129
  attr_reader :get_feed
865
1130
  ##
866
1131
  # RPC-specific configuration for `list_feeds`
867
- # @return [Gapic::Config::Method]
1132
+ # @return [::Gapic::Config::Method]
868
1133
  #
869
1134
  attr_reader :list_feeds
870
1135
  ##
871
1136
  # RPC-specific configuration for `update_feed`
872
- # @return [Gapic::Config::Method]
1137
+ # @return [::Gapic::Config::Method]
873
1138
  #
874
1139
  attr_reader :update_feed
875
1140
  ##
876
1141
  # RPC-specific configuration for `delete_feed`
877
- # @return [Gapic::Config::Method]
1142
+ # @return [::Gapic::Config::Method]
878
1143
  #
879
1144
  attr_reader :delete_feed
1145
+ ##
1146
+ # RPC-specific configuration for `search_all_resources`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :search_all_resources
1150
+ ##
1151
+ # RPC-specific configuration for `search_all_iam_policies`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :search_all_iam_policies
880
1155
 
881
1156
  # @private
882
1157
  def initialize parent_rpcs = nil
883
1158
  export_assets_config = parent_rpcs&.export_assets if parent_rpcs&.respond_to? :export_assets
884
- @export_assets = Gapic::Config::Method.new export_assets_config
1159
+ @export_assets = ::Gapic::Config::Method.new export_assets_config
885
1160
  batch_get_assets_history_config = parent_rpcs&.batch_get_assets_history if parent_rpcs&.respond_to? :batch_get_assets_history
886
- @batch_get_assets_history = Gapic::Config::Method.new batch_get_assets_history_config
1161
+ @batch_get_assets_history = ::Gapic::Config::Method.new batch_get_assets_history_config
887
1162
  create_feed_config = parent_rpcs&.create_feed if parent_rpcs&.respond_to? :create_feed
888
- @create_feed = Gapic::Config::Method.new create_feed_config
1163
+ @create_feed = ::Gapic::Config::Method.new create_feed_config
889
1164
  get_feed_config = parent_rpcs&.get_feed if parent_rpcs&.respond_to? :get_feed
890
- @get_feed = Gapic::Config::Method.new get_feed_config
1165
+ @get_feed = ::Gapic::Config::Method.new get_feed_config
891
1166
  list_feeds_config = parent_rpcs&.list_feeds if parent_rpcs&.respond_to? :list_feeds
892
- @list_feeds = Gapic::Config::Method.new list_feeds_config
1167
+ @list_feeds = ::Gapic::Config::Method.new list_feeds_config
893
1168
  update_feed_config = parent_rpcs&.update_feed if parent_rpcs&.respond_to? :update_feed
894
- @update_feed = Gapic::Config::Method.new update_feed_config
1169
+ @update_feed = ::Gapic::Config::Method.new update_feed_config
895
1170
  delete_feed_config = parent_rpcs&.delete_feed if parent_rpcs&.respond_to? :delete_feed
896
- @delete_feed = Gapic::Config::Method.new delete_feed_config
1171
+ @delete_feed = ::Gapic::Config::Method.new delete_feed_config
1172
+ search_all_resources_config = parent_rpcs&.search_all_resources if parent_rpcs&.respond_to? :search_all_resources
1173
+ @search_all_resources = ::Gapic::Config::Method.new search_all_resources_config
1174
+ search_all_iam_policies_config = parent_rpcs&.search_all_iam_policies if parent_rpcs&.respond_to? :search_all_iam_policies
1175
+ @search_all_iam_policies = ::Gapic::Config::Method.new search_all_iam_policies_config
897
1176
 
898
1177
  yield self if block_given?
899
1178
  end