google-cloud-asset-v1 0.13.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6201e73125641f2c16d4357b2622a689ced22dde2ab43a1ce72cce119ad83670
4
- data.tar.gz: fdd74f31a90c45b65a1b29731bb6c6d8bc44a0e61dd68a8fe5b52bb012b2ed9f
3
+ metadata.gz: fe4cb183d47d24ad9e43d0e891edf702ca9fa3d1208f1d59ea304c3afa9ec580
4
+ data.tar.gz: 153470a82f027869dbf0a6efae2633c471ea63e873f07ee79265153bdb1a290b
5
5
  SHA512:
6
- metadata.gz: f1ed23b1309e0dc5a030beec9045e7dfa6920b425b346031982514a161222dbefa2b8996f96d3e3df873519dd7a1db69da5cd0f2b7a736a5a1288ff179a3c8da
7
- data.tar.gz: 7d81517633b9df2849a704c48a9e939afeb4c280ab27259f235206ca852330d01971e9eeb5e76c239e936e8e9930d7a046938bd923b13a4a5eb6d86326f96fc8
6
+ metadata.gz: f3a92efbe9930cb0e62d26963e50baa9a7b1f0c33e82ea05103f1154485003bae40459ac9c96efb8c0c6ac02ae09661754e0cf0f271e4d9c83707857d2e68a01
7
+ data.tar.gz: e5be3acdae9470c8e543a9caeb544e8b3f63c22a7afc5d35bba90ac0f98331696a6e3451c9313e41e584ea254d72d53bc30c7341218482d24a9a90394359f0ec
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-asset-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Asset::V1::AssetService::Credentials}):
68
68
 
69
- 1. `ASSET_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `ASSET_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `ASSET_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `ASSET_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/asset/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Asset::V1::AssetService::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/asset/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/asset/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/asset/v1"
34
34
 
35
35
  client = ::Google::Cloud::Asset::V1::AssetService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Asset::V1::ExportAssetsRequest.new # (request fields as keyword arguments...)
37
37
  response = client.export_assets request
38
38
  ```
39
39
 
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Asset::V1::AssetService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all AssetService clients:
47
- #
48
- # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all AssetService clients
47
+ # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -69,70 +68,46 @@ module Google
69
68
 
70
69
  default_config.rpcs.list_assets.timeout = 60.0
71
70
  default_config.rpcs.list_assets.retry_policy = {
72
- initial_delay: 0.1,
73
- max_delay: 60.0,
74
- multiplier: 1.3,
75
- retry_codes: [4, 14]
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
76
72
  }
77
73
 
78
74
  default_config.rpcs.batch_get_assets_history.timeout = 60.0
79
75
  default_config.rpcs.batch_get_assets_history.retry_policy = {
80
- initial_delay: 0.1,
81
- max_delay: 60.0,
82
- multiplier: 1.3,
83
- retry_codes: [4, 14]
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
77
  }
85
78
 
86
79
  default_config.rpcs.create_feed.timeout = 60.0
87
80
 
88
81
  default_config.rpcs.get_feed.timeout = 60.0
89
82
  default_config.rpcs.get_feed.retry_policy = {
90
- initial_delay: 0.1,
91
- max_delay: 60.0,
92
- multiplier: 1.3,
93
- retry_codes: [4, 14]
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
94
84
  }
95
85
 
96
86
  default_config.rpcs.list_feeds.timeout = 60.0
97
87
  default_config.rpcs.list_feeds.retry_policy = {
98
- initial_delay: 0.1,
99
- max_delay: 60.0,
100
- multiplier: 1.3,
101
- retry_codes: [4, 14]
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
102
89
  }
103
90
 
104
91
  default_config.rpcs.update_feed.timeout = 60.0
105
92
 
106
93
  default_config.rpcs.delete_feed.timeout = 60.0
107
94
  default_config.rpcs.delete_feed.retry_policy = {
108
- initial_delay: 0.1,
109
- max_delay: 60.0,
110
- multiplier: 1.3,
111
- retry_codes: [4, 14]
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
112
96
  }
113
97
 
114
98
  default_config.rpcs.search_all_resources.timeout = 30.0
115
99
  default_config.rpcs.search_all_resources.retry_policy = {
116
- initial_delay: 0.1,
117
- max_delay: 60.0,
118
- multiplier: 1.3,
119
- retry_codes: [14]
100
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
120
101
  }
121
102
 
122
103
  default_config.rpcs.search_all_iam_policies.timeout = 30.0
123
104
  default_config.rpcs.search_all_iam_policies.retry_policy = {
124
- initial_delay: 0.1,
125
- max_delay: 60.0,
126
- multiplier: 1.3,
127
- retry_codes: [14]
105
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
128
106
  }
129
107
 
130
108
  default_config.rpcs.analyze_iam_policy.timeout = 300.0
131
109
  default_config.rpcs.analyze_iam_policy.retry_policy = {
132
- initial_delay: 0.1,
133
- max_delay: 60.0,
134
- multiplier: 1.3,
135
- retry_codes: [14]
110
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
136
111
  }
137
112
 
138
113
  default_config.rpcs.analyze_iam_policy_longrunning.timeout = 60.0
@@ -166,19 +141,15 @@ module Google
166
141
  ##
167
142
  # Create a new AssetService client object.
168
143
  #
169
- # ## Examples
170
- #
171
- # To create a new AssetService client with the default
172
- # configuration:
173
- #
174
- # client = ::Google::Cloud::Asset::V1::AssetService::Client.new
144
+ # @example
175
145
  #
176
- # To create a new AssetService client with a custom
177
- # configuration:
146
+ # # Create a client using the default configuration
147
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new
178
148
  #
179
- # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
180
- # config.timeout = 10.0
181
- # end
149
+ # # Create a client using a custom configuration
150
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
151
+ # config.timeout = 10.0
152
+ # end
182
153
  #
183
154
  # @yield [config] Configure the AssetService client.
184
155
  # @yieldparam config [Client::Configuration]
@@ -198,14 +169,13 @@ module Google
198
169
 
199
170
  # Create credentials
200
171
  credentials = @config.credentials
201
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
172
+ # Use self-signed JWT if the endpoint is unchanged from default,
202
173
  # but only if the default endpoint does not have a region prefix.
203
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
204
- @config.endpoint == Client.configure.endpoint &&
174
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
205
175
  !@config.endpoint.split(".").first.include?("-")
206
176
  credentials ||= Credentials.default scope: @config.scope,
207
177
  enable_self_signed_jwt: enable_self_signed_jwt
208
- if credentials.is_a?(String) || credentials.is_a?(Hash)
178
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
209
179
  credentials = Credentials.new credentials, scope: @config.scope
210
180
  end
211
181
  @quota_project_id = @config.quota_project
@@ -256,7 +226,7 @@ module Google
256
226
  # @param options [::Gapic::CallOptions, ::Hash]
257
227
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
258
228
  #
259
- # @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil)
229
+ # @overload export_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, output_config: nil, relationship_types: nil)
260
230
  # Pass arguments to `export_assets` via keyword arguments. Note that at
261
231
  # least one keyword argument is required. To specify no parameters, or to keep all
262
232
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -296,6 +266,22 @@ module Google
296
266
  # returned.
297
267
  # @param output_config [::Google::Cloud::Asset::V1::OutputConfig, ::Hash]
298
268
  # Required. Output configuration indicating where the results will be output to.
269
+ # @param relationship_types [::Array<::String>]
270
+ # A list of relationship types to export, for example:
271
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
272
+ # content_type=RELATIONSHIP.
273
+ # * If specified:
274
+ # it snapshots specified relationships. It returns an error if
275
+ # any of the [relationship_types] doesn't belong to the supported
276
+ # relationship types of the [asset_types] or if any of the [asset_types]
277
+ # doesn't belong to the source types of the [relationship_types].
278
+ # * Otherwise:
279
+ # it snapshots the supported relationships for all [asset_types] or returns
280
+ # an error if any of the [asset_types] has no relationship support.
281
+ # An unspecified asset types field means all supported asset_types.
282
+ # See [Introduction to Cloud Asset
283
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
284
+ # supported asset types and relationship types.
299
285
  #
300
286
  # @yield [response, operation] Access the result along with the RPC operation
301
287
  # @yieldparam response [::Gapic::Operation]
@@ -331,7 +317,9 @@ module Google
331
317
  options.apply_defaults timeout: @config.rpcs.export_assets.timeout,
332
318
  metadata: metadata,
333
319
  retry_policy: @config.rpcs.export_assets.retry_policy
334
- options.apply_defaults metadata: @config.metadata,
320
+
321
+ options.apply_defaults timeout: @config.timeout,
322
+ metadata: @config.metadata,
335
323
  retry_policy: @config.retry_policy
336
324
 
337
325
  @asset_service_stub.call_rpc :export_assets, request, options: options do |response, operation|
@@ -357,7 +345,7 @@ module Google
357
345
  # @param options [::Gapic::CallOptions, ::Hash]
358
346
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
359
347
  #
360
- # @overload list_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, page_size: nil, page_token: nil)
348
+ # @overload list_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, page_size: nil, page_token: nil, relationship_types: nil)
361
349
  # Pass arguments to `list_assets` via keyword arguments. Note that at
362
350
  # least one keyword argument is required. To specify no parameters, or to keep all
363
351
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -402,6 +390,22 @@ module Google
402
390
  # The `next_page_token` returned from the previous `ListAssetsResponse`, or
403
391
  # unspecified for the first `ListAssetsRequest`. It is a continuation of a
404
392
  # prior `ListAssets` call, and the API should return the next page of assets.
393
+ # @param relationship_types [::Array<::String>]
394
+ # A list of relationship types to output, for example:
395
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
396
+ # content_type=RELATIONSHIP.
397
+ # * If specified:
398
+ # it snapshots specified relationships. It returns an error if
399
+ # any of the [relationship_types] doesn't belong to the supported
400
+ # relationship types of the [asset_types] or if any of the [asset_types]
401
+ # doesn't belong to the source types of the [relationship_types].
402
+ # * Otherwise:
403
+ # it snapshots the supported relationships for all [asset_types] or returns
404
+ # an error if any of the [asset_types] has no relationship support.
405
+ # An unspecified asset types field means all supported asset_types.
406
+ # See [Introduction to Cloud Asset
407
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
408
+ # for all supported asset types and relationship types.
405
409
  #
406
410
  # @yield [response, operation] Access the result along with the RPC operation
407
411
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>]
@@ -437,7 +441,9 @@ module Google
437
441
  options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
438
442
  metadata: metadata,
439
443
  retry_policy: @config.rpcs.list_assets.retry_policy
440
- options.apply_defaults metadata: @config.metadata,
444
+
445
+ options.apply_defaults timeout: @config.timeout,
446
+ metadata: @config.metadata,
441
447
  retry_policy: @config.retry_policy
442
448
 
443
449
  @asset_service_stub.call_rpc :list_assets, request, options: options do |response, operation|
@@ -468,7 +474,7 @@ module Google
468
474
  # @param options [::Gapic::CallOptions, ::Hash]
469
475
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
470
476
  #
471
- # @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil)
477
+ # @overload batch_get_assets_history(parent: nil, asset_names: nil, content_type: nil, read_time_window: nil, relationship_types: nil)
472
478
  # Pass arguments to `batch_get_assets_history` via keyword arguments. Note that at
473
479
  # least one keyword argument is required. To specify no parameters, or to keep all
474
480
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -495,6 +501,23 @@ module Google
495
501
  # If start_time is not set, the snapshot of the assets at end_time will be
496
502
  # returned. The returned results contain all temporal assets whose time
497
503
  # window overlap with read_time_window.
504
+ # @param relationship_types [::Array<::String>]
505
+ # Optional. A list of relationship types to output, for example:
506
+ # `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
507
+ # content_type=RELATIONSHIP.
508
+ # * If specified:
509
+ # it outputs specified relationships' history on the [asset_names]. It
510
+ # returns an error if any of the [relationship_types] doesn't belong to the
511
+ # supported relationship types of the [asset_names] or if any of the
512
+ # [asset_names]'s types doesn't belong to the source types of the
513
+ # [relationship_types].
514
+ # * Otherwise:
515
+ # it outputs the supported relationships' history on the [asset_names] or
516
+ # returns an error if any of the [asset_names]'s types has no relationship
517
+ # support.
518
+ # See [Introduction to Cloud Asset
519
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
520
+ # supported asset types and relationship types.
498
521
  #
499
522
  # @yield [response, operation] Access the result along with the RPC operation
500
523
  # @yieldparam response [::Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse]
@@ -530,7 +553,9 @@ module Google
530
553
  options.apply_defaults timeout: @config.rpcs.batch_get_assets_history.timeout,
531
554
  metadata: metadata,
532
555
  retry_policy: @config.rpcs.batch_get_assets_history.retry_policy
533
- options.apply_defaults metadata: @config.metadata,
556
+
557
+ options.apply_defaults timeout: @config.timeout,
558
+ metadata: @config.metadata,
534
559
  retry_policy: @config.retry_policy
535
560
 
536
561
  @asset_service_stub.call_rpc :batch_get_assets_history, request, options: options do |response, operation|
@@ -610,7 +635,9 @@ module Google
610
635
  options.apply_defaults timeout: @config.rpcs.create_feed.timeout,
611
636
  metadata: metadata,
612
637
  retry_policy: @config.rpcs.create_feed.retry_policy
613
- options.apply_defaults metadata: @config.metadata,
638
+
639
+ options.apply_defaults timeout: @config.timeout,
640
+ metadata: @config.metadata,
614
641
  retry_policy: @config.retry_policy
615
642
 
616
643
  @asset_service_stub.call_rpc :create_feed, request, options: options do |response, operation|
@@ -679,7 +706,9 @@ module Google
679
706
  options.apply_defaults timeout: @config.rpcs.get_feed.timeout,
680
707
  metadata: metadata,
681
708
  retry_policy: @config.rpcs.get_feed.retry_policy
682
- options.apply_defaults metadata: @config.metadata,
709
+
710
+ options.apply_defaults timeout: @config.timeout,
711
+ metadata: @config.metadata,
683
712
  retry_policy: @config.retry_policy
684
713
 
685
714
  @asset_service_stub.call_rpc :get_feed, request, options: options do |response, operation|
@@ -747,7 +776,9 @@ module Google
747
776
  options.apply_defaults timeout: @config.rpcs.list_feeds.timeout,
748
777
  metadata: metadata,
749
778
  retry_policy: @config.rpcs.list_feeds.retry_policy
750
- options.apply_defaults metadata: @config.metadata,
779
+
780
+ options.apply_defaults timeout: @config.timeout,
781
+ metadata: @config.metadata,
751
782
  retry_policy: @config.retry_policy
752
783
 
753
784
  @asset_service_stub.call_rpc :list_feeds, request, options: options do |response, operation|
@@ -821,7 +852,9 @@ module Google
821
852
  options.apply_defaults timeout: @config.rpcs.update_feed.timeout,
822
853
  metadata: metadata,
823
854
  retry_policy: @config.rpcs.update_feed.retry_policy
824
- options.apply_defaults metadata: @config.metadata,
855
+
856
+ options.apply_defaults timeout: @config.timeout,
857
+ metadata: @config.metadata,
825
858
  retry_policy: @config.retry_policy
826
859
 
827
860
  @asset_service_stub.call_rpc :update_feed, request, options: options do |response, operation|
@@ -890,7 +923,9 @@ module Google
890
923
  options.apply_defaults timeout: @config.rpcs.delete_feed.timeout,
891
924
  metadata: metadata,
892
925
  retry_policy: @config.rpcs.delete_feed.retry_policy
893
- options.apply_defaults metadata: @config.metadata,
926
+
927
+ options.apply_defaults timeout: @config.timeout,
928
+ metadata: @config.metadata,
894
929
  retry_policy: @config.retry_policy
895
930
 
896
931
  @asset_service_stub.call_rpc :delete_feed, request, options: options do |response, operation|
@@ -917,7 +952,7 @@ module Google
917
952
  # @param options [::Gapic::CallOptions, ::Hash]
918
953
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
919
954
  #
920
- # @overload search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil)
955
+ # @overload search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil, read_mask: nil)
921
956
  # Pass arguments to `search_all_resources` via keyword arguments. Note that at
922
957
  # least one keyword argument is required. To specify no parameters, or to keep all
923
958
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -959,8 +994,8 @@ module Google
959
994
  # encryption key whose name contains the word "key".
960
995
  # * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
961
996
  # word.
962
- # * `NOT state:ACTIVE` to find \\{\\{gcp_name}} resources whose state
963
- # doesn't contain "ACTIVE" as a word.
997
+ # * `NOT state:ACTIVE` to find Cloud resources whose state doesn't contain
998
+ # "ACTIVE" as a word.
964
999
  # * `createTime<1609459200` to find Cloud resources that were created before
965
1000
  # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
966
1001
  # "2021-01-01 00:00:00 UTC" in seconds.
@@ -1006,6 +1041,7 @@ module Google
1006
1041
  # to indicate descending order. Redundant space characters are ignored.
1007
1042
  # Example: "location DESC, name".
1008
1043
  # Only singular primitive fields in the response are sortable:
1044
+ #
1009
1045
  # * name
1010
1046
  # * assetType
1011
1047
  # * project
@@ -1018,9 +1054,39 @@ module Google
1018
1054
  # * state
1019
1055
  # * parentFullResourceName
1020
1056
  # * parentAssetType
1057
+ #
1021
1058
  # All the other fields such as repeated fields (e.g., `networkTags`), map
1022
1059
  # fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`)
1023
1060
  # are not supported.
1061
+ # @param read_mask [::Google::Protobuf::FieldMask, ::Hash]
1062
+ # Optional. A comma-separated list of fields specifying which fields to be returned in
1063
+ # ResourceSearchResult. Only '*' or combination of top level fields can be
1064
+ # specified. Field names of both snake_case and camelCase are supported.
1065
+ # Examples: `"*"`, `"name,location"`, `"name,versionedResources"`.
1066
+ #
1067
+ # The read_mask paths must be valid field paths listed but not limited to
1068
+ # (both snake_case and camelCase are supported):
1069
+ #
1070
+ # * name
1071
+ # * assetType
1072
+ # * project
1073
+ # * displayName
1074
+ # * description
1075
+ # * location
1076
+ # * labels
1077
+ # * networkTags
1078
+ # * kmsKey
1079
+ # * createTime
1080
+ # * updateTime
1081
+ # * state
1082
+ # * additionalAttributes
1083
+ # * versionedResources
1084
+ #
1085
+ # If read_mask is not specified, all fields except versionedResources will
1086
+ # be returned.
1087
+ # If only '*' is specified, all fields including versionedResources will be
1088
+ # returned.
1089
+ # Any invalid field path will trigger INVALID_ARGUMENT error.
1024
1090
  #
1025
1091
  # @yield [response, operation] Access the result along with the RPC operation
1026
1092
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
@@ -1056,7 +1122,9 @@ module Google
1056
1122
  options.apply_defaults timeout: @config.rpcs.search_all_resources.timeout,
1057
1123
  metadata: metadata,
1058
1124
  retry_policy: @config.rpcs.search_all_resources.retry_policy
1059
- options.apply_defaults metadata: @config.metadata,
1125
+
1126
+ options.apply_defaults timeout: @config.timeout,
1127
+ metadata: @config.metadata,
1060
1128
  retry_policy: @config.retry_policy
1061
1129
 
1062
1130
  @asset_service_stub.call_rpc :search_all_resources, request, options: options do |response, operation|
@@ -1218,7 +1286,9 @@ module Google
1218
1286
  options.apply_defaults timeout: @config.rpcs.search_all_iam_policies.timeout,
1219
1287
  metadata: metadata,
1220
1288
  retry_policy: @config.rpcs.search_all_iam_policies.retry_policy
1221
- options.apply_defaults metadata: @config.metadata,
1289
+
1290
+ options.apply_defaults timeout: @config.timeout,
1291
+ metadata: @config.metadata,
1222
1292
  retry_policy: @config.retry_policy
1223
1293
 
1224
1294
  @asset_service_stub.call_rpc :search_all_iam_policies, request, options: options do |response, operation|
@@ -1297,7 +1367,9 @@ module Google
1297
1367
  options.apply_defaults timeout: @config.rpcs.analyze_iam_policy.timeout,
1298
1368
  metadata: metadata,
1299
1369
  retry_policy: @config.rpcs.analyze_iam_policy.retry_policy
1300
- options.apply_defaults metadata: @config.metadata,
1370
+
1371
+ options.apply_defaults timeout: @config.timeout,
1372
+ metadata: @config.metadata,
1301
1373
  retry_policy: @config.retry_policy
1302
1374
 
1303
1375
  @asset_service_stub.call_rpc :analyze_iam_policy, request, options: options do |response, operation|
@@ -1317,7 +1389,7 @@ module Google
1317
1389
  # {::Google::Longrunning::Operation google.longrunning.Operation}, which allows you to track the operation
1318
1390
  # status. We recommend intervals of at least 2 seconds with exponential
1319
1391
  # backoff retry to poll the operation result. The metadata contains the
1320
- # request to help callers to map responses to requests.
1392
+ # metadata for the long-running operation.
1321
1393
  #
1322
1394
  # @overload analyze_iam_policy_longrunning(request, options = nil)
1323
1395
  # Pass arguments to `analyze_iam_policy_longrunning` via a request object, either of type
@@ -1373,7 +1445,9 @@ module Google
1373
1445
  options.apply_defaults timeout: @config.rpcs.analyze_iam_policy_longrunning.timeout,
1374
1446
  metadata: metadata,
1375
1447
  retry_policy: @config.rpcs.analyze_iam_policy_longrunning.retry_policy
1376
- options.apply_defaults metadata: @config.metadata,
1448
+
1449
+ options.apply_defaults timeout: @config.timeout,
1450
+ metadata: @config.metadata,
1377
1451
  retry_policy: @config.retry_policy
1378
1452
 
1379
1453
  @asset_service_stub.call_rpc :analyze_iam_policy_longrunning, request, options: options do |response, operation|
@@ -1385,6 +1459,90 @@ module Google
1385
1459
  raise ::Google::Cloud::Error.from_error(e)
1386
1460
  end
1387
1461
 
1462
+ ##
1463
+ # Analyze moving a resource to a specified destination without kicking off
1464
+ # the actual move. The analysis is best effort depending on the user's
1465
+ # permissions of viewing different hierarchical policies and configurations.
1466
+ # The policies and configuration are subject to change before the actual
1467
+ # resource migration takes place.
1468
+ #
1469
+ # @overload analyze_move(request, options = nil)
1470
+ # Pass arguments to `analyze_move` via a request object, either of type
1471
+ # {::Google::Cloud::Asset::V1::AnalyzeMoveRequest} or an equivalent Hash.
1472
+ #
1473
+ # @param request [::Google::Cloud::Asset::V1::AnalyzeMoveRequest, ::Hash]
1474
+ # A request object representing the call parameters. Required. To specify no
1475
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1476
+ # @param options [::Gapic::CallOptions, ::Hash]
1477
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1478
+ #
1479
+ # @overload analyze_move(resource: nil, destination_parent: nil, view: nil)
1480
+ # Pass arguments to `analyze_move` via keyword arguments. Note that at
1481
+ # least one keyword argument is required. To specify no parameters, or to keep all
1482
+ # the default parameter values, pass an empty Hash as a request object (see above).
1483
+ #
1484
+ # @param resource [::String]
1485
+ # Required. Name of the resource to perform the analysis against.
1486
+ # Only GCP Project are supported as of today. Hence, this can only be Project
1487
+ # ID (such as "projects/my-project-id") or a Project Number (such as
1488
+ # "projects/12345").
1489
+ # @param destination_parent [::String]
1490
+ # Required. Name of the GCP Folder or Organization to reparent the target
1491
+ # resource. The analysis will be performed against hypothetically moving the
1492
+ # resource to this specified desitination parent. This can only be a Folder
1493
+ # number (such as "folders/123") or an Organization number (such as
1494
+ # "organizations/123").
1495
+ # @param view [::Google::Cloud::Asset::V1::AnalyzeMoveRequest::AnalysisView]
1496
+ # Analysis view indicating what information should be included in the
1497
+ # analysis response. If unspecified, the default view is FULL.
1498
+ #
1499
+ # @yield [response, operation] Access the result along with the RPC operation
1500
+ # @yieldparam response [::Google::Cloud::Asset::V1::AnalyzeMoveResponse]
1501
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1502
+ #
1503
+ # @return [::Google::Cloud::Asset::V1::AnalyzeMoveResponse]
1504
+ #
1505
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1506
+ #
1507
+ def analyze_move request, options = nil
1508
+ raise ::ArgumentError, "request must be provided" if request.nil?
1509
+
1510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::AnalyzeMoveRequest
1511
+
1512
+ # Converts hash and nil to an options object
1513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1514
+
1515
+ # Customize the options with defaults
1516
+ metadata = @config.rpcs.analyze_move.metadata.to_h
1517
+
1518
+ # Set x-goog-api-client and x-goog-user-project headers
1519
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1521
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
1522
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1523
+
1524
+ header_params = {
1525
+ "resource" => request.resource
1526
+ }
1527
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1528
+ metadata[:"x-goog-request-params"] ||= request_params_header
1529
+
1530
+ options.apply_defaults timeout: @config.rpcs.analyze_move.timeout,
1531
+ metadata: metadata,
1532
+ retry_policy: @config.rpcs.analyze_move.retry_policy
1533
+
1534
+ options.apply_defaults timeout: @config.timeout,
1535
+ metadata: @config.metadata,
1536
+ retry_policy: @config.retry_policy
1537
+
1538
+ @asset_service_stub.call_rpc :analyze_move, request, options: options do |response, operation|
1539
+ yield response, operation if block_given?
1540
+ return response
1541
+ end
1542
+ rescue ::GRPC::BadStatus => e
1543
+ raise ::Google::Cloud::Error.from_error(e)
1544
+ end
1545
+
1388
1546
  ##
1389
1547
  # Configuration class for the AssetService API.
1390
1548
  #
@@ -1398,22 +1556,21 @@ module Google
1398
1556
  # Configuration can be applied globally to all clients, or to a single client
1399
1557
  # on construction.
1400
1558
  #
1401
- # # Examples
1559
+ # @example
1402
1560
  #
1403
- # To modify the global config, setting the timeout for export_assets
1404
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1561
+ # # Modify the global config, setting the timeout for
1562
+ # # export_assets to 20 seconds,
1563
+ # # and all remaining timeouts to 10 seconds.
1564
+ # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
1565
+ # config.timeout = 10.0
1566
+ # config.rpcs.export_assets.timeout = 20.0
1567
+ # end
1405
1568
  #
1406
- # ::Google::Cloud::Asset::V1::AssetService::Client.configure do |config|
1407
- # config.timeout = 10.0
1408
- # config.rpcs.export_assets.timeout = 20.0
1409
- # end
1410
- #
1411
- # To apply the above configuration only to a new client:
1412
- #
1413
- # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
1414
- # config.timeout = 10.0
1415
- # config.rpcs.export_assets.timeout = 20.0
1416
- # end
1569
+ # # Apply the above configuration only to a new client.
1570
+ # client = ::Google::Cloud::Asset::V1::AssetService::Client.new do |config|
1571
+ # config.timeout = 10.0
1572
+ # config.rpcs.export_assets.timeout = 20.0
1573
+ # end
1417
1574
  #
1418
1575
  # @!attribute [rw] endpoint
1419
1576
  # The hostname or hostname:port of the service endpoint.
@@ -1581,6 +1738,11 @@ module Google
1581
1738
  # @return [::Gapic::Config::Method]
1582
1739
  #
1583
1740
  attr_reader :analyze_iam_policy_longrunning
1741
+ ##
1742
+ # RPC-specific configuration for `analyze_move`
1743
+ # @return [::Gapic::Config::Method]
1744
+ #
1745
+ attr_reader :analyze_move
1584
1746
 
1585
1747
  # @private
1586
1748
  def initialize parent_rpcs = nil
@@ -1608,6 +1770,8 @@ module Google
1608
1770
  @analyze_iam_policy = ::Gapic::Config::Method.new analyze_iam_policy_config
1609
1771
  analyze_iam_policy_longrunning_config = parent_rpcs.analyze_iam_policy_longrunning if parent_rpcs.respond_to? :analyze_iam_policy_longrunning
1610
1772
  @analyze_iam_policy_longrunning = ::Gapic::Config::Method.new analyze_iam_policy_longrunning_config
1773
+ analyze_move_config = parent_rpcs.analyze_move if parent_rpcs.respond_to? :analyze_move
1774
+ @analyze_move = ::Gapic::Config::Method.new analyze_move_config
1611
1775
 
1612
1776
  yield self if block_given?
1613
1777
  end