google-cloud-recommender-v1 0.8.1 → 0.8.5

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: 79a6ef0459d617e181f991ce523c8f46bd0635a10a8ca72f2fc110d7c36b0c94
4
- data.tar.gz: a88658f57c0466eb0829b911bbe9df205a0916b91cf1393afe5b3c49346f2faf
3
+ metadata.gz: a7f5fe1e46249992044783960760455a1362306c2910ab06dfc6f3f631935990
4
+ data.tar.gz: e1c7a165f33c14e38db363e58415235b897eb9d7065f537447b11579bda29d11
5
5
  SHA512:
6
- metadata.gz: 6a6ac649040ff69543982a4d8bfea4e7b73b6fdb81376db7827cc2f39faa3ef7db6db4599e5f9e2388ef034f75bd923fdf5f4d4a6b3c4c02638ccb4a5019ed4b
7
- data.tar.gz: 2914dd905b95a9196352a36e20f8024fe685ea825ad134ece20abf8e922e45273ab93bfba816c7192dfea6a2b23624656c910d7afbcbfc12d95954a367c4d429
6
+ metadata.gz: 0afde07778310a614f90567db054e377105c8fe0d7348fc952aa368aeb06a42f134754493a071ceb2cfaf146318ef2406856a8a8a8e8d131cbcee47d4257724e
7
+ data.tar.gz: ef1896f282823ea9fc89c0907d3c0063c2d3ac904686b95041cc496d02fedaf681e991801bf773ffada97cfeded6663f4bb4a522d42e4ec46a1651cbef78b8fc
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-recommender-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Recommender::V1::Recommender::Credentials}):
68
68
 
69
- 1. `RECOMMENDER_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `RECOMMENDER_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `RECOMMENDER_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `RECOMMENDER_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/recommender/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/recommender/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/recommender/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/recommender/v1"
34
34
 
35
35
  client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Recommender::V1::ListInsightsRequest.new # (request fields as keyword arguments...)
37
37
  response = client.list_insights request
38
38
  ```
39
39
 
@@ -1,12 +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
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/protobuf/duration_pb'
8
6
  require 'google/protobuf/struct_pb'
9
7
  require 'google/protobuf/timestamp_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/cloud/recommender/v1/insight.proto", :syntax => :proto3) do
12
12
  add_message "google.cloud.recommender.v1.Insight" do
@@ -1,13 +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
-
6
4
  require 'google/api/resource_pb'
7
5
  require 'google/protobuf/duration_pb'
8
6
  require 'google/protobuf/struct_pb'
9
7
  require 'google/protobuf/timestamp_pb'
10
8
  require 'google/type/money_pb'
9
+ require 'google/protobuf'
10
+
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  add_file("google/cloud/recommender/v1/recommendation.proto", :syntax => :proto3) do
13
13
  add_message "google.cloud.recommender.v1.Recommendation" do
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::Recommender::V1::Recommender::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all Recommender clients:
50
- #
51
- # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all Recommender clients
50
+ # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -70,36 +69,24 @@ module Google
70
69
 
71
70
  default_config.rpcs.list_insights.timeout = 60.0
72
71
  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]
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
73
  }
78
74
 
79
75
  default_config.rpcs.get_insight.timeout = 60.0
80
76
  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]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
78
  }
86
79
 
87
80
  default_config.rpcs.mark_insight_accepted.timeout = 60.0
88
81
 
89
82
  default_config.rpcs.list_recommendations.timeout = 60.0
90
83
  default_config.rpcs.list_recommendations.retry_policy = {
91
- initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
85
  }
96
86
 
97
87
  default_config.rpcs.get_recommendation.timeout = 60.0
98
88
  default_config.rpcs.get_recommendation.retry_policy = {
99
- initial_delay: 0.1,
100
- max_delay: 60.0,
101
- multiplier: 1.3,
102
- retry_codes: [4, 14]
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
103
90
  }
104
91
 
105
92
  default_config.rpcs.mark_recommendation_claimed.timeout = 60.0
@@ -137,19 +124,15 @@ module Google
137
124
  ##
138
125
  # Create a new Recommender client object.
139
126
  #
140
- # ## Examples
141
- #
142
- # To create a new Recommender client with the default
143
- # configuration:
144
- #
145
- # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
127
+ # @example
146
128
  #
147
- # To create a new Recommender client with a custom
148
- # configuration:
129
+ # # Create a client using the default configuration
130
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new
149
131
  #
150
- # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
151
- # config.timeout = 10.0
152
- # end
132
+ # # Create a client using a custom configuration
133
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
134
+ # config.timeout = 10.0
135
+ # end
153
136
  #
154
137
  # @yield [config] Configure the Recommender client.
155
138
  # @yieldparam config [Client::Configuration]
@@ -169,14 +152,13 @@ module Google
169
152
 
170
153
  # Create credentials
171
154
  credentials = @config.credentials
172
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
155
+ # Use self-signed JWT if the endpoint is unchanged from default,
173
156
  # but only if the default endpoint does not have a region prefix.
174
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
175
- @config.endpoint == Client.configure.endpoint &&
157
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
176
158
  !@config.endpoint.split(".").first.include?("-")
177
159
  credentials ||= Credentials.default scope: @config.scope,
178
160
  enable_self_signed_jwt: enable_self_signed_jwt
179
- if credentials.is_a?(String) || credentials.is_a?(Hash)
161
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
180
162
  credentials = Credentials.new credentials, scope: @config.scope
181
163
  end
182
164
  @quota_project_id = @config.quota_project
@@ -245,6 +227,27 @@ module Google
245
227
  #
246
228
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
247
229
  #
230
+ # @example Basic example
231
+ # require "google/cloud/recommender/v1"
232
+ #
233
+ # # Create a client object. The client can be reused for multiple calls.
234
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
235
+ #
236
+ # # Create a request. To set request fields, pass in keyword arguments.
237
+ # request = Google::Cloud::Recommender::V1::ListInsightsRequest.new
238
+ #
239
+ # # Call the list_insights method.
240
+ # result = client.list_insights request
241
+ #
242
+ # # The returned object is of type Gapic::PagedEnumerable. You can
243
+ # # iterate over all elements by calling #each, and the enumerable
244
+ # # will lazily make API calls to fetch subsequent pages. Other
245
+ # # methods are also available for managing paging directly.
246
+ # result.each do |response|
247
+ # # Each element is of type ::Google::Cloud::Recommender::V1::Insight.
248
+ # p response
249
+ # end
250
+ #
248
251
  def list_insights request, options = nil
249
252
  raise ::ArgumentError, "request must be provided" if request.nil?
250
253
 
@@ -262,16 +265,20 @@ module Google
262
265
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
263
266
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
264
267
 
265
- header_params = {
266
- "parent" => request.parent
267
- }
268
+ header_params = {}
269
+ if request.parent
270
+ header_params["parent"] = request.parent
271
+ end
272
+
268
273
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
269
274
  metadata[:"x-goog-request-params"] ||= request_params_header
270
275
 
271
276
  options.apply_defaults timeout: @config.rpcs.list_insights.timeout,
272
277
  metadata: metadata,
273
278
  retry_policy: @config.rpcs.list_insights.retry_policy
274
- options.apply_defaults metadata: @config.metadata,
279
+
280
+ options.apply_defaults timeout: @config.timeout,
281
+ metadata: @config.metadata,
275
282
  retry_policy: @config.retry_policy
276
283
 
277
284
  @recommender_stub.call_rpc :list_insights, request, options: options do |response, operation|
@@ -313,6 +320,21 @@ module Google
313
320
  #
314
321
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
322
  #
323
+ # @example Basic example
324
+ # require "google/cloud/recommender/v1"
325
+ #
326
+ # # Create a client object. The client can be reused for multiple calls.
327
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
328
+ #
329
+ # # Create a request. To set request fields, pass in keyword arguments.
330
+ # request = Google::Cloud::Recommender::V1::GetInsightRequest.new
331
+ #
332
+ # # Call the get_insight method.
333
+ # result = client.get_insight request
334
+ #
335
+ # # The returned object is of type Google::Cloud::Recommender::V1::Insight.
336
+ # p result
337
+ #
316
338
  def get_insight request, options = nil
317
339
  raise ::ArgumentError, "request must be provided" if request.nil?
318
340
 
@@ -330,16 +352,20 @@ module Google
330
352
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
331
353
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
354
 
333
- header_params = {
334
- "name" => request.name
335
- }
355
+ header_params = {}
356
+ if request.name
357
+ header_params["name"] = request.name
358
+ end
359
+
336
360
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
337
361
  metadata[:"x-goog-request-params"] ||= request_params_header
338
362
 
339
363
  options.apply_defaults timeout: @config.rpcs.get_insight.timeout,
340
364
  metadata: metadata,
341
365
  retry_policy: @config.rpcs.get_insight.retry_policy
342
- options.apply_defaults metadata: @config.metadata,
366
+
367
+ options.apply_defaults timeout: @config.timeout,
368
+ metadata: @config.metadata,
343
369
  retry_policy: @config.retry_policy
344
370
 
345
371
  @recommender_stub.call_rpc :get_insight, request, options: options do |response, operation|
@@ -389,6 +415,21 @@ module Google
389
415
  #
390
416
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
391
417
  #
418
+ # @example Basic example
419
+ # require "google/cloud/recommender/v1"
420
+ #
421
+ # # Create a client object. The client can be reused for multiple calls.
422
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
423
+ #
424
+ # # Create a request. To set request fields, pass in keyword arguments.
425
+ # request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new
426
+ #
427
+ # # Call the mark_insight_accepted method.
428
+ # result = client.mark_insight_accepted request
429
+ #
430
+ # # The returned object is of type Google::Cloud::Recommender::V1::Insight.
431
+ # p result
432
+ #
392
433
  def mark_insight_accepted request, options = nil
393
434
  raise ::ArgumentError, "request must be provided" if request.nil?
394
435
 
@@ -406,16 +447,20 @@ module Google
406
447
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
407
448
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
408
449
 
409
- header_params = {
410
- "name" => request.name
411
- }
450
+ header_params = {}
451
+ if request.name
452
+ header_params["name"] = request.name
453
+ end
454
+
412
455
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
413
456
  metadata[:"x-goog-request-params"] ||= request_params_header
414
457
 
415
458
  options.apply_defaults timeout: @config.rpcs.mark_insight_accepted.timeout,
416
459
  metadata: metadata,
417
460
  retry_policy: @config.rpcs.mark_insight_accepted.retry_policy
418
- options.apply_defaults metadata: @config.metadata,
461
+
462
+ options.apply_defaults timeout: @config.timeout,
463
+ metadata: @config.metadata,
419
464
  retry_policy: @config.retry_policy
420
465
 
421
466
  @recommender_stub.call_rpc :mark_insight_accepted, request, options: options do |response, operation|
@@ -478,6 +523,27 @@ module Google
478
523
  #
479
524
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
480
525
  #
526
+ # @example Basic example
527
+ # require "google/cloud/recommender/v1"
528
+ #
529
+ # # Create a client object. The client can be reused for multiple calls.
530
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
531
+ #
532
+ # # Create a request. To set request fields, pass in keyword arguments.
533
+ # request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new
534
+ #
535
+ # # Call the list_recommendations method.
536
+ # result = client.list_recommendations request
537
+ #
538
+ # # The returned object is of type Gapic::PagedEnumerable. You can
539
+ # # iterate over all elements by calling #each, and the enumerable
540
+ # # will lazily make API calls to fetch subsequent pages. Other
541
+ # # methods are also available for managing paging directly.
542
+ # result.each do |response|
543
+ # # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation.
544
+ # p response
545
+ # end
546
+ #
481
547
  def list_recommendations request, options = nil
482
548
  raise ::ArgumentError, "request must be provided" if request.nil?
483
549
 
@@ -495,16 +561,20 @@ module Google
495
561
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
496
562
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
497
563
 
498
- header_params = {
499
- "parent" => request.parent
500
- }
564
+ header_params = {}
565
+ if request.parent
566
+ header_params["parent"] = request.parent
567
+ end
568
+
501
569
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
502
570
  metadata[:"x-goog-request-params"] ||= request_params_header
503
571
 
504
572
  options.apply_defaults timeout: @config.rpcs.list_recommendations.timeout,
505
573
  metadata: metadata,
506
574
  retry_policy: @config.rpcs.list_recommendations.retry_policy
507
- options.apply_defaults metadata: @config.metadata,
575
+
576
+ options.apply_defaults timeout: @config.timeout,
577
+ metadata: @config.metadata,
508
578
  retry_policy: @config.retry_policy
509
579
 
510
580
  @recommender_stub.call_rpc :list_recommendations, request, options: options do |response, operation|
@@ -546,6 +616,21 @@ module Google
546
616
  #
547
617
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
548
618
  #
619
+ # @example Basic example
620
+ # require "google/cloud/recommender/v1"
621
+ #
622
+ # # Create a client object. The client can be reused for multiple calls.
623
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
624
+ #
625
+ # # Create a request. To set request fields, pass in keyword arguments.
626
+ # request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new
627
+ #
628
+ # # Call the get_recommendation method.
629
+ # result = client.get_recommendation request
630
+ #
631
+ # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation.
632
+ # p result
633
+ #
549
634
  def get_recommendation request, options = nil
550
635
  raise ::ArgumentError, "request must be provided" if request.nil?
551
636
 
@@ -563,16 +648,20 @@ module Google
563
648
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
564
649
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
565
650
 
566
- header_params = {
567
- "name" => request.name
568
- }
651
+ header_params = {}
652
+ if request.name
653
+ header_params["name"] = request.name
654
+ end
655
+
569
656
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
570
657
  metadata[:"x-goog-request-params"] ||= request_params_header
571
658
 
572
659
  options.apply_defaults timeout: @config.rpcs.get_recommendation.timeout,
573
660
  metadata: metadata,
574
661
  retry_policy: @config.rpcs.get_recommendation.retry_policy
575
- options.apply_defaults metadata: @config.metadata,
662
+
663
+ options.apply_defaults timeout: @config.timeout,
664
+ metadata: @config.metadata,
576
665
  retry_policy: @config.retry_policy
577
666
 
578
667
  @recommender_stub.call_rpc :get_recommendation, request, options: options do |response, operation|
@@ -615,8 +704,8 @@ module Google
615
704
  # @param state_metadata [::Hash{::String => ::String}]
616
705
  # State properties to include with this state. Overwrites any existing
617
706
  # `state_metadata`.
618
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
619
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
707
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
708
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
620
709
  # @param etag [::String]
621
710
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
622
711
  #
@@ -628,6 +717,21 @@ module Google
628
717
  #
629
718
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
630
719
  #
720
+ # @example Basic example
721
+ # require "google/cloud/recommender/v1"
722
+ #
723
+ # # Create a client object. The client can be reused for multiple calls.
724
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
725
+ #
726
+ # # Create a request. To set request fields, pass in keyword arguments.
727
+ # request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new
728
+ #
729
+ # # Call the mark_recommendation_claimed method.
730
+ # result = client.mark_recommendation_claimed request
731
+ #
732
+ # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation.
733
+ # p result
734
+ #
631
735
  def mark_recommendation_claimed request, options = nil
632
736
  raise ::ArgumentError, "request must be provided" if request.nil?
633
737
 
@@ -645,16 +749,20 @@ module Google
645
749
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
646
750
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
647
751
 
648
- header_params = {
649
- "name" => request.name
650
- }
752
+ header_params = {}
753
+ if request.name
754
+ header_params["name"] = request.name
755
+ end
756
+
651
757
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
652
758
  metadata[:"x-goog-request-params"] ||= request_params_header
653
759
 
654
760
  options.apply_defaults timeout: @config.rpcs.mark_recommendation_claimed.timeout,
655
761
  metadata: metadata,
656
762
  retry_policy: @config.rpcs.mark_recommendation_claimed.retry_policy
657
- options.apply_defaults metadata: @config.metadata,
763
+
764
+ options.apply_defaults timeout: @config.timeout,
765
+ metadata: @config.metadata,
658
766
  retry_policy: @config.retry_policy
659
767
 
660
768
  @recommender_stub.call_rpc :mark_recommendation_claimed, request, options: options do |response, operation|
@@ -698,8 +806,8 @@ module Google
698
806
  # @param state_metadata [::Hash{::String => ::String}]
699
807
  # State properties to include with this state. Overwrites any existing
700
808
  # `state_metadata`.
701
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
702
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
809
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
810
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
703
811
  # @param etag [::String]
704
812
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
705
813
  #
@@ -711,6 +819,21 @@ module Google
711
819
  #
712
820
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
713
821
  #
822
+ # @example Basic example
823
+ # require "google/cloud/recommender/v1"
824
+ #
825
+ # # Create a client object. The client can be reused for multiple calls.
826
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
827
+ #
828
+ # # Create a request. To set request fields, pass in keyword arguments.
829
+ # request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new
830
+ #
831
+ # # Call the mark_recommendation_succeeded method.
832
+ # result = client.mark_recommendation_succeeded request
833
+ #
834
+ # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation.
835
+ # p result
836
+ #
714
837
  def mark_recommendation_succeeded request, options = nil
715
838
  raise ::ArgumentError, "request must be provided" if request.nil?
716
839
 
@@ -728,16 +851,20 @@ module Google
728
851
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
729
852
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
730
853
 
731
- header_params = {
732
- "name" => request.name
733
- }
854
+ header_params = {}
855
+ if request.name
856
+ header_params["name"] = request.name
857
+ end
858
+
734
859
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
735
860
  metadata[:"x-goog-request-params"] ||= request_params_header
736
861
 
737
862
  options.apply_defaults timeout: @config.rpcs.mark_recommendation_succeeded.timeout,
738
863
  metadata: metadata,
739
864
  retry_policy: @config.rpcs.mark_recommendation_succeeded.retry_policy
740
- options.apply_defaults metadata: @config.metadata,
865
+
866
+ options.apply_defaults timeout: @config.timeout,
867
+ metadata: @config.metadata,
741
868
  retry_policy: @config.retry_policy
742
869
 
743
870
  @recommender_stub.call_rpc :mark_recommendation_succeeded, request, options: options do |response, operation|
@@ -781,8 +908,8 @@ module Google
781
908
  # @param state_metadata [::Hash{::String => ::String}]
782
909
  # State properties to include with this state. Overwrites any existing
783
910
  # `state_metadata`.
784
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
785
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
911
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
912
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
786
913
  # @param etag [::String]
787
914
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
788
915
  #
@@ -794,6 +921,21 @@ module Google
794
921
  #
795
922
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
796
923
  #
924
+ # @example Basic example
925
+ # require "google/cloud/recommender/v1"
926
+ #
927
+ # # Create a client object. The client can be reused for multiple calls.
928
+ # client = Google::Cloud::Recommender::V1::Recommender::Client.new
929
+ #
930
+ # # Create a request. To set request fields, pass in keyword arguments.
931
+ # request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new
932
+ #
933
+ # # Call the mark_recommendation_failed method.
934
+ # result = client.mark_recommendation_failed request
935
+ #
936
+ # # The returned object is of type Google::Cloud::Recommender::V1::Recommendation.
937
+ # p result
938
+ #
797
939
  def mark_recommendation_failed request, options = nil
798
940
  raise ::ArgumentError, "request must be provided" if request.nil?
799
941
 
@@ -811,16 +953,20 @@ module Google
811
953
  gapic_version: ::Google::Cloud::Recommender::V1::VERSION
812
954
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
813
955
 
814
- header_params = {
815
- "name" => request.name
816
- }
956
+ header_params = {}
957
+ if request.name
958
+ header_params["name"] = request.name
959
+ end
960
+
817
961
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
818
962
  metadata[:"x-goog-request-params"] ||= request_params_header
819
963
 
820
964
  options.apply_defaults timeout: @config.rpcs.mark_recommendation_failed.timeout,
821
965
  metadata: metadata,
822
966
  retry_policy: @config.rpcs.mark_recommendation_failed.retry_policy
823
- options.apply_defaults metadata: @config.metadata,
967
+
968
+ options.apply_defaults timeout: @config.timeout,
969
+ metadata: @config.metadata,
824
970
  retry_policy: @config.retry_policy
825
971
 
826
972
  @recommender_stub.call_rpc :mark_recommendation_failed, request, options: options do |response, operation|
@@ -844,22 +990,21 @@ module Google
844
990
  # Configuration can be applied globally to all clients, or to a single client
845
991
  # on construction.
846
992
  #
847
- # # Examples
848
- #
849
- # To modify the global config, setting the timeout for list_insights
850
- # to 20 seconds, and all remaining timeouts to 10 seconds:
851
- #
852
- # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
853
- # config.timeout = 10.0
854
- # config.rpcs.list_insights.timeout = 20.0
855
- # end
856
- #
857
- # To apply the above configuration only to a new client:
858
- #
859
- # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
860
- # config.timeout = 10.0
861
- # config.rpcs.list_insights.timeout = 20.0
862
- # end
993
+ # @example
994
+ #
995
+ # # Modify the global config, setting the timeout for
996
+ # # list_insights to 20 seconds,
997
+ # # and all remaining timeouts to 10 seconds.
998
+ # ::Google::Cloud::Recommender::V1::Recommender::Client.configure do |config|
999
+ # config.timeout = 10.0
1000
+ # config.rpcs.list_insights.timeout = 20.0
1001
+ # end
1002
+ #
1003
+ # # Apply the above configuration only to a new client.
1004
+ # client = ::Google::Cloud::Recommender::V1::Recommender::Client.new do |config|
1005
+ # config.timeout = 10.0
1006
+ # config.rpcs.list_insights.timeout = 20.0
1007
+ # end
863
1008
  #
864
1009
  # @!attribute [rw] endpoint
865
1010
  # The hostname or hostname:port of the service endpoint.
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/recommender/v1/recommender_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
9
7
  require 'google/api/resource_pb'
10
8
  require 'google/cloud/recommender/v1/insight_pb'
11
9
  require 'google/cloud/recommender/v1/recommendation_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/recommender/v1/recommender_service.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.recommender.v1.ListInsightsRequest" do
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
- VERSION = "0.8.1"
24
+ VERSION = "0.8.5"
25
25
  end
26
26
  end
27
27
  end
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -158,18 +158,27 @@ module Google
158
158
  # This is intended to be an exact match per filter. To perform advanced
159
159
  # matching, use path_value_matchers.
160
160
  #
161
- # * Example: {
161
+ # * Example:
162
+ # ```
163
+ # {
162
164
  # "/versions/*/name" : "it-123"
163
165
  # "/versions/*/targetSize/percent": 20
164
- # }
165
- # * Example: {
166
+ # }
167
+ # ```
168
+ # * Example:
169
+ # ```
170
+ # {
166
171
  # "/bindings/*/role": "roles/owner"
167
172
  # "/bindings/*/condition" : null
168
- # }
169
- # * Example: {
173
+ # }
174
+ # ```
175
+ # * Example:
176
+ # ```
177
+ # {
170
178
  # "/bindings/*/role": "roles/owner"
171
179
  # "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
172
- # }
180
+ # }
181
+ # ```
173
182
  # When both path_filters and path_value_matchers are set, an implicit AND
174
183
  # must be performed.
175
184
  # @!attribute [rw] path_value_matchers
@@ -166,8 +166,8 @@ module Google
166
166
  # @return [::Google::Protobuf::Map{::String => ::String}]
167
167
  # State properties to include with this state. Overwrites any existing
168
168
  # `state_metadata`.
169
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
170
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
169
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
170
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
171
171
  # @!attribute [rw] etag
172
172
  # @return [::String]
173
173
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
@@ -193,8 +193,8 @@ module Google
193
193
  # @return [::Google::Protobuf::Map{::String => ::String}]
194
194
  # State properties to include with this state. Overwrites any existing
195
195
  # `state_metadata`.
196
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
197
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
196
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
197
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
198
198
  # @!attribute [rw] etag
199
199
  # @return [::String]
200
200
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
@@ -220,8 +220,8 @@ module Google
220
220
  # @return [::Google::Protobuf::Map{::String => ::String}]
221
221
  # State properties to include with this state. Overwrites any existing
222
222
  # `state_metadata`.
223
- # Keys must match the regex /^[a-z0-9][a-z0-9_.-]\\{0,62}$/.
224
- # Values must match the regex /^[a-zA-Z0-9_./-]\\{0,255}$/.
223
+ # Keys must match the regex `/^[a-z0-9][a-z0-9_.-]{0,62}$/`.
224
+ # Values must match the regex `/^[a-zA-Z0-9_./-]{0,255}$/`.
225
225
  # @!attribute [rw] etag
226
226
  # @return [::String]
227
227
  # Required. Fingerprint of the Recommendation. Provides optimistic locking.
@@ -22,7 +22,7 @@ module Google
22
22
  # Represents an amount of money with its currency type.
23
23
  # @!attribute [rw] currency_code
24
24
  # @return [::String]
25
- # The 3-letter currency code defined in ISO 4217.
25
+ # The three-letter currency code defined in ISO 4217.
26
26
  # @!attribute [rw] units
27
27
  # @return [::Integer]
28
28
  # The whole units of the amount.
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.8.1
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a