google-cloud-storage_insights-v1 1.0.1 → 1.2.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.
@@ -95,6 +95,36 @@ module Google
95
95
  initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
96
96
  }
97
97
 
98
+ default_config.rpcs.list_dataset_configs.timeout = 60.0
99
+ default_config.rpcs.list_dataset_configs.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.create_dataset_config.timeout = 60.0
104
+ default_config.rpcs.create_dataset_config.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.update_dataset_config.timeout = 60.0
109
+ default_config.rpcs.update_dataset_config.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.delete_dataset_config.timeout = 60.0
114
+ default_config.rpcs.delete_dataset_config.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config.rpcs.link_dataset.timeout = 60.0
119
+ default_config.rpcs.link_dataset.retry_policy = {
120
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
121
+ }
122
+
123
+ default_config.rpcs.unlink_dataset.timeout = 60.0
124
+ default_config.rpcs.unlink_dataset.retry_policy = {
125
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
126
+ }
127
+
98
128
  default_config
99
129
  end
100
130
  yield @configure if block_given?
@@ -169,6 +199,13 @@ module Google
169
199
  @quota_project_id = @config.quota_project
170
200
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
171
201
 
202
+ @operations_client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Operations.new do |config|
203
+ config.credentials = credentials
204
+ config.quota_project = @quota_project_id
205
+ config.endpoint = @config.endpoint
206
+ config.universe_domain = @config.universe_domain
207
+ end
208
+
172
209
  @storage_insights_stub = ::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::ServiceStub.new(
173
210
  endpoint: @config.endpoint,
174
211
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
@@ -197,6 +234,13 @@ module Google
197
234
  end
198
235
  end
199
236
 
237
+ ##
238
+ # Get the associated client for long-running operations.
239
+ #
240
+ # @return [::Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Operations]
241
+ #
242
+ attr_reader :operations_client
243
+
200
244
  ##
201
245
  # Get the associated client for mix-in of the Locations.
202
246
  #
@@ -843,6 +887,662 @@ module Google
843
887
  raise ::Google::Cloud::Error.from_error(e)
844
888
  end
845
889
 
890
+ ##
891
+ # Lists the dataset configurations in a given project for a given location.
892
+ #
893
+ # @overload list_dataset_configs(request, options = nil)
894
+ # Pass arguments to `list_dataset_configs` via a request object, either of type
895
+ # {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash.
896
+ #
897
+ # @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash]
898
+ # A request object representing the call parameters. Required. To specify no
899
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
900
+ # @param options [::Gapic::CallOptions, ::Hash]
901
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
902
+ #
903
+ # @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
904
+ # Pass arguments to `list_dataset_configs` via keyword arguments. Note that at
905
+ # least one keyword argument is required. To specify no parameters, or to keep all
906
+ # the default parameter values, pass an empty Hash as a request object (see above).
907
+ #
908
+ # @param parent [::String]
909
+ # Required. Parent value for ListDatasetConfigsRequest
910
+ # @param page_size [::Integer]
911
+ # Requested page size. Server might return fewer items than requested.
912
+ # If unspecified, server picks an appropriate default.
913
+ # @param page_token [::String]
914
+ # A token identifying a page of results the server should return.
915
+ # @param filter [::String]
916
+ # Filtering results
917
+ # @param order_by [::String]
918
+ # Hint for how to order the results
919
+ # @yield [result, operation] Access the result along with the TransportOperation object
920
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>]
921
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
922
+ #
923
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>]
924
+ #
925
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
926
+ #
927
+ # @example Basic example
928
+ # require "google/cloud/storage_insights/v1"
929
+ #
930
+ # # Create a client object. The client can be reused for multiple calls.
931
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
932
+ #
933
+ # # Create a request. To set request fields, pass in keyword arguments.
934
+ # request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new
935
+ #
936
+ # # Call the list_dataset_configs method.
937
+ # result = client.list_dataset_configs request
938
+ #
939
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
940
+ # # over elements, and API calls will be issued to fetch pages as needed.
941
+ # result.each do |item|
942
+ # # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig.
943
+ # p item
944
+ # end
945
+ #
946
+ def list_dataset_configs request, options = nil
947
+ raise ::ArgumentError, "request must be provided" if request.nil?
948
+
949
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest
950
+
951
+ # Converts hash and nil to an options object
952
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
953
+
954
+ # Customize the options with defaults
955
+ call_metadata = @config.rpcs.list_dataset_configs.metadata.to_h
956
+
957
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
958
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
959
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
960
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
961
+ transports_version_send: [:rest]
962
+
963
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
964
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
965
+
966
+ options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout,
967
+ metadata: call_metadata,
968
+ retry_policy: @config.rpcs.list_dataset_configs.retry_policy
969
+
970
+ options.apply_defaults timeout: @config.timeout,
971
+ metadata: @config.metadata,
972
+ retry_policy: @config.retry_policy
973
+
974
+ @storage_insights_stub.list_dataset_configs request, options do |result, operation|
975
+ result = ::Gapic::Rest::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, "dataset_configs", request, result, options
976
+ yield result, operation if block_given?
977
+ throw :response, result
978
+ end
979
+ rescue ::Gapic::Rest::Error => e
980
+ raise ::Google::Cloud::Error.from_error(e)
981
+ end
982
+
983
+ ##
984
+ # Gets the dataset configuration in a given project for a given location.
985
+ #
986
+ # @overload get_dataset_config(request, options = nil)
987
+ # Pass arguments to `get_dataset_config` via a request object, either of type
988
+ # {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash.
989
+ #
990
+ # @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash]
991
+ # A request object representing the call parameters. Required. To specify no
992
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
993
+ # @param options [::Gapic::CallOptions, ::Hash]
994
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
995
+ #
996
+ # @overload get_dataset_config(name: nil)
997
+ # Pass arguments to `get_dataset_config` via keyword arguments. Note that at
998
+ # least one keyword argument is required. To specify no parameters, or to keep all
999
+ # the default parameter values, pass an empty Hash as a request object (see above).
1000
+ #
1001
+ # @param name [::String]
1002
+ # Required. Name of the resource
1003
+ # @yield [result, operation] Access the result along with the TransportOperation object
1004
+ # @yieldparam result [::Google::Cloud::StorageInsights::V1::DatasetConfig]
1005
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1006
+ #
1007
+ # @return [::Google::Cloud::StorageInsights::V1::DatasetConfig]
1008
+ #
1009
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1010
+ #
1011
+ # @example Basic example
1012
+ # require "google/cloud/storage_insights/v1"
1013
+ #
1014
+ # # Create a client object. The client can be reused for multiple calls.
1015
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1016
+ #
1017
+ # # Create a request. To set request fields, pass in keyword arguments.
1018
+ # request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new
1019
+ #
1020
+ # # Call the get_dataset_config method.
1021
+ # result = client.get_dataset_config request
1022
+ #
1023
+ # # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig.
1024
+ # p result
1025
+ #
1026
+ def get_dataset_config request, options = nil
1027
+ raise ::ArgumentError, "request must be provided" if request.nil?
1028
+
1029
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest
1030
+
1031
+ # Converts hash and nil to an options object
1032
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1033
+
1034
+ # Customize the options with defaults
1035
+ call_metadata = @config.rpcs.get_dataset_config.metadata.to_h
1036
+
1037
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1038
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1039
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1040
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1041
+ transports_version_send: [:rest]
1042
+
1043
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1044
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1045
+
1046
+ options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout,
1047
+ metadata: call_metadata,
1048
+ retry_policy: @config.rpcs.get_dataset_config.retry_policy
1049
+
1050
+ options.apply_defaults timeout: @config.timeout,
1051
+ metadata: @config.metadata,
1052
+ retry_policy: @config.retry_policy
1053
+
1054
+ @storage_insights_stub.get_dataset_config request, options do |result, operation|
1055
+ yield result, operation if block_given?
1056
+ end
1057
+ rescue ::Gapic::Rest::Error => e
1058
+ raise ::Google::Cloud::Error.from_error(e)
1059
+ end
1060
+
1061
+ ##
1062
+ # Creates a dataset configuration in a given project for a given location.
1063
+ #
1064
+ # @overload create_dataset_config(request, options = nil)
1065
+ # Pass arguments to `create_dataset_config` via a request object, either of type
1066
+ # {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash.
1067
+ #
1068
+ # @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash]
1069
+ # A request object representing the call parameters. Required. To specify no
1070
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1071
+ # @param options [::Gapic::CallOptions, ::Hash]
1072
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1073
+ #
1074
+ # @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil)
1075
+ # Pass arguments to `create_dataset_config` via keyword arguments. Note that at
1076
+ # least one keyword argument is required. To specify no parameters, or to keep all
1077
+ # the default parameter values, pass an empty Hash as a request object (see above).
1078
+ #
1079
+ # @param parent [::String]
1080
+ # Required. Value for parent.
1081
+ # @param dataset_config_id [::String]
1082
+ # Required. ID of the requesting object.
1083
+ # If auto-generating ID is enabled on the server-side, remove this field and
1084
+ # `dataset_config_id` from the method_signature of Create RPC
1085
+ # Note: The value should not contain any hyphens.
1086
+ # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash]
1087
+ # Required. The resource being created
1088
+ # @param request_id [::String]
1089
+ # Optional. A unique identifier for your request.
1090
+ # Specify the request ID if you need to retry the request.
1091
+ # If you retry the request with the same ID within 60 minutes, the server
1092
+ # ignores the request if it has already completed the original request.
1093
+ #
1094
+ # For example, if your initial request times out and you retry the request
1095
+ # using the same request ID, the server recognizes the original request and
1096
+ # does not process the new request.
1097
+ #
1098
+ # The request ID must be a valid UUID and cannot be a zero UUID
1099
+ # (00000000-0000-0000-0000-000000000000).
1100
+ # @yield [result, operation] Access the result along with the TransportOperation object
1101
+ # @yieldparam result [::Gapic::Operation]
1102
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1103
+ #
1104
+ # @return [::Gapic::Operation]
1105
+ #
1106
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1107
+ #
1108
+ # @example Basic example
1109
+ # require "google/cloud/storage_insights/v1"
1110
+ #
1111
+ # # Create a client object. The client can be reused for multiple calls.
1112
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1113
+ #
1114
+ # # Create a request. To set request fields, pass in keyword arguments.
1115
+ # request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new
1116
+ #
1117
+ # # Call the create_dataset_config method.
1118
+ # result = client.create_dataset_config request
1119
+ #
1120
+ # # The returned object is of type Gapic::Operation. You can use it to
1121
+ # # check the status of an operation, cancel it, or wait for results.
1122
+ # # Here is how to wait for a response.
1123
+ # result.wait_until_done! timeout: 60
1124
+ # if result.response?
1125
+ # p result.response
1126
+ # else
1127
+ # puts "No response received."
1128
+ # end
1129
+ #
1130
+ def create_dataset_config request, options = nil
1131
+ raise ::ArgumentError, "request must be provided" if request.nil?
1132
+
1133
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest
1134
+
1135
+ # Converts hash and nil to an options object
1136
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1137
+
1138
+ # Customize the options with defaults
1139
+ call_metadata = @config.rpcs.create_dataset_config.metadata.to_h
1140
+
1141
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1142
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1143
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1144
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1145
+ transports_version_send: [:rest]
1146
+
1147
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1148
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1149
+
1150
+ options.apply_defaults timeout: @config.rpcs.create_dataset_config.timeout,
1151
+ metadata: call_metadata,
1152
+ retry_policy: @config.rpcs.create_dataset_config.retry_policy
1153
+
1154
+ options.apply_defaults timeout: @config.timeout,
1155
+ metadata: @config.metadata,
1156
+ retry_policy: @config.retry_policy
1157
+
1158
+ @storage_insights_stub.create_dataset_config request, options do |result, operation|
1159
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1160
+ yield result, operation if block_given?
1161
+ throw :response, result
1162
+ end
1163
+ rescue ::Gapic::Rest::Error => e
1164
+ raise ::Google::Cloud::Error.from_error(e)
1165
+ end
1166
+
1167
+ ##
1168
+ # Updates a dataset configuration in a given project for a given location.
1169
+ #
1170
+ # @overload update_dataset_config(request, options = nil)
1171
+ # Pass arguments to `update_dataset_config` via a request object, either of type
1172
+ # {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash.
1173
+ #
1174
+ # @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash]
1175
+ # A request object representing the call parameters. Required. To specify no
1176
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1177
+ # @param options [::Gapic::CallOptions, ::Hash]
1178
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1179
+ #
1180
+ # @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil)
1181
+ # Pass arguments to `update_dataset_config` via keyword arguments. Note that at
1182
+ # least one keyword argument is required. To specify no parameters, or to keep all
1183
+ # the default parameter values, pass an empty Hash as a request object (see above).
1184
+ #
1185
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1186
+ # Required. Field mask is used to specify the fields to be overwritten in the
1187
+ # `DatasetConfig` resource by the update.
1188
+ # The fields specified in the `update_mask` are relative to the resource, not
1189
+ # the full request. A field is overwritten if it is in the mask. If the
1190
+ # user does not provide a mask then it returns an "Invalid Argument" error.
1191
+ # @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash]
1192
+ # Required. The resource being updated
1193
+ # @param request_id [::String]
1194
+ # Optional. A unique identifier for your request.
1195
+ # Specify the request ID if you need to retry the request.
1196
+ # If you retry the request with the same ID within 60 minutes, the server
1197
+ # ignores the request if it has already completed the original request.
1198
+ #
1199
+ # For example, if your initial request times out and you retry the request
1200
+ # using the same request ID, the server recognizes the original request and
1201
+ # does not process the new request.
1202
+ #
1203
+ # The request ID must be a valid UUID and cannot be a zero UUID
1204
+ # (00000000-0000-0000-0000-000000000000).
1205
+ # @yield [result, operation] Access the result along with the TransportOperation object
1206
+ # @yieldparam result [::Gapic::Operation]
1207
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1208
+ #
1209
+ # @return [::Gapic::Operation]
1210
+ #
1211
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1212
+ #
1213
+ # @example Basic example
1214
+ # require "google/cloud/storage_insights/v1"
1215
+ #
1216
+ # # Create a client object. The client can be reused for multiple calls.
1217
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1218
+ #
1219
+ # # Create a request. To set request fields, pass in keyword arguments.
1220
+ # request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new
1221
+ #
1222
+ # # Call the update_dataset_config method.
1223
+ # result = client.update_dataset_config request
1224
+ #
1225
+ # # The returned object is of type Gapic::Operation. You can use it to
1226
+ # # check the status of an operation, cancel it, or wait for results.
1227
+ # # Here is how to wait for a response.
1228
+ # result.wait_until_done! timeout: 60
1229
+ # if result.response?
1230
+ # p result.response
1231
+ # else
1232
+ # puts "No response received."
1233
+ # end
1234
+ #
1235
+ def update_dataset_config request, options = nil
1236
+ raise ::ArgumentError, "request must be provided" if request.nil?
1237
+
1238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest
1239
+
1240
+ # Converts hash and nil to an options object
1241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1242
+
1243
+ # Customize the options with defaults
1244
+ call_metadata = @config.rpcs.update_dataset_config.metadata.to_h
1245
+
1246
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1247
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1249
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1250
+ transports_version_send: [:rest]
1251
+
1252
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1253
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1254
+
1255
+ options.apply_defaults timeout: @config.rpcs.update_dataset_config.timeout,
1256
+ metadata: call_metadata,
1257
+ retry_policy: @config.rpcs.update_dataset_config.retry_policy
1258
+
1259
+ options.apply_defaults timeout: @config.timeout,
1260
+ metadata: @config.metadata,
1261
+ retry_policy: @config.retry_policy
1262
+
1263
+ @storage_insights_stub.update_dataset_config request, options do |result, operation|
1264
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1265
+ yield result, operation if block_given?
1266
+ throw :response, result
1267
+ end
1268
+ rescue ::Gapic::Rest::Error => e
1269
+ raise ::Google::Cloud::Error.from_error(e)
1270
+ end
1271
+
1272
+ ##
1273
+ # Deletes a dataset configuration in a given project for a given location.
1274
+ #
1275
+ # @overload delete_dataset_config(request, options = nil)
1276
+ # Pass arguments to `delete_dataset_config` via a request object, either of type
1277
+ # {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash.
1278
+ #
1279
+ # @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash]
1280
+ # A request object representing the call parameters. Required. To specify no
1281
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1282
+ # @param options [::Gapic::CallOptions, ::Hash]
1283
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1284
+ #
1285
+ # @overload delete_dataset_config(name: nil, request_id: nil)
1286
+ # Pass arguments to `delete_dataset_config` via keyword arguments. Note that at
1287
+ # least one keyword argument is required. To specify no parameters, or to keep all
1288
+ # the default parameter values, pass an empty Hash as a request object (see above).
1289
+ #
1290
+ # @param name [::String]
1291
+ # Required. Name of the resource
1292
+ # @param request_id [::String]
1293
+ # Optional. A unique identifier for your request.
1294
+ # Specify the request ID if you need to retry the request.
1295
+ # If you retry the request with the same ID within 60 minutes, the server
1296
+ # ignores the request if it has already completed the original request.
1297
+ #
1298
+ # For example, if your initial request times out and you retry the request
1299
+ # using the same request ID, the server recognizes the original request and
1300
+ # does not process the new request.
1301
+ #
1302
+ # The request ID must be a valid UUID and cannot be a zero UUID
1303
+ # (00000000-0000-0000-0000-000000000000).
1304
+ # @yield [result, operation] Access the result along with the TransportOperation object
1305
+ # @yieldparam result [::Gapic::Operation]
1306
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1307
+ #
1308
+ # @return [::Gapic::Operation]
1309
+ #
1310
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1311
+ #
1312
+ # @example Basic example
1313
+ # require "google/cloud/storage_insights/v1"
1314
+ #
1315
+ # # Create a client object. The client can be reused for multiple calls.
1316
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1317
+ #
1318
+ # # Create a request. To set request fields, pass in keyword arguments.
1319
+ # request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new
1320
+ #
1321
+ # # Call the delete_dataset_config method.
1322
+ # result = client.delete_dataset_config request
1323
+ #
1324
+ # # The returned object is of type Gapic::Operation. You can use it to
1325
+ # # check the status of an operation, cancel it, or wait for results.
1326
+ # # Here is how to wait for a response.
1327
+ # result.wait_until_done! timeout: 60
1328
+ # if result.response?
1329
+ # p result.response
1330
+ # else
1331
+ # puts "No response received."
1332
+ # end
1333
+ #
1334
+ def delete_dataset_config request, options = nil
1335
+ raise ::ArgumentError, "request must be provided" if request.nil?
1336
+
1337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest
1338
+
1339
+ # Converts hash and nil to an options object
1340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1341
+
1342
+ # Customize the options with defaults
1343
+ call_metadata = @config.rpcs.delete_dataset_config.metadata.to_h
1344
+
1345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1348
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1349
+ transports_version_send: [:rest]
1350
+
1351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1353
+
1354
+ options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout,
1355
+ metadata: call_metadata,
1356
+ retry_policy: @config.rpcs.delete_dataset_config.retry_policy
1357
+
1358
+ options.apply_defaults timeout: @config.timeout,
1359
+ metadata: @config.metadata,
1360
+ retry_policy: @config.retry_policy
1361
+
1362
+ @storage_insights_stub.delete_dataset_config request, options do |result, operation|
1363
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1364
+ yield result, operation if block_given?
1365
+ throw :response, result
1366
+ end
1367
+ rescue ::Gapic::Rest::Error => e
1368
+ raise ::Google::Cloud::Error.from_error(e)
1369
+ end
1370
+
1371
+ ##
1372
+ # Links a dataset to BigQuery in a given project for a given location.
1373
+ #
1374
+ # @overload link_dataset(request, options = nil)
1375
+ # Pass arguments to `link_dataset` via a request object, either of type
1376
+ # {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash.
1377
+ #
1378
+ # @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash]
1379
+ # A request object representing the call parameters. Required. To specify no
1380
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1381
+ # @param options [::Gapic::CallOptions, ::Hash]
1382
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1383
+ #
1384
+ # @overload link_dataset(name: nil)
1385
+ # Pass arguments to `link_dataset` via keyword arguments. Note that at
1386
+ # least one keyword argument is required. To specify no parameters, or to keep all
1387
+ # the default parameter values, pass an empty Hash as a request object (see above).
1388
+ #
1389
+ # @param name [::String]
1390
+ # Required. Name of the resource
1391
+ # @yield [result, operation] Access the result along with the TransportOperation object
1392
+ # @yieldparam result [::Gapic::Operation]
1393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1394
+ #
1395
+ # @return [::Gapic::Operation]
1396
+ #
1397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1398
+ #
1399
+ # @example Basic example
1400
+ # require "google/cloud/storage_insights/v1"
1401
+ #
1402
+ # # Create a client object. The client can be reused for multiple calls.
1403
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1404
+ #
1405
+ # # Create a request. To set request fields, pass in keyword arguments.
1406
+ # request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new
1407
+ #
1408
+ # # Call the link_dataset method.
1409
+ # result = client.link_dataset request
1410
+ #
1411
+ # # The returned object is of type Gapic::Operation. You can use it to
1412
+ # # check the status of an operation, cancel it, or wait for results.
1413
+ # # Here is how to wait for a response.
1414
+ # result.wait_until_done! timeout: 60
1415
+ # if result.response?
1416
+ # p result.response
1417
+ # else
1418
+ # puts "No response received."
1419
+ # end
1420
+ #
1421
+ def link_dataset request, options = nil
1422
+ raise ::ArgumentError, "request must be provided" if request.nil?
1423
+
1424
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest
1425
+
1426
+ # Converts hash and nil to an options object
1427
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1428
+
1429
+ # Customize the options with defaults
1430
+ call_metadata = @config.rpcs.link_dataset.metadata.to_h
1431
+
1432
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1433
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1434
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1435
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1436
+ transports_version_send: [:rest]
1437
+
1438
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1439
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1440
+
1441
+ options.apply_defaults timeout: @config.rpcs.link_dataset.timeout,
1442
+ metadata: call_metadata,
1443
+ retry_policy: @config.rpcs.link_dataset.retry_policy
1444
+
1445
+ options.apply_defaults timeout: @config.timeout,
1446
+ metadata: @config.metadata,
1447
+ retry_policy: @config.retry_policy
1448
+
1449
+ @storage_insights_stub.link_dataset request, options do |result, operation|
1450
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1451
+ yield result, operation if block_given?
1452
+ throw :response, result
1453
+ end
1454
+ rescue ::Gapic::Rest::Error => e
1455
+ raise ::Google::Cloud::Error.from_error(e)
1456
+ end
1457
+
1458
+ ##
1459
+ # Unlinks a dataset from BigQuery in a given project
1460
+ # for a given location.
1461
+ #
1462
+ # @overload unlink_dataset(request, options = nil)
1463
+ # Pass arguments to `unlink_dataset` via a request object, either of type
1464
+ # {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash.
1465
+ #
1466
+ # @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash]
1467
+ # A request object representing the call parameters. Required. To specify no
1468
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1469
+ # @param options [::Gapic::CallOptions, ::Hash]
1470
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1471
+ #
1472
+ # @overload unlink_dataset(name: nil)
1473
+ # Pass arguments to `unlink_dataset` via keyword arguments. Note that at
1474
+ # least one keyword argument is required. To specify no parameters, or to keep all
1475
+ # the default parameter values, pass an empty Hash as a request object (see above).
1476
+ #
1477
+ # @param name [::String]
1478
+ # Required. Name of the resource
1479
+ # @yield [result, operation] Access the result along with the TransportOperation object
1480
+ # @yieldparam result [::Gapic::Operation]
1481
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1482
+ #
1483
+ # @return [::Gapic::Operation]
1484
+ #
1485
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1486
+ #
1487
+ # @example Basic example
1488
+ # require "google/cloud/storage_insights/v1"
1489
+ #
1490
+ # # Create a client object. The client can be reused for multiple calls.
1491
+ # client = Google::Cloud::StorageInsights::V1::StorageInsights::Rest::Client.new
1492
+ #
1493
+ # # Create a request. To set request fields, pass in keyword arguments.
1494
+ # request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new
1495
+ #
1496
+ # # Call the unlink_dataset method.
1497
+ # result = client.unlink_dataset request
1498
+ #
1499
+ # # The returned object is of type Gapic::Operation. You can use it to
1500
+ # # check the status of an operation, cancel it, or wait for results.
1501
+ # # Here is how to wait for a response.
1502
+ # result.wait_until_done! timeout: 60
1503
+ # if result.response?
1504
+ # p result.response
1505
+ # else
1506
+ # puts "No response received."
1507
+ # end
1508
+ #
1509
+ def unlink_dataset request, options = nil
1510
+ raise ::ArgumentError, "request must be provided" if request.nil?
1511
+
1512
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest
1513
+
1514
+ # Converts hash and nil to an options object
1515
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1516
+
1517
+ # Customize the options with defaults
1518
+ call_metadata = @config.rpcs.unlink_dataset.metadata.to_h
1519
+
1520
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1521
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1522
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1523
+ gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION,
1524
+ transports_version_send: [:rest]
1525
+
1526
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1527
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1528
+
1529
+ options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout,
1530
+ metadata: call_metadata,
1531
+ retry_policy: @config.rpcs.unlink_dataset.retry_policy
1532
+
1533
+ options.apply_defaults timeout: @config.timeout,
1534
+ metadata: @config.metadata,
1535
+ retry_policy: @config.retry_policy
1536
+
1537
+ @storage_insights_stub.unlink_dataset request, options do |result, operation|
1538
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1539
+ yield result, operation if block_given?
1540
+ throw :response, result
1541
+ end
1542
+ rescue ::Gapic::Rest::Error => e
1543
+ raise ::Google::Cloud::Error.from_error(e)
1544
+ end
1545
+
846
1546
  ##
847
1547
  # Configuration class for the StorageInsights REST API.
848
1548
  #
@@ -1031,6 +1731,41 @@ module Google
1031
1731
  # @return [::Gapic::Config::Method]
1032
1732
  #
1033
1733
  attr_reader :get_report_detail
1734
+ ##
1735
+ # RPC-specific configuration for `list_dataset_configs`
1736
+ # @return [::Gapic::Config::Method]
1737
+ #
1738
+ attr_reader :list_dataset_configs
1739
+ ##
1740
+ # RPC-specific configuration for `get_dataset_config`
1741
+ # @return [::Gapic::Config::Method]
1742
+ #
1743
+ attr_reader :get_dataset_config
1744
+ ##
1745
+ # RPC-specific configuration for `create_dataset_config`
1746
+ # @return [::Gapic::Config::Method]
1747
+ #
1748
+ attr_reader :create_dataset_config
1749
+ ##
1750
+ # RPC-specific configuration for `update_dataset_config`
1751
+ # @return [::Gapic::Config::Method]
1752
+ #
1753
+ attr_reader :update_dataset_config
1754
+ ##
1755
+ # RPC-specific configuration for `delete_dataset_config`
1756
+ # @return [::Gapic::Config::Method]
1757
+ #
1758
+ attr_reader :delete_dataset_config
1759
+ ##
1760
+ # RPC-specific configuration for `link_dataset`
1761
+ # @return [::Gapic::Config::Method]
1762
+ #
1763
+ attr_reader :link_dataset
1764
+ ##
1765
+ # RPC-specific configuration for `unlink_dataset`
1766
+ # @return [::Gapic::Config::Method]
1767
+ #
1768
+ attr_reader :unlink_dataset
1034
1769
 
1035
1770
  # @private
1036
1771
  def initialize parent_rpcs = nil
@@ -1048,6 +1783,20 @@ module Google
1048
1783
  @list_report_details = ::Gapic::Config::Method.new list_report_details_config
1049
1784
  get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail
1050
1785
  @get_report_detail = ::Gapic::Config::Method.new get_report_detail_config
1786
+ list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs
1787
+ @list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config
1788
+ get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config
1789
+ @get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config
1790
+ create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config
1791
+ @create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config
1792
+ update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config
1793
+ @update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config
1794
+ delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config
1795
+ @delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config
1796
+ link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset
1797
+ @link_dataset = ::Gapic::Config::Method.new link_dataset_config
1798
+ unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset
1799
+ @unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config
1051
1800
 
1052
1801
  yield self if block_given?
1053
1802
  end