google-cloud-asset-v1 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46d2dae780be9b911cc5c6669adddec0675b5eaabcde6d6298044932e1b2140e
4
- data.tar.gz: d29b266276dfb3c6698f5a2c18f2ed8309df3b29be64df68fa376110c1a39322
3
+ metadata.gz: 891090c6919656207064a14b1101e602479a7006bbf90e28e8940736d6a06054
4
+ data.tar.gz: 53ccaba37d8c75b556e5d99ea2a3303a09c6088a06faf41979380efbd1afc258
5
5
  SHA512:
6
- metadata.gz: c75af2b681517e3ead7f999240db55f809cd6cba6cfc78a91680eceb79a33c0b680ef8cd3b0e5f6deb033944a682dbc15ba345dfe1c079fc9af5ba7f5a421c2b
7
- data.tar.gz: 0ea7430442e24daeeb1a3201379a81e7645a30181d94368922642aa14421bd6510215f596ff17bf6c90a4dfb19acb569c8dfa739fef1ef8df8b4e8a88c93d5eb
6
+ metadata.gz: dcf71ccf88416d2e4baa789c5b0f7882f70753d60cdd2d35db170bef50350e1a40d325fbd45378eac33e330bc3137349e72706e0100d0cc513c4ef20061207bd
7
+ data.tar.gz: c132e6b6d39104a421332d9e2e4fbdecdb138cecf9ebaee94a5425760316626114e76adde474dc9f8b35c062f28a53aa90f837ad7469093edde4899d4befdf2f
@@ -67,6 +67,14 @@ module Google
67
67
 
68
68
  default_config.rpcs.export_assets.timeout = 60.0
69
69
 
70
+ default_config.rpcs.list_assets.timeout = 60.0
71
+ 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]
76
+ }
77
+
70
78
  default_config.rpcs.batch_get_assets_history.timeout = 60.0
71
79
  default_config.rpcs.batch_get_assets_history.retry_policy = {
72
80
  initial_delay: 0.1,
@@ -335,6 +343,112 @@ module Google
335
343
  raise ::Google::Cloud::Error.from_error(e)
336
344
  end
337
345
 
346
+ ##
347
+ # Lists assets with time and resource types and returns paged results in
348
+ # response.
349
+ #
350
+ # @overload list_assets(request, options = nil)
351
+ # Pass arguments to `list_assets` via a request object, either of type
352
+ # {::Google::Cloud::Asset::V1::ListAssetsRequest} or an equivalent Hash.
353
+ #
354
+ # @param request [::Google::Cloud::Asset::V1::ListAssetsRequest, ::Hash]
355
+ # A request object representing the call parameters. Required. To specify no
356
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
357
+ # @param options [::Gapic::CallOptions, ::Hash]
358
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
359
+ #
360
+ # @overload list_assets(parent: nil, read_time: nil, asset_types: nil, content_type: nil, page_size: nil, page_token: nil)
361
+ # Pass arguments to `list_assets` via keyword arguments. Note that at
362
+ # least one keyword argument is required. To specify no parameters, or to keep all
363
+ # the default parameter values, pass an empty Hash as a request object (see above).
364
+ #
365
+ # @param parent [::String]
366
+ # Required. Name of the organization or project the assets belong to. Format:
367
+ # "organizations/[organization-number]" (such as "organizations/123"),
368
+ # "projects/[project-id]" (such as "projects/my-project-id"), or
369
+ # "projects/[project-number]" (such as "projects/12345").
370
+ # @param read_time [::Google::Protobuf::Timestamp, ::Hash]
371
+ # Timestamp to take an asset snapshot. This can only be set to a timestamp
372
+ # between the current time and the current time minus 35 days (inclusive).
373
+ # If not specified, the current time will be used. Due to delays in resource
374
+ # data collection and indexing, there is a volatile window during which
375
+ # running the same query may get different results.
376
+ # @param asset_types [::Array<::String>]
377
+ # A list of asset types to take a snapshot for. For example:
378
+ # "compute.googleapis.com/Disk".
379
+ #
380
+ # Regular expression is also supported. For example:
381
+ #
382
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
383
+ # with "compute.googleapis.com".
384
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
385
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
386
+ #
387
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
388
+ # regular expression syntax. If the regular expression does not match any
389
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
390
+ #
391
+ # If specified, only matching assets will be returned, otherwise, it will
392
+ # snapshot all asset types. See [Introduction to Cloud Asset
393
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
394
+ # for all supported asset types.
395
+ # @param content_type [::Google::Cloud::Asset::V1::ContentType]
396
+ # Asset content type. If not specified, no content but the asset name will
397
+ # be returned.
398
+ # @param page_size [::Integer]
399
+ # The maximum number of assets to be returned in a single response. Default
400
+ # is 100, minimum is 1, and maximum is 1000.
401
+ # @param page_token [::String]
402
+ # The `next_page_token` returned from the previous `ListAssetsResponse`, or
403
+ # unspecified for the first `ListAssetsRequest`. It is a continuation of a
404
+ # prior `ListAssets` call, and the API should return the next page of assets.
405
+ #
406
+ # @yield [response, operation] Access the result along with the RPC operation
407
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>]
408
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
409
+ #
410
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::Asset>]
411
+ #
412
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
413
+ #
414
+ def list_assets request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::ListAssetsRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ metadata = @config.rpcs.list_assets.metadata.to_h
424
+
425
+ # Set x-goog-api-client and x-goog-user-project headers
426
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
429
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
430
+
431
+ header_params = {
432
+ "parent" => request.parent
433
+ }
434
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
435
+ metadata[:"x-goog-request-params"] ||= request_params_header
436
+
437
+ options.apply_defaults timeout: @config.rpcs.list_assets.timeout,
438
+ metadata: metadata,
439
+ retry_policy: @config.rpcs.list_assets.retry_policy
440
+ options.apply_defaults metadata: @config.metadata,
441
+ retry_policy: @config.retry_policy
442
+
443
+ @asset_service_stub.call_rpc :list_assets, request, options: options do |response, operation|
444
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :list_assets, request, response, operation, options
445
+ yield response, operation if block_given?
446
+ return response
447
+ end
448
+ rescue ::GRPC::BadStatus => e
449
+ raise ::Google::Cloud::Error.from_error(e)
450
+ end
451
+
338
452
  ##
339
453
  # Batch gets the update history of assets that overlap a time window.
340
454
  # For IAM_POLICY content, this API outputs history when the asset and its
@@ -811,7 +925,7 @@ module Google
811
925
  # @param scope [::String]
812
926
  # Required. A scope can be a project, a folder, or an organization. The search is
813
927
  # limited to the resources within the `scope`. The caller must be granted the
814
- # [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
928
+ # [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
815
929
  # permission on the desired scope.
816
930
  #
817
931
  # The allowed values are:
@@ -822,36 +936,41 @@ module Google
822
936
  # * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
823
937
  # @param query [::String]
824
938
  # Optional. The query statement. See [how to construct a
825
- # query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
939
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
826
940
  # for more information. If not specified or empty, it will search all the
827
- # resources within the specified `scope`. Note that the query string is
828
- # compared against each Cloud IAM policy binding, including its members,
829
- # roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
830
- # contain the bindings that match your query. To learn more about the IAM
831
- # policy structure, see [IAM policy
832
- # doc](https://cloud.google.com/iam/docs/policies#structure).
941
+ # resources within the specified `scope`.
833
942
  #
834
943
  # Examples:
835
944
  #
836
945
  # * `name:Important` to find Cloud resources whose name contains
837
946
  # "Important" as a word.
947
+ # * `name=Important` to find the Cloud resource whose name is exactly
948
+ # "Important".
838
949
  # * `displayName:Impor*` to find Cloud resources whose display name
839
- # contains "Impor" as a prefix.
840
- # * `description:*por*` to find Cloud resources whose description
841
- # contains "por" as a substring.
842
- # * `location:us-west*` to find Cloud resources whose location is
843
- # prefixed with "us-west".
950
+ # contains "Impor" as a prefix of any word in the field.
951
+ # * `location:us-west*` to find Cloud resources whose location contains both
952
+ # "us" and "west" as prefixes.
844
953
  # * `labels:prod` to find Cloud resources whose labels contain "prod" as
845
954
  # a key or value.
846
955
  # * `labels.env:prod` to find Cloud resources that have a label "env"
847
956
  # and its value is "prod".
848
957
  # * `labels.env:*` to find Cloud resources that have a label "env".
958
+ # * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
959
+ # encryption key whose name contains the word "key".
960
+ # * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
961
+ # word.
962
+ # * `NOT state:ACTIVE` to find \\{\\{gcp_name}} resources whose state
963
+ # doesn't contain "ACTIVE" as a word.
964
+ # * `createTime<1609459200` to find Cloud resources that were created before
965
+ # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
966
+ # "2021-01-01 00:00:00 UTC" in seconds.
967
+ # * `updateTime>1609459200` to find Cloud resources that were updated after
968
+ # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
969
+ # "2021-01-01 00:00:00 UTC" in seconds.
849
970
  # * `Important` to find Cloud resources that contain "Important" as a word
850
971
  # in any of the searchable fields.
851
- # * `Impor*` to find Cloud resources that contain "Impor" as a prefix
852
- # in any of the searchable fields.
853
- # * `*por*` to find Cloud resources that contain "por" as a substring in
854
- # any of the searchable fields.
972
+ # * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any
973
+ # word in any of the searchable fields.
855
974
  # * `Important location:(us-west1 OR global)` to find Cloud
856
975
  # resources that contain "Important" as a word in any of the searchable
857
976
  # fields and are also located in the "us-west1" region or the "global"
@@ -860,6 +979,17 @@ module Google
860
979
  # Optional. A list of asset types that this request searches for. If empty, it will
861
980
  # search all the [searchable asset
862
981
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
982
+ #
983
+ # Regular expressions are also supported. For example:
984
+ #
985
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
986
+ # with "compute.googleapis.com".
987
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
988
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
989
+ #
990
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
991
+ # regular expression syntax. If the regular expression does not match any
992
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
863
993
  # @param page_size [::Integer]
864
994
  # Optional. The page size for search result pagination. Page size is capped at 500 even
865
995
  # if a larger value is given. If set to zero, server will pick an appropriate
@@ -871,12 +1001,24 @@ module Google
871
1001
  # the previous response. The values of all other method parameters, must be
872
1002
  # identical to those in the previous call.
873
1003
  # @param order_by [::String]
874
- # Optional. A comma separated list of fields specifying the sorting order of the
1004
+ # Optional. A comma-separated list of fields specifying the sorting order of the
875
1005
  # results. The default order is ascending. Add " DESC" after the field name
876
1006
  # to indicate descending order. Redundant space characters are ignored.
877
- # Example: "location DESC, name". Only string fields in the response are
878
- # sortable, including `name`, `displayName`, `description`, `location`. All
879
- # the other fields such as repeated fields (e.g., `networkTags`), map
1007
+ # Example: "location DESC, name".
1008
+ # Only singular primitive fields in the response are sortable:
1009
+ # * name
1010
+ # * assetType
1011
+ # * project
1012
+ # * displayName
1013
+ # * description
1014
+ # * location
1015
+ # * kmsKey
1016
+ # * createTime
1017
+ # * updateTime
1018
+ # * state
1019
+ # * parentFullResourceName
1020
+ # * parentAssetType
1021
+ # All the other fields such as repeated fields (e.g., `networkTags`), map
880
1022
  # fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`)
881
1023
  # are not supported.
882
1024
  #
@@ -951,7 +1093,7 @@ module Google
951
1093
  # Required. A scope can be a project, a folder, or an organization. The search is
952
1094
  # limited to the IAM policies within the `scope`. The caller must be granted
953
1095
  # the
954
- # [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
1096
+ # [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
955
1097
  # permission on the desired scope.
956
1098
  #
957
1099
  # The allowed values are:
@@ -964,7 +1106,12 @@ module Google
964
1106
  # Optional. The query statement. See [how to construct a
965
1107
  # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
966
1108
  # for more information. If not specified or empty, it will search all the
967
- # IAM policies within the specified `scope`.
1109
+ # IAM policies within the specified `scope`. Note that the query string is
1110
+ # compared against each Cloud IAM policy binding, including its members,
1111
+ # roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
1112
+ # contain the bindings that match your query. To learn more about the IAM
1113
+ # policy structure, see [IAM policy
1114
+ # doc](https://cloud.google.com/iam/docs/policies#structure).
968
1115
  #
969
1116
  # Examples:
970
1117
  #
@@ -972,18 +1119,25 @@ module Google
972
1119
  # "amy@gmail.com".
973
1120
  # * `policy:roles/compute.admin` to find IAM policy bindings that specify
974
1121
  # the Compute Admin role.
1122
+ # * `policy:comp*` to find IAM policy bindings that contain "comp" as a
1123
+ # prefix of any word in the binding.
975
1124
  # * `policy.role.permissions:storage.buckets.update` to find IAM policy
976
1125
  # bindings that specify a role containing "storage.buckets.update"
977
1126
  # permission. Note that if callers don't have `iam.roles.get` access to a
978
1127
  # role's included permissions, policy bindings that specify this role will
979
1128
  # be dropped from the search results.
1129
+ # * `policy.role.permissions:upd*` to find IAM policy bindings that specify a
1130
+ # role containing "upd" as a prefix of any word in the role permission.
1131
+ # Note that if callers don't have `iam.roles.get` access to a role's
1132
+ # included permissions, policy bindings that specify this role will be
1133
+ # dropped from the search results.
980
1134
  # * `resource:organizations/123456` to find IAM policy bindings
981
1135
  # that are set on "organizations/123456".
1136
+ # * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to
1137
+ # find IAM policy bindings that are set on the project named "myproject".
982
1138
  # * `Important` to find IAM policy bindings that contain "Important" as a
983
1139
  # word in any of the searchable fields (except for the included
984
1140
  # permissions).
985
- # * `*por*` to find IAM policy bindings that contain "por" as a substring
986
- # in any of the searchable fields (except for the included permissions).
987
1141
  # * `resource:(instance1 OR instance2) policy:amy` to find
988
1142
  # IAM policy bindings that are set on resources "instance1" or
989
1143
  # "instance2" and also specify user "amy".
@@ -1341,6 +1495,11 @@ module Google
1341
1495
  #
1342
1496
  attr_reader :export_assets
1343
1497
  ##
1498
+ # RPC-specific configuration for `list_assets`
1499
+ # @return [::Gapic::Config::Method]
1500
+ #
1501
+ attr_reader :list_assets
1502
+ ##
1344
1503
  # RPC-specific configuration for `batch_get_assets_history`
1345
1504
  # @return [::Gapic::Config::Method]
1346
1505
  #
@@ -1395,6 +1554,8 @@ module Google
1395
1554
  def initialize parent_rpcs = nil
1396
1555
  export_assets_config = parent_rpcs.export_assets if parent_rpcs.respond_to? :export_assets
1397
1556
  @export_assets = ::Gapic::Config::Method.new export_assets_config
1557
+ list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets
1558
+ @list_assets = ::Gapic::Config::Method.new list_assets_config
1398
1559
  batch_get_assets_history_config = parent_rpcs.batch_get_assets_history if parent_rpcs.respond_to? :batch_get_assets_history
1399
1560
  @batch_get_assets_history = ::Gapic::Config::Method.new batch_get_assets_history_config
1400
1561
  create_feed_config = parent_rpcs.create_feed if parent_rpcs.respond_to? :create_feed
@@ -12,6 +12,7 @@ require 'google/longrunning/operations_pb'
12
12
  require 'google/protobuf/duration_pb'
13
13
  require 'google/protobuf/empty_pb'
14
14
  require 'google/protobuf/field_mask_pb'
15
+ require 'google/protobuf/struct_pb'
15
16
  require 'google/protobuf/timestamp_pb'
16
17
  require 'google/type/expr_pb'
17
18
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -28,6 +29,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
29
  optional :output_config, :message, 2, "google.cloud.asset.v1.OutputConfig"
29
30
  optional :output_result, :message, 3, "google.cloud.asset.v1.OutputResult"
30
31
  end
32
+ add_message "google.cloud.asset.v1.ListAssetsRequest" do
33
+ optional :parent, :string, 1
34
+ optional :read_time, :message, 2, "google.protobuf.Timestamp"
35
+ repeated :asset_types, :string, 3
36
+ optional :content_type, :enum, 4, "google.cloud.asset.v1.ContentType"
37
+ optional :page_size, :int32, 5
38
+ optional :page_token, :string, 6
39
+ end
40
+ add_message "google.cloud.asset.v1.ListAssetsResponse" do
41
+ optional :read_time, :message, 1, "google.protobuf.Timestamp"
42
+ repeated :assets, :message, 2, "google.cloud.asset.v1.Asset"
43
+ optional :next_page_token, :string, 3
44
+ end
31
45
  add_message "google.cloud.asset.v1.BatchGetAssetsHistoryRequest" do
32
46
  optional :parent, :string, 1
33
47
  repeated :asset_names, :string, 2
@@ -137,6 +151,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
137
151
  optional :identity_selector, :message, 3, "google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector"
138
152
  optional :access_selector, :message, 4, "google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector"
139
153
  optional :options, :message, 5, "google.cloud.asset.v1.IamPolicyAnalysisQuery.Options"
154
+ optional :condition_context, :message, 6, "google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext"
140
155
  end
141
156
  add_message "google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector" do
142
157
  optional :full_resource_name, :string, 1
@@ -156,6 +171,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
156
171
  optional :output_group_edges, :bool, 5
157
172
  optional :analyze_service_account_impersonation, :bool, 6
158
173
  end
174
+ add_message "google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext" do
175
+ oneof :TimeContext do
176
+ optional :access_time, :message, 1, "google.protobuf.Timestamp"
177
+ end
178
+ end
159
179
  add_message "google.cloud.asset.v1.AnalyzeIamPolicyRequest" do
160
180
  optional :analysis_query, :message, 1, "google.cloud.asset.v1.IamPolicyAnalysisQuery"
161
181
  optional :execution_timeout, :message, 2, "google.protobuf.Duration"
@@ -213,6 +233,8 @@ module Google
213
233
  module V1
214
234
  ExportAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ExportAssetsRequest").msgclass
215
235
  ExportAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ExportAssetsResponse").msgclass
236
+ ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ListAssetsRequest").msgclass
237
+ ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ListAssetsResponse").msgclass
216
238
  BatchGetAssetsHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.BatchGetAssetsHistoryRequest").msgclass
217
239
  BatchGetAssetsHistoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.BatchGetAssetsHistoryResponse").msgclass
218
240
  CreateFeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.CreateFeedRequest").msgclass
@@ -240,6 +262,7 @@ module Google
240
262
  IamPolicyAnalysisQuery::IdentitySelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector").msgclass
241
263
  IamPolicyAnalysisQuery::AccessSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector").msgclass
242
264
  IamPolicyAnalysisQuery::Options = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisQuery.Options").msgclass
265
+ IamPolicyAnalysisQuery::ConditionContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext").msgclass
243
266
  AnalyzeIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.AnalyzeIamPolicyRequest").msgclass
244
267
  AnalyzeIamPolicyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.AnalyzeIamPolicyResponse").msgclass
245
268
  AnalyzeIamPolicyResponse::IamPolicyAnalysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis").msgclass
@@ -27,7 +27,7 @@ module Google
27
27
  # Asset service definition.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -44,6 +44,9 @@ module Google
44
44
  # result. For regular-size resource parent, the export operation usually
45
45
  # finishes within 5 minutes.
46
46
  rpc :ExportAssets, ::Google::Cloud::Asset::V1::ExportAssetsRequest, ::Google::Longrunning::Operation
47
+ # Lists assets with time and resource types and returns paged results in
48
+ # response.
49
+ rpc :ListAssets, ::Google::Cloud::Asset::V1::ListAssetsRequest, ::Google::Cloud::Asset::V1::ListAssetsResponse
47
50
  # Batch gets the update history of assets that overlap a time window.
48
51
  # For IAM_POLICY content, this API outputs history when the asset and its
49
52
  # attached IAM POLICY both exist. This can create gaps in the output history.
@@ -63,12 +63,20 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
63
63
  optional :name, :string, 1
64
64
  optional :asset_type, :string, 2
65
65
  optional :project, :string, 3
66
+ repeated :folders, :string, 17
67
+ optional :organization, :string, 18
66
68
  optional :display_name, :string, 4
67
69
  optional :description, :string, 5
68
70
  optional :location, :string, 6
69
71
  map :labels, :string, :string, 7
70
72
  repeated :network_tags, :string, 8
73
+ optional :kms_key, :string, 10
74
+ optional :create_time, :message, 11, "google.protobuf.Timestamp"
75
+ optional :update_time, :message, 12, "google.protobuf.Timestamp"
76
+ optional :state, :string, 13
71
77
  optional :additional_attributes, :message, 9, "google.protobuf.Struct"
78
+ optional :parent_full_resource_name, :string, 19
79
+ optional :parent_asset_type, :string, 103
72
80
  end
73
81
  add_message "google.cloud.asset.v1.IamPolicySearchResult" do
74
82
  optional :resource, :string, 1
@@ -86,6 +94,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
86
94
  optional :code, :enum, 1, "google.rpc.Code"
87
95
  optional :cause, :string, 2
88
96
  end
97
+ add_message "google.cloud.asset.v1.ConditionEvaluation" do
98
+ optional :evaluation_value, :enum, 1, "google.cloud.asset.v1.ConditionEvaluation.EvaluationValue"
99
+ end
100
+ add_enum "google.cloud.asset.v1.ConditionEvaluation.EvaluationValue" do
101
+ value :EVALUATION_VALUE_UNSPECIFIED, 0
102
+ value :TRUE, 1
103
+ value :FALSE, 2
104
+ value :CONDITIONAL, 3
105
+ end
89
106
  add_message "google.cloud.asset.v1.IamPolicyAnalysisResult" do
90
107
  optional :attached_resource_full_name, :string, 1
91
108
  optional :iam_binding, :message, 2, "google.iam.v1.Binding"
@@ -116,6 +133,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
116
133
  repeated :resources, :message, 1, "google.cloud.asset.v1.IamPolicyAnalysisResult.Resource"
117
134
  repeated :accesses, :message, 2, "google.cloud.asset.v1.IamPolicyAnalysisResult.Access"
118
135
  repeated :resource_edges, :message, 3, "google.cloud.asset.v1.IamPolicyAnalysisResult.Edge"
136
+ optional :condition_evaluation, :message, 4, "google.cloud.asset.v1.ConditionEvaluation"
119
137
  end
120
138
  add_message "google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList" do
121
139
  repeated :identities, :message, 1, "google.cloud.asset.v1.IamPolicyAnalysisResult.Identity"
@@ -138,6 +156,8 @@ module Google
138
156
  IamPolicySearchResult::Explanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicySearchResult.Explanation").msgclass
139
157
  IamPolicySearchResult::Explanation::Permissions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions").msgclass
140
158
  IamPolicyAnalysisState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisState").msgclass
159
+ ConditionEvaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ConditionEvaluation").msgclass
160
+ ConditionEvaluation::EvaluationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ConditionEvaluation.EvaluationValue").enummodule
141
161
  IamPolicyAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisResult").msgclass
142
162
  IamPolicyAnalysisResult::Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisResult.Resource").msgclass
143
163
  IamPolicyAnalysisResult::Access = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicyAnalysisResult.Access").msgclass
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Asset
23
23
  module V1
24
- VERSION = "0.11.0"
24
+ VERSION = "0.12.0"
25
25
  end
26
26
  end
27
27
  end
@@ -88,6 +88,75 @@ module Google
88
88
  extend ::Google::Protobuf::MessageExts::ClassMethods
89
89
  end
90
90
 
91
+ # ListAssets request.
92
+ # @!attribute [rw] parent
93
+ # @return [::String]
94
+ # Required. Name of the organization or project the assets belong to. Format:
95
+ # "organizations/[organization-number]" (such as "organizations/123"),
96
+ # "projects/[project-id]" (such as "projects/my-project-id"), or
97
+ # "projects/[project-number]" (such as "projects/12345").
98
+ # @!attribute [rw] read_time
99
+ # @return [::Google::Protobuf::Timestamp]
100
+ # Timestamp to take an asset snapshot. This can only be set to a timestamp
101
+ # between the current time and the current time minus 35 days (inclusive).
102
+ # If not specified, the current time will be used. Due to delays in resource
103
+ # data collection and indexing, there is a volatile window during which
104
+ # running the same query may get different results.
105
+ # @!attribute [rw] asset_types
106
+ # @return [::Array<::String>]
107
+ # A list of asset types to take a snapshot for. For example:
108
+ # "compute.googleapis.com/Disk".
109
+ #
110
+ # Regular expression is also supported. For example:
111
+ #
112
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
113
+ # with "compute.googleapis.com".
114
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
115
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
116
+ #
117
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
118
+ # regular expression syntax. If the regular expression does not match any
119
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
120
+ #
121
+ # If specified, only matching assets will be returned, otherwise, it will
122
+ # snapshot all asset types. See [Introduction to Cloud Asset
123
+ # Inventory](https://cloud.google.com/asset-inventory/docs/overview)
124
+ # for all supported asset types.
125
+ # @!attribute [rw] content_type
126
+ # @return [::Google::Cloud::Asset::V1::ContentType]
127
+ # Asset content type. If not specified, no content but the asset name will
128
+ # be returned.
129
+ # @!attribute [rw] page_size
130
+ # @return [::Integer]
131
+ # The maximum number of assets to be returned in a single response. Default
132
+ # is 100, minimum is 1, and maximum is 1000.
133
+ # @!attribute [rw] page_token
134
+ # @return [::String]
135
+ # The `next_page_token` returned from the previous `ListAssetsResponse`, or
136
+ # unspecified for the first `ListAssetsRequest`. It is a continuation of a
137
+ # prior `ListAssets` call, and the API should return the next page of assets.
138
+ class ListAssetsRequest
139
+ include ::Google::Protobuf::MessageExts
140
+ extend ::Google::Protobuf::MessageExts::ClassMethods
141
+ end
142
+
143
+ # ListAssets response.
144
+ # @!attribute [rw] read_time
145
+ # @return [::Google::Protobuf::Timestamp]
146
+ # Time the snapshot was taken.
147
+ # @!attribute [rw] assets
148
+ # @return [::Array<::Google::Cloud::Asset::V1::Asset>]
149
+ # Assets.
150
+ # @!attribute [rw] next_page_token
151
+ # @return [::String]
152
+ # Token to retrieve the next page of results. It expires 72 hours after the
153
+ # page token for the first page is generated. Set to empty if there are no
154
+ # remaining results.
155
+ class ListAssetsResponse
156
+ include ::Google::Protobuf::MessageExts
157
+ extend ::Google::Protobuf::MessageExts::ClassMethods
158
+ end
159
+
91
160
  # Batch get assets history request.
92
161
  # @!attribute [rw] parent
93
162
  # @return [::String]
@@ -253,6 +322,10 @@ module Google
253
322
  # Editing Object
254
323
  # Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
255
324
  # for more information.
325
+ #
326
+ # If the specified Cloud Storage object already exists and there is no
327
+ # [hold](https://cloud.google.com/storage/docs/object-holds), it will be
328
+ # overwritten with the exported result.
256
329
  # @!attribute [rw] uri_prefix
257
330
  # @return [::String]
258
331
  # The uri prefix of all generated Cloud Storage objects. Example:
@@ -457,7 +530,7 @@ module Google
457
530
  # @return [::String]
458
531
  # Required. A scope can be a project, a folder, or an organization. The search is
459
532
  # limited to the resources within the `scope`. The caller must be granted the
460
- # [`cloudasset.assets.searchAllResources`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
533
+ # [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
461
534
  # permission on the desired scope.
462
535
  #
463
536
  # The allowed values are:
@@ -469,36 +542,41 @@ module Google
469
542
  # @!attribute [rw] query
470
543
  # @return [::String]
471
544
  # Optional. The query statement. See [how to construct a
472
- # query](http://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
545
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
473
546
  # for more information. If not specified or empty, it will search all the
474
- # resources within the specified `scope`. Note that the query string is
475
- # compared against each Cloud IAM policy binding, including its members,
476
- # roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
477
- # contain the bindings that match your query. To learn more about the IAM
478
- # policy structure, see [IAM policy
479
- # doc](https://cloud.google.com/iam/docs/policies#structure).
547
+ # resources within the specified `scope`.
480
548
  #
481
549
  # Examples:
482
550
  #
483
551
  # * `name:Important` to find Cloud resources whose name contains
484
552
  # "Important" as a word.
553
+ # * `name=Important` to find the Cloud resource whose name is exactly
554
+ # "Important".
485
555
  # * `displayName:Impor*` to find Cloud resources whose display name
486
- # contains "Impor" as a prefix.
487
- # * `description:*por*` to find Cloud resources whose description
488
- # contains "por" as a substring.
489
- # * `location:us-west*` to find Cloud resources whose location is
490
- # prefixed with "us-west".
556
+ # contains "Impor" as a prefix of any word in the field.
557
+ # * `location:us-west*` to find Cloud resources whose location contains both
558
+ # "us" and "west" as prefixes.
491
559
  # * `labels:prod` to find Cloud resources whose labels contain "prod" as
492
560
  # a key or value.
493
561
  # * `labels.env:prod` to find Cloud resources that have a label "env"
494
562
  # and its value is "prod".
495
563
  # * `labels.env:*` to find Cloud resources that have a label "env".
564
+ # * `kmsKey:key` to find Cloud resources encrypted with a customer-managed
565
+ # encryption key whose name contains the word "key".
566
+ # * `state:ACTIVE` to find Cloud resources whose state contains "ACTIVE" as a
567
+ # word.
568
+ # * `NOT state:ACTIVE` to find \\{\\{gcp_name}} resources whose state
569
+ # doesn't contain "ACTIVE" as a word.
570
+ # * `createTime<1609459200` to find Cloud resources that were created before
571
+ # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
572
+ # "2021-01-01 00:00:00 UTC" in seconds.
573
+ # * `updateTime>1609459200` to find Cloud resources that were updated after
574
+ # "2021-01-01 00:00:00 UTC". 1609459200 is the epoch timestamp of
575
+ # "2021-01-01 00:00:00 UTC" in seconds.
496
576
  # * `Important` to find Cloud resources that contain "Important" as a word
497
577
  # in any of the searchable fields.
498
- # * `Impor*` to find Cloud resources that contain "Impor" as a prefix
499
- # in any of the searchable fields.
500
- # * `*por*` to find Cloud resources that contain "por" as a substring in
501
- # any of the searchable fields.
578
+ # * `Impor*` to find Cloud resources that contain "Impor" as a prefix of any
579
+ # word in any of the searchable fields.
502
580
  # * `Important location:(us-west1 OR global)` to find Cloud
503
581
  # resources that contain "Important" as a word in any of the searchable
504
582
  # fields and are also located in the "us-west1" region or the "global"
@@ -508,6 +586,17 @@ module Google
508
586
  # Optional. A list of asset types that this request searches for. If empty, it will
509
587
  # search all the [searchable asset
510
588
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
589
+ #
590
+ # Regular expressions are also supported. For example:
591
+ #
592
+ # * "compute.googleapis.com.*" snapshots resources whose asset type starts
593
+ # with "compute.googleapis.com".
594
+ # * ".*Instance" snapshots resources whose asset type ends with "Instance".
595
+ # * ".*Instance.*" snapshots resources whose asset type contains "Instance".
596
+ #
597
+ # See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
598
+ # regular expression syntax. If the regular expression does not match any
599
+ # supported asset type, an INVALID_ARGUMENT error will be returned.
511
600
  # @!attribute [rw] page_size
512
601
  # @return [::Integer]
513
602
  # Optional. The page size for search result pagination. Page size is capped at 500 even
@@ -522,12 +611,24 @@ module Google
522
611
  # identical to those in the previous call.
523
612
  # @!attribute [rw] order_by
524
613
  # @return [::String]
525
- # Optional. A comma separated list of fields specifying the sorting order of the
614
+ # Optional. A comma-separated list of fields specifying the sorting order of the
526
615
  # results. The default order is ascending. Add " DESC" after the field name
527
616
  # to indicate descending order. Redundant space characters are ignored.
528
- # Example: "location DESC, name". Only string fields in the response are
529
- # sortable, including `name`, `displayName`, `description`, `location`. All
530
- # the other fields such as repeated fields (e.g., `networkTags`), map
617
+ # Example: "location DESC, name".
618
+ # Only singular primitive fields in the response are sortable:
619
+ # * name
620
+ # * assetType
621
+ # * project
622
+ # * displayName
623
+ # * description
624
+ # * location
625
+ # * kmsKey
626
+ # * createTime
627
+ # * updateTime
628
+ # * state
629
+ # * parentFullResourceName
630
+ # * parentAssetType
631
+ # All the other fields such as repeated fields (e.g., `networkTags`), map
531
632
  # fields (e.g., `labels`) and struct fields (e.g., `additionalAttributes`)
532
633
  # are not supported.
533
634
  class SearchAllResourcesRequest
@@ -556,7 +657,7 @@ module Google
556
657
  # Required. A scope can be a project, a folder, or an organization. The search is
557
658
  # limited to the IAM policies within the `scope`. The caller must be granted
558
659
  # the
559
- # [`cloudasset.assets.searchAllIamPolicies`](http://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
660
+ # [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions)
560
661
  # permission on the desired scope.
561
662
  #
562
663
  # The allowed values are:
@@ -570,7 +671,12 @@ module Google
570
671
  # Optional. The query statement. See [how to construct a
571
672
  # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
572
673
  # for more information. If not specified or empty, it will search all the
573
- # IAM policies within the specified `scope`.
674
+ # IAM policies within the specified `scope`. Note that the query string is
675
+ # compared against each Cloud IAM policy binding, including its members,
676
+ # roles, and Cloud IAM conditions. The returned Cloud IAM policies will only
677
+ # contain the bindings that match your query. To learn more about the IAM
678
+ # policy structure, see [IAM policy
679
+ # doc](https://cloud.google.com/iam/docs/policies#structure).
574
680
  #
575
681
  # Examples:
576
682
  #
@@ -578,18 +684,25 @@ module Google
578
684
  # "amy@gmail.com".
579
685
  # * `policy:roles/compute.admin` to find IAM policy bindings that specify
580
686
  # the Compute Admin role.
687
+ # * `policy:comp*` to find IAM policy bindings that contain "comp" as a
688
+ # prefix of any word in the binding.
581
689
  # * `policy.role.permissions:storage.buckets.update` to find IAM policy
582
690
  # bindings that specify a role containing "storage.buckets.update"
583
691
  # permission. Note that if callers don't have `iam.roles.get` access to a
584
692
  # role's included permissions, policy bindings that specify this role will
585
693
  # be dropped from the search results.
694
+ # * `policy.role.permissions:upd*` to find IAM policy bindings that specify a
695
+ # role containing "upd" as a prefix of any word in the role permission.
696
+ # Note that if callers don't have `iam.roles.get` access to a role's
697
+ # included permissions, policy bindings that specify this role will be
698
+ # dropped from the search results.
586
699
  # * `resource:organizations/123456` to find IAM policy bindings
587
700
  # that are set on "organizations/123456".
701
+ # * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to
702
+ # find IAM policy bindings that are set on the project named "myproject".
588
703
  # * `Important` to find IAM policy bindings that contain "Important" as a
589
704
  # word in any of the searchable fields (except for the included
590
705
  # permissions).
591
- # * `*por*` to find IAM policy bindings that contain "por" as a substring
592
- # in any of the searchable fields (except for the included permissions).
593
706
  # * `resource:(instance1 OR instance2) policy:amy` to find
594
707
  # IAM policy bindings that are set on resources "instance1" or
595
708
  # "instance2" and also specify user "amy".
@@ -625,7 +738,7 @@ module Google
625
738
  extend ::Google::Protobuf::MessageExts::ClassMethods
626
739
  end
627
740
 
628
- # IAM policy analysis query message.
741
+ # ## IAM policy analysis query message.
629
742
  # @!attribute [rw] scope
630
743
  # @return [::String]
631
744
  # Required. The relative name of the root asset. Only resources and IAM policies within
@@ -652,6 +765,9 @@ module Google
652
765
  # @!attribute [rw] options
653
766
  # @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::Options]
654
767
  # Optional. The query options.
768
+ # @!attribute [rw] condition_context
769
+ # @return [::Google::Cloud::Asset::V1::IamPolicyAnalysisQuery::ConditionContext]
770
+ # Optional. The hypothetical context for IAM conditions evaluation.
655
771
  class IamPolicyAnalysisQuery
656
772
  include ::Google::Protobuf::MessageExts
657
773
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -791,6 +907,17 @@ module Google
791
907
  include ::Google::Protobuf::MessageExts
792
908
  extend ::Google::Protobuf::MessageExts::ClassMethods
793
909
  end
910
+
911
+ # The IAM conditions context.
912
+ # @!attribute [rw] access_time
913
+ # @return [::Google::Protobuf::Timestamp]
914
+ # The hypothetical access timestamp to evaluate IAM conditions. Note that
915
+ # this value must not be earlier than the current time; otherwise, an
916
+ # INVALID_ARGUMENT error will be returned.
917
+ class ConditionContext
918
+ include ::Google::Protobuf::MessageExts
919
+ extend ::Google::Protobuf::MessageExts::ClassMethods
920
+ end
794
921
  end
795
922
 
796
923
  # A request message for {::Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy AssetService.AnalyzeIamPolicy}.
@@ -868,9 +995,14 @@ module Google
868
995
  # @!attribute [rw] uri
869
996
  # @return [::String]
870
997
  # Required. The uri of the Cloud Storage object. It's the same uri that is used by
871
- # gsutil. For example: "gs://bucket_name/object_name". See
872
- # [Quickstart: Using the gsutil tool]
873
- # (https://cloud.google.com/storage/docs/quickstart-gsutil) for examples.
998
+ # gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
999
+ # Editing Object
1000
+ # Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
1001
+ # for more information.
1002
+ #
1003
+ # If the specified Cloud Storage object already exists and there is no
1004
+ # [hold](https://cloud.google.com/storage/docs/object-holds), it will be
1005
+ # overwritten with the analysis result.
874
1006
  class GcsDestination
875
1007
  include ::Google::Protobuf::MessageExts
876
1008
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -79,7 +79,8 @@ module Google
79
79
  # [resource
80
80
  # hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
81
81
  # a resource outside the Google Cloud resource hierarchy (such as Google
82
- # Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
82
+ # Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy),
83
+ # or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship).
83
84
  # See [Supported asset
84
85
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
85
86
  # for more information.
@@ -230,14 +231,40 @@ module Google
230
231
  # @!attribute [rw] project
231
232
  # @return [::String]
232
233
  # The project that this resource belongs to, in the form of
233
- # projects/\\{PROJECT_NUMBER}.
234
+ # projects/\\{PROJECT_NUMBER}. This field is available when the resource
235
+ # belongs to a project.
234
236
  #
235
- # To search against the `project`:
237
+ # To search against `project`:
236
238
  #
239
+ # * use a field query. Example: `project:12345`
240
+ # * use a free text query. Example: `12345`
237
241
  # * specify the `scope` field as this project in your search request.
242
+ # @!attribute [rw] folders
243
+ # @return [::Array<::String>]
244
+ # The folder(s) that this resource belongs to, in the form of
245
+ # folders/\\{FOLDER_NUMBER}. This field is available when the resource
246
+ # belongs to one or more folders.
247
+ #
248
+ # To search against `folders`:
249
+ #
250
+ # * use a field query. Example: `folders:(123 OR 456)`
251
+ # * use a free text query. Example: `123`
252
+ # * specify the `scope` field as this folder in your search request.
253
+ # @!attribute [rw] organization
254
+ # @return [::String]
255
+ # The organization that this resource belongs to, in the form of
256
+ # organizations/\\{ORGANIZATION_NUMBER}. This field is available when the
257
+ # resource belongs to an organization.
258
+ #
259
+ # To search against `organization`:
260
+ #
261
+ # * use a field query. Example: `organization:123`
262
+ # * use a free text query. Example: `123`
263
+ # * specify the `scope` field as this organization in your search request.
238
264
  # @!attribute [rw] display_name
239
265
  # @return [::String]
240
- # The display name of this resource.
266
+ # The display name of this resource. This field is available only when the
267
+ # resource's proto contains it.
241
268
  #
242
269
  # To search against the `display_name`:
243
270
  #
@@ -246,16 +273,18 @@ module Google
246
273
  # @!attribute [rw] description
247
274
  # @return [::String]
248
275
  # One or more paragraphs of text description of this resource. Maximum length
249
- # could be up to 1M bytes.
276
+ # could be up to 1M bytes. This field is available only when the resource's
277
+ # proto contains it.
250
278
  #
251
279
  # To search against the `description`:
252
280
  #
253
- # * use a field query. Example: `description:"*important instance*"`
254
- # * use a free text query. Example: `"*important instance*"`
281
+ # * use a field query. Example: `description:"important instance"`
282
+ # * use a free text query. Example: `"important instance"`
255
283
  # @!attribute [rw] location
256
284
  # @return [::String]
257
285
  # Location can be `global`, regional like `us-east1`, or zonal like
258
- # `us-west1-b`.
286
+ # `us-west1-b`. This field is available only when the resource's proto
287
+ # contains it.
259
288
  #
260
289
  # To search against the `location`:
261
290
  #
@@ -265,7 +294,8 @@ module Google
265
294
  # @return [::Google::Protobuf::Map{::String => ::String}]
266
295
  # Labels associated with this resource. See [Labelling and grouping GCP
267
296
  # resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
268
- # for more information.
297
+ # for more information. This field is available only when the resource's
298
+ # proto contains it.
269
299
  #
270
300
  # To search against the `labels`:
271
301
  #
@@ -279,12 +309,73 @@ module Google
279
309
  # Network tags associated with this resource. Like labels, network tags are a
280
310
  # type of annotations used to group GCP resources. See [Labelling GCP
281
311
  # resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
282
- # for more information.
312
+ # for more information. This field is available only when the resource's
313
+ # proto contains it.
283
314
  #
284
315
  # To search against the `network_tags`:
285
316
  #
286
317
  # * use a field query. Example: `networkTags:internal`
287
318
  # * use a free text query. Example: `internal`
319
+ # @!attribute [rw] kms_key
320
+ # @return [::String]
321
+ # The Cloud KMS
322
+ # [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys?hl=en)
323
+ # name or
324
+ # [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en)
325
+ # name. This field is available only when the resource's proto contains it.
326
+ #
327
+ # To search against the `kms_key`:
328
+ #
329
+ # * use a field query. Example: `kmsKey:key`
330
+ # * use a free text query. Example: `key`
331
+ # @!attribute [rw] create_time
332
+ # @return [::Google::Protobuf::Timestamp]
333
+ # The create timestamp of this resource, at which the resource was created.
334
+ # The granularity is in seconds. Timestamp.nanos will always be 0. This field
335
+ # is available only when the resource's proto contains it.
336
+ #
337
+ # To search against `create_time`:
338
+ #
339
+ # * use a field query.
340
+ # - value in seconds since unix epoch. Example: `createTime > 1609459200`
341
+ # - value in date string. Example: `createTime > 2021-01-01`
342
+ # - value in date-time string (must be quoted). Example: `createTime >
343
+ # "2021-01-01T00:00:00"`
344
+ # @!attribute [rw] update_time
345
+ # @return [::Google::Protobuf::Timestamp]
346
+ # The last update timestamp of this resource, at which the resource was last
347
+ # modified or deleted. The granularity is in seconds. Timestamp.nanos will
348
+ # always be 0. This field is available only when the resource's proto
349
+ # contains it.
350
+ #
351
+ # To search against `update_time`:
352
+ #
353
+ # * use a field query.
354
+ # - value in seconds since unix epoch. Example: `updateTime < 1609459200`
355
+ # - value in date string. Example: `updateTime < 2021-01-01`
356
+ # - value in date-time string (must be quoted). Example: `updateTime <
357
+ # "2021-01-01T00:00:00"`
358
+ # @!attribute [rw] state
359
+ # @return [::String]
360
+ # The state of this resource. Different resources types have different state
361
+ # definitions that are mapped from various fields of different resource
362
+ # types. This field is available only when the resource's proto contains it.
363
+ #
364
+ # Example:
365
+ # If the resource is an instance provided by Compute Engine,
366
+ # its state will include PROVISIONING, STAGING, RUNNING, STOPPING,
367
+ # SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition
368
+ # in [API
369
+ # Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances).
370
+ # If the resource is a project provided by Cloud Resource Manager, its state
371
+ # will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and
372
+ # DELETE_IN_PROGRESS. See `lifecycleState` definition in [API
373
+ # Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects).
374
+ #
375
+ # To search against the `state`:
376
+ #
377
+ # * use a field query. Example: `state:RUNNING`
378
+ # * use a free text query. Example: `RUNNING`
288
379
  # @!attribute [rw] additional_attributes
289
380
  # @return [::Google::Protobuf::Struct]
290
381
  # The additional searchable attributes of this resource. The attributes may
@@ -294,7 +385,7 @@ module Google
294
385
  # corresponding GCP service (e.g., Compute Engine). see [API references and
295
386
  # supported searchable
296
387
  # attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types)
297
- # for more information.
388
+ # to see which fields are included.
298
389
  #
299
390
  # You can search values of these fields through free text search. However,
300
391
  # you should not consume the field programically as the field names and
@@ -306,6 +397,25 @@ module Google
306
397
  # * use a free text query to match the attributes values. Example: to search
307
398
  # `additional_attributes = { dnsName: "foobar" }`, you can issue a query
308
399
  # `foobar`.
400
+ # @!attribute [rw] parent_full_resource_name
401
+ # @return [::String]
402
+ # The full resource name of this resource's parent, if it has one.
403
+ # To search against the `parent_full_resource_name`:
404
+ #
405
+ # * use a field query. Example:
406
+ # `parentFullResourceName:"project-name"`
407
+ # * use a free text query. Example:
408
+ # `project-name`
409
+ # @!attribute [rw] parent_asset_type
410
+ # @return [::String]
411
+ # The type of this resource's immediate parent, if there is one.
412
+ #
413
+ # To search against the `parent_asset_type`:
414
+ #
415
+ # * use a field query. Example:
416
+ # `parentAssetType:"cloudresourcemanager.googleapis.com/Project"`
417
+ # * use a free text query. Example:
418
+ # `cloudresourcemanager.googleapis.com/Project`
309
419
  class ResourceSearchResult
310
420
  include ::Google::Protobuf::MessageExts
311
421
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -339,7 +449,7 @@ module Google
339
449
  # projects/\\{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM
340
450
  # instance, Cloud Storage bucket), the project field will indicate the
341
451
  # project that contains the resource. If an IAM policy is set on a folder or
342
- # orgnization, the project field will be empty.
452
+ # orgnization, this field will be empty.
343
453
  #
344
454
  # To search against the `project`:
345
455
  #
@@ -420,6 +530,32 @@ module Google
420
530
  extend ::Google::Protobuf::MessageExts::ClassMethods
421
531
  end
422
532
 
533
+ # The Condition evaluation.
534
+ # @!attribute [rw] evaluation_value
535
+ # @return [::Google::Cloud::Asset::V1::ConditionEvaluation::EvaluationValue]
536
+ # The evaluation result.
537
+ class ConditionEvaluation
538
+ include ::Google::Protobuf::MessageExts
539
+ extend ::Google::Protobuf::MessageExts::ClassMethods
540
+
541
+ # Value of this expression.
542
+ module EvaluationValue
543
+ # Reserved for future use.
544
+ EVALUATION_VALUE_UNSPECIFIED = 0
545
+
546
+ # The evaluation result is `true`.
547
+ TRUE = 1
548
+
549
+ # The evaluation result is `false`.
550
+ FALSE = 2
551
+
552
+ # The evaluation result is `conditional` when the condition expression
553
+ # contains variables that are either missing input values or have not been
554
+ # supported by Analyzer yet.
555
+ CONDITIONAL = 3
556
+ end
557
+ end
558
+
423
559
  # IAM Policy analysis result, consisting of one IAM policy binding and derived
424
560
  # access control lists.
425
561
  # @!attribute [rw] attached_resource_full_name
@@ -542,6 +678,10 @@ module Google
542
678
  # the full resource name of a parent resource and {::Google::Cloud::Asset::V1::IamPolicyAnalysisResult::Edge#target_node Edge.target_node}
543
679
  # contains the full resource name of a child resource. This field is
544
680
  # present only if the output_resource_edges option is enabled in request.
681
+ # @!attribute [rw] condition_evaluation
682
+ # @return [::Google::Cloud::Asset::V1::ConditionEvaluation]
683
+ # Condition evaluation for this AccessControlList, if there is a condition
684
+ # defined in the above IAM policy binding.
545
685
  class AccessControlList
546
686
  include ::Google::Protobuf::MessageExts
547
687
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-asset-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.5'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.5'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -47,7 +53,7 @@ dependencies:
47
53
  version: 0.6.10
48
54
  - - "<"
49
55
  - !ruby/object:Gem::Version
50
- version: '2.0'
56
+ version: 2.a
51
57
  type: :runtime
52
58
  prerelease: false
53
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +63,7 @@ dependencies:
57
63
  version: 0.6.10
58
64
  - - "<"
59
65
  - !ruby/object:Gem::Version
60
- version: '2.0'
66
+ version: 2.a
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: google-style
63
69
  requirement: !ruby/object:Gem::Requirement
@@ -242,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
248
  - !ruby/object:Gem::Version
243
249
  version: '0'
244
250
  requirements: []
245
- rubygems_version: 3.2.13
251
+ rubygems_version: 3.2.17
246
252
  signing_key:
247
253
  specification_version: 4
248
254
  summary: API Client library for the Cloud Asset V1 API