google-cloud-recommender-v1 0.4.2 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad4774c50b90e40f5d74d59aea6f7b89ef88652bc6f87f5bfba825584560362a
4
- data.tar.gz: 629db979d3784b9da36ddf9bd5e9705c378f1ec7cb718e958c9e5985d2dab88a
3
+ metadata.gz: 54b1052159b78e8f617677704f4af520f174464800c801432330a3a18ee322d9
4
+ data.tar.gz: fed1be380b52b53e8136a81a6f3d09a1102065fb56e30ea04e93635fdf28cbec
5
5
  SHA512:
6
- metadata.gz: 49bcc262f3b2c1217f4b8f079014a180108e4f37633bc5f38c29c915a2166ceafd740f821e6c68cd02659d7c490e1f70f915b582af349fa4f9008fe000bada55
7
- data.tar.gz: eea13f795e632523ca9c773e13c9ce24a2cde6c65d5be549250a0cdbe01b20b9673a9ce819db1304aea3965b888728d6d11d4abb42323eabc05556e2ee443d54
6
+ metadata.gz: a04f71f5f3246425da931e8727eb77f5f2ffb86cdb113c564be5e9963a77362e0deb3e785443f55c19a15ef87abd1dc2739e4f2b615af830146028ba1714db2a
7
+ data.tar.gz: 7a1f84adac7827cfa6cac15d9e4188e053501cca97eac389d331302f130b00a24f8f1e0ea26f8a30026e85e0164c5c82e6c1f9fb909ea334781bf32f48cc5710
data/README.md CHANGED
@@ -18,6 +18,7 @@ In order to use this library, you first need to go through the following steps:
18
18
 
19
19
  1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
20
20
  1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
21
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/recommender.googleapis.com)
21
22
  1. {file:AUTHENTICATION.md Set up authentication.}
22
23
 
23
24
  ## Quick Start
@@ -27,12 +28,15 @@ require "google/cloud/recommender/v1"
27
28
 
28
29
  client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
29
30
  request = my_create_request
30
- response = client.list_recommendations request
31
+ response = client.list_insights request
31
32
  ```
32
33
 
33
34
  View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-recommender-v1/latest)
34
35
  for class and method documentation.
35
36
 
37
+ See also the [Product Documentation](https://cloud.google.com/recommender)
38
+ for general usage information.
39
+
36
40
  ## Enabling Logging
37
41
 
38
42
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
@@ -0,0 +1,60 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/recommender/v1/insight.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/resource_pb'
7
+ require 'google/protobuf/duration_pb'
8
+ require 'google/protobuf/struct_pb'
9
+ require 'google/protobuf/timestamp_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_file("google/cloud/recommender/v1/insight.proto", :syntax => :proto3) do
12
+ add_message "google.cloud.recommender.v1.Insight" do
13
+ optional :name, :string, 1
14
+ optional :description, :string, 2
15
+ repeated :target_resources, :string, 9
16
+ optional :insight_subtype, :string, 10
17
+ optional :content, :message, 3, "google.protobuf.Struct"
18
+ optional :last_refresh_time, :message, 4, "google.protobuf.Timestamp"
19
+ optional :observation_period, :message, 5, "google.protobuf.Duration"
20
+ optional :state_info, :message, 6, "google.cloud.recommender.v1.InsightStateInfo"
21
+ optional :category, :enum, 7, "google.cloud.recommender.v1.Insight.Category"
22
+ optional :etag, :string, 11
23
+ repeated :associated_recommendations, :message, 8, "google.cloud.recommender.v1.Insight.RecommendationReference"
24
+ end
25
+ add_message "google.cloud.recommender.v1.Insight.RecommendationReference" do
26
+ optional :recommendation, :string, 1
27
+ end
28
+ add_enum "google.cloud.recommender.v1.Insight.Category" do
29
+ value :CATEGORY_UNSPECIFIED, 0
30
+ value :COST, 1
31
+ value :SECURITY, 2
32
+ value :PERFORMANCE, 3
33
+ value :MANAGEABILITY, 4
34
+ end
35
+ add_message "google.cloud.recommender.v1.InsightStateInfo" do
36
+ optional :state, :enum, 1, "google.cloud.recommender.v1.InsightStateInfo.State"
37
+ map :state_metadata, :string, :string, 2
38
+ end
39
+ add_enum "google.cloud.recommender.v1.InsightStateInfo.State" do
40
+ value :STATE_UNSPECIFIED, 0
41
+ value :ACTIVE, 1
42
+ value :ACCEPTED, 2
43
+ value :DISMISSED, 3
44
+ end
45
+ end
46
+ end
47
+
48
+ module Google
49
+ module Cloud
50
+ module Recommender
51
+ module V1
52
+ Insight = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight").msgclass
53
+ Insight::RecommendationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.RecommendationReference").msgclass
54
+ Insight::Category = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Insight.Category").enummodule
55
+ InsightStateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo").msgclass
56
+ InsightStateInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.InsightStateInfo.State").enummodule
57
+ end
58
+ end
59
+ end
60
+ end
@@ -20,6 +20,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
20
20
  optional :content, :message, 7, "google.cloud.recommender.v1.RecommendationContent"
21
21
  optional :state_info, :message, 10, "google.cloud.recommender.v1.RecommendationStateInfo"
22
22
  optional :etag, :string, 11
23
+ repeated :associated_insights, :message, 14, "google.cloud.recommender.v1.Recommendation.InsightReference"
24
+ end
25
+ add_message "google.cloud.recommender.v1.Recommendation.InsightReference" do
26
+ optional :insight, :string, 1
23
27
  end
24
28
  add_message "google.cloud.recommender.v1.RecommendationContent" do
25
29
  repeated :operation_groups, :message, 2, "google.cloud.recommender.v1.OperationGroup"
@@ -83,6 +87,7 @@ module Google
83
87
  module Recommender
84
88
  module V1
85
89
  Recommendation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation").msgclass
90
+ Recommendation::InsightReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Recommendation.InsightReference").msgclass
86
91
  RecommendationContent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.RecommendationContent").msgclass
87
92
  OperationGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.OperationGroup").msgclass
88
93
  Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.Operation").msgclass
@@ -31,10 +31,10 @@ module Google
31
31
  module Recommender
32
32
  module V1
33
33
  ##
34
- # Provides recommendations for cloud customers for various categories like
35
- # performance optimization, cost savings, reliability, feature discovery, etc.
36
- # These recommendations are generated automatically based on analysis of user
37
- # resources, configuration and monitoring metrics.
34
+ # Provides insights and recommendations for cloud customers for various
35
+ # categories like performance optimization, cost savings, reliability, feature
36
+ # discovery, etc. Insights and recommendations are generated automatically
37
+ # based on analysis of user resources, configuration and monitoring metrics.
38
38
  #
39
39
  # To load this service and instantiate a client:
40
40
  #
@@ -27,10 +27,10 @@ module Google
27
27
  ##
28
28
  # Client for the Recommender service.
29
29
  #
30
- # Provides recommendations for cloud customers for various categories like
31
- # performance optimization, cost savings, reliability, feature discovery, etc.
32
- # These recommendations are generated automatically based on analysis of user
33
- # resources, configuration and monitoring metrics.
30
+ # Provides insights and recommendations for cloud customers for various
31
+ # categories like performance optimization, cost savings, reliability, feature
32
+ # discovery, etc. Insights and recommendations are generated automatically
33
+ # based on analysis of user resources, configuration and monitoring metrics.
34
34
  #
35
35
  class Client
36
36
  include Paths
@@ -68,12 +68,30 @@ module Google
68
68
  end
69
69
  default_config = Client::Configuration.new parent_config
70
70
 
71
+ default_config.rpcs.list_insights.timeout = 60.0
72
+ default_config.rpcs.list_insights.retry_policy = {
73
+ initial_delay: 0.1,
74
+ max_delay: 60.0,
75
+ multiplier: 1.3,
76
+ retry_codes: [4, 14]
77
+ }
78
+
79
+ default_config.rpcs.get_insight.timeout = 60.0
80
+ default_config.rpcs.get_insight.retry_policy = {
81
+ initial_delay: 0.1,
82
+ max_delay: 60.0,
83
+ multiplier: 1.3,
84
+ retry_codes: [4, 14]
85
+ }
86
+
87
+ default_config.rpcs.mark_insight_accepted.timeout = 60.0
88
+
71
89
  default_config.rpcs.list_recommendations.timeout = 60.0
72
90
  default_config.rpcs.list_recommendations.retry_policy = {
73
91
  initial_delay: 0.1,
74
92
  max_delay: 60.0,
75
93
  multiplier: 1.3,
76
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
94
+ retry_codes: [4, 14]
77
95
  }
78
96
 
79
97
  default_config.rpcs.get_recommendation.timeout = 60.0
@@ -81,7 +99,7 @@ module Google
81
99
  initial_delay: 0.1,
82
100
  max_delay: 60.0,
83
101
  multiplier: 1.3,
84
- retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
102
+ retry_codes: [4, 14]
85
103
  }
86
104
 
87
105
  default_config.rpcs.mark_recommendation_claimed.timeout = 60.0
@@ -169,6 +187,237 @@ module Google
169
187
 
170
188
  # Service calls
171
189
 
190
+ ##
191
+ # Lists insights for a Cloud project. Requires the recommender.*.list IAM
192
+ # permission for the specified insight type.
193
+ #
194
+ # @overload list_insights(request, options = nil)
195
+ # Pass arguments to `list_insights` via a request object, either of type
196
+ # {::Google::Cloud::Recommender::V1::ListInsightsRequest} or an equivalent Hash.
197
+ #
198
+ # @param request [::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Hash]
199
+ # A request object representing the call parameters. Required. To specify no
200
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
201
+ # @param options [::Gapic::CallOptions, ::Hash]
202
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
203
+ #
204
+ # @overload list_insights(parent: nil, page_size: nil, page_token: nil, filter: nil)
205
+ # Pass arguments to `list_insights` via keyword arguments. Note that at
206
+ # least one keyword argument is required. To specify no parameters, or to keep all
207
+ # the default parameter values, pass an empty Hash as a request object (see above).
208
+ #
209
+ # @param parent [::String]
210
+ # Required. The container resource on which to execute the request.
211
+ # Acceptable formats:
212
+ #
213
+ # 1.
214
+ # "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]",
215
+ #
216
+ # LOCATION here refers to GCP Locations:
217
+ # https://cloud.google.com/about/locations/
218
+ # @param page_size [::Integer]
219
+ # Optional. The maximum number of results to return from this request. Non-positive
220
+ # values are ignored. If not specified, the server will determine the number
221
+ # of results to return.
222
+ # @param page_token [::String]
223
+ # Optional. If present, retrieves the next batch of results from the preceding call to
224
+ # this method. `page_token` must be the value of `next_page_token` from the
225
+ # previous response. The values of other method parameters must be identical
226
+ # to those in the previous call.
227
+ # @param filter [::String]
228
+ # Optional. Filter expression to restrict the insights returned. Supported
229
+ # filter fields: state
230
+ # Eg: `state:"DISMISSED" or state:"ACTIVE"
231
+ #
232
+ # @yield [response, operation] Access the result along with the RPC operation
233
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>]
234
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
235
+ #
236
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Recommender::V1::Insight>]
237
+ #
238
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
239
+ #
240
+ def list_insights request, options = nil
241
+ raise ::ArgumentError, "request must be provided" if request.nil?
242
+
243
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::ListInsightsRequest
244
+
245
+ # Converts hash and nil to an options object
246
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
247
+
248
+ # Customize the options with defaults
249
+ metadata = @config.rpcs.list_insights.metadata.to_h
250
+
251
+ # Set x-goog-api-client and x-goog-user-project headers
252
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
253
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
254
+ gapic_version: ::Google::Cloud::Recommender::V1::VERSION
255
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
256
+
257
+ header_params = {
258
+ "parent" => request.parent
259
+ }
260
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
261
+ metadata[:"x-goog-request-params"] ||= request_params_header
262
+
263
+ options.apply_defaults timeout: @config.rpcs.list_insights.timeout,
264
+ metadata: metadata,
265
+ retry_policy: @config.rpcs.list_insights.retry_policy
266
+ options.apply_defaults metadata: @config.metadata,
267
+ retry_policy: @config.retry_policy
268
+
269
+ @recommender_stub.call_rpc :list_insights, request, options: options do |response, operation|
270
+ response = ::Gapic::PagedEnumerable.new @recommender_stub, :list_insights, request, response, operation, options
271
+ yield response, operation if block_given?
272
+ return response
273
+ end
274
+ rescue ::GRPC::BadStatus => e
275
+ raise ::Google::Cloud::Error.from_error(e)
276
+ end
277
+
278
+ ##
279
+ # Gets the requested insight. Requires the recommender.*.get IAM permission
280
+ # for the specified insight type.
281
+ #
282
+ # @overload get_insight(request, options = nil)
283
+ # Pass arguments to `get_insight` via a request object, either of type
284
+ # {::Google::Cloud::Recommender::V1::GetInsightRequest} or an equivalent Hash.
285
+ #
286
+ # @param request [::Google::Cloud::Recommender::V1::GetInsightRequest, ::Hash]
287
+ # A request object representing the call parameters. Required. To specify no
288
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
289
+ # @param options [::Gapic::CallOptions, ::Hash]
290
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
291
+ #
292
+ # @overload get_insight(name: nil)
293
+ # Pass arguments to `get_insight` via keyword arguments. Note that at
294
+ # least one keyword argument is required. To specify no parameters, or to keep all
295
+ # the default parameter values, pass an empty Hash as a request object (see above).
296
+ #
297
+ # @param name [::String]
298
+ # Required. Name of the insight.
299
+ #
300
+ # @yield [response, operation] Access the result along with the RPC operation
301
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Insight]
302
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
303
+ #
304
+ # @return [::Google::Cloud::Recommender::V1::Insight]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
307
+ #
308
+ def get_insight request, options = nil
309
+ raise ::ArgumentError, "request must be provided" if request.nil?
310
+
311
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::GetInsightRequest
312
+
313
+ # Converts hash and nil to an options object
314
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
315
+
316
+ # Customize the options with defaults
317
+ metadata = @config.rpcs.get_insight.metadata.to_h
318
+
319
+ # Set x-goog-api-client and x-goog-user-project headers
320
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
321
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
322
+ gapic_version: ::Google::Cloud::Recommender::V1::VERSION
323
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
+
325
+ header_params = {
326
+ "name" => request.name
327
+ }
328
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
329
+ metadata[:"x-goog-request-params"] ||= request_params_header
330
+
331
+ options.apply_defaults timeout: @config.rpcs.get_insight.timeout,
332
+ metadata: metadata,
333
+ retry_policy: @config.rpcs.get_insight.retry_policy
334
+ options.apply_defaults metadata: @config.metadata,
335
+ retry_policy: @config.retry_policy
336
+
337
+ @recommender_stub.call_rpc :get_insight, request, options: options do |response, operation|
338
+ yield response, operation if block_given?
339
+ return response
340
+ end
341
+ rescue ::GRPC::BadStatus => e
342
+ raise ::Google::Cloud::Error.from_error(e)
343
+ end
344
+
345
+ ##
346
+ # Marks the Insight State as Accepted. Users can use this method to
347
+ # indicate to the Recommender API that they have applied some action based
348
+ # on the insight. This stops the insight content from being updated.
349
+ #
350
+ # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires
351
+ # the recommender.*.update IAM permission for the specified insight.
352
+ #
353
+ # @overload mark_insight_accepted(request, options = nil)
354
+ # Pass arguments to `mark_insight_accepted` via a request object, either of type
355
+ # {::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest} or an equivalent Hash.
356
+ #
357
+ # @param request [::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Hash]
358
+ # A request object representing the call parameters. Required. To specify no
359
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
360
+ # @param options [::Gapic::CallOptions, ::Hash]
361
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
362
+ #
363
+ # @overload mark_insight_accepted(name: nil, state_metadata: nil, etag: nil)
364
+ # Pass arguments to `mark_insight_accepted` via keyword arguments. Note that at
365
+ # least one keyword argument is required. To specify no parameters, or to keep all
366
+ # the default parameter values, pass an empty Hash as a request object (see above).
367
+ #
368
+ # @param name [::String]
369
+ # Required. Name of the insight.
370
+ # @param state_metadata [::Hash{::String => ::String}]
371
+ # Optional. State properties user wish to include with this state. Full replace of the
372
+ # current state_metadata.
373
+ # @param etag [::String]
374
+ # Required. Fingerprint of the Insight. Provides optimistic locking.
375
+ #
376
+ # @yield [response, operation] Access the result along with the RPC operation
377
+ # @yieldparam response [::Google::Cloud::Recommender::V1::Insight]
378
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
379
+ #
380
+ # @return [::Google::Cloud::Recommender::V1::Insight]
381
+ #
382
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
383
+ #
384
+ def mark_insight_accepted request, options = nil
385
+ raise ::ArgumentError, "request must be provided" if request.nil?
386
+
387
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest
388
+
389
+ # Converts hash and nil to an options object
390
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
391
+
392
+ # Customize the options with defaults
393
+ metadata = @config.rpcs.mark_insight_accepted.metadata.to_h
394
+
395
+ # Set x-goog-api-client and x-goog-user-project headers
396
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
397
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
398
+ gapic_version: ::Google::Cloud::Recommender::V1::VERSION
399
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
400
+
401
+ header_params = {
402
+ "name" => request.name
403
+ }
404
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
405
+ metadata[:"x-goog-request-params"] ||= request_params_header
406
+
407
+ options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout,
408
+ metadata: metadata,
409
+ retry_policy: @config.rpcs.mark_insight_accepted.retry_policy
410
+ options.apply_defaults metadata: @config.metadata,
411
+ retry_policy: @config.retry_policy
412
+
413
+ @recommender_stub.call_rpc :mark_insight_accepted, request, options: options do |response, operation|
414
+ yield response, operation if block_given?
415
+ return response
416
+ end
417
+ rescue ::GRPC::BadStatus => e
418
+ raise ::Google::Cloud::Error.from_error(e)
419
+ end
420
+
172
421
  ##
173
422
  # Lists recommendations for a Cloud project. Requires the recommender.*.list
174
423
  # IAM permission for the specified recommender.
@@ -325,10 +574,10 @@ module Google
325
574
  end
326
575
 
327
576
  ##
328
- # Mark the Recommendation State as Claimed. Users can use this method to
577
+ # Marks the Recommendation State as Claimed. Users can use this method to
329
578
  # indicate to the Recommender API that they are starting to apply the
330
579
  # recommendation themselves. This stops the recommendation content from being
331
- # updated.
580
+ # updated. Associated insights are frozen and placed in the ACCEPTED state.
332
581
  #
333
582
  # MarkRecommendationClaimed can be applied to recommendations in CLAIMED,
334
583
  # SUCCEEDED, FAILED, or ACTIVE state.
@@ -407,10 +656,11 @@ module Google
407
656
  end
408
657
 
409
658
  ##
410
- # Mark the Recommendation State as Succeeded. Users can use this method to
659
+ # Marks the Recommendation State as Succeeded. Users can use this method to
411
660
  # indicate to the Recommender API that they have applied the recommendation
412
661
  # themselves, and the operation was successful. This stops the recommendation
413
- # content from being updated.
662
+ # content from being updated. Associated insights are frozen and placed in
663
+ # the ACCEPTED state.
414
664
  #
415
665
  # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE,
416
666
  # CLAIMED, SUCCEEDED, or FAILED state.
@@ -489,10 +739,11 @@ module Google
489
739
  end
490
740
 
491
741
  ##
492
- # Mark the Recommendation State as Failed. Users can use this method to
742
+ # Marks the Recommendation State as Failed. Users can use this method to
493
743
  # indicate to the Recommender API that they have applied the recommendation
494
744
  # themselves, and the operation failed. This stops the recommendation content
495
- # from being updated.
745
+ # from being updated. Associated insights are frozen and placed in the
746
+ # ACCEPTED state.
496
747
  #
497
748
  # MarkRecommendationFailed can be applied to recommendations in ACTIVE,
498
749
  # CLAIMED, SUCCEEDED, or FAILED state.
@@ -585,19 +836,19 @@ module Google
585
836
  #
586
837
  # # Examples
587
838
  #
588
- # To modify the global config, setting the timeout for list_recommendations
839
+ # To modify the global config, setting the timeout for list_insights
589
840
  # to 20 seconds, and all remaining timeouts to 10 seconds:
590
841
  #
591
842
  # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
592
843
  # config.timeout = 10.0
593
- # config.rpcs.list_recommendations.timeout = 20.0
844
+ # config.rpcs.list_insights.timeout = 20.0
594
845
  # end
595
846
  #
596
847
  # To apply the above configuration only to a new client:
597
848
  #
598
849
  # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
599
850
  # config.timeout = 10.0
600
- # config.rpcs.list_recommendations.timeout = 20.0
851
+ # config.rpcs.list_insights.timeout = 20.0
601
852
  # end
602
853
  #
603
854
  # @!attribute [rw] endpoint
@@ -655,7 +906,7 @@ module Google
655
906
 
656
907
  config_attr :endpoint, "recommender.googleapis.com", ::String
657
908
  config_attr :credentials, nil do |value|
658
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
909
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
659
910
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
660
911
  allowed.any? { |klass| klass === value }
661
912
  end
@@ -706,6 +957,21 @@ module Google
706
957
  # trigger a retry.
707
958
  #
708
959
  class Rpcs
960
+ ##
961
+ # RPC-specific configuration for `list_insights`
962
+ # @return [::Gapic::Config::Method]
963
+ #
964
+ attr_reader :list_insights
965
+ ##
966
+ # RPC-specific configuration for `get_insight`
967
+ # @return [::Gapic::Config::Method]
968
+ #
969
+ attr_reader :get_insight
970
+ ##
971
+ # RPC-specific configuration for `mark_insight_accepted`
972
+ # @return [::Gapic::Config::Method]
973
+ #
974
+ attr_reader :mark_insight_accepted
709
975
  ##
710
976
  # RPC-specific configuration for `list_recommendations`
711
977
  # @return [::Gapic::Config::Method]
@@ -734,6 +1000,12 @@ module Google
734
1000
 
735
1001
  # @private
736
1002
  def initialize parent_rpcs = nil
1003
+ list_insights_config = parent_rpcs&.list_insights if parent_rpcs&.respond_to? :list_insights
1004
+ @list_insights = ::Gapic::Config::Method.new list_insights_config
1005
+ get_insight_config = parent_rpcs&.get_insight if parent_rpcs&.respond_to? :get_insight
1006
+ @get_insight = ::Gapic::Config::Method.new get_insight_config
1007
+ mark_insight_accepted_config = parent_rpcs&.mark_insight_accepted if parent_rpcs&.respond_to? :mark_insight_accepted
1008
+ @mark_insight_accepted = ::Gapic::Config::Method.new mark_insight_accepted_config
737
1009
  list_recommendations_config = parent_rpcs&.list_recommendations if parent_rpcs&.respond_to? :list_recommendations
738
1010
  @list_recommendations = ::Gapic::Config::Method.new list_recommendations_config
739
1011
  get_recommendation_config = parent_rpcs&.get_recommendation if parent_rpcs&.respond_to? :get_recommendation
@@ -24,6 +24,46 @@ module Google
24
24
  module Recommender
25
25
  # Path helper methods for the Recommender API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified Insight resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param insight_type [String]
37
+ # @param insight [String]
38
+ #
39
+ # @return [::String]
40
+ def insight_path project:, location:, insight_type:, insight:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+ raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
44
+
45
+ "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
46
+ end
47
+
48
+ ##
49
+ # Create a fully-qualified InsightType resource string.
50
+ #
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/locations/{location}/insightTypes/{insight_type}`
54
+ #
55
+ # @param project [String]
56
+ # @param location [String]
57
+ # @param insight_type [String]
58
+ #
59
+ # @return [::String]
60
+ def insight_type_path project:, location:, insight_type:
61
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
62
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
63
+
64
+ "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}"
65
+ end
66
+
27
67
  ##
28
68
  # Create a fully-qualified Recommendation resource string.
29
69
  #
@@ -7,9 +7,28 @@ require 'google/api/annotations_pb'
7
7
  require 'google/api/client_pb'
8
8
  require 'google/api/field_behavior_pb'
9
9
  require 'google/api/resource_pb'
10
+ require 'google/cloud/recommender/v1/insight_pb'
10
11
  require 'google/cloud/recommender/v1/recommendation_pb'
11
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
13
  add_file("google/cloud/recommender/v1/recommender_service.proto", :syntax => :proto3) do
14
+ add_message "google.cloud.recommender.v1.ListInsightsRequest" do
15
+ optional :parent, :string, 1
16
+ optional :page_size, :int32, 2
17
+ optional :page_token, :string, 3
18
+ optional :filter, :string, 4
19
+ end
20
+ add_message "google.cloud.recommender.v1.ListInsightsResponse" do
21
+ repeated :insights, :message, 1, "google.cloud.recommender.v1.Insight"
22
+ optional :next_page_token, :string, 2
23
+ end
24
+ add_message "google.cloud.recommender.v1.GetInsightRequest" do
25
+ optional :name, :string, 1
26
+ end
27
+ add_message "google.cloud.recommender.v1.MarkInsightAcceptedRequest" do
28
+ optional :name, :string, 1
29
+ map :state_metadata, :string, :string, 2
30
+ optional :etag, :string, 3
31
+ end
13
32
  add_message "google.cloud.recommender.v1.ListRecommendationsRequest" do
14
33
  optional :parent, :string, 1
15
34
  optional :page_size, :int32, 2
@@ -45,6 +64,10 @@ module Google
45
64
  module Cloud
46
65
  module Recommender
47
66
  module V1
67
+ ListInsightsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsRequest").msgclass
68
+ ListInsightsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListInsightsResponse").msgclass
69
+ GetInsightRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetInsightRequest").msgclass
70
+ MarkInsightAcceptedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.MarkInsightAcceptedRequest").msgclass
48
71
  ListRecommendationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsRequest").msgclass
49
72
  ListRecommendationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.ListRecommendationsResponse").msgclass
50
73
  GetRecommendationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recommender.v1.GetRecommendationRequest").msgclass
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/cloud/recommender/v1/recommender_service.proto for package 'google.cloud.recommender.v1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
  require 'grpc'
21
20
  require 'google/cloud/recommender/v1/recommender_service_pb'
@@ -25,10 +24,10 @@ module Google
25
24
  module Recommender
26
25
  module V1
27
26
  module Recommender
28
- # Provides recommendations for cloud customers for various categories like
29
- # performance optimization, cost savings, reliability, feature discovery, etc.
30
- # These recommendations are generated automatically based on analysis of user
31
- # resources, configuration and monitoring metrics.
27
+ # Provides insights and recommendations for cloud customers for various
28
+ # categories like performance optimization, cost savings, reliability, feature
29
+ # discovery, etc. Insights and recommendations are generated automatically
30
+ # based on analysis of user resources, configuration and monitoring metrics.
32
31
  class Service
33
32
 
34
33
  include GRPC::GenericService
@@ -37,45 +36,60 @@ module Google
37
36
  self.unmarshal_class_method = :decode
38
37
  self.service_name = 'google.cloud.recommender.v1.Recommender'
39
38
 
39
+ # Lists insights for a Cloud project. Requires the recommender.*.list IAM
40
+ # permission for the specified insight type.
41
+ rpc :ListInsights, ::Google::Cloud::Recommender::V1::ListInsightsRequest, ::Google::Cloud::Recommender::V1::ListInsightsResponse
42
+ # Gets the requested insight. Requires the recommender.*.get IAM permission
43
+ # for the specified insight type.
44
+ rpc :GetInsight, ::Google::Cloud::Recommender::V1::GetInsightRequest, ::Google::Cloud::Recommender::V1::Insight
45
+ # Marks the Insight State as Accepted. Users can use this method to
46
+ # indicate to the Recommender API that they have applied some action based
47
+ # on the insight. This stops the insight content from being updated.
48
+ #
49
+ # MarkInsightAccepted can be applied to insights in ACTIVE state. Requires
50
+ # the recommender.*.update IAM permission for the specified insight.
51
+ rpc :MarkInsightAccepted, ::Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest, ::Google::Cloud::Recommender::V1::Insight
40
52
  # Lists recommendations for a Cloud project. Requires the recommender.*.list
41
53
  # IAM permission for the specified recommender.
42
- rpc :ListRecommendations, ListRecommendationsRequest, ListRecommendationsResponse
54
+ rpc :ListRecommendations, ::Google::Cloud::Recommender::V1::ListRecommendationsRequest, ::Google::Cloud::Recommender::V1::ListRecommendationsResponse
43
55
  # Gets the requested recommendation. Requires the recommender.*.get
44
56
  # IAM permission for the specified recommender.
45
- rpc :GetRecommendation, GetRecommendationRequest, Recommendation
46
- # Mark the Recommendation State as Claimed. Users can use this method to
57
+ rpc :GetRecommendation, ::Google::Cloud::Recommender::V1::GetRecommendationRequest, ::Google::Cloud::Recommender::V1::Recommendation
58
+ # Marks the Recommendation State as Claimed. Users can use this method to
47
59
  # indicate to the Recommender API that they are starting to apply the
48
60
  # recommendation themselves. This stops the recommendation content from being
49
- # updated.
61
+ # updated. Associated insights are frozen and placed in the ACCEPTED state.
50
62
  #
51
63
  # MarkRecommendationClaimed can be applied to recommendations in CLAIMED,
52
64
  # SUCCEEDED, FAILED, or ACTIVE state.
53
65
  #
54
66
  # Requires the recommender.*.update IAM permission for the specified
55
67
  # recommender.
56
- rpc :MarkRecommendationClaimed, MarkRecommendationClaimedRequest, Recommendation
57
- # Mark the Recommendation State as Succeeded. Users can use this method to
68
+ rpc :MarkRecommendationClaimed, ::Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest, ::Google::Cloud::Recommender::V1::Recommendation
69
+ # Marks the Recommendation State as Succeeded. Users can use this method to
58
70
  # indicate to the Recommender API that they have applied the recommendation
59
71
  # themselves, and the operation was successful. This stops the recommendation
60
- # content from being updated.
72
+ # content from being updated. Associated insights are frozen and placed in
73
+ # the ACCEPTED state.
61
74
  #
62
75
  # MarkRecommendationSucceeded can be applied to recommendations in ACTIVE,
63
76
  # CLAIMED, SUCCEEDED, or FAILED state.
64
77
  #
65
78
  # Requires the recommender.*.update IAM permission for the specified
66
79
  # recommender.
67
- rpc :MarkRecommendationSucceeded, MarkRecommendationSucceededRequest, Recommendation
68
- # Mark the Recommendation State as Failed. Users can use this method to
80
+ rpc :MarkRecommendationSucceeded, ::Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest, ::Google::Cloud::Recommender::V1::Recommendation
81
+ # Marks the Recommendation State as Failed. Users can use this method to
69
82
  # indicate to the Recommender API that they have applied the recommendation
70
83
  # themselves, and the operation failed. This stops the recommendation content
71
- # from being updated.
84
+ # from being updated. Associated insights are frozen and placed in the
85
+ # ACCEPTED state.
72
86
  #
73
87
  # MarkRecommendationFailed can be applied to recommendations in ACTIVE,
74
88
  # CLAIMED, SUCCEEDED, or FAILED state.
75
89
  #
76
90
  # Requires the recommender.*.update IAM permission for the specified
77
91
  # recommender.
78
- rpc :MarkRecommendationFailed, MarkRecommendationFailedRequest, Recommendation
92
+ rpc :MarkRecommendationFailed, ::Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest, ::Google::Cloud::Recommender::V1::Recommendation
79
93
  end
80
94
 
81
95
  Stub = Service.rpc_stub_class
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
- VERSION = "0.4.2"
24
+ VERSION = "0.5.3"
25
25
  end
26
26
  end
27
27
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Recommender
23
+ module V1
24
+ # An insight along with the information used to derive the insight. The insight
25
+ # may have associated recomendations as well.
26
+ # @!attribute [rw] name
27
+ # @return [::String]
28
+ # Name of the insight.
29
+ # @!attribute [rw] description
30
+ # @return [::String]
31
+ # Free-form human readable summary in English. The maximum length is 500
32
+ # characters.
33
+ # @!attribute [rw] target_resources
34
+ # @return [::Array<::String>]
35
+ # Fully qualified resource names that this insight is targeting.
36
+ # @!attribute [rw] insight_subtype
37
+ # @return [::String]
38
+ # Insight subtype. Insight content schema will be stable for a given subtype.
39
+ # @!attribute [rw] content
40
+ # @return [::Google::Protobuf::Struct]
41
+ # A struct of custom fields to explain the insight.
42
+ # Example: "grantedPermissionsCount": "1000"
43
+ # @!attribute [rw] last_refresh_time
44
+ # @return [::Google::Protobuf::Timestamp]
45
+ # Timestamp of the latest data used to generate the insight.
46
+ # @!attribute [rw] observation_period
47
+ # @return [::Google::Protobuf::Duration]
48
+ # Observation period that led to the insight. The source data used to
49
+ # generate the insight ends at last_refresh_time and begins at
50
+ # (last_refresh_time - observation_period).
51
+ # @!attribute [rw] state_info
52
+ # @return [::Google::Cloud::Recommender::V1::InsightStateInfo]
53
+ # Information state and metadata.
54
+ # @!attribute [rw] category
55
+ # @return [::Google::Cloud::Recommender::V1::Insight::Category]
56
+ # Category being targeted by the insight.
57
+ # @!attribute [rw] etag
58
+ # @return [::String]
59
+ # Fingerprint of the Insight. Provides optimistic locking when updating
60
+ # states.
61
+ # @!attribute [rw] associated_recommendations
62
+ # @return [::Array<::Google::Cloud::Recommender::V1::Insight::RecommendationReference>]
63
+ # Recommendations derived from this insight.
64
+ class Insight
65
+ include ::Google::Protobuf::MessageExts
66
+ extend ::Google::Protobuf::MessageExts::ClassMethods
67
+
68
+ # Reference to an associated recommendation.
69
+ # @!attribute [rw] recommendation
70
+ # @return [::String]
71
+ # Recommendation resource name, e.g.
72
+ # projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID]/recommendations/[RECOMMENDATION_ID]
73
+ class RecommendationReference
74
+ include ::Google::Protobuf::MessageExts
75
+ extend ::Google::Protobuf::MessageExts::ClassMethods
76
+ end
77
+
78
+ # Insight category.
79
+ module Category
80
+ # Unspecified category.
81
+ CATEGORY_UNSPECIFIED = 0
82
+
83
+ # The insight is related to cost.
84
+ COST = 1
85
+
86
+ # The insight is related to security.
87
+ SECURITY = 2
88
+
89
+ # The insight is related to performance.
90
+ PERFORMANCE = 3
91
+
92
+ # This insight is related to manageability.
93
+ MANAGEABILITY = 4
94
+ end
95
+ end
96
+
97
+ # Information related to insight state.
98
+ # @!attribute [rw] state
99
+ # @return [::Google::Cloud::Recommender::V1::InsightStateInfo::State]
100
+ # Insight state.
101
+ # @!attribute [rw] state_metadata
102
+ # @return [::Google::Protobuf::Map{::String => ::String}]
103
+ # A map of metadata for the state, provided by user or automations systems.
104
+ class InsightStateInfo
105
+ include ::Google::Protobuf::MessageExts
106
+ extend ::Google::Protobuf::MessageExts::ClassMethods
107
+
108
+ # @!attribute [rw] key
109
+ # @return [::String]
110
+ # @!attribute [rw] value
111
+ # @return [::String]
112
+ class StateMetadataEntry
113
+ include ::Google::Protobuf::MessageExts
114
+ extend ::Google::Protobuf::MessageExts::ClassMethods
115
+ end
116
+
117
+ # Represents insight state.
118
+ module State
119
+ # Unspecified state.
120
+ STATE_UNSPECIFIED = 0
121
+
122
+ # Insight is active. Content for ACTIVE insights can be updated by Google.
123
+ # ACTIVE insights can be marked DISMISSED OR ACCEPTED.
124
+ ACTIVE = 1
125
+
126
+ # Some action has been taken based on this insight. Insights become
127
+ # accepted when a recommendation derived from the insight has been marked
128
+ # CLAIMED, SUCCEEDED, or FAILED. ACTIVE insights can also be marked
129
+ # ACCEPTED explicitly. Content for ACCEPTED insights is immutable. ACCEPTED
130
+ # insights can only be marked ACCEPTED (which may update state metadata).
131
+ ACCEPTED = 2
132
+
133
+ # Insight is dismissed. Content for DISMISSED insights can be updated by
134
+ # Google. DISMISSED insights can be marked as ACTIVE.
135
+ DISMISSED = 3
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -64,9 +64,22 @@ module Google
64
64
  # @return [::String]
65
65
  # Fingerprint of the Recommendation. Provides optimistic locking when
66
66
  # updating states.
67
+ # @!attribute [rw] associated_insights
68
+ # @return [::Array<::Google::Cloud::Recommender::V1::Recommendation::InsightReference>]
69
+ # Insights that led to this recommendation.
67
70
  class Recommendation
68
71
  include ::Google::Protobuf::MessageExts
69
72
  extend ::Google::Protobuf::MessageExts::ClassMethods
73
+
74
+ # Reference to an associated insight.
75
+ # @!attribute [rw] insight
76
+ # @return [::String]
77
+ # Insight resource name, e.g.
78
+ # projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]/insights/[INSIGHT_ID]
79
+ class InsightReference
80
+ include ::Google::Protobuf::MessageExts
81
+ extend ::Google::Protobuf::MessageExts::ClassMethods
82
+ end
70
83
  end
71
84
 
72
85
  # Contains what resources are changing and how they are changing.
@@ -264,7 +277,7 @@ module Google
264
277
  extend ::Google::Protobuf::MessageExts::ClassMethods
265
278
  end
266
279
 
267
- # Represents Recommendation State
280
+ # Represents Recommendation State.
268
281
  module State
269
282
  # Default state. Don't use directly.
270
283
  STATE_UNSPECIFIED = 0
@@ -21,6 +21,85 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
+ # Request for the `ListInsights` method.
25
+ # @!attribute [rw] parent
26
+ # @return [::String]
27
+ # Required. The container resource on which to execute the request.
28
+ # Acceptable formats:
29
+ #
30
+ # 1.
31
+ # "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[INSIGHT_TYPE_ID]",
32
+ #
33
+ # LOCATION here refers to GCP Locations:
34
+ # https://cloud.google.com/about/locations/
35
+ # @!attribute [rw] page_size
36
+ # @return [::Integer]
37
+ # Optional. The maximum number of results to return from this request. Non-positive
38
+ # values are ignored. If not specified, the server will determine the number
39
+ # of results to return.
40
+ # @!attribute [rw] page_token
41
+ # @return [::String]
42
+ # Optional. If present, retrieves the next batch of results from the preceding call to
43
+ # this method. `page_token` must be the value of `next_page_token` from the
44
+ # previous response. The values of other method parameters must be identical
45
+ # to those in the previous call.
46
+ # @!attribute [rw] filter
47
+ # @return [::String]
48
+ # Optional. Filter expression to restrict the insights returned. Supported
49
+ # filter fields: state
50
+ # Eg: `state:"DISMISSED" or state:"ACTIVE"
51
+ class ListInsightsRequest
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+ end
55
+
56
+ # Response to the `ListInsights` method.
57
+ # @!attribute [rw] insights
58
+ # @return [::Array<::Google::Cloud::Recommender::V1::Insight>]
59
+ # The set of insights for the `parent` resource.
60
+ # @!attribute [rw] next_page_token
61
+ # @return [::String]
62
+ # A token that can be used to request the next page of results. This field is
63
+ # empty if there are no additional results.
64
+ class ListInsightsResponse
65
+ include ::Google::Protobuf::MessageExts
66
+ extend ::Google::Protobuf::MessageExts::ClassMethods
67
+ end
68
+
69
+ # Request to the `GetInsight` method.
70
+ # @!attribute [rw] name
71
+ # @return [::String]
72
+ # Required. Name of the insight.
73
+ class GetInsightRequest
74
+ include ::Google::Protobuf::MessageExts
75
+ extend ::Google::Protobuf::MessageExts::ClassMethods
76
+ end
77
+
78
+ # Request for the `MarkInsightAccepted` method.
79
+ # @!attribute [rw] name
80
+ # @return [::String]
81
+ # Required. Name of the insight.
82
+ # @!attribute [rw] state_metadata
83
+ # @return [::Google::Protobuf::Map{::String => ::String}]
84
+ # Optional. State properties user wish to include with this state. Full replace of the
85
+ # current state_metadata.
86
+ # @!attribute [rw] etag
87
+ # @return [::String]
88
+ # Required. Fingerprint of the Insight. Provides optimistic locking.
89
+ class MarkInsightAcceptedRequest
90
+ include ::Google::Protobuf::MessageExts
91
+ extend ::Google::Protobuf::MessageExts::ClassMethods
92
+
93
+ # @!attribute [rw] key
94
+ # @return [::String]
95
+ # @!attribute [rw] value
96
+ # @return [::String]
97
+ class StateMetadataEntry
98
+ include ::Google::Protobuf::MessageExts
99
+ extend ::Google::Protobuf::MessageExts::ClassMethods
100
+ end
101
+ end
102
+
24
103
  # Request for the `ListRecommendations` method.
25
104
  # @!attribute [rw] parent
26
105
  # @return [::String]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-recommender-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-06 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-errors
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +163,7 @@ files:
163
163
  - README.md
164
164
  - lib/google-cloud-recommender-v1.rb
165
165
  - lib/google/cloud/recommender/v1.rb
166
+ - lib/google/cloud/recommender/v1/insight_pb.rb
166
167
  - lib/google/cloud/recommender/v1/recommendation_pb.rb
167
168
  - lib/google/cloud/recommender/v1/recommender.rb
168
169
  - lib/google/cloud/recommender/v1/recommender/client.rb
@@ -174,6 +175,7 @@ files:
174
175
  - proto_docs/README.md
175
176
  - proto_docs/google/api/field_behavior.rb
176
177
  - proto_docs/google/api/resource.rb
178
+ - proto_docs/google/cloud/recommender/v1/insight.rb
177
179
  - proto_docs/google/cloud/recommender/v1/recommendation.rb
178
180
  - proto_docs/google/cloud/recommender/v1/recommender_service.rb
179
181
  - proto_docs/google/protobuf/duration.rb
@@ -199,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
201
  - !ruby/object:Gem::Version
200
202
  version: '0'
201
203
  requirements: []
202
- rubygems_version: 3.1.3
204
+ rubygems_version: 3.1.4
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: API Client library for the Recommender V1 API