google-cloud-asset-v1 0.2.3 → 0.4.3

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: 146d92531ea9d255916e790bba685754e5dd33c40bda18a0bca7a5a41b65c463
4
- data.tar.gz: d6ce7170c915fb035581a909bf716dd4d16271027f6c22256149d9a4739afd2d
3
+ metadata.gz: f46ad7edc434252f8c8dee87bfba260b8aa24346e300cf6ab7d442e81c89c3e1
4
+ data.tar.gz: 56d5a1b6d03b3b5a8ec8448266abd000d76dc0e06245b6590a7f2739e32852f7
5
5
  SHA512:
6
- metadata.gz: 5919727dae53db59a1409e5b011b7b97edf4d0af4b23cf2f7efc0b27275ef201ed7e51695630ffda06d9b0b6c27c6691dfc9503fba21fcbd261e867d139b93b2
7
- data.tar.gz: ef8c73a1dc3da98c135aa199258a2f301ab591b50dfa21b85f755eab31ff49e8d3479adb64b01e2182bc421e3871bca1d8599264238e92b5c7a5af95bb9abfb6
6
+ metadata.gz: f12603eeb775698889082767fec48569b8a072e9029a42f9f4399e50148d9e322fb608fa2a13c8236980aae9249b63c011f7146aa7fa856a2a249a00bd435cf0
7
+ data.tar.gz: 433f992728d70ada4cce95693659300799287c9482be3d481ab9e9ea02fc8c712b0e4acc4a1be603272ae1a9c9634d5a1134204591e3644fb0249faf7e949b55
@@ -75,6 +75,22 @@ module Google
75
75
  retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
76
76
  }
77
77
 
78
+ default_config.rpcs.search_all_resources.timeout = 15.0
79
+ default_config.rpcs.search_all_resources.retry_policy = {
80
+ initial_delay: 0.1,
81
+ max_delay: 60.0,
82
+ multiplier: 1.3,
83
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
84
+ }
85
+
86
+ default_config.rpcs.search_all_iam_policies.timeout = 15.0
87
+ default_config.rpcs.search_all_iam_policies.retry_policy = {
88
+ initial_delay: 0.1,
89
+ max_delay: 60.0,
90
+ multiplier: 1.3,
91
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
92
+ }
93
+
78
94
  default_config
79
95
  end
80
96
  yield @configure if block_given?
@@ -140,7 +156,8 @@ module Google
140
156
  if credentials.is_a?(String) || credentials.is_a?(Hash)
141
157
  credentials = Credentials.new credentials, scope: @config.scope
142
158
  end
143
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
144
161
 
145
162
  @operations_client = Operations.new do |config|
146
163
  config.credentials = credentials
@@ -168,8 +185,9 @@ module Google
168
185
  ##
169
186
  # Exports assets with time and resource types to a given Cloud Storage
170
187
  # location. The output format is newline-delimited JSON.
171
- # This API implements the {::Google::Longrunning::Operation google.longrunning.Operation} API allowing you
172
- # to keep track of the export.
188
+ # This API implements the
189
+ # {::Google::Longrunning::Operation google.longrunning.Operation} API allowing
190
+ # you to keep track of the export.
173
191
  #
174
192
  # @overload export_assets(request, options = nil)
175
193
  # Pass arguments to `export_assets` via a request object, either of type
@@ -379,9 +397,8 @@ module Google
379
397
  # Required. This is the client-assigned asset feed identifier and it needs to
380
398
  # be unique under a specific parent project/folder/organization.
381
399
  # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
382
- # Required. The feed details. The field `name` must be empty and it will be generated
383
- # in the format of:
384
- # projects/project_number/feeds/feed_id
400
+ # Required. The feed details. The field `name` must be empty and it will be
401
+ # generated in the format of: projects/project_number/feeds/feed_id
385
402
  # folders/folder_number/feeds/feed_id
386
403
  # organizations/organization_number/feeds/feed_id
387
404
  #
@@ -586,8 +603,8 @@ module Google
586
603
  # the default parameter values, pass an empty Hash as a request object (see above).
587
604
  #
588
605
  # @param feed [::Google::Cloud::Asset::V1::Feed, ::Hash]
589
- # Required. The new values of feed details. It must match an existing feed and the
590
- # field `name` must be in the format of:
606
+ # Required. The new values of feed details. It must match an existing feed
607
+ # and the field `name` must be in the format of:
591
608
  # projects/project_number/feeds/feed_id or
592
609
  # folders/folder_number/feeds/feed_id or
593
610
  # organizations/organization_number/feeds/feed_id.
@@ -710,6 +727,250 @@ module Google
710
727
  raise ::Google::Cloud::Error.from_error(e)
711
728
  end
712
729
 
730
+ ##
731
+ # Searches all the resources within the given accessible scope (e.g., a
732
+ # project, a folder or an organization). Callers should have
733
+ # cloud.assets.SearchAllResources permission upon the requested scope,
734
+ # otherwise the request will be rejected.
735
+ #
736
+ # @overload search_all_resources(request, options = nil)
737
+ # Pass arguments to `search_all_resources` via a request object, either of type
738
+ # {::Google::Cloud::Asset::V1::SearchAllResourcesRequest} or an equivalent Hash.
739
+ #
740
+ # @param request [::Google::Cloud::Asset::V1::SearchAllResourcesRequest, ::Hash]
741
+ # A request object representing the call parameters. Required. To specify no
742
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
743
+ # @param options [::Gapic::CallOptions, ::Hash]
744
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
745
+ #
746
+ # @overload search_all_resources(scope: nil, query: nil, asset_types: nil, page_size: nil, page_token: nil, order_by: nil)
747
+ # Pass arguments to `search_all_resources` via keyword arguments. Note that at
748
+ # least one keyword argument is required. To specify no parameters, or to keep all
749
+ # the default parameter values, pass an empty Hash as a request object (see above).
750
+ #
751
+ # @param scope [::String]
752
+ # Required. A scope can be a project, a folder or an organization. The search
753
+ # is limited to the resources within the `scope`.
754
+ #
755
+ # The allowed values are:
756
+ #
757
+ # * projects/\\{PROJECT_ID}
758
+ # * projects/\\{PROJECT_NUMBER}
759
+ # * folders/\\{FOLDER_NUMBER}
760
+ # * organizations/\\{ORGANIZATION_NUMBER}
761
+ # @param query [::String]
762
+ # Optional. The query statement. An empty query can be specified to search
763
+ # all the resources of certain `asset_types` within the given `scope`.
764
+ #
765
+ # Examples:
766
+ #
767
+ # * `name : "Important"` to find Cloud resources whose name contains
768
+ # "Important" as a word.
769
+ # * `displayName : "Impor*"` to find Cloud resources whose display name
770
+ # contains "Impor" as a word prefix.
771
+ # * `description : "*por*"` to find Cloud resources whose description
772
+ # contains "por" as a substring.
773
+ # * `location : "us-west*"` to find Cloud resources whose location is
774
+ # prefixed with "us-west".
775
+ # * `labels : "prod"` to find Cloud resources whose labels contain "prod" as
776
+ # a key or value.
777
+ # * `labels.env : "prod"` to find Cloud resources which have a label "env"
778
+ # and its value is "prod".
779
+ # * `labels.env : *` to find Cloud resources which have a label "env".
780
+ # * `"Important"` to find Cloud resources which contain "Important" as a word
781
+ # in any of the searchable fields.
782
+ # * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix
783
+ # in any of the searchable fields.
784
+ # * `"*por*"` to find Cloud resources which contain "por" as a substring in
785
+ # any of the searchable fields.
786
+ # * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud
787
+ # resources which contain "Important" as a word in any of the searchable
788
+ # fields and are also located in the "us-west1" region or the "global"
789
+ # location.
790
+ #
791
+ # See [how to construct a
792
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
793
+ # for more details.
794
+ # @param asset_types [::Array<::String>]
795
+ # Optional. A list of asset types that this request searches for. If empty,
796
+ # it will search all the [searchable asset
797
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
798
+ # @param page_size [::Integer]
799
+ # Optional. The page size for search result pagination. Page size is capped
800
+ # at 500 even if a larger value is given. If set to zero, server will pick an
801
+ # appropriate default. Returned results may be fewer than requested. When
802
+ # this happens, there could be more results as long as `next_page_token` is
803
+ # returned.
804
+ # @param page_token [::String]
805
+ # Optional. If present, then retrieve the next batch of results from the
806
+ # preceding call to this method. `page_token` must be the value of
807
+ # `next_page_token` from the previous response. The values of all other
808
+ # method parameters, must be identical to those in the previous call.
809
+ # @param order_by [::String]
810
+ # Optional. A comma separated list of fields specifying the sorting order of
811
+ # the results. The default order is ascending. Add " DESC" after the field
812
+ # name to indicate descending order. Redundant space characters are ignored.
813
+ # Example: "location DESC, name". See [supported resource metadata
814
+ # fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields)
815
+ # for more details.
816
+ #
817
+ # @yield [response, operation] Access the result along with the RPC operation
818
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
819
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
820
+ #
821
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::ResourceSearchResult>]
822
+ #
823
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
824
+ #
825
+ def search_all_resources request, options = nil
826
+ raise ::ArgumentError, "request must be provided" if request.nil?
827
+
828
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllResourcesRequest
829
+
830
+ # Converts hash and nil to an options object
831
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
832
+
833
+ # Customize the options with defaults
834
+ metadata = @config.rpcs.search_all_resources.metadata.to_h
835
+
836
+ # Set x-goog-api-client and x-goog-user-project headers
837
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
838
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
839
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
840
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
841
+
842
+ header_params = {
843
+ "scope" => request.scope
844
+ }
845
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
846
+ metadata[:"x-goog-request-params"] ||= request_params_header
847
+
848
+ options.apply_defaults timeout: @config.rpcs.search_all_resources.timeout,
849
+ metadata: metadata,
850
+ retry_policy: @config.rpcs.search_all_resources.retry_policy
851
+ options.apply_defaults metadata: @config.metadata,
852
+ retry_policy: @config.retry_policy
853
+
854
+ @asset_service_stub.call_rpc :search_all_resources, request, options: options do |response, operation|
855
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_resources, request, response, operation, options
856
+ yield response, operation if block_given?
857
+ return response
858
+ end
859
+ rescue ::GRPC::BadStatus => e
860
+ raise ::Google::Cloud::Error.from_error(e)
861
+ end
862
+
863
+ ##
864
+ # Searches all the IAM policies within the given accessible scope (e.g., a
865
+ # project, a folder or an organization). Callers should have
866
+ # cloud.assets.SearchAllIamPolicies permission upon the requested scope,
867
+ # otherwise the request will be rejected.
868
+ #
869
+ # @overload search_all_iam_policies(request, options = nil)
870
+ # Pass arguments to `search_all_iam_policies` via a request object, either of type
871
+ # {::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest} or an equivalent Hash.
872
+ #
873
+ # @param request [::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest, ::Hash]
874
+ # A request object representing the call parameters. Required. To specify no
875
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
876
+ # @param options [::Gapic::CallOptions, ::Hash]
877
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
878
+ #
879
+ # @overload search_all_iam_policies(scope: nil, query: nil, page_size: nil, page_token: nil)
880
+ # Pass arguments to `search_all_iam_policies` via keyword arguments. Note that at
881
+ # least one keyword argument is required. To specify no parameters, or to keep all
882
+ # the default parameter values, pass an empty Hash as a request object (see above).
883
+ #
884
+ # @param scope [::String]
885
+ # Required. A scope can be a project, a folder or an organization. The search
886
+ # is limited to the IAM policies within the `scope`.
887
+ #
888
+ # The allowed values are:
889
+ #
890
+ # * projects/\\{PROJECT_ID}
891
+ # * projects/\\{PROJECT_NUMBER}
892
+ # * folders/\\{FOLDER_NUMBER}
893
+ # * organizations/\\{ORGANIZATION_NUMBER}
894
+ # @param query [::String]
895
+ # Optional. The query statement. An empty query can be specified to search
896
+ # all the IAM policies within the given `scope`.
897
+ #
898
+ # Examples:
899
+ #
900
+ # * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that
901
+ # specify user "amy@gmail.com".
902
+ # * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that
903
+ # specify the Compute Admin role.
904
+ # * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM
905
+ # policy bindings that specify a role containing "storage.buckets.update"
906
+ # permission.
907
+ # * `resource : "organizations/123"` to find Cloud IAM policy bindings that
908
+ # are set on "organizations/123".
909
+ # * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")`
910
+ # to find Cloud IAM policy bindings that are set on "organizations/123" or
911
+ # "folders/1234", and also specify user "amy".
912
+ #
913
+ # See [how to construct a
914
+ # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
915
+ # for more details.
916
+ # @param page_size [::Integer]
917
+ # Optional. The page size for search result pagination. Page size is capped
918
+ # at 500 even if a larger value is given. If set to zero, server will pick an
919
+ # appropriate default. Returned results may be fewer than requested. When
920
+ # this happens, there could be more results as long as `next_page_token` is
921
+ # returned.
922
+ # @param page_token [::String]
923
+ # Optional. If present, retrieve the next batch of results from the preceding
924
+ # call to this method. `page_token` must be the value of `next_page_token`
925
+ # from the previous response. The values of all other method parameters must
926
+ # be identical to those in the previous call.
927
+ #
928
+ # @yield [response, operation] Access the result along with the RPC operation
929
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
930
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
931
+ #
932
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
933
+ #
934
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
935
+ #
936
+ def search_all_iam_policies request, options = nil
937
+ raise ::ArgumentError, "request must be provided" if request.nil?
938
+
939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest
940
+
941
+ # Converts hash and nil to an options object
942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
943
+
944
+ # Customize the options with defaults
945
+ metadata = @config.rpcs.search_all_iam_policies.metadata.to_h
946
+
947
+ # Set x-goog-api-client and x-goog-user-project headers
948
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
950
+ gapic_version: ::Google::Cloud::Asset::V1::VERSION
951
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
952
+
953
+ header_params = {
954
+ "scope" => request.scope
955
+ }
956
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
957
+ metadata[:"x-goog-request-params"] ||= request_params_header
958
+
959
+ options.apply_defaults timeout: @config.rpcs.search_all_iam_policies.timeout,
960
+ metadata: metadata,
961
+ retry_policy: @config.rpcs.search_all_iam_policies.retry_policy
962
+ options.apply_defaults metadata: @config.metadata,
963
+ retry_policy: @config.retry_policy
964
+
965
+ @asset_service_stub.call_rpc :search_all_iam_policies, request, options: options do |response, operation|
966
+ response = ::Gapic::PagedEnumerable.new @asset_service_stub, :search_all_iam_policies, request, response, operation, options
967
+ yield response, operation if block_given?
968
+ return response
969
+ end
970
+ rescue ::GRPC::BadStatus => e
971
+ raise ::Google::Cloud::Error.from_error(e)
972
+ end
973
+
713
974
  ##
714
975
  # Configuration class for the AssetService API.
715
976
  #
@@ -786,24 +1047,28 @@ module Google
786
1047
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
787
1048
  # trigger a retry.
788
1049
  # @return [::Hash]
1050
+ # @!attribute [rw] quota_project
1051
+ # A separate project against which to charge quota.
1052
+ # @return [::String]
789
1053
  #
790
1054
  class Configuration
791
1055
  extend ::Gapic::Config
792
1056
 
793
- config_attr :endpoint, "cloudasset.googleapis.com", String
794
- config_attr :credentials, nil do |value|
1057
+ config_attr :endpoint, "cloudasset.googleapis.com", ::String
1058
+ config_attr :credentials, nil do |value|
795
1059
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
796
1060
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
797
1061
  allowed.any? { |klass| klass === value }
798
1062
  end
799
- config_attr :scope, nil, ::String, ::Array, nil
800
- config_attr :lib_name, nil, ::String, nil
801
- config_attr :lib_version, nil, ::String, nil
802
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
803
- config_attr :interceptors, nil, ::Array, nil
804
- config_attr :timeout, nil, ::Numeric, nil
805
- config_attr :metadata, nil, ::Hash, nil
806
- config_attr :retry_policy, nil, ::Hash, Proc, nil
1063
+ config_attr :scope, nil, ::String, ::Array, nil
1064
+ config_attr :lib_name, nil, ::String, nil
1065
+ config_attr :lib_version, nil, ::String, nil
1066
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1067
+ config_attr :interceptors, nil, ::Array, nil
1068
+ config_attr :timeout, nil, ::Numeric, nil
1069
+ config_attr :metadata, nil, ::Hash, nil
1070
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1071
+ config_attr :quota_project, nil, ::String, nil
807
1072
 
808
1073
  # @private
809
1074
  def initialize parent_config = nil
@@ -819,7 +1084,7 @@ module Google
819
1084
  def rpcs
820
1085
  @rpcs ||= begin
821
1086
  parent_rpcs = nil
822
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
1087
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
823
1088
  Rpcs.new parent_rpcs
824
1089
  end
825
1090
  end
@@ -877,6 +1142,16 @@ module Google
877
1142
  # @return [::Gapic::Config::Method]
878
1143
  #
879
1144
  attr_reader :delete_feed
1145
+ ##
1146
+ # RPC-specific configuration for `search_all_resources`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :search_all_resources
1150
+ ##
1151
+ # RPC-specific configuration for `search_all_iam_policies`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :search_all_iam_policies
880
1155
 
881
1156
  # @private
882
1157
  def initialize parent_rpcs = nil
@@ -894,6 +1169,10 @@ module Google
894
1169
  @update_feed = ::Gapic::Config::Method.new update_feed_config
895
1170
  delete_feed_config = parent_rpcs&.delete_feed if parent_rpcs&.respond_to? :delete_feed
896
1171
  @delete_feed = ::Gapic::Config::Method.new delete_feed_config
1172
+ search_all_resources_config = parent_rpcs&.search_all_resources if parent_rpcs&.respond_to? :search_all_resources
1173
+ @search_all_resources = ::Gapic::Config::Method.new search_all_resources_config
1174
+ search_all_iam_policies_config = parent_rpcs&.search_all_iam_policies if parent_rpcs&.respond_to? :search_all_iam_policies
1175
+ @search_all_iam_policies = ::Gapic::Config::Method.new search_all_iam_policies_config
897
1176
 
898
1177
  yield self if block_given?
899
1178
  end
@@ -85,6 +85,8 @@ module Google
85
85
  if credentials.is_a?(String) || credentials.is_a?(Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
+ @quota_project_id = @config.quota_project
89
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
88
90
 
89
91
  @operations_stub = ::Gapic::ServiceStub.new(
90
92
  ::Google::Longrunning::Operations::Stub,
@@ -464,24 +466,28 @@ module Google
464
466
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
465
467
  # trigger a retry.
466
468
  # @return [::Hash]
469
+ # @!attribute [rw] quota_project
470
+ # A separate project against which to charge quota.
471
+ # @return [::String]
467
472
  #
468
473
  class Configuration
469
474
  extend ::Gapic::Config
470
475
 
471
- config_attr :endpoint, "cloudasset.googleapis.com", String
472
- config_attr :credentials, nil do |value|
476
+ config_attr :endpoint, "cloudasset.googleapis.com", ::String
477
+ config_attr :credentials, nil do |value|
473
478
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
474
479
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
475
480
  allowed.any? { |klass| klass === value }
476
481
  end
477
- config_attr :scope, nil, ::String, ::Array, nil
478
- config_attr :lib_name, nil, ::String, nil
479
- config_attr :lib_version, nil, ::String, nil
480
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
481
- config_attr :interceptors, nil, ::Array, nil
482
- config_attr :timeout, nil, ::Numeric, nil
483
- config_attr :metadata, nil, ::Hash, nil
484
- config_attr :retry_policy, nil, ::Hash, Proc, nil
482
+ config_attr :scope, nil, ::String, ::Array, nil
483
+ config_attr :lib_name, nil, ::String, nil
484
+ config_attr :lib_version, nil, ::String, nil
485
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
486
+ config_attr :interceptors, nil, ::Array, nil
487
+ config_attr :timeout, nil, ::Numeric, nil
488
+ config_attr :metadata, nil, ::Hash, nil
489
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
490
+ config_attr :quota_project, nil, ::String, nil
485
491
 
486
492
  # @private
487
493
  def initialize parent_config = nil
@@ -497,7 +503,7 @@ module Google
497
503
  def rpcs
498
504
  @rpcs ||= begin
499
505
  parent_rpcs = nil
500
- parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
506
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
501
507
  Rpcs.new parent_rpcs
502
508
  end
503
509
  end
@@ -88,6 +88,28 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
88
88
  optional :content_type, :enum, 4, "google.cloud.asset.v1.ContentType"
89
89
  optional :feed_output_config, :message, 5, "google.cloud.asset.v1.FeedOutputConfig"
90
90
  end
91
+ add_message "google.cloud.asset.v1.SearchAllResourcesRequest" do
92
+ optional :scope, :string, 1
93
+ optional :query, :string, 2
94
+ repeated :asset_types, :string, 3
95
+ optional :page_size, :int32, 4
96
+ optional :page_token, :string, 5
97
+ optional :order_by, :string, 6
98
+ end
99
+ add_message "google.cloud.asset.v1.SearchAllResourcesResponse" do
100
+ repeated :results, :message, 1, "google.cloud.asset.v1.ResourceSearchResult"
101
+ optional :next_page_token, :string, 2
102
+ end
103
+ add_message "google.cloud.asset.v1.SearchAllIamPoliciesRequest" do
104
+ optional :scope, :string, 1
105
+ optional :query, :string, 2
106
+ optional :page_size, :int32, 3
107
+ optional :page_token, :string, 4
108
+ end
109
+ add_message "google.cloud.asset.v1.SearchAllIamPoliciesResponse" do
110
+ repeated :results, :message, 1, "google.cloud.asset.v1.IamPolicySearchResult"
111
+ optional :next_page_token, :string, 2
112
+ end
91
113
  add_enum "google.cloud.asset.v1.ContentType" do
92
114
  value :CONTENT_TYPE_UNSPECIFIED, 0
93
115
  value :RESOURCE, 1
@@ -118,6 +140,10 @@ module Google
118
140
  PubsubDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.PubsubDestination").msgclass
119
141
  FeedOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.FeedOutputConfig").msgclass
120
142
  Feed = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.Feed").msgclass
143
+ SearchAllResourcesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.SearchAllResourcesRequest").msgclass
144
+ SearchAllResourcesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.SearchAllResourcesResponse").msgclass
145
+ SearchAllIamPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.SearchAllIamPoliciesRequest").msgclass
146
+ SearchAllIamPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.SearchAllIamPoliciesResponse").msgclass
121
147
  ContentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ContentType").enummodule
122
148
  end
123
149
  end
@@ -35,8 +35,9 @@ module Google
35
35
 
36
36
  # Exports assets with time and resource types to a given Cloud Storage
37
37
  # location. The output format is newline-delimited JSON.
38
- # This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing you
39
- # to keep track of the export.
38
+ # This API implements the
39
+ # [google.longrunning.Operation][google.longrunning.Operation] API allowing
40
+ # you to keep track of the export.
40
41
  rpc :ExportAssets, ExportAssetsRequest, Google::Longrunning::Operation
41
42
  # Batch gets the update history of assets that overlap a time window.
42
43
  # For RESOURCE content, this API outputs history with asset in both
@@ -57,6 +58,16 @@ module Google
57
58
  rpc :UpdateFeed, UpdateFeedRequest, Feed
58
59
  # Deletes an asset feed.
59
60
  rpc :DeleteFeed, DeleteFeedRequest, Google::Protobuf::Empty
61
+ # Searches all the resources within the given accessible scope (e.g., a
62
+ # project, a folder or an organization). Callers should have
63
+ # cloud.assets.SearchAllResources permission upon the requested scope,
64
+ # otherwise the request will be rejected.
65
+ rpc :SearchAllResources, SearchAllResourcesRequest, SearchAllResourcesResponse
66
+ # Searches all the IAM policies within the given accessible scope (e.g., a
67
+ # project, a folder or an organization). Callers should have
68
+ # cloud.assets.SearchAllIamPolicies permission upon the requested scope,
69
+ # otherwise the request will be rejected.
70
+ rpc :SearchAllIamPolicies, SearchAllIamPoliciesRequest, SearchAllIamPoliciesResponse
60
71
  end
61
72
 
62
73
  Stub = Service.rpc_stub_class
@@ -3,6 +3,7 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'google/api/annotations_pb'
6
7
  require 'google/api/resource_pb'
7
8
  require 'google/cloud/orgpolicy/v1/orgpolicy_pb'
8
9
  require 'google/iam/v1/policy_pb'
@@ -12,7 +13,6 @@ require 'google/identity/accesscontextmanager/v1/service_perimeter_pb'
12
13
  require 'google/protobuf/any_pb'
13
14
  require 'google/protobuf/struct_pb'
14
15
  require 'google/protobuf/timestamp_pb'
15
- require 'google/api/annotations_pb'
16
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  add_file("google/cloud/asset/v1/assets.proto", :syntax => :proto3) do
18
18
  add_message "google.cloud.asset.v1.TemporalAsset" do
@@ -44,6 +44,30 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
44
44
  optional :resource_url, :string, 4
45
45
  optional :parent, :string, 5
46
46
  optional :data, :message, 6, "google.protobuf.Struct"
47
+ optional :location, :string, 8
48
+ end
49
+ add_message "google.cloud.asset.v1.ResourceSearchResult" do
50
+ optional :name, :string, 1
51
+ optional :asset_type, :string, 2
52
+ optional :project, :string, 3
53
+ optional :display_name, :string, 4
54
+ optional :description, :string, 5
55
+ optional :location, :string, 6
56
+ map :labels, :string, :string, 7
57
+ repeated :network_tags, :string, 8
58
+ optional :additional_attributes, :message, 9, "google.protobuf.Struct"
59
+ end
60
+ add_message "google.cloud.asset.v1.IamPolicySearchResult" do
61
+ optional :resource, :string, 1
62
+ optional :project, :string, 2
63
+ optional :policy, :message, 3, "google.iam.v1.Policy"
64
+ optional :explanation, :message, 4, "google.cloud.asset.v1.IamPolicySearchResult.Explanation"
65
+ end
66
+ add_message "google.cloud.asset.v1.IamPolicySearchResult.Explanation" do
67
+ map :matched_permissions, :string, :message, 1, "google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions"
68
+ end
69
+ add_message "google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions" do
70
+ repeated :permissions, :string, 1
47
71
  end
48
72
  end
49
73
  end
@@ -56,6 +80,10 @@ module Google
56
80
  TimeWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.TimeWindow").msgclass
57
81
  Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.Asset").msgclass
58
82
  Resource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.Resource").msgclass
83
+ ResourceSearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.ResourceSearchResult").msgclass
84
+ IamPolicySearchResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicySearchResult").msgclass
85
+ IamPolicySearchResult::Explanation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicySearchResult.Explanation").msgclass
86
+ IamPolicySearchResult::Explanation::Permissions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions").msgclass
59
87
  end
60
88
  end
61
89
  end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Asset
23
23
  module V1
24
- VERSION = "0.2.3"
24
+ VERSION = "0.4.3"
25
25
  end
26
26
  end
27
27
  end
@@ -56,8 +56,10 @@ module Google
56
56
  end
57
57
 
58
58
  # The export asset response. This message is returned by the
59
- # google.longrunning.Operations.GetOperation method in the returned
60
- # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} field.
59
+ # google.longrunning.Operations.GetOperation
60
+ # method in the returned
61
+ # {::Google::Longrunning::Operation#response google.longrunning.Operation.response}
62
+ # field.
61
63
  # @!attribute [rw] read_time
62
64
  # @return [::Google::Protobuf::Timestamp]
63
65
  # Time the snapshot was taken.
@@ -127,9 +129,8 @@ module Google
127
129
  # be unique under a specific parent project/folder/organization.
128
130
  # @!attribute [rw] feed
129
131
  # @return [::Google::Cloud::Asset::V1::Feed]
130
- # Required. The feed details. The field `name` must be empty and it will be generated
131
- # in the format of:
132
- # projects/project_number/feeds/feed_id
132
+ # Required. The feed details. The field `name` must be empty and it will be
133
+ # generated in the format of: projects/project_number/feeds/feed_id
133
134
  # folders/folder_number/feeds/feed_id
134
135
  # organizations/organization_number/feeds/feed_id
135
136
  class CreateFeedRequest
@@ -171,8 +172,8 @@ module Google
171
172
  # Update asset feed request.
172
173
  # @!attribute [rw] feed
173
174
  # @return [::Google::Cloud::Asset::V1::Feed]
174
- # Required. The new values of feed details. It must match an existing feed and the
175
- # field `name` must be in the format of:
175
+ # Required. The new values of feed details. It must match an existing feed
176
+ # and the field `name` must be in the format of:
176
177
  # projects/project_number/feeds/feed_id or
177
178
  # folders/folder_number/feeds/feed_id or
178
179
  # organizations/organization_number/feeds/feed_id.
@@ -325,6 +326,166 @@ module Google
325
326
  extend ::Google::Protobuf::MessageExts::ClassMethods
326
327
  end
327
328
 
329
+ # Search all resources request.
330
+ # @!attribute [rw] scope
331
+ # @return [::String]
332
+ # Required. A scope can be a project, a folder or an organization. The search
333
+ # is limited to the resources within the `scope`.
334
+ #
335
+ # The allowed values are:
336
+ #
337
+ # * projects/\\{PROJECT_ID}
338
+ # * projects/\\{PROJECT_NUMBER}
339
+ # * folders/\\{FOLDER_NUMBER}
340
+ # * organizations/\\{ORGANIZATION_NUMBER}
341
+ # @!attribute [rw] query
342
+ # @return [::String]
343
+ # Optional. The query statement. An empty query can be specified to search
344
+ # all the resources of certain `asset_types` within the given `scope`.
345
+ #
346
+ # Examples:
347
+ #
348
+ # * `name : "Important"` to find Cloud resources whose name contains
349
+ # "Important" as a word.
350
+ # * `displayName : "Impor*"` to find Cloud resources whose display name
351
+ # contains "Impor" as a word prefix.
352
+ # * `description : "*por*"` to find Cloud resources whose description
353
+ # contains "por" as a substring.
354
+ # * `location : "us-west*"` to find Cloud resources whose location is
355
+ # prefixed with "us-west".
356
+ # * `labels : "prod"` to find Cloud resources whose labels contain "prod" as
357
+ # a key or value.
358
+ # * `labels.env : "prod"` to find Cloud resources which have a label "env"
359
+ # and its value is "prod".
360
+ # * `labels.env : *` to find Cloud resources which have a label "env".
361
+ # * `"Important"` to find Cloud resources which contain "Important" as a word
362
+ # in any of the searchable fields.
363
+ # * `"Impor*"` to find Cloud resources which contain "Impor" as a word prefix
364
+ # in any of the searchable fields.
365
+ # * `"*por*"` to find Cloud resources which contain "por" as a substring in
366
+ # any of the searchable fields.
367
+ # * `("Important" AND location : ("us-west1" OR "global"))` to find Cloud
368
+ # resources which contain "Important" as a word in any of the searchable
369
+ # fields and are also located in the "us-west1" region or the "global"
370
+ # location.
371
+ #
372
+ # See [how to construct a
373
+ # query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query)
374
+ # for more details.
375
+ # @!attribute [rw] asset_types
376
+ # @return [::Array<::String>]
377
+ # Optional. A list of asset types that this request searches for. If empty,
378
+ # it will search all the [searchable asset
379
+ # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#searchable_asset_types).
380
+ # @!attribute [rw] page_size
381
+ # @return [::Integer]
382
+ # Optional. The page size for search result pagination. Page size is capped
383
+ # at 500 even if a larger value is given. If set to zero, server will pick an
384
+ # appropriate default. Returned results may be fewer than requested. When
385
+ # this happens, there could be more results as long as `next_page_token` is
386
+ # returned.
387
+ # @!attribute [rw] page_token
388
+ # @return [::String]
389
+ # Optional. If present, then retrieve the next batch of results from the
390
+ # preceding call to this method. `page_token` must be the value of
391
+ # `next_page_token` from the previous response. The values of all other
392
+ # method parameters, must be identical to those in the previous call.
393
+ # @!attribute [rw] order_by
394
+ # @return [::String]
395
+ # Optional. A comma separated list of fields specifying the sorting order of
396
+ # the results. The default order is ascending. Add " DESC" after the field
397
+ # name to indicate descending order. Redundant space characters are ignored.
398
+ # Example: "location DESC, name". See [supported resource metadata
399
+ # fields](https://cloud.google.com/asset-inventory/docs/searching-resources#query_on_resource_metadata_fields)
400
+ # for more details.
401
+ class SearchAllResourcesRequest
402
+ include ::Google::Protobuf::MessageExts
403
+ extend ::Google::Protobuf::MessageExts::ClassMethods
404
+ end
405
+
406
+ # Search all resources response.
407
+ # @!attribute [rw] results
408
+ # @return [::Array<::Google::Cloud::Asset::V1::ResourceSearchResult>]
409
+ # A list of Resources that match the search query. It contains the resource
410
+ # standard metadata information.
411
+ # @!attribute [rw] next_page_token
412
+ # @return [::String]
413
+ # If there are more results than those appearing in this response, then
414
+ # `next_page_token` is included. To get the next set of results, call this
415
+ # method again using the value of `next_page_token` as `page_token`.
416
+ class SearchAllResourcesResponse
417
+ include ::Google::Protobuf::MessageExts
418
+ extend ::Google::Protobuf::MessageExts::ClassMethods
419
+ end
420
+
421
+ # Search all IAM policies request.
422
+ # @!attribute [rw] scope
423
+ # @return [::String]
424
+ # Required. A scope can be a project, a folder or an organization. The search
425
+ # is limited to the IAM policies within the `scope`.
426
+ #
427
+ # The allowed values are:
428
+ #
429
+ # * projects/\\{PROJECT_ID}
430
+ # * projects/\\{PROJECT_NUMBER}
431
+ # * folders/\\{FOLDER_NUMBER}
432
+ # * organizations/\\{ORGANIZATION_NUMBER}
433
+ # @!attribute [rw] query
434
+ # @return [::String]
435
+ # Optional. The query statement. An empty query can be specified to search
436
+ # all the IAM policies within the given `scope`.
437
+ #
438
+ # Examples:
439
+ #
440
+ # * `policy : "amy@gmail.com"` to find Cloud IAM policy bindings that
441
+ # specify user "amy@gmail.com".
442
+ # * `policy : "roles/compute.admin"` to find Cloud IAM policy bindings that
443
+ # specify the Compute Admin role.
444
+ # * `policy.role.permissions : "storage.buckets.update"` to find Cloud IAM
445
+ # policy bindings that specify a role containing "storage.buckets.update"
446
+ # permission.
447
+ # * `resource : "organizations/123"` to find Cloud IAM policy bindings that
448
+ # are set on "organizations/123".
449
+ # * `(resource : ("organizations/123" OR "folders/1234") AND policy : "amy")`
450
+ # to find Cloud IAM policy bindings that are set on "organizations/123" or
451
+ # "folders/1234", and also specify user "amy".
452
+ #
453
+ # See [how to construct a
454
+ # query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query)
455
+ # for more details.
456
+ # @!attribute [rw] page_size
457
+ # @return [::Integer]
458
+ # Optional. The page size for search result pagination. Page size is capped
459
+ # at 500 even if a larger value is given. If set to zero, server will pick an
460
+ # appropriate default. Returned results may be fewer than requested. When
461
+ # this happens, there could be more results as long as `next_page_token` is
462
+ # returned.
463
+ # @!attribute [rw] page_token
464
+ # @return [::String]
465
+ # Optional. If present, retrieve the next batch of results from the preceding
466
+ # call to this method. `page_token` must be the value of `next_page_token`
467
+ # from the previous response. The values of all other method parameters must
468
+ # be identical to those in the previous call.
469
+ class SearchAllIamPoliciesRequest
470
+ include ::Google::Protobuf::MessageExts
471
+ extend ::Google::Protobuf::MessageExts::ClassMethods
472
+ end
473
+
474
+ # Search all IAM policies response.
475
+ # @!attribute [rw] results
476
+ # @return [::Array<::Google::Cloud::Asset::V1::IamPolicySearchResult>]
477
+ # A list of IamPolicy that match the search query. Related information such
478
+ # as the associated resource is returned along with the policy.
479
+ # @!attribute [rw] next_page_token
480
+ # @return [::String]
481
+ # Set if there are more results than those appearing in this response; to get
482
+ # the next set of results, call this method again, using this value as the
483
+ # `page_token`.
484
+ class SearchAllIamPoliciesResponse
485
+ include ::Google::Protobuf::MessageExts
486
+ extend ::Google::Protobuf::MessageExts::ClassMethods
487
+ end
488
+
328
489
  # Asset content type.
329
490
  module ContentType
330
491
  # Unspecified content type.
@@ -37,7 +37,7 @@ module Google
37
37
  extend ::Google::Protobuf::MessageExts::ClassMethods
38
38
  end
39
39
 
40
- # A time window specified by its "start_time" and "end_time".
40
+ # A time window specified by its `start_time` and `end_time`.
41
41
  # @!attribute [rw] start_time
42
42
  # @return [::Google::Protobuf::Timestamp]
43
43
  # Start time of the time window (exclusive).
@@ -58,14 +58,14 @@ module Google
58
58
  # @!attribute [rw] name
59
59
  # @return [::String]
60
60
  # The full name of the asset. For example:
61
- # "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1"
61
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
62
62
  #
63
63
  # See [Resource
64
64
  # names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
65
65
  # for more information.
66
66
  # @!attribute [rw] asset_type
67
67
  # @return [::String]
68
- # The type of the asset. For example: "compute.googleapis.com/Disk"
68
+ # The type of the asset. For example: `compute.googleapis.com/Disk`
69
69
  #
70
70
  # See [Supported asset
71
71
  # types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
@@ -114,19 +114,19 @@ module Google
114
114
  # A representation of a Google Cloud resource.
115
115
  # @!attribute [rw] version
116
116
  # @return [::String]
117
- # The API version. For example: "v1"
117
+ # The API version. For example: `v1`
118
118
  # @!attribute [rw] discovery_document_uri
119
119
  # @return [::String]
120
120
  # The URL of the discovery document containing the resource's JSON schema.
121
121
  # For example:
122
- # "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"
122
+ # `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
123
123
  #
124
124
  # This value is unspecified for resources that do not have an API based on a
125
125
  # discovery document, such as Cloud Bigtable.
126
126
  # @!attribute [rw] discovery_name
127
127
  # @return [::String]
128
128
  # The JSON schema name listed in the discovery document. For example:
129
- # "Project"
129
+ # `Project`
130
130
  #
131
131
  # This value is unspecified for resources that do not have an API based on a
132
132
  # discovery document, such as Cloud Bigtable.
@@ -134,7 +134,7 @@ module Google
134
134
  # @return [::String]
135
135
  # The REST URL for accessing the resource. An HTTP `GET` request using this
136
136
  # URL returns the resource itself. For example:
137
- # "https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123"
137
+ # `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
138
138
  #
139
139
  # This value is unspecified for resources without a REST API.
140
140
  # @!attribute [rw] parent
@@ -148,17 +148,206 @@ module Google
148
148
  # [Cloud IAM policy
149
149
  # hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
150
150
  # For example:
151
- # "//cloudresourcemanager.googleapis.com/projects/my_project_123"
151
+ # `//cloudresourcemanager.googleapis.com/projects/my_project_123`
152
152
  #
153
153
  # For third-party assets, this field may be set differently.
154
154
  # @!attribute [rw] data
155
155
  # @return [::Google::Protobuf::Struct]
156
156
  # The content of the resource, in which some sensitive fields are removed
157
157
  # and may not be present.
158
+ # @!attribute [rw] location
159
+ # @return [::String]
160
+ # The location of the resource in Google Cloud, such as its zone and region.
161
+ # For more information, see https://cloud.google.com/about/locations/.
158
162
  class Resource
159
163
  include ::Google::Protobuf::MessageExts
160
164
  extend ::Google::Protobuf::MessageExts::ClassMethods
161
165
  end
166
+
167
+ # A result of Resource Search, containing information of a cloud resoure.
168
+ # @!attribute [rw] name
169
+ # @return [::String]
170
+ # The full resource name of this resource. Example:
171
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
172
+ # See [Cloud Asset Inventory Resource Name
173
+ # Format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
174
+ # for more information.
175
+ #
176
+ # To search against the `name`:
177
+ #
178
+ # * use a field query. Example: `name : "instance1"`
179
+ # * use a free text query. Example: `"instance1"`
180
+ # @!attribute [rw] asset_type
181
+ # @return [::String]
182
+ # The type of this resource. Example: `compute.googleapis.com/Disk`.
183
+ #
184
+ # To search against the `asset_type`:
185
+ #
186
+ # * specify the `asset_type` field in your search request.
187
+ # @!attribute [rw] project
188
+ # @return [::String]
189
+ # The project that this resource belongs to, in the form of
190
+ # projects/\\{PROJECT_NUMBER}.
191
+ #
192
+ # To search against the `project`:
193
+ #
194
+ # * specify the `scope` field as this project in your search request.
195
+ # @!attribute [rw] display_name
196
+ # @return [::String]
197
+ # The display name of this resource.
198
+ #
199
+ # To search against the `display_name`:
200
+ #
201
+ # * use a field query. Example: `displayName : "My Instance"`
202
+ # * use a free text query. Example: `"My Instance"`
203
+ # @!attribute [rw] description
204
+ # @return [::String]
205
+ # One or more paragraphs of text description of this resource. Maximum length
206
+ # could be up to 1M bytes.
207
+ #
208
+ # To search against the `description`:
209
+ #
210
+ # * use a field query. Example: `description : "*important instance*"`
211
+ # * use a free text query. Example: `"*important instance*"`
212
+ # @!attribute [rw] location
213
+ # @return [::String]
214
+ # Location can be `global`, regional like `us-east1`, or zonal like
215
+ # `us-west1-b`.
216
+ #
217
+ # To search against the `location`:
218
+ #
219
+ # * use a field query. Example: `location : "us-west*"`
220
+ # * use a free text query. Example: `"us-west*"`
221
+ # @!attribute [rw] labels
222
+ # @return [::Google::Protobuf::Map{::String => ::String}]
223
+ # Labels associated with this resource. See [Labelling and grouping GCP
224
+ # resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
225
+ # for more information.
226
+ #
227
+ # To search against the `labels`:
228
+ #
229
+ # * use a field query, as following:
230
+ # - query on any label's key or value. Example: `labels : "prod"`
231
+ # - query by a given label. Example: `labels.env : "prod"`
232
+ # - query by a given label'sexistence. Example: `labels.env : *`
233
+ # * use a free text query. Example: `"prod"`
234
+ # @!attribute [rw] network_tags
235
+ # @return [::Array<::String>]
236
+ # Network tags associated with this resource. Like labels, network tags are a
237
+ # type of annotations used to group GCP resources. See [Labelling GCP
238
+ # resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources)
239
+ # for more information.
240
+ #
241
+ # To search against the `network_tags`:
242
+ #
243
+ # * use a field query. Example: `networkTags : "internal"`
244
+ # * use a free text query. Example: `"internal"`
245
+ # @!attribute [rw] additional_attributes
246
+ # @return [::Google::Protobuf::Struct]
247
+ # The additional attributes of this resource. The attributes may vary from
248
+ # one resource type to another. Examples: `projectId` for Project,
249
+ # `dnsName` for DNS ManagedZone.
250
+ #
251
+ # To search against the `additional_attributes`:
252
+ #
253
+ # * use a free text query to match the attributes values. Example: to search
254
+ # `additional_attributes = { dnsName: "foobar" }`, you can issue a query
255
+ # `"foobar"`.
256
+ class ResourceSearchResult
257
+ include ::Google::Protobuf::MessageExts
258
+ extend ::Google::Protobuf::MessageExts::ClassMethods
259
+
260
+ # @!attribute [rw] key
261
+ # @return [::String]
262
+ # @!attribute [rw] value
263
+ # @return [::String]
264
+ class LabelsEntry
265
+ include ::Google::Protobuf::MessageExts
266
+ extend ::Google::Protobuf::MessageExts::ClassMethods
267
+ end
268
+ end
269
+
270
+ # A result of IAM Policy search, containing information of an IAM policy.
271
+ # @!attribute [rw] resource
272
+ # @return [::String]
273
+ # The full resource name of the resource associated with this IAM policy.
274
+ # Example:
275
+ # `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
276
+ # See [Cloud Asset Inventory Resource Name
277
+ # Format](https://cloud.google.com/asset-inventory/docs/resource-name-format)
278
+ # for more information.
279
+ #
280
+ # To search against the `resource`:
281
+ #
282
+ # * use a field query. Example: `resource : "organizations/123"`
283
+ # @!attribute [rw] project
284
+ # @return [::String]
285
+ # The project that the associated GCP resource belongs to, in the form of
286
+ # projects/\\{PROJECT_NUMBER}. If an IAM policy is set on a resource (like VM
287
+ # instance, Cloud Storage bucket), the project field will indicate the
288
+ # project that contains the resource. If an IAM policy is set on a folder or
289
+ # orgnization, the project field will be empty.
290
+ #
291
+ # To search against the `project`:
292
+ #
293
+ # * specify the `scope` field as this project in your search request.
294
+ # @!attribute [rw] policy
295
+ # @return [::Google::Iam::V1::Policy]
296
+ # The IAM policy directly set on the given resource. Note that the original
297
+ # IAM policy can contain multiple bindings. This only contains the bindings
298
+ # that match the given query. For queries that don't contain a constrain on
299
+ # policies (e.g., an empty query), this contains all the bindings.
300
+ #
301
+ # To search against the `policy` bindings:
302
+ #
303
+ # * use a field query, as following:
304
+ # - query by the policy contained members. Example:
305
+ # `policy : "amy@gmail.com"`
306
+ # - query by the policy contained roles. Example:
307
+ # `policy : "roles/compute.admin"`
308
+ # - query by the policy contained roles' implied permissions. Example:
309
+ # `policy.role.permissions : "compute.instances.create"`
310
+ # @!attribute [rw] explanation
311
+ # @return [::Google::Cloud::Asset::V1::IamPolicySearchResult::Explanation]
312
+ # Explanation about the IAM policy search result. It contains additional
313
+ # information to explain why the search result matches the query.
314
+ class IamPolicySearchResult
315
+ include ::Google::Protobuf::MessageExts
316
+ extend ::Google::Protobuf::MessageExts::ClassMethods
317
+
318
+ # Explanation about the IAM policy search result.
319
+ # @!attribute [rw] matched_permissions
320
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Asset::V1::IamPolicySearchResult::Explanation::Permissions}]
321
+ # The map from roles to their included permissions that match the
322
+ # permission query (i.e., a query containing `policy.role.permissions:`).
323
+ # Example: if query `policy.role.permissions : "compute.disk.get"`
324
+ # matches a policy binding that contains owner role, the
325
+ # matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The
326
+ # roles can also be found in the returned `policy` bindings. Note that the
327
+ # map is populated only for requests with permission queries.
328
+ class Explanation
329
+ include ::Google::Protobuf::MessageExts
330
+ extend ::Google::Protobuf::MessageExts::ClassMethods
331
+
332
+ # IAM permissions
333
+ # @!attribute [rw] permissions
334
+ # @return [::Array<::String>]
335
+ # A list of permissions. A sample permission string: `compute.disk.get`.
336
+ class Permissions
337
+ include ::Google::Protobuf::MessageExts
338
+ extend ::Google::Protobuf::MessageExts::ClassMethods
339
+ end
340
+
341
+ # @!attribute [rw] key
342
+ # @return [::String]
343
+ # @!attribute [rw] value
344
+ # @return [::Google::Cloud::Asset::V1::IamPolicySearchResult::Explanation::Permissions]
345
+ class MatchedPermissionsEntry
346
+ include ::Google::Protobuf::MessageExts
347
+ extend ::Google::Protobuf::MessageExts::ClassMethods
348
+ end
349
+ end
350
+ end
162
351
  end
163
352
  end
164
353
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-asset-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-05 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -78,14 +78,42 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '5.10'
81
+ version: '5.14'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '5.10'
88
+ version: '5.14'
89
+ - !ruby/object:Gem::Dependency
90
+ name: minitest-focus
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.1'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.1'
103
+ - !ruby/object:Gem::Dependency
104
+ name: minitest-rg
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '5.2'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '5.2'
89
117
  - !ruby/object:Gem::Dependency
90
118
  name: rake
91
119
  requirement: !ruby/object:Gem::Requirement
@@ -165,7 +193,6 @@ files:
165
193
  - lib/google/cloud/asset/v1/asset_service_services_pb.rb
166
194
  - lib/google/cloud/asset/v1/assets_pb.rb
167
195
  - lib/google/cloud/asset/v1/version.rb
168
- - lib/google/cloud/common_resources_pb.rb
169
196
  - lib/google/cloud/orgpolicy/v1/orgpolicy_pb.rb
170
197
  - lib/google/identity/accesscontextmanager/type/device_resources_pb.rb
171
198
  - lib/google/identity/accesscontextmanager/v1/access_level_pb.rb
@@ -209,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
236
  - !ruby/object:Gem::Version
210
237
  version: '0'
211
238
  requirements: []
212
- rubygems_version: 3.0.6
239
+ rubygems_version: 3.1.3
213
240
  signing_key:
214
241
  specification_version: 4
215
242
  summary: API Client library for the Cloud Asset V1 API
@@ -1,15 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/common_resources.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/api/resource_pb'
7
- Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_file("google/cloud/common_resources.proto", :syntax => :proto3) do
9
- end
10
- end
11
-
12
- module Google
13
- module Cloud
14
- end
15
- end