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.
- checksums.yaml +4 -4
- data/lib/google/cloud/storage_insights/v1/storage_insights/client.rb +969 -171
- data/lib/google/cloud/storage_insights/v1/storage_insights/operations.rb +813 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/paths.rb +19 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest/client.rb +749 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest/operations.rb +914 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest/service_stub.rb +431 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights/rest.rb +1 -0
- data/lib/google/cloud/storage_insights/v1/storage_insights.rb +1 -0
- data/lib/google/cloud/storage_insights/v1/version.rb +1 -1
- data/lib/google/cloud/storageinsights/v1/storageinsights_pb.rb +25 -1
- data/lib/google/cloud/storageinsights/v1/storageinsights_services_pb.rb +15 -0
- data/proto_docs/google/cloud/storageinsights/v1/storageinsights.rb +493 -1
- data/proto_docs/google/longrunning/operations.rb +173 -0
- metadata +13 -22
@@ -93,6 +93,36 @@ module Google
|
|
93
93
|
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
94
94
|
}
|
95
95
|
|
96
|
+
default_config.rpcs.list_dataset_configs.timeout = 60.0
|
97
|
+
default_config.rpcs.list_dataset_configs.retry_policy = {
|
98
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
99
|
+
}
|
100
|
+
|
101
|
+
default_config.rpcs.create_dataset_config.timeout = 60.0
|
102
|
+
default_config.rpcs.create_dataset_config.retry_policy = {
|
103
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
104
|
+
}
|
105
|
+
|
106
|
+
default_config.rpcs.update_dataset_config.timeout = 60.0
|
107
|
+
default_config.rpcs.update_dataset_config.retry_policy = {
|
108
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
109
|
+
}
|
110
|
+
|
111
|
+
default_config.rpcs.delete_dataset_config.timeout = 60.0
|
112
|
+
default_config.rpcs.delete_dataset_config.retry_policy = {
|
113
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
114
|
+
}
|
115
|
+
|
116
|
+
default_config.rpcs.link_dataset.timeout = 60.0
|
117
|
+
default_config.rpcs.link_dataset.retry_policy = {
|
118
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
119
|
+
}
|
120
|
+
|
121
|
+
default_config.rpcs.unlink_dataset.timeout = 60.0
|
122
|
+
default_config.rpcs.unlink_dataset.retry_policy = {
|
123
|
+
initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
|
124
|
+
}
|
125
|
+
|
96
126
|
default_config
|
97
127
|
end
|
98
128
|
yield @configure if block_given?
|
@@ -172,6 +202,13 @@ module Google
|
|
172
202
|
@quota_project_id = @config.quota_project
|
173
203
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
174
204
|
|
205
|
+
@operations_client = Operations.new do |config|
|
206
|
+
config.credentials = credentials
|
207
|
+
config.quota_project = @quota_project_id
|
208
|
+
config.endpoint = @config.endpoint
|
209
|
+
config.universe_domain = @config.universe_domain
|
210
|
+
end
|
211
|
+
|
175
212
|
@storage_insights_stub = ::Gapic::ServiceStub.new(
|
176
213
|
::Google::Cloud::StorageInsights::V1::StorageInsights::Stub,
|
177
214
|
credentials: credentials,
|
@@ -203,6 +240,13 @@ module Google
|
|
203
240
|
end
|
204
241
|
end
|
205
242
|
|
243
|
+
##
|
244
|
+
# Get the associated client for long-running operations.
|
245
|
+
#
|
246
|
+
# @return [::Google::Cloud::StorageInsights::V1::StorageInsights::Operations]
|
247
|
+
#
|
248
|
+
attr_reader :operations_client
|
249
|
+
|
206
250
|
##
|
207
251
|
# Get the associated client for mix-in of the Locations.
|
208
252
|
#
|
@@ -899,194 +943,899 @@ module Google
|
|
899
943
|
end
|
900
944
|
|
901
945
|
##
|
902
|
-
#
|
946
|
+
# Lists the dataset configurations in a given project for a given location.
|
903
947
|
#
|
904
|
-
#
|
905
|
-
#
|
906
|
-
#
|
907
|
-
# applied individually to specific RPCs. See
|
908
|
-
# {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration::Rpcs}
|
909
|
-
# for a list of RPCs that can be configured independently.
|
948
|
+
# @overload list_dataset_configs(request, options = nil)
|
949
|
+
# Pass arguments to `list_dataset_configs` via a request object, either of type
|
950
|
+
# {::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest} or an equivalent Hash.
|
910
951
|
#
|
911
|
-
#
|
912
|
-
#
|
952
|
+
# @param request [::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest, ::Hash]
|
953
|
+
# A request object representing the call parameters. Required. To specify no
|
954
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
955
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
956
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
913
957
|
#
|
914
|
-
# @
|
958
|
+
# @overload list_dataset_configs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
959
|
+
# Pass arguments to `list_dataset_configs` via keyword arguments. Note that at
|
960
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
961
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
915
962
|
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
#
|
919
|
-
#
|
920
|
-
#
|
921
|
-
#
|
922
|
-
#
|
963
|
+
# @param parent [::String]
|
964
|
+
# Required. Parent value for ListDatasetConfigsRequest
|
965
|
+
# @param page_size [::Integer]
|
966
|
+
# Requested page size. Server might return fewer items than requested.
|
967
|
+
# If unspecified, server picks an appropriate default.
|
968
|
+
# @param page_token [::String]
|
969
|
+
# A token identifying a page of results the server should return.
|
970
|
+
# @param filter [::String]
|
971
|
+
# Filtering results
|
972
|
+
# @param order_by [::String]
|
973
|
+
# Hint for how to order the results
|
923
974
|
#
|
924
|
-
#
|
925
|
-
#
|
926
|
-
#
|
927
|
-
# config.rpcs.list_report_configs.timeout = 20.0
|
928
|
-
# end
|
975
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
976
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>]
|
977
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
929
978
|
#
|
930
|
-
#
|
931
|
-
# A custom service endpoint, as a hostname or hostname:port. The default is
|
932
|
-
# nil, indicating to use the default endpoint in the current universe domain.
|
933
|
-
# @return [::String,nil]
|
934
|
-
# @!attribute [rw] credentials
|
935
|
-
# Credentials to send with calls. You may provide any of the following types:
|
936
|
-
# * (`String`) The path to a service account key file in JSON format
|
937
|
-
# * (`Hash`) A service account key as a Hash
|
938
|
-
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
939
|
-
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
940
|
-
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
941
|
-
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
942
|
-
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
943
|
-
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
944
|
-
# * (`nil`) indicating no credentials
|
979
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::StorageInsights::V1::DatasetConfig>]
|
945
980
|
#
|
946
|
-
#
|
947
|
-
# external source for authentication to Google Cloud, you must validate it before
|
948
|
-
# providing it to a Google API client library. Providing an unvalidated credential
|
949
|
-
# configuration to Google APIs can compromise the security of your systems and data.
|
950
|
-
# For more information, refer to [Validate credential configurations from external
|
951
|
-
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
952
|
-
# @return [::Object]
|
953
|
-
# @!attribute [rw] scope
|
954
|
-
# The OAuth scopes
|
955
|
-
# @return [::Array<::String>]
|
956
|
-
# @!attribute [rw] lib_name
|
957
|
-
# The library name as recorded in instrumentation and logging
|
958
|
-
# @return [::String]
|
959
|
-
# @!attribute [rw] lib_version
|
960
|
-
# The library version as recorded in instrumentation and logging
|
961
|
-
# @return [::String]
|
962
|
-
# @!attribute [rw] channel_args
|
963
|
-
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
964
|
-
# `GRPC::Core::Channel` object is provided as the credential.
|
965
|
-
# @return [::Hash]
|
966
|
-
# @!attribute [rw] interceptors
|
967
|
-
# An array of interceptors that are run before calls are executed.
|
968
|
-
# @return [::Array<::GRPC::ClientInterceptor>]
|
969
|
-
# @!attribute [rw] timeout
|
970
|
-
# The call timeout in seconds.
|
971
|
-
# @return [::Numeric]
|
972
|
-
# @!attribute [rw] metadata
|
973
|
-
# Additional gRPC headers to be sent with the call.
|
974
|
-
# @return [::Hash{::Symbol=>::String}]
|
975
|
-
# @!attribute [rw] retry_policy
|
976
|
-
# The retry policy. The value is a hash with the following keys:
|
977
|
-
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
978
|
-
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
979
|
-
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
980
|
-
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
981
|
-
# trigger a retry.
|
982
|
-
# @return [::Hash]
|
983
|
-
# @!attribute [rw] quota_project
|
984
|
-
# A separate project against which to charge quota.
|
985
|
-
# @return [::String]
|
986
|
-
# @!attribute [rw] universe_domain
|
987
|
-
# The universe domain within which to make requests. This determines the
|
988
|
-
# default endpoint URL. The default value of nil uses the environment
|
989
|
-
# universe (usually the default "googleapis.com" universe).
|
990
|
-
# @return [::String,nil]
|
991
|
-
# @!attribute [rw] logger
|
992
|
-
# A custom logger to use for request/response debug logging, or the value
|
993
|
-
# `:default` (the default) to construct a default logger, or `nil` to
|
994
|
-
# explicitly disable logging.
|
995
|
-
# @return [::Logger,:default,nil]
|
981
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
996
982
|
#
|
997
|
-
|
998
|
-
|
983
|
+
# @example Basic example
|
984
|
+
# require "google/cloud/storage_insights/v1"
|
985
|
+
#
|
986
|
+
# # Create a client object. The client can be reused for multiple calls.
|
987
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
988
|
+
#
|
989
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
990
|
+
# request = Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest.new
|
991
|
+
#
|
992
|
+
# # Call the list_dataset_configs method.
|
993
|
+
# result = client.list_dataset_configs request
|
994
|
+
#
|
995
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
996
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
997
|
+
# result.each do |item|
|
998
|
+
# # Each element is of type ::Google::Cloud::StorageInsights::V1::DatasetConfig.
|
999
|
+
# p item
|
1000
|
+
# end
|
1001
|
+
#
|
1002
|
+
def list_dataset_configs request, options = nil
|
1003
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
999
1004
|
|
1000
|
-
|
1001
|
-
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1002
|
-
DEFAULT_ENDPOINT = "storageinsights.googleapis.com"
|
1005
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::ListDatasetConfigsRequest
|
1003
1006
|
|
1004
|
-
|
1005
|
-
|
1006
|
-
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
1007
|
-
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
1008
|
-
allowed.any? { |klass| klass === value }
|
1009
|
-
end
|
1010
|
-
config_attr :scope, nil, ::String, ::Array, nil
|
1011
|
-
config_attr :lib_name, nil, ::String, nil
|
1012
|
-
config_attr :lib_version, nil, ::String, nil
|
1013
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1014
|
-
config_attr :interceptors, nil, ::Array, nil
|
1015
|
-
config_attr :timeout, nil, ::Numeric, nil
|
1016
|
-
config_attr :metadata, nil, ::Hash, nil
|
1017
|
-
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1018
|
-
config_attr :quota_project, nil, ::String, nil
|
1019
|
-
config_attr :universe_domain, nil, ::String, nil
|
1020
|
-
config_attr :logger, :default, ::Logger, nil, :default
|
1007
|
+
# Converts hash and nil to an options object
|
1008
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1021
1009
|
|
1022
|
-
#
|
1023
|
-
|
1024
|
-
@parent_config = parent_config unless parent_config.nil?
|
1010
|
+
# Customize the options with defaults
|
1011
|
+
metadata = @config.rpcs.list_dataset_configs.metadata.to_h
|
1025
1012
|
|
1026
|
-
|
1027
|
-
|
1013
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1014
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1015
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1016
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1017
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1018
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1028
1019
|
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
#
|
1033
|
-
def rpcs
|
1034
|
-
@rpcs ||= begin
|
1035
|
-
parent_rpcs = nil
|
1036
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1037
|
-
Rpcs.new parent_rpcs
|
1038
|
-
end
|
1020
|
+
header_params = {}
|
1021
|
+
if request.parent
|
1022
|
+
header_params["parent"] = request.parent
|
1039
1023
|
end
|
1040
1024
|
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1025
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1026
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1027
|
+
|
1028
|
+
options.apply_defaults timeout: @config.rpcs.list_dataset_configs.timeout,
|
1029
|
+
metadata: metadata,
|
1030
|
+
retry_policy: @config.rpcs.list_dataset_configs.retry_policy
|
1031
|
+
|
1032
|
+
options.apply_defaults timeout: @config.timeout,
|
1033
|
+
metadata: @config.metadata,
|
1034
|
+
retry_policy: @config.retry_policy
|
1035
|
+
|
1036
|
+
@storage_insights_stub.call_rpc :list_dataset_configs, request, options: options do |response, operation|
|
1037
|
+
response = ::Gapic::PagedEnumerable.new @storage_insights_stub, :list_dataset_configs, request, response, operation, options
|
1038
|
+
yield response, operation if block_given?
|
1039
|
+
throw :response, response
|
1047
1040
|
end
|
1041
|
+
rescue ::GRPC::BadStatus => e
|
1042
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1043
|
+
end
|
1048
1044
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1045
|
+
##
|
1046
|
+
# Gets the dataset configuration in a given project for a given location.
|
1047
|
+
#
|
1048
|
+
# @overload get_dataset_config(request, options = nil)
|
1049
|
+
# Pass arguments to `get_dataset_config` via a request object, either of type
|
1050
|
+
# {::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest} or an equivalent Hash.
|
1051
|
+
#
|
1052
|
+
# @param request [::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest, ::Hash]
|
1053
|
+
# A request object representing the call parameters. Required. To specify no
|
1054
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1055
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1056
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1057
|
+
#
|
1058
|
+
# @overload get_dataset_config(name: nil)
|
1059
|
+
# Pass arguments to `get_dataset_config` via keyword arguments. Note that at
|
1060
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1061
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1062
|
+
#
|
1063
|
+
# @param name [::String]
|
1064
|
+
# Required. Name of the resource
|
1065
|
+
#
|
1066
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1067
|
+
# @yieldparam response [::Google::Cloud::StorageInsights::V1::DatasetConfig]
|
1068
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1069
|
+
#
|
1070
|
+
# @return [::Google::Cloud::StorageInsights::V1::DatasetConfig]
|
1071
|
+
#
|
1072
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1073
|
+
#
|
1074
|
+
# @example Basic example
|
1075
|
+
# require "google/cloud/storage_insights/v1"
|
1076
|
+
#
|
1077
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1078
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1079
|
+
#
|
1080
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1081
|
+
# request = Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest.new
|
1082
|
+
#
|
1083
|
+
# # Call the get_dataset_config method.
|
1084
|
+
# result = client.get_dataset_config request
|
1085
|
+
#
|
1086
|
+
# # The returned object is of type Google::Cloud::StorageInsights::V1::DatasetConfig.
|
1087
|
+
# p result
|
1088
|
+
#
|
1089
|
+
def get_dataset_config request, options = nil
|
1090
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1091
|
+
|
1092
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::GetDatasetConfigRequest
|
1093
|
+
|
1094
|
+
# Converts hash and nil to an options object
|
1095
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1096
|
+
|
1097
|
+
# Customize the options with defaults
|
1098
|
+
metadata = @config.rpcs.get_dataset_config.metadata.to_h
|
1099
|
+
|
1100
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1101
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1102
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1103
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1104
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1105
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1106
|
+
|
1107
|
+
header_params = {}
|
1108
|
+
if request.name
|
1109
|
+
header_params["name"] = request.name
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1113
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1114
|
+
|
1115
|
+
options.apply_defaults timeout: @config.rpcs.get_dataset_config.timeout,
|
1116
|
+
metadata: metadata,
|
1117
|
+
retry_policy: @config.rpcs.get_dataset_config.retry_policy
|
1118
|
+
|
1119
|
+
options.apply_defaults timeout: @config.timeout,
|
1120
|
+
metadata: @config.metadata,
|
1121
|
+
retry_policy: @config.retry_policy
|
1122
|
+
|
1123
|
+
@storage_insights_stub.call_rpc :get_dataset_config, request, options: options do |response, operation|
|
1124
|
+
yield response, operation if block_given?
|
1125
|
+
end
|
1126
|
+
rescue ::GRPC::BadStatus => e
|
1127
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
##
|
1131
|
+
# Creates a dataset configuration in a given project for a given location.
|
1132
|
+
#
|
1133
|
+
# @overload create_dataset_config(request, options = nil)
|
1134
|
+
# Pass arguments to `create_dataset_config` via a request object, either of type
|
1135
|
+
# {::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest} or an equivalent Hash.
|
1136
|
+
#
|
1137
|
+
# @param request [::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest, ::Hash]
|
1138
|
+
# A request object representing the call parameters. Required. To specify no
|
1139
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1140
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1141
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1142
|
+
#
|
1143
|
+
# @overload create_dataset_config(parent: nil, dataset_config_id: nil, dataset_config: nil, request_id: nil)
|
1144
|
+
# Pass arguments to `create_dataset_config` via keyword arguments. Note that at
|
1145
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1146
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1147
|
+
#
|
1148
|
+
# @param parent [::String]
|
1149
|
+
# Required. Value for parent.
|
1150
|
+
# @param dataset_config_id [::String]
|
1151
|
+
# Required. ID of the requesting object.
|
1152
|
+
# If auto-generating ID is enabled on the server-side, remove this field and
|
1153
|
+
# `dataset_config_id` from the method_signature of Create RPC
|
1154
|
+
# Note: The value should not contain any hyphens.
|
1155
|
+
# @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash]
|
1156
|
+
# Required. The resource being created
|
1157
|
+
# @param request_id [::String]
|
1158
|
+
# Optional. A unique identifier for your request.
|
1159
|
+
# Specify the request ID if you need to retry the request.
|
1160
|
+
# If you retry the request with the same ID within 60 minutes, the server
|
1161
|
+
# ignores the request if it has already completed the original request.
|
1162
|
+
#
|
1163
|
+
# For example, if your initial request times out and you retry the request
|
1164
|
+
# using the same request ID, the server recognizes the original request and
|
1165
|
+
# does not process the new request.
|
1166
|
+
#
|
1167
|
+
# The request ID must be a valid UUID and cannot be a zero UUID
|
1168
|
+
# (00000000-0000-0000-0000-000000000000).
|
1169
|
+
#
|
1170
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1171
|
+
# @yieldparam response [::Gapic::Operation]
|
1172
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1173
|
+
#
|
1174
|
+
# @return [::Gapic::Operation]
|
1175
|
+
#
|
1176
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1177
|
+
#
|
1178
|
+
# @example Basic example
|
1179
|
+
# require "google/cloud/storage_insights/v1"
|
1180
|
+
#
|
1181
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1182
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1183
|
+
#
|
1184
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1185
|
+
# request = Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest.new
|
1186
|
+
#
|
1187
|
+
# # Call the create_dataset_config method.
|
1188
|
+
# result = client.create_dataset_config request
|
1189
|
+
#
|
1190
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1191
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1192
|
+
# # Here is how to wait for a response.
|
1193
|
+
# result.wait_until_done! timeout: 60
|
1194
|
+
# if result.response?
|
1195
|
+
# p result.response
|
1196
|
+
# else
|
1197
|
+
# puts "No response received."
|
1198
|
+
# end
|
1199
|
+
#
|
1200
|
+
def create_dataset_config request, options = nil
|
1201
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1202
|
+
|
1203
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::CreateDatasetConfigRequest
|
1204
|
+
|
1205
|
+
# Converts hash and nil to an options object
|
1206
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1207
|
+
|
1208
|
+
# Customize the options with defaults
|
1209
|
+
metadata = @config.rpcs.create_dataset_config.metadata.to_h
|
1210
|
+
|
1211
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1212
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1213
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1214
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1215
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1216
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1217
|
+
|
1218
|
+
header_params = {}
|
1219
|
+
if request.parent
|
1220
|
+
header_params["parent"] = request.parent
|
1221
|
+
end
|
1222
|
+
|
1223
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1224
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1225
|
+
|
1226
|
+
options.apply_defaults timeout: @config.rpcs.create_dataset_config.timeout,
|
1227
|
+
metadata: metadata,
|
1228
|
+
retry_policy: @config.rpcs.create_dataset_config.retry_policy
|
1229
|
+
|
1230
|
+
options.apply_defaults timeout: @config.timeout,
|
1231
|
+
metadata: @config.metadata,
|
1232
|
+
retry_policy: @config.retry_policy
|
1233
|
+
|
1234
|
+
@storage_insights_stub.call_rpc :create_dataset_config, request, options: options do |response, operation|
|
1235
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1236
|
+
yield response, operation if block_given?
|
1237
|
+
throw :response, response
|
1238
|
+
end
|
1239
|
+
rescue ::GRPC::BadStatus => e
|
1240
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1241
|
+
end
|
1242
|
+
|
1243
|
+
##
|
1244
|
+
# Updates a dataset configuration in a given project for a given location.
|
1245
|
+
#
|
1246
|
+
# @overload update_dataset_config(request, options = nil)
|
1247
|
+
# Pass arguments to `update_dataset_config` via a request object, either of type
|
1248
|
+
# {::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest} or an equivalent Hash.
|
1249
|
+
#
|
1250
|
+
# @param request [::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest, ::Hash]
|
1251
|
+
# A request object representing the call parameters. Required. To specify no
|
1252
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1253
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1254
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1255
|
+
#
|
1256
|
+
# @overload update_dataset_config(update_mask: nil, dataset_config: nil, request_id: nil)
|
1257
|
+
# Pass arguments to `update_dataset_config` via keyword arguments. Note that at
|
1258
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1259
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1260
|
+
#
|
1261
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1262
|
+
# Required. Field mask is used to specify the fields to be overwritten in the
|
1263
|
+
# `DatasetConfig` resource by the update.
|
1264
|
+
# The fields specified in the `update_mask` are relative to the resource, not
|
1265
|
+
# the full request. A field is overwritten if it is in the mask. If the
|
1266
|
+
# user does not provide a mask then it returns an "Invalid Argument" error.
|
1267
|
+
# @param dataset_config [::Google::Cloud::StorageInsights::V1::DatasetConfig, ::Hash]
|
1268
|
+
# Required. The resource being updated
|
1269
|
+
# @param request_id [::String]
|
1270
|
+
# Optional. A unique identifier for your request.
|
1271
|
+
# Specify the request ID if you need to retry the request.
|
1272
|
+
# If you retry the request with the same ID within 60 minutes, the server
|
1273
|
+
# ignores the request if it has already completed the original request.
|
1274
|
+
#
|
1275
|
+
# For example, if your initial request times out and you retry the request
|
1276
|
+
# using the same request ID, the server recognizes the original request and
|
1277
|
+
# does not process the new request.
|
1278
|
+
#
|
1279
|
+
# The request ID must be a valid UUID and cannot be a zero UUID
|
1280
|
+
# (00000000-0000-0000-0000-000000000000).
|
1281
|
+
#
|
1282
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1283
|
+
# @yieldparam response [::Gapic::Operation]
|
1284
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1285
|
+
#
|
1286
|
+
# @return [::Gapic::Operation]
|
1287
|
+
#
|
1288
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1289
|
+
#
|
1290
|
+
# @example Basic example
|
1291
|
+
# require "google/cloud/storage_insights/v1"
|
1292
|
+
#
|
1293
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1294
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1295
|
+
#
|
1296
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1297
|
+
# request = Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest.new
|
1298
|
+
#
|
1299
|
+
# # Call the update_dataset_config method.
|
1300
|
+
# result = client.update_dataset_config request
|
1301
|
+
#
|
1302
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1303
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1304
|
+
# # Here is how to wait for a response.
|
1305
|
+
# result.wait_until_done! timeout: 60
|
1306
|
+
# if result.response?
|
1307
|
+
# p result.response
|
1308
|
+
# else
|
1309
|
+
# puts "No response received."
|
1310
|
+
# end
|
1311
|
+
#
|
1312
|
+
def update_dataset_config request, options = nil
|
1313
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1314
|
+
|
1315
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UpdateDatasetConfigRequest
|
1316
|
+
|
1317
|
+
# Converts hash and nil to an options object
|
1318
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1319
|
+
|
1320
|
+
# Customize the options with defaults
|
1321
|
+
metadata = @config.rpcs.update_dataset_config.metadata.to_h
|
1322
|
+
|
1323
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1324
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1325
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1326
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1327
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1328
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1329
|
+
|
1330
|
+
header_params = {}
|
1331
|
+
if request.dataset_config&.name
|
1332
|
+
header_params["dataset_config.name"] = request.dataset_config.name
|
1333
|
+
end
|
1334
|
+
|
1335
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1336
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1337
|
+
|
1338
|
+
options.apply_defaults timeout: @config.rpcs.update_dataset_config.timeout,
|
1339
|
+
metadata: metadata,
|
1340
|
+
retry_policy: @config.rpcs.update_dataset_config.retry_policy
|
1341
|
+
|
1342
|
+
options.apply_defaults timeout: @config.timeout,
|
1343
|
+
metadata: @config.metadata,
|
1344
|
+
retry_policy: @config.retry_policy
|
1345
|
+
|
1346
|
+
@storage_insights_stub.call_rpc :update_dataset_config, request, options: options do |response, operation|
|
1347
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1348
|
+
yield response, operation if block_given?
|
1349
|
+
throw :response, response
|
1350
|
+
end
|
1351
|
+
rescue ::GRPC::BadStatus => e
|
1352
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1353
|
+
end
|
1354
|
+
|
1355
|
+
##
|
1356
|
+
# Deletes a dataset configuration in a given project for a given location.
|
1357
|
+
#
|
1358
|
+
# @overload delete_dataset_config(request, options = nil)
|
1359
|
+
# Pass arguments to `delete_dataset_config` via a request object, either of type
|
1360
|
+
# {::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest} or an equivalent Hash.
|
1361
|
+
#
|
1362
|
+
# @param request [::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest, ::Hash]
|
1363
|
+
# A request object representing the call parameters. Required. To specify no
|
1364
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1365
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1366
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1367
|
+
#
|
1368
|
+
# @overload delete_dataset_config(name: nil, request_id: nil)
|
1369
|
+
# Pass arguments to `delete_dataset_config` via keyword arguments. Note that at
|
1370
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1371
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1372
|
+
#
|
1373
|
+
# @param name [::String]
|
1374
|
+
# Required. Name of the resource
|
1375
|
+
# @param request_id [::String]
|
1376
|
+
# Optional. A unique identifier for your request.
|
1377
|
+
# Specify the request ID if you need to retry the request.
|
1378
|
+
# If you retry the request with the same ID within 60 minutes, the server
|
1379
|
+
# ignores the request if it has already completed the original request.
|
1380
|
+
#
|
1381
|
+
# For example, if your initial request times out and you retry the request
|
1382
|
+
# using the same request ID, the server recognizes the original request and
|
1383
|
+
# does not process the new request.
|
1384
|
+
#
|
1385
|
+
# The request ID must be a valid UUID and cannot be a zero UUID
|
1386
|
+
# (00000000-0000-0000-0000-000000000000).
|
1387
|
+
#
|
1388
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1389
|
+
# @yieldparam response [::Gapic::Operation]
|
1390
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1391
|
+
#
|
1392
|
+
# @return [::Gapic::Operation]
|
1393
|
+
#
|
1394
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1395
|
+
#
|
1396
|
+
# @example Basic example
|
1397
|
+
# require "google/cloud/storage_insights/v1"
|
1398
|
+
#
|
1399
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1400
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1401
|
+
#
|
1402
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1403
|
+
# request = Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest.new
|
1404
|
+
#
|
1405
|
+
# # Call the delete_dataset_config method.
|
1406
|
+
# result = client.delete_dataset_config request
|
1407
|
+
#
|
1408
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1409
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1410
|
+
# # Here is how to wait for a response.
|
1411
|
+
# result.wait_until_done! timeout: 60
|
1412
|
+
# if result.response?
|
1413
|
+
# p result.response
|
1414
|
+
# else
|
1415
|
+
# puts "No response received."
|
1416
|
+
# end
|
1417
|
+
#
|
1418
|
+
def delete_dataset_config request, options = nil
|
1419
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1420
|
+
|
1421
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::DeleteDatasetConfigRequest
|
1422
|
+
|
1423
|
+
# Converts hash and nil to an options object
|
1424
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1425
|
+
|
1426
|
+
# Customize the options with defaults
|
1427
|
+
metadata = @config.rpcs.delete_dataset_config.metadata.to_h
|
1428
|
+
|
1429
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1430
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1431
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1432
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1433
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1434
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1435
|
+
|
1436
|
+
header_params = {}
|
1437
|
+
if request.name
|
1438
|
+
header_params["name"] = request.name
|
1439
|
+
end
|
1440
|
+
|
1441
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1442
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1443
|
+
|
1444
|
+
options.apply_defaults timeout: @config.rpcs.delete_dataset_config.timeout,
|
1445
|
+
metadata: metadata,
|
1446
|
+
retry_policy: @config.rpcs.delete_dataset_config.retry_policy
|
1447
|
+
|
1448
|
+
options.apply_defaults timeout: @config.timeout,
|
1449
|
+
metadata: @config.metadata,
|
1450
|
+
retry_policy: @config.retry_policy
|
1451
|
+
|
1452
|
+
@storage_insights_stub.call_rpc :delete_dataset_config, request, options: options do |response, operation|
|
1453
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1454
|
+
yield response, operation if block_given?
|
1455
|
+
throw :response, response
|
1456
|
+
end
|
1457
|
+
rescue ::GRPC::BadStatus => e
|
1458
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1459
|
+
end
|
1460
|
+
|
1461
|
+
##
|
1462
|
+
# Links a dataset to BigQuery in a given project for a given location.
|
1463
|
+
#
|
1464
|
+
# @overload link_dataset(request, options = nil)
|
1465
|
+
# Pass arguments to `link_dataset` via a request object, either of type
|
1466
|
+
# {::Google::Cloud::StorageInsights::V1::LinkDatasetRequest} or an equivalent Hash.
|
1467
|
+
#
|
1468
|
+
# @param request [::Google::Cloud::StorageInsights::V1::LinkDatasetRequest, ::Hash]
|
1469
|
+
# A request object representing the call parameters. Required. To specify no
|
1470
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1471
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1472
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1473
|
+
#
|
1474
|
+
# @overload link_dataset(name: nil)
|
1475
|
+
# Pass arguments to `link_dataset` via keyword arguments. Note that at
|
1476
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1477
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1478
|
+
#
|
1479
|
+
# @param name [::String]
|
1480
|
+
# Required. Name of the resource
|
1481
|
+
#
|
1482
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1483
|
+
# @yieldparam response [::Gapic::Operation]
|
1484
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1485
|
+
#
|
1486
|
+
# @return [::Gapic::Operation]
|
1487
|
+
#
|
1488
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1489
|
+
#
|
1490
|
+
# @example Basic example
|
1491
|
+
# require "google/cloud/storage_insights/v1"
|
1492
|
+
#
|
1493
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1494
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1495
|
+
#
|
1496
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1497
|
+
# request = Google::Cloud::StorageInsights::V1::LinkDatasetRequest.new
|
1498
|
+
#
|
1499
|
+
# # Call the link_dataset method.
|
1500
|
+
# result = client.link_dataset request
|
1501
|
+
#
|
1502
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1503
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1504
|
+
# # Here is how to wait for a response.
|
1505
|
+
# result.wait_until_done! timeout: 60
|
1506
|
+
# if result.response?
|
1507
|
+
# p result.response
|
1508
|
+
# else
|
1509
|
+
# puts "No response received."
|
1510
|
+
# end
|
1511
|
+
#
|
1512
|
+
def link_dataset request, options = nil
|
1513
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1514
|
+
|
1515
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::LinkDatasetRequest
|
1516
|
+
|
1517
|
+
# Converts hash and nil to an options object
|
1518
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1519
|
+
|
1520
|
+
# Customize the options with defaults
|
1521
|
+
metadata = @config.rpcs.link_dataset.metadata.to_h
|
1522
|
+
|
1523
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1524
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1525
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1526
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1527
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1528
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1529
|
+
|
1530
|
+
header_params = {}
|
1531
|
+
if request.name
|
1532
|
+
header_params["name"] = request.name
|
1533
|
+
end
|
1534
|
+
|
1535
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1536
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1537
|
+
|
1538
|
+
options.apply_defaults timeout: @config.rpcs.link_dataset.timeout,
|
1539
|
+
metadata: metadata,
|
1540
|
+
retry_policy: @config.rpcs.link_dataset.retry_policy
|
1541
|
+
|
1542
|
+
options.apply_defaults timeout: @config.timeout,
|
1543
|
+
metadata: @config.metadata,
|
1544
|
+
retry_policy: @config.retry_policy
|
1545
|
+
|
1546
|
+
@storage_insights_stub.call_rpc :link_dataset, request, options: options do |response, operation|
|
1547
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1548
|
+
yield response, operation if block_given?
|
1549
|
+
throw :response, response
|
1550
|
+
end
|
1551
|
+
rescue ::GRPC::BadStatus => e
|
1552
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1553
|
+
end
|
1554
|
+
|
1555
|
+
##
|
1556
|
+
# Unlinks a dataset from BigQuery in a given project
|
1557
|
+
# for a given location.
|
1558
|
+
#
|
1559
|
+
# @overload unlink_dataset(request, options = nil)
|
1560
|
+
# Pass arguments to `unlink_dataset` via a request object, either of type
|
1561
|
+
# {::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest} or an equivalent Hash.
|
1562
|
+
#
|
1563
|
+
# @param request [::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest, ::Hash]
|
1564
|
+
# A request object representing the call parameters. Required. To specify no
|
1565
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1566
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1567
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1568
|
+
#
|
1569
|
+
# @overload unlink_dataset(name: nil)
|
1570
|
+
# Pass arguments to `unlink_dataset` via keyword arguments. Note that at
|
1571
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1572
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1573
|
+
#
|
1574
|
+
# @param name [::String]
|
1575
|
+
# Required. Name of the resource
|
1576
|
+
#
|
1577
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1578
|
+
# @yieldparam response [::Gapic::Operation]
|
1579
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1580
|
+
#
|
1581
|
+
# @return [::Gapic::Operation]
|
1582
|
+
#
|
1583
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1584
|
+
#
|
1585
|
+
# @example Basic example
|
1586
|
+
# require "google/cloud/storage_insights/v1"
|
1587
|
+
#
|
1588
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1589
|
+
# client = Google::Cloud::StorageInsights::V1::StorageInsights::Client.new
|
1590
|
+
#
|
1591
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1592
|
+
# request = Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest.new
|
1593
|
+
#
|
1594
|
+
# # Call the unlink_dataset method.
|
1595
|
+
# result = client.unlink_dataset request
|
1596
|
+
#
|
1597
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1598
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1599
|
+
# # Here is how to wait for a response.
|
1600
|
+
# result.wait_until_done! timeout: 60
|
1601
|
+
# if result.response?
|
1602
|
+
# p result.response
|
1603
|
+
# else
|
1604
|
+
# puts "No response received."
|
1605
|
+
# end
|
1606
|
+
#
|
1607
|
+
def unlink_dataset request, options = nil
|
1608
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1609
|
+
|
1610
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::StorageInsights::V1::UnlinkDatasetRequest
|
1611
|
+
|
1612
|
+
# Converts hash and nil to an options object
|
1613
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1614
|
+
|
1615
|
+
# Customize the options with defaults
|
1616
|
+
metadata = @config.rpcs.unlink_dataset.metadata.to_h
|
1617
|
+
|
1618
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1619
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1620
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1621
|
+
gapic_version: ::Google::Cloud::StorageInsights::V1::VERSION
|
1622
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1623
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1624
|
+
|
1625
|
+
header_params = {}
|
1626
|
+
if request.name
|
1627
|
+
header_params["name"] = request.name
|
1628
|
+
end
|
1629
|
+
|
1630
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1631
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1632
|
+
|
1633
|
+
options.apply_defaults timeout: @config.rpcs.unlink_dataset.timeout,
|
1634
|
+
metadata: metadata,
|
1635
|
+
retry_policy: @config.rpcs.unlink_dataset.retry_policy
|
1636
|
+
|
1637
|
+
options.apply_defaults timeout: @config.timeout,
|
1638
|
+
metadata: @config.metadata,
|
1639
|
+
retry_policy: @config.retry_policy
|
1640
|
+
|
1641
|
+
@storage_insights_stub.call_rpc :unlink_dataset, request, options: options do |response, operation|
|
1642
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1643
|
+
yield response, operation if block_given?
|
1644
|
+
throw :response, response
|
1645
|
+
end
|
1646
|
+
rescue ::GRPC::BadStatus => e
|
1647
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1648
|
+
end
|
1649
|
+
|
1650
|
+
##
|
1651
|
+
# Configuration class for the StorageInsights API.
|
1652
|
+
#
|
1653
|
+
# This class represents the configuration for StorageInsights,
|
1654
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1655
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1656
|
+
# applied individually to specific RPCs. See
|
1657
|
+
# {::Google::Cloud::StorageInsights::V1::StorageInsights::Client::Configuration::Rpcs}
|
1658
|
+
# for a list of RPCs that can be configured independently.
|
1659
|
+
#
|
1660
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1661
|
+
# on construction.
|
1662
|
+
#
|
1663
|
+
# @example
|
1664
|
+
#
|
1665
|
+
# # Modify the global config, setting the timeout for
|
1666
|
+
# # list_report_configs to 20 seconds,
|
1667
|
+
# # and all remaining timeouts to 10 seconds.
|
1668
|
+
# ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.configure do |config|
|
1669
|
+
# config.timeout = 10.0
|
1670
|
+
# config.rpcs.list_report_configs.timeout = 20.0
|
1671
|
+
# end
|
1672
|
+
#
|
1673
|
+
# # Apply the above configuration only to a new client.
|
1674
|
+
# client = ::Google::Cloud::StorageInsights::V1::StorageInsights::Client.new do |config|
|
1675
|
+
# config.timeout = 10.0
|
1676
|
+
# config.rpcs.list_report_configs.timeout = 20.0
|
1677
|
+
# end
|
1678
|
+
#
|
1679
|
+
# @!attribute [rw] endpoint
|
1680
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1681
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1682
|
+
# @return [::String,nil]
|
1683
|
+
# @!attribute [rw] credentials
|
1684
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1685
|
+
# * (`String`) The path to a service account key file in JSON format
|
1686
|
+
# * (`Hash`) A service account key as a Hash
|
1687
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1688
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1689
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1690
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1691
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
1692
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
1693
|
+
# * (`nil`) indicating no credentials
|
1694
|
+
#
|
1695
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1696
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1697
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1698
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1699
|
+
# For more information, refer to [Validate credential configurations from external
|
1700
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1701
|
+
# @return [::Object]
|
1702
|
+
# @!attribute [rw] scope
|
1703
|
+
# The OAuth scopes
|
1704
|
+
# @return [::Array<::String>]
|
1705
|
+
# @!attribute [rw] lib_name
|
1706
|
+
# The library name as recorded in instrumentation and logging
|
1707
|
+
# @return [::String]
|
1708
|
+
# @!attribute [rw] lib_version
|
1709
|
+
# The library version as recorded in instrumentation and logging
|
1710
|
+
# @return [::String]
|
1711
|
+
# @!attribute [rw] channel_args
|
1712
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
1713
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
1714
|
+
# @return [::Hash]
|
1715
|
+
# @!attribute [rw] interceptors
|
1716
|
+
# An array of interceptors that are run before calls are executed.
|
1717
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
1718
|
+
# @!attribute [rw] timeout
|
1719
|
+
# The call timeout in seconds.
|
1720
|
+
# @return [::Numeric]
|
1721
|
+
# @!attribute [rw] metadata
|
1722
|
+
# Additional gRPC headers to be sent with the call.
|
1723
|
+
# @return [::Hash{::Symbol=>::String}]
|
1724
|
+
# @!attribute [rw] retry_policy
|
1725
|
+
# The retry policy. The value is a hash with the following keys:
|
1726
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1727
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1728
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1729
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1730
|
+
# trigger a retry.
|
1731
|
+
# @return [::Hash]
|
1732
|
+
# @!attribute [rw] quota_project
|
1733
|
+
# A separate project against which to charge quota.
|
1734
|
+
# @return [::String]
|
1735
|
+
# @!attribute [rw] universe_domain
|
1736
|
+
# The universe domain within which to make requests. This determines the
|
1737
|
+
# default endpoint URL. The default value of nil uses the environment
|
1738
|
+
# universe (usually the default "googleapis.com" universe).
|
1739
|
+
# @return [::String,nil]
|
1740
|
+
# @!attribute [rw] logger
|
1741
|
+
# A custom logger to use for request/response debug logging, or the value
|
1742
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1743
|
+
# explicitly disable logging.
|
1744
|
+
# @return [::Logger,:default,nil]
|
1745
|
+
#
|
1746
|
+
class Configuration
|
1747
|
+
extend ::Gapic::Config
|
1748
|
+
|
1749
|
+
# @private
|
1750
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1751
|
+
DEFAULT_ENDPOINT = "storageinsights.googleapis.com"
|
1752
|
+
|
1753
|
+
config_attr :endpoint, nil, ::String, nil
|
1754
|
+
config_attr :credentials, nil do |value|
|
1755
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
1756
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
1757
|
+
allowed.any? { |klass| klass === value }
|
1758
|
+
end
|
1759
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1760
|
+
config_attr :lib_name, nil, ::String, nil
|
1761
|
+
config_attr :lib_version, nil, ::String, nil
|
1762
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
1763
|
+
config_attr :interceptors, nil, ::Array, nil
|
1764
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1765
|
+
config_attr :metadata, nil, ::Hash, nil
|
1766
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1767
|
+
config_attr :quota_project, nil, ::String, nil
|
1768
|
+
config_attr :universe_domain, nil, ::String, nil
|
1769
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1770
|
+
|
1771
|
+
# @private
|
1772
|
+
def initialize parent_config = nil
|
1773
|
+
@parent_config = parent_config unless parent_config.nil?
|
1774
|
+
|
1775
|
+
yield self if block_given?
|
1776
|
+
end
|
1777
|
+
|
1778
|
+
##
|
1779
|
+
# Configurations for individual RPCs
|
1780
|
+
# @return [Rpcs]
|
1781
|
+
#
|
1782
|
+
def rpcs
|
1783
|
+
@rpcs ||= begin
|
1784
|
+
parent_rpcs = nil
|
1785
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1786
|
+
Rpcs.new parent_rpcs
|
1787
|
+
end
|
1788
|
+
end
|
1789
|
+
|
1790
|
+
##
|
1791
|
+
# Configuration for the channel pool
|
1792
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
1793
|
+
#
|
1794
|
+
def channel_pool
|
1795
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
1796
|
+
end
|
1797
|
+
|
1798
|
+
##
|
1799
|
+
# Configuration RPC class for the StorageInsights API.
|
1800
|
+
#
|
1801
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1802
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1803
|
+
# the following configuration fields:
|
1804
|
+
#
|
1805
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1806
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1807
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1808
|
+
# include the following keys:
|
1809
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1810
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1811
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1812
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1813
|
+
# trigger a retry.
|
1814
|
+
#
|
1815
|
+
class Rpcs
|
1816
|
+
##
|
1817
|
+
# RPC-specific configuration for `list_report_configs`
|
1818
|
+
# @return [::Gapic::Config::Method]
|
1819
|
+
#
|
1820
|
+
attr_reader :list_report_configs
|
1821
|
+
##
|
1822
|
+
# RPC-specific configuration for `get_report_config`
|
1823
|
+
# @return [::Gapic::Config::Method]
|
1824
|
+
#
|
1825
|
+
attr_reader :get_report_config
|
1826
|
+
##
|
1827
|
+
# RPC-specific configuration for `create_report_config`
|
1828
|
+
# @return [::Gapic::Config::Method]
|
1829
|
+
#
|
1830
|
+
attr_reader :create_report_config
|
1831
|
+
##
|
1832
|
+
# RPC-specific configuration for `update_report_config`
|
1833
|
+
# @return [::Gapic::Config::Method]
|
1834
|
+
#
|
1835
|
+
attr_reader :update_report_config
|
1836
|
+
##
|
1837
|
+
# RPC-specific configuration for `delete_report_config`
|
1838
|
+
# @return [::Gapic::Config::Method]
|
1090
1839
|
#
|
1091
1840
|
attr_reader :delete_report_config
|
1092
1841
|
##
|
@@ -1099,6 +1848,41 @@ module Google
|
|
1099
1848
|
# @return [::Gapic::Config::Method]
|
1100
1849
|
#
|
1101
1850
|
attr_reader :get_report_detail
|
1851
|
+
##
|
1852
|
+
# RPC-specific configuration for `list_dataset_configs`
|
1853
|
+
# @return [::Gapic::Config::Method]
|
1854
|
+
#
|
1855
|
+
attr_reader :list_dataset_configs
|
1856
|
+
##
|
1857
|
+
# RPC-specific configuration for `get_dataset_config`
|
1858
|
+
# @return [::Gapic::Config::Method]
|
1859
|
+
#
|
1860
|
+
attr_reader :get_dataset_config
|
1861
|
+
##
|
1862
|
+
# RPC-specific configuration for `create_dataset_config`
|
1863
|
+
# @return [::Gapic::Config::Method]
|
1864
|
+
#
|
1865
|
+
attr_reader :create_dataset_config
|
1866
|
+
##
|
1867
|
+
# RPC-specific configuration for `update_dataset_config`
|
1868
|
+
# @return [::Gapic::Config::Method]
|
1869
|
+
#
|
1870
|
+
attr_reader :update_dataset_config
|
1871
|
+
##
|
1872
|
+
# RPC-specific configuration for `delete_dataset_config`
|
1873
|
+
# @return [::Gapic::Config::Method]
|
1874
|
+
#
|
1875
|
+
attr_reader :delete_dataset_config
|
1876
|
+
##
|
1877
|
+
# RPC-specific configuration for `link_dataset`
|
1878
|
+
# @return [::Gapic::Config::Method]
|
1879
|
+
#
|
1880
|
+
attr_reader :link_dataset
|
1881
|
+
##
|
1882
|
+
# RPC-specific configuration for `unlink_dataset`
|
1883
|
+
# @return [::Gapic::Config::Method]
|
1884
|
+
#
|
1885
|
+
attr_reader :unlink_dataset
|
1102
1886
|
|
1103
1887
|
# @private
|
1104
1888
|
def initialize parent_rpcs = nil
|
@@ -1116,6 +1900,20 @@ module Google
|
|
1116
1900
|
@list_report_details = ::Gapic::Config::Method.new list_report_details_config
|
1117
1901
|
get_report_detail_config = parent_rpcs.get_report_detail if parent_rpcs.respond_to? :get_report_detail
|
1118
1902
|
@get_report_detail = ::Gapic::Config::Method.new get_report_detail_config
|
1903
|
+
list_dataset_configs_config = parent_rpcs.list_dataset_configs if parent_rpcs.respond_to? :list_dataset_configs
|
1904
|
+
@list_dataset_configs = ::Gapic::Config::Method.new list_dataset_configs_config
|
1905
|
+
get_dataset_config_config = parent_rpcs.get_dataset_config if parent_rpcs.respond_to? :get_dataset_config
|
1906
|
+
@get_dataset_config = ::Gapic::Config::Method.new get_dataset_config_config
|
1907
|
+
create_dataset_config_config = parent_rpcs.create_dataset_config if parent_rpcs.respond_to? :create_dataset_config
|
1908
|
+
@create_dataset_config = ::Gapic::Config::Method.new create_dataset_config_config
|
1909
|
+
update_dataset_config_config = parent_rpcs.update_dataset_config if parent_rpcs.respond_to? :update_dataset_config
|
1910
|
+
@update_dataset_config = ::Gapic::Config::Method.new update_dataset_config_config
|
1911
|
+
delete_dataset_config_config = parent_rpcs.delete_dataset_config if parent_rpcs.respond_to? :delete_dataset_config
|
1912
|
+
@delete_dataset_config = ::Gapic::Config::Method.new delete_dataset_config_config
|
1913
|
+
link_dataset_config = parent_rpcs.link_dataset if parent_rpcs.respond_to? :link_dataset
|
1914
|
+
@link_dataset = ::Gapic::Config::Method.new link_dataset_config
|
1915
|
+
unlink_dataset_config = parent_rpcs.unlink_dataset if parent_rpcs.respond_to? :unlink_dataset
|
1916
|
+
@unlink_dataset = ::Gapic::Config::Method.new unlink_dataset_config
|
1119
1917
|
|
1120
1918
|
yield self if block_given?
|
1121
1919
|
end
|