google-cloud-recommender-v1 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/google/cloud/recommender/v1/insight_pb.rb +2 -1
- data/lib/google/cloud/recommender/v1/insight_type_config_pb.rb +37 -0
- data/lib/google/cloud/recommender/v1/recommendation_pb.rb +2 -1
- data/lib/google/cloud/recommender/v1/recommender/client.rb +414 -16
- data/lib/google/cloud/recommender/v1/recommender/paths.rb +86 -0
- data/lib/google/cloud/recommender/v1/recommender_config_pb.rb +37 -0
- data/lib/google/cloud/recommender/v1/recommender_service_pb.rb +25 -1
- data/lib/google/cloud/recommender/v1/recommender_service_services_pb.rb +12 -0
- data/lib/google/cloud/recommender/v1/version.rb +1 -1
- data/proto_docs/google/cloud/recommender/v1/insight_type_config.rb +88 -0
- data/proto_docs/google/cloud/recommender/v1/recommender_config.rb +88 -0
- data/proto_docs/google/cloud/recommender/v1/recommender_service.rb +82 -16
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +2 -2
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2adbdd889c4bdf994e64efc871668f6361c8c26a269dfb37a99dc44a3c4f609e
|
4
|
+
data.tar.gz: e0cb6c95d7268418133df5257815b2b8b082a4934c85b8f97c566866986a37a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb947fdd92c9d02c895e108d1efca62315e4dbc04eba0898d512d371483fb81138b07fc960841e2c1250814ffdd3233e8ff39f9ce38ea4a4e690c4a4aa2ca65
|
7
|
+
data.tar.gz: 697b6e436c8cea8fabf8363799ba15753f09ad28541008d25832784fe7d60de08dc0e5d280f5c78d61dc5e2655f5b7412a79cec0815d51ea4b999dde890068bf
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/recommender/v1/insight.proto
|
3
3
|
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
4
6
|
require 'google/api/resource_pb'
|
5
7
|
require 'google/protobuf/duration_pb'
|
6
8
|
require 'google/protobuf/struct_pb'
|
7
9
|
require 'google/protobuf/timestamp_pb'
|
8
|
-
require 'google/protobuf'
|
9
10
|
|
10
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
12
|
add_file("google/cloud/recommender/v1/insight.proto", :syntax => :proto3) do
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/recommender/v1/insight_type_config.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/field_behavior_pb'
|
7
|
+
require 'google/api/resource_pb'
|
8
|
+
require 'google/protobuf/struct_pb'
|
9
|
+
require 'google/protobuf/timestamp_pb'
|
10
|
+
|
11
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
|
+
add_file("google/cloud/recommender/v1/insight_type_config.proto", :syntax => :proto3) do
|
13
|
+
add_message "google.cloud.recommender.v1.InsightTypeConfig" do
|
14
|
+
optional :name, :string, 1
|
15
|
+
optional :insight_type_generation_config, :message, 2, "google.cloud.recommender.v1.InsightTypeGenerationConfig"
|
16
|
+
optional :etag, :string, 3
|
17
|
+
optional :update_time, :message, 4, "google.protobuf.Timestamp"
|
18
|
+
optional :revision_id, :string, 5
|
19
|
+
map :annotations, :string, :string, 6
|
20
|
+
optional :display_name, :string, 7
|
21
|
+
end
|
22
|
+
add_message "google.cloud.recommender.v1.InsightTypeGenerationConfig" do
|
23
|
+
optional :params, :message, 1, "google.protobuf.Struct"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
module Google
|
29
|
+
module Cloud
|
30
|
+
module Recommender
|
31
|
+
module V1
|
32
|
+
InsightTypeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeConfig").msgclass
|
33
|
+
InsightTypeGenerationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightTypeGenerationConfig").msgclass
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/recommender/v1/recommendation.proto
|
3
3
|
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
4
6
|
require 'google/api/resource_pb'
|
5
7
|
require 'google/protobuf/duration_pb'
|
6
8
|
require 'google/protobuf/struct_pb'
|
7
9
|
require 'google/protobuf/timestamp_pb'
|
8
10
|
require 'google/type/money_pb'
|
9
|
-
require 'google/protobuf'
|
10
11
|
|
11
12
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
13
|
add_file("google/cloud/recommender/v1/recommendation.proto", :syntax => :proto3) do
|
@@ -213,14 +213,14 @@ module Google
|
|
213
213
|
# INSIGHT_TYPE_ID refers to supported insight types:
|
214
214
|
# https://cloud.google.com/recommender/docs/insights/insight-types.
|
215
215
|
# @param page_size [::Integer]
|
216
|
-
# Optional. The maximum number of results to return from this request.
|
217
|
-
# values are ignored. If not specified, the server will
|
218
|
-
# of results to return.
|
216
|
+
# Optional. The maximum number of results to return from this request.
|
217
|
+
# Non-positive values are ignored. If not specified, the server will
|
218
|
+
# determine the number of results to return.
|
219
219
|
# @param page_token [::String]
|
220
|
-
# Optional. If present, retrieves the next batch of results from the
|
221
|
-
# this method. `page_token` must be the value of
|
222
|
-
# previous response. The values of other method
|
223
|
-
# to those in the previous call.
|
220
|
+
# Optional. If present, retrieves the next batch of results from the
|
221
|
+
# preceding call to this method. `page_token` must be the value of
|
222
|
+
# `next_page_token` from the previous response. The values of other method
|
223
|
+
# parameters must be identical to those in the previous call.
|
224
224
|
# @param filter [::String]
|
225
225
|
# Optional. Filter expression to restrict the insights returned. Supported
|
226
226
|
# filter fields:
|
@@ -427,8 +427,8 @@ module Google
|
|
427
427
|
# @param name [::String]
|
428
428
|
# Required. Name of the insight.
|
429
429
|
# @param state_metadata [::Hash{::String => ::String}]
|
430
|
-
# Optional. State properties user wish to include with this state. Full
|
431
|
-
# current state_metadata.
|
430
|
+
# Optional. State properties user wish to include with this state. Full
|
431
|
+
# replace of the current state_metadata.
|
432
432
|
# @param etag [::String]
|
433
433
|
# Required. Fingerprint of the Insight. Provides optimistic locking.
|
434
434
|
#
|
@@ -534,14 +534,14 @@ module Google
|
|
534
534
|
# RECOMMENDER_ID refers to supported recommenders:
|
535
535
|
# https://cloud.google.com/recommender/docs/recommenders.
|
536
536
|
# @param page_size [::Integer]
|
537
|
-
# Optional. The maximum number of results to return from this request.
|
538
|
-
# values are ignored. If not specified, the server will
|
539
|
-
# of results to return.
|
537
|
+
# Optional. The maximum number of results to return from this request.
|
538
|
+
# Non-positive values are ignored. If not specified, the server will
|
539
|
+
# determine the number of results to return.
|
540
540
|
# @param page_token [::String]
|
541
|
-
# Optional. If present, retrieves the next batch of results from the
|
542
|
-
# this method. `page_token` must be the value of
|
543
|
-
# previous response. The values of other method
|
544
|
-
# to those in the previous call.
|
541
|
+
# Optional. If present, retrieves the next batch of results from the
|
542
|
+
# preceding call to this method. `page_token` must be the value of
|
543
|
+
# `next_page_token` from the previous response. The values of other method
|
544
|
+
# parameters must be identical to those in the previous call.
|
545
545
|
# @param filter [::String]
|
546
546
|
# Filter expression to restrict the recommendations returned. Supported
|
547
547
|
# filter fields:
|
@@ -1027,6 +1027,376 @@ module Google
|
|
1027
1027
|
raise ::Google::Cloud::Error.from_error(e)
|
1028
1028
|
end
|
1029
1029
|
|
1030
|
+
##
|
1031
|
+
# Gets the requested Recommender Config. There is only one instance of the
|
1032
|
+
# config for each Recommender.
|
1033
|
+
#
|
1034
|
+
# @overload get_recommender_config(request, options = nil)
|
1035
|
+
# Pass arguments to `get_recommender_config` via a request object, either of type
|
1036
|
+
# {::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest} or an equivalent Hash.
|
1037
|
+
#
|
1038
|
+
# @param request [::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest, ::Hash]
|
1039
|
+
# A request object representing the call parameters. Required. To specify no
|
1040
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1041
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1042
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1043
|
+
#
|
1044
|
+
# @overload get_recommender_config(name: nil)
|
1045
|
+
# Pass arguments to `get_recommender_config` via keyword arguments. Note that at
|
1046
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1047
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1048
|
+
#
|
1049
|
+
# @param name [::String]
|
1050
|
+
# Required. Name of the Recommendation Config to get.
|
1051
|
+
#
|
1052
|
+
# Acceptable formats:
|
1053
|
+
#
|
1054
|
+
# * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config`
|
1055
|
+
#
|
1056
|
+
# * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config`
|
1057
|
+
#
|
1058
|
+
# * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/config`
|
1059
|
+
#
|
1060
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1061
|
+
# @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig]
|
1062
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1063
|
+
#
|
1064
|
+
# @return [::Google::Cloud::Recommender::V1::RecommenderConfig]
|
1065
|
+
#
|
1066
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1067
|
+
#
|
1068
|
+
# @example Basic example
|
1069
|
+
# require "google/cloud/recommender/v1"
|
1070
|
+
#
|
1071
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1072
|
+
# client = Google::Cloud::Recommender::V1::Recommender::Client.new
|
1073
|
+
#
|
1074
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1075
|
+
# request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new
|
1076
|
+
#
|
1077
|
+
# # Call the get_recommender_config method.
|
1078
|
+
# result = client.get_recommender_config request
|
1079
|
+
#
|
1080
|
+
# # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig.
|
1081
|
+
# p result
|
1082
|
+
#
|
1083
|
+
def get_recommender_config request, options = nil
|
1084
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1085
|
+
|
1086
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetRecommenderConfigRequest
|
1087
|
+
|
1088
|
+
# Converts hash and nil to an options object
|
1089
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1090
|
+
|
1091
|
+
# Customize the options with defaults
|
1092
|
+
metadata = @config.rpcs.get_recommender_config.metadata.to_h
|
1093
|
+
|
1094
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1095
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1096
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1097
|
+
gapic_version: ::Google::Cloud::Recommender::V1::VERSION
|
1098
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1099
|
+
|
1100
|
+
header_params = {}
|
1101
|
+
if request.name
|
1102
|
+
header_params["name"] = request.name
|
1103
|
+
end
|
1104
|
+
|
1105
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1106
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1107
|
+
|
1108
|
+
options.apply_defaults timeout: @config.rpcs.get_recommender_config.timeout,
|
1109
|
+
metadata: metadata,
|
1110
|
+
retry_policy: @config.rpcs.get_recommender_config.retry_policy
|
1111
|
+
|
1112
|
+
options.apply_defaults timeout: @config.timeout,
|
1113
|
+
metadata: @config.metadata,
|
1114
|
+
retry_policy: @config.retry_policy
|
1115
|
+
|
1116
|
+
@recommender_stub.call_rpc :get_recommender_config, request, options: options do |response, operation|
|
1117
|
+
yield response, operation if block_given?
|
1118
|
+
return response
|
1119
|
+
end
|
1120
|
+
rescue ::GRPC::BadStatus => e
|
1121
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1122
|
+
end
|
1123
|
+
|
1124
|
+
##
|
1125
|
+
# Updates a Recommender Config. This will create a new revision of the
|
1126
|
+
# config.
|
1127
|
+
#
|
1128
|
+
# @overload update_recommender_config(request, options = nil)
|
1129
|
+
# Pass arguments to `update_recommender_config` via a request object, either of type
|
1130
|
+
# {::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest} or an equivalent Hash.
|
1131
|
+
#
|
1132
|
+
# @param request [::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest, ::Hash]
|
1133
|
+
# A request object representing the call parameters. Required. To specify no
|
1134
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1135
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1136
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1137
|
+
#
|
1138
|
+
# @overload update_recommender_config(recommender_config: nil, update_mask: nil, validate_only: nil)
|
1139
|
+
# Pass arguments to `update_recommender_config` via keyword arguments. Note that at
|
1140
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1141
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1142
|
+
#
|
1143
|
+
# @param recommender_config [::Google::Cloud::Recommender::V1::RecommenderConfig, ::Hash]
|
1144
|
+
# Required. The RecommenderConfig to update.
|
1145
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1146
|
+
# The list of fields to be updated.
|
1147
|
+
# @param validate_only [::Boolean]
|
1148
|
+
# If true, validate the request and preview the change, but do not actually
|
1149
|
+
# update it.
|
1150
|
+
#
|
1151
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1152
|
+
# @yieldparam response [::Google::Cloud::Recommender::V1::RecommenderConfig]
|
1153
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1154
|
+
#
|
1155
|
+
# @return [::Google::Cloud::Recommender::V1::RecommenderConfig]
|
1156
|
+
#
|
1157
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1158
|
+
#
|
1159
|
+
# @example Basic example
|
1160
|
+
# require "google/cloud/recommender/v1"
|
1161
|
+
#
|
1162
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1163
|
+
# client = Google::Cloud::Recommender::V1::Recommender::Client.new
|
1164
|
+
#
|
1165
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1166
|
+
# request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new
|
1167
|
+
#
|
1168
|
+
# # Call the update_recommender_config method.
|
1169
|
+
# result = client.update_recommender_config request
|
1170
|
+
#
|
1171
|
+
# # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig.
|
1172
|
+
# p result
|
1173
|
+
#
|
1174
|
+
def update_recommender_config request, options = nil
|
1175
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1176
|
+
|
1177
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest
|
1178
|
+
|
1179
|
+
# Converts hash and nil to an options object
|
1180
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1181
|
+
|
1182
|
+
# Customize the options with defaults
|
1183
|
+
metadata = @config.rpcs.update_recommender_config.metadata.to_h
|
1184
|
+
|
1185
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1186
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1187
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1188
|
+
gapic_version: ::Google::Cloud::Recommender::V1::VERSION
|
1189
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1190
|
+
|
1191
|
+
header_params = {}
|
1192
|
+
if request.recommender_config&.name
|
1193
|
+
header_params["recommender_config.name"] = request.recommender_config.name
|
1194
|
+
end
|
1195
|
+
|
1196
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1197
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1198
|
+
|
1199
|
+
options.apply_defaults timeout: @config.rpcs.update_recommender_config.timeout,
|
1200
|
+
metadata: metadata,
|
1201
|
+
retry_policy: @config.rpcs.update_recommender_config.retry_policy
|
1202
|
+
|
1203
|
+
options.apply_defaults timeout: @config.timeout,
|
1204
|
+
metadata: @config.metadata,
|
1205
|
+
retry_policy: @config.retry_policy
|
1206
|
+
|
1207
|
+
@recommender_stub.call_rpc :update_recommender_config, request, options: options do |response, operation|
|
1208
|
+
yield response, operation if block_given?
|
1209
|
+
return response
|
1210
|
+
end
|
1211
|
+
rescue ::GRPC::BadStatus => e
|
1212
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1213
|
+
end
|
1214
|
+
|
1215
|
+
##
|
1216
|
+
# Gets the requested InsightTypeConfig. There is only one instance of the
|
1217
|
+
# config for each InsightType.
|
1218
|
+
#
|
1219
|
+
# @overload get_insight_type_config(request, options = nil)
|
1220
|
+
# Pass arguments to `get_insight_type_config` via a request object, either of type
|
1221
|
+
# {::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest} or an equivalent Hash.
|
1222
|
+
#
|
1223
|
+
# @param request [::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest, ::Hash]
|
1224
|
+
# A request object representing the call parameters. Required. To specify no
|
1225
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1226
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1227
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1228
|
+
#
|
1229
|
+
# @overload get_insight_type_config(name: nil)
|
1230
|
+
# Pass arguments to `get_insight_type_config` via keyword arguments. Note that at
|
1231
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1232
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1233
|
+
#
|
1234
|
+
# @param name [::String]
|
1235
|
+
# Required. Name of the InsightTypeConfig to get.
|
1236
|
+
#
|
1237
|
+
# Acceptable formats:
|
1238
|
+
#
|
1239
|
+
# * `projects/[PROJECT_NUMBER]/locations/global/recommenders/[INSIGHT_TYPE_ID]/config`
|
1240
|
+
#
|
1241
|
+
# * `projects/[PROJECT_ID]/locations/global/recommenders/[INSIGHT_TYPE_ID]/config`
|
1242
|
+
#
|
1243
|
+
# * `organizations/[ORGANIZATION_ID]/locations/global/recommenders/[INSIGHT_TYPE_ID]/config`
|
1244
|
+
#
|
1245
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1246
|
+
# @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig]
|
1247
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1248
|
+
#
|
1249
|
+
# @return [::Google::Cloud::Recommender::V1::InsightTypeConfig]
|
1250
|
+
#
|
1251
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1252
|
+
#
|
1253
|
+
# @example Basic example
|
1254
|
+
# require "google/cloud/recommender/v1"
|
1255
|
+
#
|
1256
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1257
|
+
# client = Google::Cloud::Recommender::V1::Recommender::Client.new
|
1258
|
+
#
|
1259
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1260
|
+
# request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new
|
1261
|
+
#
|
1262
|
+
# # Call the get_insight_type_config method.
|
1263
|
+
# result = client.get_insight_type_config request
|
1264
|
+
#
|
1265
|
+
# # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig.
|
1266
|
+
# p result
|
1267
|
+
#
|
1268
|
+
def get_insight_type_config request, options = nil
|
1269
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1270
|
+
|
1271
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest
|
1272
|
+
|
1273
|
+
# Converts hash and nil to an options object
|
1274
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1275
|
+
|
1276
|
+
# Customize the options with defaults
|
1277
|
+
metadata = @config.rpcs.get_insight_type_config.metadata.to_h
|
1278
|
+
|
1279
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1280
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1281
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1282
|
+
gapic_version: ::Google::Cloud::Recommender::V1::VERSION
|
1283
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1284
|
+
|
1285
|
+
header_params = {}
|
1286
|
+
if request.name
|
1287
|
+
header_params["name"] = request.name
|
1288
|
+
end
|
1289
|
+
|
1290
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1291
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1292
|
+
|
1293
|
+
options.apply_defaults timeout: @config.rpcs.get_insight_type_config.timeout,
|
1294
|
+
metadata: metadata,
|
1295
|
+
retry_policy: @config.rpcs.get_insight_type_config.retry_policy
|
1296
|
+
|
1297
|
+
options.apply_defaults timeout: @config.timeout,
|
1298
|
+
metadata: @config.metadata,
|
1299
|
+
retry_policy: @config.retry_policy
|
1300
|
+
|
1301
|
+
@recommender_stub.call_rpc :get_insight_type_config, request, options: options do |response, operation|
|
1302
|
+
yield response, operation if block_given?
|
1303
|
+
return response
|
1304
|
+
end
|
1305
|
+
rescue ::GRPC::BadStatus => e
|
1306
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
##
|
1310
|
+
# Updates an InsightTypeConfig change. This will create a new revision of the
|
1311
|
+
# config.
|
1312
|
+
#
|
1313
|
+
# @overload update_insight_type_config(request, options = nil)
|
1314
|
+
# Pass arguments to `update_insight_type_config` via a request object, either of type
|
1315
|
+
# {::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest} or an equivalent Hash.
|
1316
|
+
#
|
1317
|
+
# @param request [::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest, ::Hash]
|
1318
|
+
# A request object representing the call parameters. Required. To specify no
|
1319
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1320
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1321
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1322
|
+
#
|
1323
|
+
# @overload update_insight_type_config(insight_type_config: nil, update_mask: nil, validate_only: nil)
|
1324
|
+
# Pass arguments to `update_insight_type_config` via keyword arguments. Note that at
|
1325
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1326
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1327
|
+
#
|
1328
|
+
# @param insight_type_config [::Google::Cloud::Recommender::V1::InsightTypeConfig, ::Hash]
|
1329
|
+
# Required. The InsightTypeConfig to update.
|
1330
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1331
|
+
# The list of fields to be updated.
|
1332
|
+
# @param validate_only [::Boolean]
|
1333
|
+
# If true, validate the request and preview the change, but do not actually
|
1334
|
+
# update it.
|
1335
|
+
#
|
1336
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1337
|
+
# @yieldparam response [::Google::Cloud::Recommender::V1::InsightTypeConfig]
|
1338
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1339
|
+
#
|
1340
|
+
# @return [::Google::Cloud::Recommender::V1::InsightTypeConfig]
|
1341
|
+
#
|
1342
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1343
|
+
#
|
1344
|
+
# @example Basic example
|
1345
|
+
# require "google/cloud/recommender/v1"
|
1346
|
+
#
|
1347
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1348
|
+
# client = Google::Cloud::Recommender::V1::Recommender::Client.new
|
1349
|
+
#
|
1350
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1351
|
+
# request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new
|
1352
|
+
#
|
1353
|
+
# # Call the update_insight_type_config method.
|
1354
|
+
# result = client.update_insight_type_config request
|
1355
|
+
#
|
1356
|
+
# # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig.
|
1357
|
+
# p result
|
1358
|
+
#
|
1359
|
+
def update_insight_type_config request, options = nil
|
1360
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1361
|
+
|
1362
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest
|
1363
|
+
|
1364
|
+
# Converts hash and nil to an options object
|
1365
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1366
|
+
|
1367
|
+
# Customize the options with defaults
|
1368
|
+
metadata = @config.rpcs.update_insight_type_config.metadata.to_h
|
1369
|
+
|
1370
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1371
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1372
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1373
|
+
gapic_version: ::Google::Cloud::Recommender::V1::VERSION
|
1374
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1375
|
+
|
1376
|
+
header_params = {}
|
1377
|
+
if request.insight_type_config&.name
|
1378
|
+
header_params["insight_type_config.name"] = request.insight_type_config.name
|
1379
|
+
end
|
1380
|
+
|
1381
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1382
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1383
|
+
|
1384
|
+
options.apply_defaults timeout: @config.rpcs.update_insight_type_config.timeout,
|
1385
|
+
metadata: metadata,
|
1386
|
+
retry_policy: @config.rpcs.update_insight_type_config.retry_policy
|
1387
|
+
|
1388
|
+
options.apply_defaults timeout: @config.timeout,
|
1389
|
+
metadata: @config.metadata,
|
1390
|
+
retry_policy: @config.retry_policy
|
1391
|
+
|
1392
|
+
@recommender_stub.call_rpc :update_insight_type_config, request, options: options do |response, operation|
|
1393
|
+
yield response, operation if block_given?
|
1394
|
+
return response
|
1395
|
+
end
|
1396
|
+
rescue ::GRPC::BadStatus => e
|
1397
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1398
|
+
end
|
1399
|
+
|
1030
1400
|
##
|
1031
1401
|
# Configuration class for the Recommender API.
|
1032
1402
|
#
|
@@ -1202,6 +1572,26 @@ module Google
|
|
1202
1572
|
# @return [::Gapic::Config::Method]
|
1203
1573
|
#
|
1204
1574
|
attr_reader :mark_recommendation_failed
|
1575
|
+
##
|
1576
|
+
# RPC-specific configuration for `get_recommender_config`
|
1577
|
+
# @return [::Gapic::Config::Method]
|
1578
|
+
#
|
1579
|
+
attr_reader :get_recommender_config
|
1580
|
+
##
|
1581
|
+
# RPC-specific configuration for `update_recommender_config`
|
1582
|
+
# @return [::Gapic::Config::Method]
|
1583
|
+
#
|
1584
|
+
attr_reader :update_recommender_config
|
1585
|
+
##
|
1586
|
+
# RPC-specific configuration for `get_insight_type_config`
|
1587
|
+
# @return [::Gapic::Config::Method]
|
1588
|
+
#
|
1589
|
+
attr_reader :get_insight_type_config
|
1590
|
+
##
|
1591
|
+
# RPC-specific configuration for `update_insight_type_config`
|
1592
|
+
# @return [::Gapic::Config::Method]
|
1593
|
+
#
|
1594
|
+
attr_reader :update_insight_type_config
|
1205
1595
|
|
1206
1596
|
# @private
|
1207
1597
|
def initialize parent_rpcs = nil
|
@@ -1221,6 +1611,14 @@ module Google
|
|
1221
1611
|
@mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config
|
1222
1612
|
mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed
|
1223
1613
|
@mark_recommendation_failed = ::Gapic::Config::Method.new mark_recommendation_failed_config
|
1614
|
+
get_recommender_config_config = parent_rpcs.get_recommender_config if parent_rpcs.respond_to? :get_recommender_config
|
1615
|
+
@get_recommender_config = ::Gapic::Config::Method.new get_recommender_config_config
|
1616
|
+
update_recommender_config_config = parent_rpcs.update_recommender_config if parent_rpcs.respond_to? :update_recommender_config
|
1617
|
+
@update_recommender_config = ::Gapic::Config::Method.new update_recommender_config_config
|
1618
|
+
get_insight_type_config_config = parent_rpcs.get_insight_type_config if parent_rpcs.respond_to? :get_insight_type_config
|
1619
|
+
@get_insight_type_config = ::Gapic::Config::Method.new get_insight_type_config_config
|
1620
|
+
update_insight_type_config_config = parent_rpcs.update_insight_type_config if parent_rpcs.respond_to? :update_insight_type_config
|
1621
|
+
@update_insight_type_config = ::Gapic::Config::Method.new update_insight_type_config_config
|
1224
1622
|
|
1225
1623
|
yield self if block_given?
|
1226
1624
|
end
|
@@ -178,6 +178,49 @@ module Google
|
|
178
178
|
resource.call(**args)
|
179
179
|
end
|
180
180
|
|
181
|
+
##
|
182
|
+
# Create a fully-qualified InsightTypeConfig resource string.
|
183
|
+
#
|
184
|
+
# @overload insight_type_config_path(project:, location:, insight_type:)
|
185
|
+
# The resource will be in the following format:
|
186
|
+
#
|
187
|
+
# `projects/{project}/locations/{location}/insightTypes/{insight_type}/config`
|
188
|
+
#
|
189
|
+
# @param project [String]
|
190
|
+
# @param location [String]
|
191
|
+
# @param insight_type [String]
|
192
|
+
#
|
193
|
+
# @overload insight_type_config_path(organization:, location:, insight_type:)
|
194
|
+
# The resource will be in the following format:
|
195
|
+
#
|
196
|
+
# `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/config`
|
197
|
+
#
|
198
|
+
# @param organization [String]
|
199
|
+
# @param location [String]
|
200
|
+
# @param insight_type [String]
|
201
|
+
#
|
202
|
+
# @return [::String]
|
203
|
+
def insight_type_config_path **args
|
204
|
+
resources = {
|
205
|
+
"insight_type:location:project" => (proc do |project:, location:, insight_type:|
|
206
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
207
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
208
|
+
|
209
|
+
"projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/config"
|
210
|
+
end),
|
211
|
+
"insight_type:location:organization" => (proc do |organization:, location:, insight_type:|
|
212
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
213
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
214
|
+
|
215
|
+
"organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/config"
|
216
|
+
end)
|
217
|
+
}
|
218
|
+
|
219
|
+
resource = resources[args.keys.sort.join(":")]
|
220
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
221
|
+
resource.call(**args)
|
222
|
+
end
|
223
|
+
|
181
224
|
##
|
182
225
|
# Create a fully-qualified Recommendation resource string.
|
183
226
|
#
|
@@ -332,6 +375,49 @@ module Google
|
|
332
375
|
resource.call(**args)
|
333
376
|
end
|
334
377
|
|
378
|
+
##
|
379
|
+
# Create a fully-qualified RecommenderConfig resource string.
|
380
|
+
#
|
381
|
+
# @overload recommender_config_path(project:, location:, recommender:)
|
382
|
+
# The resource will be in the following format:
|
383
|
+
#
|
384
|
+
# `projects/{project}/locations/{location}/recommenders/{recommender}/config`
|
385
|
+
#
|
386
|
+
# @param project [String]
|
387
|
+
# @param location [String]
|
388
|
+
# @param recommender [String]
|
389
|
+
#
|
390
|
+
# @overload recommender_config_path(organization:, location:, recommender:)
|
391
|
+
# The resource will be in the following format:
|
392
|
+
#
|
393
|
+
# `organizations/{organization}/locations/{location}/recommenders/{recommender}/config`
|
394
|
+
#
|
395
|
+
# @param organization [String]
|
396
|
+
# @param location [String]
|
397
|
+
# @param recommender [String]
|
398
|
+
#
|
399
|
+
# @return [::String]
|
400
|
+
def recommender_config_path **args
|
401
|
+
resources = {
|
402
|
+
"location:project:recommender" => (proc do |project:, location:, recommender:|
|
403
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
404
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
405
|
+
|
406
|
+
"projects/#{project}/locations/#{location}/recommenders/#{recommender}/config"
|
407
|
+
end),
|
408
|
+
"location:organization:recommender" => (proc do |organization:, location:, recommender:|
|
409
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
410
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
411
|
+
|
412
|
+
"organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/config"
|
413
|
+
end)
|
414
|
+
}
|
415
|
+
|
416
|
+
resource = resources[args.keys.sort.join(":")]
|
417
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
418
|
+
resource.call(**args)
|
419
|
+
end
|
420
|
+
|
335
421
|
extend self
|
336
422
|
end
|
337
423
|
end
|