google-cloud-recommender-v1 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54b1052159b78e8f617677704f4af520f174464800c801432330a3a18ee322d9
4
- data.tar.gz: fed1be380b52b53e8136a81a6f3d09a1102065fb56e30ea04e93635fdf28cbec
3
+ metadata.gz: 46fb7c89b82a0dea66ee1a8f050fef7fee2ca7f0ca80a708e0ec5da7a46078ce
4
+ data.tar.gz: f05bb2566528e5dcc18e3529748db0d9b9b4ab0e3cfdf24b4c06c4f4dfcb88b2
5
5
  SHA512:
6
- metadata.gz: a04f71f5f3246425da931e8727eb77f5f2ffb86cdb113c564be5e9963a77362e0deb3e785443f55c19a15ef87abd1dc2739e4f2b615af830146028ba1714db2a
7
- data.tar.gz: 7a1f84adac7827cfa6cac15d9e4188e053501cca97eac389d331302f130b00a24f8f1e0ea26f8a30026e85e0164c5c82e6c1f9fb909ea334781bf32f48cc5710
6
+ metadata.gz: 500a68ce669f879dd97620bb00eff11a50238f8065d74fb7538def6ccfa96de555b0b7dccba5af074906439561b12e00aae5693db35f08c91e848ab717c58749
7
+ data.tar.gz: f7954ff026b31d5ac06e4dd56251252c85f37bba6828249f2fb43fc351186f45c85d16cea443fe8ad4138bf4eb1cba918ebc2163da860a8004a91f5405a1d168
@@ -33,3 +33,6 @@ module Google
33
33
  end
34
34
  end
35
35
  end
36
+
37
+ helper_path = ::File.join __dir__, "v1", "_helpers.rb"
38
+ require "google/cloud/recommender/v1/_helpers" if ::File.file? helper_path
@@ -215,6 +215,8 @@ module Google
215
215
  #
216
216
  # LOCATION here refers to GCP Locations:
217
217
  # https://cloud.google.com/about/locations/
218
+ # INSIGHT_TYPE_ID refers to supported insight types:
219
+ # https://cloud.google.com/recommender/docs/insights/insight-types.)
218
220
  # @param page_size [::Integer]
219
221
  # Optional. The maximum number of results to return from this request. Non-positive
220
222
  # values are ignored. If not specified, the server will determine the number
@@ -446,6 +448,8 @@ module Google
446
448
  #
447
449
  # LOCATION here refers to GCP Locations:
448
450
  # https://cloud.google.com/about/locations/
451
+ # RECOMMENDER_ID refers to supported recommenders:
452
+ # https://cloud.google.com/recommender/docs/recommenders.
449
453
  # @param page_size [::Integer]
450
454
  # Optional. The maximum number of results to return from this request. Non-positive
451
455
  # values are ignored. If not specified, the server will determine the number
@@ -946,7 +950,7 @@ module Google
946
950
  # Each configuration object is of type `Gapic::Config::Method` and includes
947
951
  # the following configuration fields:
948
952
  #
949
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
953
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
950
954
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
951
955
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
952
956
  # include the following keys:
@@ -27,81 +27,309 @@ module Google
27
27
  ##
28
28
  # Create a fully-qualified Insight resource string.
29
29
  #
30
- # The resource will be in the following format:
30
+ # @overload insight_path(project:, location:, insight_type:, insight:)
31
+ # The resource will be in the following format:
31
32
  #
32
- # `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
33
+ # `projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
33
34
  #
34
- # @param project [String]
35
- # @param location [String]
36
- # @param insight_type [String]
37
- # @param insight [String]
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param insight_type [String]
38
+ # @param insight [String]
39
+ #
40
+ # @overload insight_path(billing_account:, location:, insight_type:, insight:)
41
+ # The resource will be in the following format:
42
+ #
43
+ # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
44
+ #
45
+ # @param billing_account [String]
46
+ # @param location [String]
47
+ # @param insight_type [String]
48
+ # @param insight [String]
49
+ #
50
+ # @overload insight_path(folder:, location:, insight_type:, insight:)
51
+ # The resource will be in the following format:
52
+ #
53
+ # `folders/{folder}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
54
+ #
55
+ # @param folder [String]
56
+ # @param location [String]
57
+ # @param insight_type [String]
58
+ # @param insight [String]
59
+ #
60
+ # @overload insight_path(organization:, location:, insight_type:, insight:)
61
+ # The resource will be in the following format:
62
+ #
63
+ # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}/insights/{insight}`
64
+ #
65
+ # @param organization [String]
66
+ # @param location [String]
67
+ # @param insight_type [String]
68
+ # @param insight [String]
38
69
  #
39
70
  # @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? "/"
71
+ def insight_path **args
72
+ resources = {
73
+ "insight:insight_type:location:project" => (proc do |project:, location:, insight_type:, insight:|
74
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
75
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
76
+ raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
77
+
78
+ "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
79
+ end),
80
+ "billing_account:insight:insight_type:location" => (proc do |billing_account:, location:, insight_type:, insight:|
81
+ raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
82
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
83
+ raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
84
+
85
+ "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
86
+ end),
87
+ "folder:insight:insight_type:location" => (proc do |folder:, location:, insight_type:, insight:|
88
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
89
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
90
+ raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
91
+
92
+ "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
93
+ end),
94
+ "insight:insight_type:location:organization" => (proc do |organization:, location:, insight_type:, insight:|
95
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
96
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
97
+ raise ::ArgumentError, "insight_type cannot contain /" if insight_type.to_s.include? "/"
98
+
99
+ "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
100
+ end)
101
+ }
44
102
 
45
- "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}/insights/#{insight}"
103
+ resource = resources[args.keys.sort.join(":")]
104
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
105
+ resource.call(**args)
46
106
  end
47
107
 
48
108
  ##
49
109
  # Create a fully-qualified InsightType resource string.
50
110
  #
51
- # The resource will be in the following format:
111
+ # @overload insight_type_path(project:, location:, insight_type:)
112
+ # The resource will be in the following format:
52
113
  #
53
- # `projects/{project}/locations/{location}/insightTypes/{insight_type}`
114
+ # `projects/{project}/locations/{location}/insightTypes/{insight_type}`
54
115
  #
55
- # @param project [String]
56
- # @param location [String]
57
- # @param insight_type [String]
116
+ # @param project [String]
117
+ # @param location [String]
118
+ # @param insight_type [String]
119
+ #
120
+ # @overload insight_type_path(billing_account:, location:, insight_type:)
121
+ # The resource will be in the following format:
122
+ #
123
+ # `billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}`
124
+ #
125
+ # @param billing_account [String]
126
+ # @param location [String]
127
+ # @param insight_type [String]
128
+ #
129
+ # @overload insight_type_path(folder:, location:, insight_type:)
130
+ # The resource will be in the following format:
131
+ #
132
+ # `folders/{folder}/locations/{location}/insightTypes/{insight_type}`
133
+ #
134
+ # @param folder [String]
135
+ # @param location [String]
136
+ # @param insight_type [String]
137
+ #
138
+ # @overload insight_type_path(organization:, location:, insight_type:)
139
+ # The resource will be in the following format:
140
+ #
141
+ # `organizations/{organization}/locations/{location}/insightTypes/{insight_type}`
142
+ #
143
+ # @param organization [String]
144
+ # @param location [String]
145
+ # @param insight_type [String]
58
146
  #
59
147
  # @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? "/"
148
+ def insight_type_path **args
149
+ resources = {
150
+ "insight_type:location:project" => (proc do |project:, location:, insight_type:|
151
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
152
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
153
+
154
+ "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}"
155
+ end),
156
+ "billing_account:insight_type:location" => (proc do |billing_account:, location:, insight_type:|
157
+ raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
158
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
159
+
160
+ "billingAccounts/#{billing_account}/locations/#{location}/insightTypes/#{insight_type}"
161
+ end),
162
+ "folder:insight_type:location" => (proc do |folder:, location:, insight_type:|
163
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
164
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
165
+
166
+ "folders/#{folder}/locations/#{location}/insightTypes/#{insight_type}"
167
+ end),
168
+ "insight_type:location:organization" => (proc do |organization:, location:, insight_type:|
169
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
170
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
171
+
172
+ "organizations/#{organization}/locations/#{location}/insightTypes/#{insight_type}"
173
+ end)
174
+ }
63
175
 
64
- "projects/#{project}/locations/#{location}/insightTypes/#{insight_type}"
176
+ resource = resources[args.keys.sort.join(":")]
177
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
178
+ resource.call(**args)
65
179
  end
66
180
 
67
181
  ##
68
182
  # Create a fully-qualified Recommendation resource string.
69
183
  #
70
- # The resource will be in the following format:
184
+ # @overload recommendation_path(project:, location:, recommender:, recommendation:)
185
+ # The resource will be in the following format:
71
186
  #
72
- # `projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
187
+ # `projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
73
188
  #
74
- # @param project [String]
75
- # @param location [String]
76
- # @param recommender [String]
77
- # @param recommendation [String]
189
+ # @param project [String]
190
+ # @param location [String]
191
+ # @param recommender [String]
192
+ # @param recommendation [String]
193
+ #
194
+ # @overload recommendation_path(billing_account:, location:, recommender:, recommendation:)
195
+ # The resource will be in the following format:
196
+ #
197
+ # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
198
+ #
199
+ # @param billing_account [String]
200
+ # @param location [String]
201
+ # @param recommender [String]
202
+ # @param recommendation [String]
203
+ #
204
+ # @overload recommendation_path(folder:, location:, recommender:, recommendation:)
205
+ # The resource will be in the following format:
206
+ #
207
+ # `folders/{folder}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
208
+ #
209
+ # @param folder [String]
210
+ # @param location [String]
211
+ # @param recommender [String]
212
+ # @param recommendation [String]
213
+ #
214
+ # @overload recommendation_path(organization:, location:, recommender:, recommendation:)
215
+ # The resource will be in the following format:
216
+ #
217
+ # `organizations/{organization}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}`
218
+ #
219
+ # @param organization [String]
220
+ # @param location [String]
221
+ # @param recommender [String]
222
+ # @param recommendation [String]
78
223
  #
79
224
  # @return [::String]
80
- def recommendation_path project:, location:, recommender:, recommendation:
81
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
82
- raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
83
- raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
225
+ def recommendation_path **args
226
+ resources = {
227
+ "location:project:recommendation:recommender" => (proc do |project:, location:, recommender:, recommendation:|
228
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
229
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
230
+ raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
231
+
232
+ "projects/#{project}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
233
+ end),
234
+ "billing_account:location:recommendation:recommender" => (proc do |billing_account:, location:, recommender:, recommendation:|
235
+ raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
236
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
237
+ raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
238
+
239
+ "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
240
+ end),
241
+ "folder:location:recommendation:recommender" => (proc do |folder:, location:, recommender:, recommendation:|
242
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
243
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
244
+ raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
245
+
246
+ "folders/#{folder}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
247
+ end),
248
+ "location:organization:recommendation:recommender" => (proc do |organization:, location:, recommender:, recommendation:|
249
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
250
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
251
+ raise ::ArgumentError, "recommender cannot contain /" if recommender.to_s.include? "/"
252
+
253
+ "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
254
+ end)
255
+ }
84
256
 
85
- "projects/#{project}/locations/#{location}/recommenders/#{recommender}/recommendations/#{recommendation}"
257
+ resource = resources[args.keys.sort.join(":")]
258
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
259
+ resource.call(**args)
86
260
  end
87
261
 
88
262
  ##
89
263
  # Create a fully-qualified Recommender resource string.
90
264
  #
91
- # The resource will be in the following format:
265
+ # @overload recommender_path(project:, location:, recommender:)
266
+ # The resource will be in the following format:
92
267
  #
93
- # `projects/{project}/locations/{location}/recommenders/{recommender}`
268
+ # `projects/{project}/locations/{location}/recommenders/{recommender}`
94
269
  #
95
- # @param project [String]
96
- # @param location [String]
97
- # @param recommender [String]
270
+ # @param project [String]
271
+ # @param location [String]
272
+ # @param recommender [String]
273
+ #
274
+ # @overload recommender_path(billing_account:, location:, recommender:)
275
+ # The resource will be in the following format:
276
+ #
277
+ # `billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}`
278
+ #
279
+ # @param billing_account [String]
280
+ # @param location [String]
281
+ # @param recommender [String]
282
+ #
283
+ # @overload recommender_path(folder:, location:, recommender:)
284
+ # The resource will be in the following format:
285
+ #
286
+ # `folders/{folder}/locations/{location}/recommenders/{recommender}`
287
+ #
288
+ # @param folder [String]
289
+ # @param location [String]
290
+ # @param recommender [String]
291
+ #
292
+ # @overload recommender_path(organization:, location:, recommender:)
293
+ # The resource will be in the following format:
294
+ #
295
+ # `organizations/{organization}/locations/{location}/recommenders/{recommender}`
296
+ #
297
+ # @param organization [String]
298
+ # @param location [String]
299
+ # @param recommender [String]
98
300
  #
99
301
  # @return [::String]
100
- def recommender_path project:, location:, recommender:
101
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
102
- raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
302
+ def recommender_path **args
303
+ resources = {
304
+ "location:project:recommender" => (proc do |project:, location:, recommender:|
305
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
306
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
307
+
308
+ "projects/#{project}/locations/#{location}/recommenders/#{recommender}"
309
+ end),
310
+ "billing_account:location:recommender" => (proc do |billing_account:, location:, recommender:|
311
+ raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
312
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
313
+
314
+ "billingAccounts/#{billing_account}/locations/#{location}/recommenders/#{recommender}"
315
+ end),
316
+ "folder:location:recommender" => (proc do |folder:, location:, recommender:|
317
+ raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
318
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
319
+
320
+ "folders/#{folder}/locations/#{location}/recommenders/#{recommender}"
321
+ end),
322
+ "location:organization:recommender" => (proc do |organization:, location:, recommender:|
323
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
324
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
325
+
326
+ "organizations/#{organization}/locations/#{location}/recommenders/#{recommender}"
327
+ end)
328
+ }
103
329
 
104
- "projects/#{project}/locations/#{location}/recommenders/#{recommender}"
330
+ resource = resources[args.keys.sort.join(":")]
331
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
332
+ resource.call(**args)
105
333
  end
106
334
 
107
335
  extend self
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Recommender
23
23
  module V1
24
- VERSION = "0.5.3"
24
+ VERSION = "0.6.0"
25
25
  end
26
26
  end
27
27
  end
@@ -163,12 +163,12 @@ module Google
163
163
  # "/versions/*/targetSize/percent": 20
164
164
  # }
165
165
  # * Example: {
166
- # "/bindings/*/role": "roles/admin"
166
+ # "/bindings/*/role": "roles/owner"
167
167
  # "/bindings/*/condition" : null
168
168
  # }
169
169
  # * Example: {
170
- # "/bindings/*/role": "roles/admin"
171
- # "/bindings/*/members/*" : ["x@google.com", "y@google.com"]
170
+ # "/bindings/*/role": "roles/owner"
171
+ # "/bindings/*/members/*" : ["x@example.com", "y@example.com"]
172
172
  # }
173
173
  # When both path_filters and path_value_matchers are set, an implicit AND
174
174
  # must be performed.
@@ -32,6 +32,8 @@ module Google
32
32
  #
33
33
  # LOCATION here refers to GCP Locations:
34
34
  # https://cloud.google.com/about/locations/
35
+ # INSIGHT_TYPE_ID refers to supported insight types:
36
+ # https://cloud.google.com/recommender/docs/insights/insight-types.)
35
37
  # @!attribute [rw] page_size
36
38
  # @return [::Integer]
37
39
  # Optional. The maximum number of results to return from this request. Non-positive
@@ -111,6 +113,8 @@ module Google
111
113
  #
112
114
  # LOCATION here refers to GCP Locations:
113
115
  # https://cloud.google.com/about/locations/
116
+ # RECOMMENDER_ID refers to supported recommenders:
117
+ # https://cloud.google.com/recommender/docs/recommenders.
114
118
  # @!attribute [rw] page_size
115
119
  # @return [::Integer]
116
120
  # Optional. The maximum number of results to return from this request. Non-positive
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.5.3
4
+ version: 0.6.0
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-10-29 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  - !ruby/object:Gem::Version
202
202
  version: '0'
203
203
  requirements: []
204
- rubygems_version: 3.1.4
204
+ rubygems_version: 3.2.6
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: API Client library for the Recommender V1 API