google-cloud-recommender-v1 0.8.6 → 0.11.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 +11 -6
- data/lib/google/cloud/recommender/v1/insight_pb.rb +11 -1
- data/lib/google/cloud/recommender/v1/insight_type_config_pb.rb +37 -0
- data/lib/google/cloud/recommender/v1/recommendation_pb.rb +18 -1
- data/lib/google/cloud/recommender/v1/recommender/client.rb +477 -29
- 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 +16 -4
- data/lib/google/cloud/recommender/v1/version.rb +1 -1
- data/lib/google/cloud/recommender/v1.rb +2 -0
- data/proto_docs/google/cloud/recommender/v1/insight.rb +21 -0
- data/proto_docs/google/cloud/recommender/v1/insight_type_config.rb +88 -0
- data/proto_docs/google/cloud/recommender/v1/recommendation.rb +47 -2
- data/proto_docs/google/cloud/recommender/v1/recommender_config.rb +88 -0
- data/proto_docs/google/cloud/recommender/v1/recommender_service.rb +141 -25
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +2 -2
- metadata +17 -12
@@ -176,8 +176,8 @@ module Google
|
|
176
176
|
# Service calls
|
177
177
|
|
178
178
|
##
|
179
|
-
# Lists insights for
|
180
|
-
# permission for the specified insight type.
|
179
|
+
# Lists insights for the specified Cloud Resource. Requires the
|
180
|
+
# recommender.*.list IAM permission for the specified insight type.
|
181
181
|
#
|
182
182
|
# @overload list_insights(request, options = nil)
|
183
183
|
# Pass arguments to `list_insights` via a request object, either of type
|
@@ -198,26 +198,51 @@ module Google
|
|
198
198
|
# Required. The container resource on which to execute the request.
|
199
199
|
# Acceptable formats:
|
200
200
|
#
|
201
|
-
#
|
202
|
-
#
|
201
|
+
# * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
|
202
|
+
#
|
203
|
+
# * `projects/[PROJECT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
|
204
|
+
#
|
205
|
+
# * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
|
206
|
+
#
|
207
|
+
# * `folders/[FOLDER_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
|
208
|
+
#
|
209
|
+
# * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]`
|
203
210
|
#
|
204
211
|
# LOCATION here refers to GCP Locations:
|
205
212
|
# https://cloud.google.com/about/locations/
|
206
213
|
# INSIGHT_TYPE_ID refers to supported insight types:
|
207
|
-
# https://cloud.google.com/recommender/docs/insights/insight-types.
|
214
|
+
# https://cloud.google.com/recommender/docs/insights/insight-types.
|
208
215
|
# @param page_size [::Integer]
|
209
|
-
# Optional. The maximum number of results to return from this request.
|
210
|
-
# values are ignored. If not specified, the server will
|
211
|
-
# 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.
|
212
219
|
# @param page_token [::String]
|
213
|
-
# Optional. If present, retrieves the next batch of results from the
|
214
|
-
# this method. `page_token` must be the value of
|
215
|
-
# previous response. The values of other method
|
216
|
-
# 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.
|
217
224
|
# @param filter [::String]
|
218
225
|
# Optional. Filter expression to restrict the insights returned. Supported
|
219
|
-
# filter fields:
|
220
|
-
#
|
226
|
+
# filter fields:
|
227
|
+
#
|
228
|
+
# * `stateInfo.state`
|
229
|
+
#
|
230
|
+
# * `insightSubtype`
|
231
|
+
#
|
232
|
+
# * `severity`
|
233
|
+
#
|
234
|
+
# Examples:
|
235
|
+
#
|
236
|
+
# * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED`
|
237
|
+
#
|
238
|
+
# * `insightSubtype = PERMISSIONS_USAGE`
|
239
|
+
#
|
240
|
+
# * `severity = CRITICAL OR severity = HIGH`
|
241
|
+
#
|
242
|
+
# * `stateInfo.state = ACTIVE AND (severity = CRITICAL OR severity = HIGH)`
|
243
|
+
#
|
244
|
+
# (These expressions are based on the filter language described at
|
245
|
+
# https://google.aip.dev/160)
|
221
246
|
#
|
222
247
|
# @yield [response, operation] Access the result along with the RPC operation
|
223
248
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>]
|
@@ -402,8 +427,8 @@ module Google
|
|
402
427
|
# @param name [::String]
|
403
428
|
# Required. Name of the insight.
|
404
429
|
# @param state_metadata [::Hash{::String => ::String}]
|
405
|
-
# Optional. State properties user wish to include with this state. Full
|
406
|
-
# current state_metadata.
|
430
|
+
# Optional. State properties user wish to include with this state. Full
|
431
|
+
# replace of the current state_metadata.
|
407
432
|
# @param etag [::String]
|
408
433
|
# Required. Fingerprint of the Insight. Provides optimistic locking.
|
409
434
|
#
|
@@ -472,8 +497,8 @@ module Google
|
|
472
497
|
end
|
473
498
|
|
474
499
|
##
|
475
|
-
# Lists recommendations for
|
476
|
-
# IAM permission for the specified recommender.
|
500
|
+
# Lists recommendations for the specified Cloud Resource. Requires the
|
501
|
+
# recommender.*.list IAM permission for the specified recommender.
|
477
502
|
#
|
478
503
|
# @overload list_recommendations(request, options = nil)
|
479
504
|
# Pass arguments to `list_recommendations` via a request object, either of type
|
@@ -494,26 +519,51 @@ module Google
|
|
494
519
|
# Required. The container resource on which to execute the request.
|
495
520
|
# Acceptable formats:
|
496
521
|
#
|
497
|
-
#
|
498
|
-
#
|
522
|
+
# * `projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
|
523
|
+
#
|
524
|
+
# * `projects/[PROJECT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
|
525
|
+
#
|
526
|
+
# * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
|
527
|
+
#
|
528
|
+
# * `folders/[FOLDER_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
|
529
|
+
#
|
530
|
+
# * `organizations/[ORGANIZATION_ID]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]`
|
499
531
|
#
|
500
532
|
# LOCATION here refers to GCP Locations:
|
501
533
|
# https://cloud.google.com/about/locations/
|
502
534
|
# RECOMMENDER_ID refers to supported recommenders:
|
503
535
|
# https://cloud.google.com/recommender/docs/recommenders.
|
504
536
|
# @param page_size [::Integer]
|
505
|
-
# Optional. The maximum number of results to return from this request.
|
506
|
-
# values are ignored. If not specified, the server will
|
507
|
-
# 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.
|
508
540
|
# @param page_token [::String]
|
509
|
-
# Optional. If present, retrieves the next batch of results from the
|
510
|
-
# this method. `page_token` must be the value of
|
511
|
-
# previous response. The values of other method
|
512
|
-
# 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.
|
513
545
|
# @param filter [::String]
|
514
546
|
# Filter expression to restrict the recommendations returned. Supported
|
515
|
-
# filter fields:
|
516
|
-
#
|
547
|
+
# filter fields:
|
548
|
+
#
|
549
|
+
# * `state_info.state`
|
550
|
+
#
|
551
|
+
# * `recommenderSubtype`
|
552
|
+
#
|
553
|
+
# * `priority`
|
554
|
+
#
|
555
|
+
# Examples:
|
556
|
+
#
|
557
|
+
# * `stateInfo.state = ACTIVE OR stateInfo.state = DISMISSED`
|
558
|
+
#
|
559
|
+
# * `recommenderSubtype = REMOVE_ROLE OR recommenderSubtype = REPLACE_ROLE`
|
560
|
+
#
|
561
|
+
# * `priority = P1 OR priority = P2`
|
562
|
+
#
|
563
|
+
# * `stateInfo.state = ACTIVE AND (priority = P1 OR priority = P2)`
|
564
|
+
#
|
565
|
+
# (These expressions are based on the filter language described at
|
566
|
+
# https://google.aip.dev/160)
|
517
567
|
#
|
518
568
|
# @yield [response, operation] Access the result along with the RPC operation
|
519
569
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Recommendation>]
|
@@ -977,6 +1027,376 @@ module Google
|
|
977
1027
|
raise ::Google::Cloud::Error.from_error(e)
|
978
1028
|
end
|
979
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
|
+
|
980
1400
|
##
|
981
1401
|
# Configuration class for the Recommender API.
|
982
1402
|
#
|
@@ -1152,6 +1572,26 @@ module Google
|
|
1152
1572
|
# @return [::Gapic::Config::Method]
|
1153
1573
|
#
|
1154
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
|
1155
1595
|
|
1156
1596
|
# @private
|
1157
1597
|
def initialize parent_rpcs = nil
|
@@ -1171,6 +1611,14 @@ module Google
|
|
1171
1611
|
@mark_recommendation_succeeded = ::Gapic::Config::Method.new mark_recommendation_succeeded_config
|
1172
1612
|
mark_recommendation_failed_config = parent_rpcs.mark_recommendation_failed if parent_rpcs.respond_to? :mark_recommendation_failed
|
1173
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
|
1174
1622
|
|
1175
1623
|
yield self if block_given?
|
1176
1624
|
end
|