google-cloud-storage-control-v2 1.10.1 → 1.11.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.
@@ -132,6 +132,63 @@ module Google
132
132
  resource.call(**args)
133
133
  end
134
134
 
135
+ ##
136
+ # Create a fully-qualified IntelligenceFinding resource string.
137
+ #
138
+ # The resource will be in the following format:
139
+ #
140
+ # `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
141
+ #
142
+ # @param project [String]
143
+ # @param location [String]
144
+ # @param intelligence_finding [String]
145
+ #
146
+ # @return [::String]
147
+ def intelligence_finding_path project:, location:, intelligence_finding:
148
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
149
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
150
+
151
+ "projects/#{project}/locations/#{location}/intelligenceFindings/#{intelligence_finding}"
152
+ end
153
+
154
+ ##
155
+ # Create a fully-qualified IntelligenceFindingRevision resource string.
156
+ #
157
+ # The resource will be in the following format:
158
+ #
159
+ # `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
160
+ #
161
+ # @param project [String]
162
+ # @param location [String]
163
+ # @param intelligence_finding [String]
164
+ # @param revision [String]
165
+ #
166
+ # @return [::String]
167
+ def intelligence_finding_revision_path project:, location:, intelligence_finding:, revision:
168
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
169
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
170
+ raise ::ArgumentError, "intelligence_finding cannot contain /" if intelligence_finding.to_s.include? "/"
171
+
172
+ "projects/#{project}/locations/#{location}/intelligenceFindings/#{intelligence_finding}/revisions/#{revision}"
173
+ end
174
+
175
+ ##
176
+ # Create a fully-qualified Location resource string.
177
+ #
178
+ # The resource will be in the following format:
179
+ #
180
+ # `projects/{project}/locations/{location}`
181
+ #
182
+ # @param project [String]
183
+ # @param location [String]
184
+ #
185
+ # @return [::String]
186
+ def location_path project:, location:
187
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
188
+
189
+ "projects/#{project}/locations/#{location}"
190
+ end
191
+
135
192
  ##
136
193
  # Create a fully-qualified ManagedFolder resource string.
137
194
  #
@@ -105,6 +105,31 @@ module Google
105
105
  initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
106
106
  }
107
107
 
108
+ default_config.rpcs.get_intelligence_finding.timeout = 60.0
109
+ default_config.rpcs.get_intelligence_finding.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
111
+ }
112
+
113
+ default_config.rpcs.list_intelligence_findings.timeout = 60.0
114
+ default_config.rpcs.list_intelligence_findings.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
116
+ }
117
+
118
+ default_config.rpcs.summarize_intelligence_findings.timeout = 60.0
119
+ default_config.rpcs.summarize_intelligence_findings.retry_policy = {
120
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
121
+ }
122
+
123
+ default_config.rpcs.get_intelligence_finding_revision.timeout = 60.0
124
+ default_config.rpcs.get_intelligence_finding_revision.retry_policy = {
125
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
126
+ }
127
+
128
+ default_config.rpcs.list_intelligence_finding_revisions.timeout = 60.0
129
+ default_config.rpcs.list_intelligence_finding_revisions.retry_policy = {
130
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2]
131
+ }
132
+
108
133
  default_config
109
134
  end
110
135
  yield @configure if block_given?
@@ -707,6 +732,483 @@ module Google
707
732
  raise ::Google::Cloud::Error.from_error(e)
708
733
  end
709
734
 
735
+ ##
736
+ # Gets the `IntelligenceFinding` for a project.
737
+ #
738
+ # @overload get_intelligence_finding(request, options = nil)
739
+ # Pass arguments to `get_intelligence_finding` via a request object, either of type
740
+ # {::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest} or an equivalent Hash.
741
+ #
742
+ # @param request [::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest, ::Hash]
743
+ # A request object representing the call parameters. Required. To specify no
744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
745
+ # @param options [::Gapic::CallOptions, ::Hash]
746
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
747
+ #
748
+ # @overload get_intelligence_finding(name: nil)
749
+ # Pass arguments to `get_intelligence_finding` via keyword arguments. Note that at
750
+ # least one keyword argument is required. To specify no parameters, or to keep all
751
+ # the default parameter values, pass an empty Hash as a request object (see above).
752
+ #
753
+ # @param name [::String]
754
+ # Required. The name of the `IntelligenceFinding` resource.
755
+ #
756
+ # Format:
757
+ # `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
758
+ # @yield [result, operation] Access the result along with the TransportOperation object
759
+ # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceFinding]
760
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
761
+ #
762
+ # @return [::Google::Cloud::Storage::Control::V2::IntelligenceFinding]
763
+ #
764
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
765
+ #
766
+ # @example Basic example
767
+ # require "google/cloud/storage/control/v2"
768
+ #
769
+ # # Create a client object. The client can be reused for multiple calls.
770
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new
771
+ #
772
+ # # Create a request. To set request fields, pass in keyword arguments.
773
+ # request = Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest.new
774
+ #
775
+ # # Call the get_intelligence_finding method.
776
+ # result = client.get_intelligence_finding request
777
+ #
778
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceFinding.
779
+ # p result
780
+ #
781
+ def get_intelligence_finding request, options = nil
782
+ raise ::ArgumentError, "request must be provided" if request.nil?
783
+
784
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRequest
785
+
786
+ # Converts hash and nil to an options object
787
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
788
+
789
+ # Customize the options with defaults
790
+ call_metadata = @config.rpcs.get_intelligence_finding.metadata.to_h
791
+
792
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
793
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
794
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
795
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
796
+ transports_version_send: [:rest]
797
+
798
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
799
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
800
+
801
+ options.apply_defaults timeout: @config.rpcs.get_intelligence_finding.timeout,
802
+ metadata: call_metadata,
803
+ retry_policy: @config.rpcs.get_intelligence_finding.retry_policy
804
+
805
+ options.apply_defaults timeout: @config.timeout,
806
+ metadata: @config.metadata,
807
+ retry_policy: @config.retry_policy
808
+
809
+ @storage_control_stub.get_intelligence_finding request, options do |result, operation|
810
+ yield result, operation if block_given?
811
+ end
812
+ rescue ::Gapic::Rest::Error => e
813
+ raise ::Google::Cloud::Error.from_error(e)
814
+ end
815
+
816
+ ##
817
+ # Lists the `IntelligenceFinding` resources for the specified project.
818
+ #
819
+ # @overload list_intelligence_findings(request, options = nil)
820
+ # Pass arguments to `list_intelligence_findings` via a request object, either of type
821
+ # {::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest} or an equivalent Hash.
822
+ #
823
+ # @param request [::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest, ::Hash]
824
+ # A request object representing the call parameters. Required. To specify no
825
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
826
+ # @param options [::Gapic::CallOptions, ::Hash]
827
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
828
+ #
829
+ # @overload list_intelligence_findings(parent: nil, filter: nil, page_size: nil, page_token: nil)
830
+ # Pass arguments to `list_intelligence_findings` via keyword arguments. Note that at
831
+ # least one keyword argument is required. To specify no parameters, or to keep all
832
+ # the default parameter values, pass an empty Hash as a request object (see above).
833
+ #
834
+ # @param parent [::String]
835
+ # Required. The parent of the `IntelligenceFinding` resource.
836
+ #
837
+ # Format: `projects/{project}/locations/{location}`
838
+ # @param filter [::String]
839
+ # Optional. The filter expression to be applied.
840
+ # Supports filtering by `type` and `associated_resources`.
841
+ # @param page_size [::Integer]
842
+ # Optional. The maximum number of `IntelligenceFinding` resources to return.
843
+ #
844
+ # The maximum value is `100`; values above `100` will be coerced to `100`.
845
+ # The default value is `100`.
846
+ # @param page_token [::String]
847
+ # Optional. A page token, received from a previous `ListIntelligenceFindings`
848
+ # call. Provide this to retrieve the subsequent page.
849
+ #
850
+ # When paginating, all other parameters provided to
851
+ # `ListIntelligenceFindings` must match the call that provided the page
852
+ # token.
853
+ # @yield [result, operation] Access the result along with the TransportOperation object
854
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding>]
855
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
856
+ #
857
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFinding>]
858
+ #
859
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
860
+ #
861
+ # @example Basic example
862
+ # require "google/cloud/storage/control/v2"
863
+ #
864
+ # # Create a client object. The client can be reused for multiple calls.
865
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new
866
+ #
867
+ # # Create a request. To set request fields, pass in keyword arguments.
868
+ # request = Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest.new
869
+ #
870
+ # # Call the list_intelligence_findings method.
871
+ # result = client.list_intelligence_findings request
872
+ #
873
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
874
+ # # over elements, and API calls will be issued to fetch pages as needed.
875
+ # result.each do |item|
876
+ # # Each element is of type ::Google::Cloud::Storage::Control::V2::IntelligenceFinding.
877
+ # p item
878
+ # end
879
+ #
880
+ def list_intelligence_findings request, options = nil
881
+ raise ::ArgumentError, "request must be provided" if request.nil?
882
+
883
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingsRequest
884
+
885
+ # Converts hash and nil to an options object
886
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
887
+
888
+ # Customize the options with defaults
889
+ call_metadata = @config.rpcs.list_intelligence_findings.metadata.to_h
890
+
891
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
892
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
893
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
894
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
895
+ transports_version_send: [:rest]
896
+
897
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
898
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
+
900
+ options.apply_defaults timeout: @config.rpcs.list_intelligence_findings.timeout,
901
+ metadata: call_metadata,
902
+ retry_policy: @config.rpcs.list_intelligence_findings.retry_policy
903
+
904
+ options.apply_defaults timeout: @config.timeout,
905
+ metadata: @config.metadata,
906
+ retry_policy: @config.retry_policy
907
+
908
+ @storage_control_stub.list_intelligence_findings request, options do |result, operation|
909
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :list_intelligence_findings, "intelligence_findings", request, result, options
910
+ yield result, operation if block_given?
911
+ throw :response, result
912
+ end
913
+ rescue ::Gapic::Rest::Error => e
914
+ raise ::Google::Cloud::Error.from_error(e)
915
+ end
916
+
917
+ ##
918
+ # Summarize the intelligence findings for the specified scope(org, folder or
919
+ # project).
920
+ #
921
+ # @overload summarize_intelligence_findings(request, options = nil)
922
+ # Pass arguments to `summarize_intelligence_findings` via a request object, either of type
923
+ # {::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest} or an equivalent Hash.
924
+ #
925
+ # @param request [::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest, ::Hash]
926
+ # A request object representing the call parameters. Required. To specify no
927
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
928
+ # @param options [::Gapic::CallOptions, ::Hash]
929
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
930
+ #
931
+ # @overload summarize_intelligence_findings(parent: nil, resource_scope: nil, filter: nil, page_size: nil, page_token: nil)
932
+ # Pass arguments to `summarize_intelligence_findings` via keyword arguments. Note that at
933
+ # least one keyword argument is required. To specify no parameters, or to keep all
934
+ # the default parameter values, pass an empty Hash as a request object (see above).
935
+ #
936
+ # @param parent [::String]
937
+ # Required. The scope to summarize the findings for.
938
+ # Format:
939
+ # - `organizations/{organization}/locations/{location}`
940
+ # - `folders/{folder}/locations/{location}`
941
+ # - `projects/{project}/locations/{location}`
942
+ # @param resource_scope [::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest::ResourceScope]
943
+ # Optional. Determines the granularity of the findings
944
+ # when the `parent` is an organization or folder.
945
+ #
946
+ # - `PARENT` (or not set): A single summary is
947
+ # returned for each insight type, aggregated across the entire `parent`
948
+ # scope.
949
+ # - `PROJECT`: A separate summary is returned for each
950
+ # insight type for every project within the `parent` scope.
951
+ #
952
+ # The only supported values are `PARENT` and `PROJECT`.
953
+ # If no value is specified, the API behaviour defaults to the `PARENT`.
954
+ # @param filter [::String]
955
+ # Optional. The filter expression, following AIP-160.
956
+ # Supports filtering by FindingType.
957
+ # @param page_size [::Integer]
958
+ # Optional. The maximum number of findings to return.
959
+ #
960
+ # The maximum value is `100`; values above `100` will be coerced to `100`.
961
+ # The default value is `100`.
962
+ # @param page_token [::String]
963
+ # Optional. A page token, received from a previous
964
+ # `SummarizeIntelligenceFindings` call. Provide this to retrieve the
965
+ # subsequent page.
966
+ #
967
+ # When paginating, all other parameters provided to
968
+ # `SummarizeIntelligenceFindings` must match the call that provided the page
969
+ # token.
970
+ # @yield [result, operation] Access the result along with the TransportOperation object
971
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary>]
972
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
973
+ #
974
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::FindingSummary>]
975
+ #
976
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
977
+ #
978
+ # @example Basic example
979
+ # require "google/cloud/storage/control/v2"
980
+ #
981
+ # # Create a client object. The client can be reused for multiple calls.
982
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new
983
+ #
984
+ # # Create a request. To set request fields, pass in keyword arguments.
985
+ # request = Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest.new
986
+ #
987
+ # # Call the summarize_intelligence_findings method.
988
+ # result = client.summarize_intelligence_findings request
989
+ #
990
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
991
+ # # over elements, and API calls will be issued to fetch pages as needed.
992
+ # result.each do |item|
993
+ # # Each element is of type ::Google::Cloud::Storage::Control::V2::FindingSummary.
994
+ # p item
995
+ # end
996
+ #
997
+ def summarize_intelligence_findings request, options = nil
998
+ raise ::ArgumentError, "request must be provided" if request.nil?
999
+
1000
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::SummarizeIntelligenceFindingsRequest
1001
+
1002
+ # Converts hash and nil to an options object
1003
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1004
+
1005
+ # Customize the options with defaults
1006
+ call_metadata = @config.rpcs.summarize_intelligence_findings.metadata.to_h
1007
+
1008
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1009
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1010
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1011
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
1012
+ transports_version_send: [:rest]
1013
+
1014
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1015
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1016
+
1017
+ options.apply_defaults timeout: @config.rpcs.summarize_intelligence_findings.timeout,
1018
+ metadata: call_metadata,
1019
+ retry_policy: @config.rpcs.summarize_intelligence_findings.retry_policy
1020
+
1021
+ options.apply_defaults timeout: @config.timeout,
1022
+ metadata: @config.metadata,
1023
+ retry_policy: @config.retry_policy
1024
+
1025
+ @storage_control_stub.summarize_intelligence_findings request, options do |result, operation|
1026
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :summarize_intelligence_findings, "finding_summaries", request, result, options
1027
+ yield result, operation if block_given?
1028
+ throw :response, result
1029
+ end
1030
+ rescue ::Gapic::Rest::Error => e
1031
+ raise ::Google::Cloud::Error.from_error(e)
1032
+ end
1033
+
1034
+ ##
1035
+ # Gets the `IntelligenceFindingRevision` resource.
1036
+ #
1037
+ # @overload get_intelligence_finding_revision(request, options = nil)
1038
+ # Pass arguments to `get_intelligence_finding_revision` via a request object, either of type
1039
+ # {::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest} or an equivalent Hash.
1040
+ #
1041
+ # @param request [::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest, ::Hash]
1042
+ # A request object representing the call parameters. Required. To specify no
1043
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1044
+ # @param options [::Gapic::CallOptions, ::Hash]
1045
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1046
+ #
1047
+ # @overload get_intelligence_finding_revision(name: nil)
1048
+ # Pass arguments to `get_intelligence_finding_revision` via keyword arguments. Note that at
1049
+ # least one keyword argument is required. To specify no parameters, or to keep all
1050
+ # the default parameter values, pass an empty Hash as a request object (see above).
1051
+ #
1052
+ # @param name [::String]
1053
+ # Required. The name of the `IntelligenceFindingRevision` resource.
1054
+ # ## Format:
1055
+ #
1056
+ # `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}/revisions/{revision}`
1057
+ # @yield [result, operation] Access the result along with the TransportOperation object
1058
+ # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision]
1059
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1060
+ #
1061
+ # @return [::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision]
1062
+ #
1063
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1064
+ #
1065
+ # @example Basic example
1066
+ # require "google/cloud/storage/control/v2"
1067
+ #
1068
+ # # Create a client object. The client can be reused for multiple calls.
1069
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new
1070
+ #
1071
+ # # Create a request. To set request fields, pass in keyword arguments.
1072
+ # request = Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest.new
1073
+ #
1074
+ # # Call the get_intelligence_finding_revision method.
1075
+ # result = client.get_intelligence_finding_revision request
1076
+ #
1077
+ # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision.
1078
+ # p result
1079
+ #
1080
+ def get_intelligence_finding_revision request, options = nil
1081
+ raise ::ArgumentError, "request must be provided" if request.nil?
1082
+
1083
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetIntelligenceFindingRevisionRequest
1084
+
1085
+ # Converts hash and nil to an options object
1086
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1087
+
1088
+ # Customize the options with defaults
1089
+ call_metadata = @config.rpcs.get_intelligence_finding_revision.metadata.to_h
1090
+
1091
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1092
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1093
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1094
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
1095
+ transports_version_send: [:rest]
1096
+
1097
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1098
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1099
+
1100
+ options.apply_defaults timeout: @config.rpcs.get_intelligence_finding_revision.timeout,
1101
+ metadata: call_metadata,
1102
+ retry_policy: @config.rpcs.get_intelligence_finding_revision.retry_policy
1103
+
1104
+ options.apply_defaults timeout: @config.timeout,
1105
+ metadata: @config.metadata,
1106
+ retry_policy: @config.retry_policy
1107
+
1108
+ @storage_control_stub.get_intelligence_finding_revision request, options do |result, operation|
1109
+ yield result, operation if block_given?
1110
+ end
1111
+ rescue ::Gapic::Rest::Error => e
1112
+ raise ::Google::Cloud::Error.from_error(e)
1113
+ end
1114
+
1115
+ ##
1116
+ # Lists all the revisions of an `IntelligenceFinding` resource.
1117
+ #
1118
+ # @overload list_intelligence_finding_revisions(request, options = nil)
1119
+ # Pass arguments to `list_intelligence_finding_revisions` via a request object, either of type
1120
+ # {::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest} or an equivalent Hash.
1121
+ #
1122
+ # @param request [::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest, ::Hash]
1123
+ # A request object representing the call parameters. Required. To specify no
1124
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1125
+ # @param options [::Gapic::CallOptions, ::Hash]
1126
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1127
+ #
1128
+ # @overload list_intelligence_finding_revisions(parent: nil, page_size: nil, page_token: nil)
1129
+ # Pass arguments to `list_intelligence_finding_revisions` via keyword arguments. Note that at
1130
+ # least one keyword argument is required. To specify no parameters, or to keep all
1131
+ # the default parameter values, pass an empty Hash as a request object (see above).
1132
+ #
1133
+ # @param parent [::String]
1134
+ # Required. The parent of the `IntelligenceFindingRevision` resource.
1135
+ # ## Format:
1136
+ #
1137
+ # `projects/{project}/locations/{location}/intelligenceFindings/{intelligence_finding}`
1138
+ # @param page_size [::Integer]
1139
+ # Optional. The maximum number of `IntelligenceFindingRevision` resources to
1140
+ # return.
1141
+ #
1142
+ # The maximum value is `100`; values above `100` will be coerced to `100`.
1143
+ # The default value is `100`.
1144
+ # @param page_token [::String]
1145
+ # Optional. A page token, received from a previous
1146
+ # `ListIntelligenceFindingRevisions` call. Provide this to retrieve the
1147
+ # subsequent page.
1148
+ # @yield [result, operation] Access the result along with the TransportOperation object
1149
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision>]
1150
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1151
+ #
1152
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision>]
1153
+ #
1154
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1155
+ #
1156
+ # @example Basic example
1157
+ # require "google/cloud/storage/control/v2"
1158
+ #
1159
+ # # Create a client object. The client can be reused for multiple calls.
1160
+ # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new
1161
+ #
1162
+ # # Create a request. To set request fields, pass in keyword arguments.
1163
+ # request = Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest.new
1164
+ #
1165
+ # # Call the list_intelligence_finding_revisions method.
1166
+ # result = client.list_intelligence_finding_revisions request
1167
+ #
1168
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1169
+ # # over elements, and API calls will be issued to fetch pages as needed.
1170
+ # result.each do |item|
1171
+ # # Each element is of type ::Google::Cloud::Storage::Control::V2::IntelligenceFindingRevision.
1172
+ # p item
1173
+ # end
1174
+ #
1175
+ def list_intelligence_finding_revisions request, options = nil
1176
+ raise ::ArgumentError, "request must be provided" if request.nil?
1177
+
1178
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListIntelligenceFindingRevisionsRequest
1179
+
1180
+ # Converts hash and nil to an options object
1181
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1182
+
1183
+ # Customize the options with defaults
1184
+ call_metadata = @config.rpcs.list_intelligence_finding_revisions.metadata.to_h
1185
+
1186
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1187
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1188
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1189
+ gapic_version: ::Google::Cloud::Storage::Control::V2::VERSION,
1190
+ transports_version_send: [:rest]
1191
+
1192
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1193
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1194
+
1195
+ options.apply_defaults timeout: @config.rpcs.list_intelligence_finding_revisions.timeout,
1196
+ metadata: call_metadata,
1197
+ retry_policy: @config.rpcs.list_intelligence_finding_revisions.retry_policy
1198
+
1199
+ options.apply_defaults timeout: @config.timeout,
1200
+ metadata: @config.metadata,
1201
+ retry_policy: @config.retry_policy
1202
+
1203
+ @storage_control_stub.list_intelligence_finding_revisions request, options do |result, operation|
1204
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_control_stub, :list_intelligence_finding_revisions, "intelligence_finding_revisions", request, result, options
1205
+ yield result, operation if block_given?
1206
+ throw :response, result
1207
+ end
1208
+ rescue ::Gapic::Rest::Error => e
1209
+ raise ::Google::Cloud::Error.from_error(e)
1210
+ end
1211
+
710
1212
  ##
711
1213
  # Configuration class for the StorageControl REST API.
712
1214
  #
@@ -883,6 +1385,31 @@ module Google
883
1385
  # @return [::Gapic::Config::Method]
884
1386
  #
885
1387
  attr_reader :update_organization_intelligence_config
1388
+ ##
1389
+ # RPC-specific configuration for `get_intelligence_finding`
1390
+ # @return [::Gapic::Config::Method]
1391
+ #
1392
+ attr_reader :get_intelligence_finding
1393
+ ##
1394
+ # RPC-specific configuration for `list_intelligence_findings`
1395
+ # @return [::Gapic::Config::Method]
1396
+ #
1397
+ attr_reader :list_intelligence_findings
1398
+ ##
1399
+ # RPC-specific configuration for `summarize_intelligence_findings`
1400
+ # @return [::Gapic::Config::Method]
1401
+ #
1402
+ attr_reader :summarize_intelligence_findings
1403
+ ##
1404
+ # RPC-specific configuration for `get_intelligence_finding_revision`
1405
+ # @return [::Gapic::Config::Method]
1406
+ #
1407
+ attr_reader :get_intelligence_finding_revision
1408
+ ##
1409
+ # RPC-specific configuration for `list_intelligence_finding_revisions`
1410
+ # @return [::Gapic::Config::Method]
1411
+ #
1412
+ attr_reader :list_intelligence_finding_revisions
886
1413
 
887
1414
  # @private
888
1415
  def initialize parent_rpcs = nil
@@ -898,6 +1425,16 @@ module Google
898
1425
  @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config
899
1426
  update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config
900
1427
  @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config
1428
+ get_intelligence_finding_config = parent_rpcs.get_intelligence_finding if parent_rpcs.respond_to? :get_intelligence_finding
1429
+ @get_intelligence_finding = ::Gapic::Config::Method.new get_intelligence_finding_config
1430
+ list_intelligence_findings_config = parent_rpcs.list_intelligence_findings if parent_rpcs.respond_to? :list_intelligence_findings
1431
+ @list_intelligence_findings = ::Gapic::Config::Method.new list_intelligence_findings_config
1432
+ summarize_intelligence_findings_config = parent_rpcs.summarize_intelligence_findings if parent_rpcs.respond_to? :summarize_intelligence_findings
1433
+ @summarize_intelligence_findings = ::Gapic::Config::Method.new summarize_intelligence_findings_config
1434
+ get_intelligence_finding_revision_config = parent_rpcs.get_intelligence_finding_revision if parent_rpcs.respond_to? :get_intelligence_finding_revision
1435
+ @get_intelligence_finding_revision = ::Gapic::Config::Method.new get_intelligence_finding_revision_config
1436
+ list_intelligence_finding_revisions_config = parent_rpcs.list_intelligence_finding_revisions if parent_rpcs.respond_to? :list_intelligence_finding_revisions
1437
+ @list_intelligence_finding_revisions = ::Gapic::Config::Method.new list_intelligence_finding_revisions_config
901
1438
 
902
1439
  yield self if block_given?
903
1440
  end