google-apis-recommender_v1beta1 0.1.0

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.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module RecommenderV1beta1
18
+ # Version of the google-apis-recommender_v1beta1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201204"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,328 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module RecommenderV1beta1
24
+
25
+ class GoogleCloudRecommenderV1beta1CostProjection
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleCloudRecommenderV1beta1Impact
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleCloudRecommenderV1beta1Insight
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleCloudRecommenderV1beta1InsightRecommendationReference
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleCloudRecommenderV1beta1InsightStateInfo
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleCloudRecommenderV1beta1ListInsightsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleCloudRecommenderV1beta1ListRecommendationsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleCloudRecommenderV1beta1Operation
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleCloudRecommenderV1beta1OperationGroup
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleCloudRecommenderV1beta1Recommendation
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleCloudRecommenderV1beta1RecommendationContent
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleCloudRecommenderV1beta1RecommendationInsightReference
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class GoogleCloudRecommenderV1beta1RecommendationStateInfo
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class GoogleCloudRecommenderV1beta1ValueMatcher
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class GoogleTypeMoney
134
+ class Representation < Google::Apis::Core::JsonRepresentation; end
135
+
136
+ include Google::Apis::Core::JsonObjectSupport
137
+ end
138
+
139
+ class GoogleCloudRecommenderV1beta1CostProjection
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :cost, as: 'cost', class: Google::Apis::RecommenderV1beta1::GoogleTypeMoney, decorator: Google::Apis::RecommenderV1beta1::GoogleTypeMoney::Representation
143
+
144
+ property :duration, as: 'duration'
145
+ end
146
+ end
147
+
148
+ class GoogleCloudRecommenderV1beta1Impact
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ property :category, as: 'category'
152
+ property :cost_projection, as: 'costProjection', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1CostProjection, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1CostProjection::Representation
153
+
154
+ end
155
+ end
156
+
157
+ class GoogleCloudRecommenderV1beta1Insight
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ collection :associated_recommendations, as: 'associatedRecommendations', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1InsightRecommendationReference, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1InsightRecommendationReference::Representation
161
+
162
+ property :category, as: 'category'
163
+ hash :content, as: 'content'
164
+ property :description, as: 'description'
165
+ property :etag, as: 'etag'
166
+ property :insight_subtype, as: 'insightSubtype'
167
+ property :last_refresh_time, as: 'lastRefreshTime'
168
+ property :name, as: 'name'
169
+ property :observation_period, as: 'observationPeriod'
170
+ property :state_info, as: 'stateInfo', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1InsightStateInfo, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1InsightStateInfo::Representation
171
+
172
+ collection :target_resources, as: 'targetResources'
173
+ end
174
+ end
175
+
176
+ class GoogleCloudRecommenderV1beta1InsightRecommendationReference
177
+ # @private
178
+ class Representation < Google::Apis::Core::JsonRepresentation
179
+ property :recommendation, as: 'recommendation'
180
+ end
181
+ end
182
+
183
+ class GoogleCloudRecommenderV1beta1InsightStateInfo
184
+ # @private
185
+ class Representation < Google::Apis::Core::JsonRepresentation
186
+ property :state, as: 'state'
187
+ hash :state_metadata, as: 'stateMetadata'
188
+ end
189
+ end
190
+
191
+ class GoogleCloudRecommenderV1beta1ListInsightsResponse
192
+ # @private
193
+ class Representation < Google::Apis::Core::JsonRepresentation
194
+ collection :insights, as: 'insights', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight::Representation
195
+
196
+ property :next_page_token, as: 'nextPageToken'
197
+ end
198
+ end
199
+
200
+ class GoogleCloudRecommenderV1beta1ListRecommendationsResponse
201
+ # @private
202
+ class Representation < Google::Apis::Core::JsonRepresentation
203
+ property :next_page_token, as: 'nextPageToken'
204
+ collection :recommendations, as: 'recommendations', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
205
+
206
+ end
207
+ end
208
+
209
+ class GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest
210
+ # @private
211
+ class Representation < Google::Apis::Core::JsonRepresentation
212
+ property :etag, as: 'etag'
213
+ hash :state_metadata, as: 'stateMetadata'
214
+ end
215
+ end
216
+
217
+ class GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest
218
+ # @private
219
+ class Representation < Google::Apis::Core::JsonRepresentation
220
+ property :etag, as: 'etag'
221
+ hash :state_metadata, as: 'stateMetadata'
222
+ end
223
+ end
224
+
225
+ class GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest
226
+ # @private
227
+ class Representation < Google::Apis::Core::JsonRepresentation
228
+ property :etag, as: 'etag'
229
+ hash :state_metadata, as: 'stateMetadata'
230
+ end
231
+ end
232
+
233
+ class GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest
234
+ # @private
235
+ class Representation < Google::Apis::Core::JsonRepresentation
236
+ property :etag, as: 'etag'
237
+ hash :state_metadata, as: 'stateMetadata'
238
+ end
239
+ end
240
+
241
+ class GoogleCloudRecommenderV1beta1Operation
242
+ # @private
243
+ class Representation < Google::Apis::Core::JsonRepresentation
244
+ property :action, as: 'action'
245
+ property :path, as: 'path'
246
+ hash :path_filters, as: 'pathFilters'
247
+ hash :path_value_matchers, as: 'pathValueMatchers', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ValueMatcher, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ValueMatcher::Representation
248
+
249
+ property :resource, as: 'resource'
250
+ property :resource_type, as: 'resourceType'
251
+ property :source_path, as: 'sourcePath'
252
+ property :source_resource, as: 'sourceResource'
253
+ property :value, as: 'value'
254
+ property :value_matcher, as: 'valueMatcher', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ValueMatcher, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ValueMatcher::Representation
255
+
256
+ end
257
+ end
258
+
259
+ class GoogleCloudRecommenderV1beta1OperationGroup
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ collection :operations, as: 'operations', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Operation, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Operation::Representation
263
+
264
+ end
265
+ end
266
+
267
+ class GoogleCloudRecommenderV1beta1Recommendation
268
+ # @private
269
+ class Representation < Google::Apis::Core::JsonRepresentation
270
+ collection :additional_impact, as: 'additionalImpact', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Impact, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Impact::Representation
271
+
272
+ collection :associated_insights, as: 'associatedInsights', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationInsightReference, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationInsightReference::Representation
273
+
274
+ property :content, as: 'content', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationContent, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationContent::Representation
275
+
276
+ property :description, as: 'description'
277
+ property :etag, as: 'etag'
278
+ property :last_refresh_time, as: 'lastRefreshTime'
279
+ property :name, as: 'name'
280
+ property :primary_impact, as: 'primaryImpact', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Impact, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Impact::Representation
281
+
282
+ property :recommender_subtype, as: 'recommenderSubtype'
283
+ property :state_info, as: 'stateInfo', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationStateInfo, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1RecommendationStateInfo::Representation
284
+
285
+ end
286
+ end
287
+
288
+ class GoogleCloudRecommenderV1beta1RecommendationContent
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ collection :operation_groups, as: 'operationGroups', class: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1OperationGroup, decorator: Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1OperationGroup::Representation
292
+
293
+ end
294
+ end
295
+
296
+ class GoogleCloudRecommenderV1beta1RecommendationInsightReference
297
+ # @private
298
+ class Representation < Google::Apis::Core::JsonRepresentation
299
+ property :insight, as: 'insight'
300
+ end
301
+ end
302
+
303
+ class GoogleCloudRecommenderV1beta1RecommendationStateInfo
304
+ # @private
305
+ class Representation < Google::Apis::Core::JsonRepresentation
306
+ property :state, as: 'state'
307
+ hash :state_metadata, as: 'stateMetadata'
308
+ end
309
+ end
310
+
311
+ class GoogleCloudRecommenderV1beta1ValueMatcher
312
+ # @private
313
+ class Representation < Google::Apis::Core::JsonRepresentation
314
+ property :matches_pattern, as: 'matchesPattern'
315
+ end
316
+ end
317
+
318
+ class GoogleTypeMoney
319
+ # @private
320
+ class Representation < Google::Apis::Core::JsonRepresentation
321
+ property :currency_code, as: 'currencyCode'
322
+ property :nanos, as: 'nanos'
323
+ property :units, :numeric_string => true, as: 'units'
324
+ end
325
+ end
326
+ end
327
+ end
328
+ end
@@ -0,0 +1,695 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module RecommenderV1beta1
23
+ # Recommender API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/recommender_v1beta1'
29
+ #
30
+ # Recommender = Google::Apis::RecommenderV1beta1 # Alias the module
31
+ # service = Recommender::RecommenderService.new
32
+ #
33
+ # @see https://cloud.google.com/recommender/docs/
34
+ class RecommenderService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://recommender.googleapis.com/', '',
47
+ client_name: 'google-apis-recommender_v1beta1',
48
+ client_version: Google::Apis::RecommenderV1beta1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Gets the requested insight. Requires the recommender.*.get IAM permission for
53
+ # the specified insight type.
54
+ # @param [String] name
55
+ # Required. Name of the insight.
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def get_billing_account_location_insight_type_insight(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
75
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight::Representation
76
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight
77
+ command.params['name'] = name unless name.nil?
78
+ command.query['fields'] = fields unless fields.nil?
79
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
80
+ execute_or_queue_command(command, &block)
81
+ end
82
+
83
+ # Lists insights for a Cloud project. Requires the recommender.*.list IAM
84
+ # permission for the specified insight type.
85
+ # @param [String] parent
86
+ # Required. The container resource on which to execute the request. Acceptable
87
+ # formats: 1. "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[
88
+ # INSIGHT_TYPE_ID]", LOCATION here refers to GCP Locations: https://cloud.google.
89
+ # com/about/locations/ INSIGHT_TYPE_ID refers to supported insight types: https:/
90
+ # /cloud.google.com/recommender/docs/insights/insight-types.
91
+ # @param [String] filter
92
+ # Optional. Filter expression to restrict the insights returned. Supported
93
+ # filter fields: state Eg: `state:"DISMISSED" or state:"ACTIVE"
94
+ # @param [Fixnum] page_size
95
+ # Optional. The maximum number of results to return from this request. Non-
96
+ # positive values are ignored. If not specified, the server will determine the
97
+ # number of results to return.
98
+ # @param [String] page_token
99
+ # Optional. If present, retrieves the next batch of results from the preceding
100
+ # call to this method. `page_token` must be the value of `next_page_token` from
101
+ # the previous response. The values of other method parameters must be identical
102
+ # to those in the previous call.
103
+ # @param [String] fields
104
+ # Selector specifying which fields to include in a partial response.
105
+ # @param [String] quota_user
106
+ # Available to use for quota purposes for server-side applications. Can be any
107
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
108
+ # @param [Google::Apis::RequestOptions] options
109
+ # Request-specific options
110
+ #
111
+ # @yield [result, err] Result & error if block supplied
112
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse]
116
+ #
117
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
118
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
119
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
120
+ def list_billing_account_location_insight_type_insights(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
121
+ command = make_simple_command(:get, 'v1beta1/{+parent}/insights', options)
122
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse::Representation
123
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse
124
+ command.params['parent'] = parent unless parent.nil?
125
+ command.query['filter'] = filter unless filter.nil?
126
+ command.query['pageSize'] = page_size unless page_size.nil?
127
+ command.query['pageToken'] = page_token unless page_token.nil?
128
+ command.query['fields'] = fields unless fields.nil?
129
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
130
+ execute_or_queue_command(command, &block)
131
+ end
132
+
133
+ # Marks the Insight State as Accepted. Users can use this method to indicate to
134
+ # the Recommender API that they have applied some action based on the insight.
135
+ # This stops the insight content from being updated. MarkInsightAccepted can be
136
+ # applied to insights in ACTIVE state. Requires the recommender.*.update IAM
137
+ # permission for the specified insight.
138
+ # @param [String] name
139
+ # Required. Name of the insight.
140
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest] google_cloud_recommender_v1beta1_mark_insight_accepted_request_object
141
+ # @param [String] fields
142
+ # Selector specifying which fields to include in a partial response.
143
+ # @param [String] quota_user
144
+ # Available to use for quota purposes for server-side applications. Can be any
145
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
146
+ # @param [Google::Apis::RequestOptions] options
147
+ # Request-specific options
148
+ #
149
+ # @yield [result, err] Result & error if block supplied
150
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight] parsed result object
151
+ # @yieldparam err [StandardError] error object if request failed
152
+ #
153
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight]
154
+ #
155
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
156
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
157
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
158
+ def mark_billing_account_location_insight_type_insight_accepted(name, google_cloud_recommender_v1beta1_mark_insight_accepted_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
159
+ command = make_simple_command(:post, 'v1beta1/{+name}:markAccepted', options)
160
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest::Representation
161
+ command.request_object = google_cloud_recommender_v1beta1_mark_insight_accepted_request_object
162
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight::Representation
163
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight
164
+ command.params['name'] = name unless name.nil?
165
+ command.query['fields'] = fields unless fields.nil?
166
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
167
+ execute_or_queue_command(command, &block)
168
+ end
169
+
170
+ # Gets the requested recommendation. Requires the recommender.*.get IAM
171
+ # permission for the specified recommender.
172
+ # @param [String] name
173
+ # Required. Name of the recommendation.
174
+ # @param [String] fields
175
+ # Selector specifying which fields to include in a partial response.
176
+ # @param [String] quota_user
177
+ # Available to use for quota purposes for server-side applications. Can be any
178
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
179
+ # @param [Google::Apis::RequestOptions] options
180
+ # Request-specific options
181
+ #
182
+ # @yield [result, err] Result & error if block supplied
183
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
184
+ # @yieldparam err [StandardError] error object if request failed
185
+ #
186
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
187
+ #
188
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
189
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
190
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
191
+ def get_billing_account_location_recommender_recommendation(name, fields: nil, quota_user: nil, options: nil, &block)
192
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
193
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
194
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
195
+ command.params['name'] = name unless name.nil?
196
+ command.query['fields'] = fields unless fields.nil?
197
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
198
+ execute_or_queue_command(command, &block)
199
+ end
200
+
201
+ # Lists recommendations for a Cloud project. Requires the recommender.*.list IAM
202
+ # permission for the specified recommender.
203
+ # @param [String] parent
204
+ # Required. The container resource on which to execute the request. Acceptable
205
+ # formats: 1. "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[
206
+ # RECOMMENDER_ID]", LOCATION here refers to GCP Locations: https://cloud.google.
207
+ # com/about/locations/ RECOMMENDER_ID refers to supported recommenders: https://
208
+ # cloud.google.com/recommender/docs/recommenders.
209
+ # @param [String] filter
210
+ # Filter expression to restrict the recommendations returned. Supported filter
211
+ # fields: state_info.state Eg: `state_info.state:"DISMISSED" or state_info.state:
212
+ # "FAILED"
213
+ # @param [Fixnum] page_size
214
+ # Optional. The maximum number of results to return from this request. Non-
215
+ # positive values are ignored. If not specified, the server will determine the
216
+ # number of results to return.
217
+ # @param [String] page_token
218
+ # Optional. If present, retrieves the next batch of results from the preceding
219
+ # call to this method. `page_token` must be the value of `next_page_token` from
220
+ # the previous response. The values of other method parameters must be identical
221
+ # to those in the previous call.
222
+ # @param [String] fields
223
+ # Selector specifying which fields to include in a partial response.
224
+ # @param [String] quota_user
225
+ # Available to use for quota purposes for server-side applications. Can be any
226
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
227
+ # @param [Google::Apis::RequestOptions] options
228
+ # Request-specific options
229
+ #
230
+ # @yield [result, err] Result & error if block supplied
231
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse] parsed result object
232
+ # @yieldparam err [StandardError] error object if request failed
233
+ #
234
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse]
235
+ #
236
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
237
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
238
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
239
+ def list_billing_account_location_recommender_recommendations(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
240
+ command = make_simple_command(:get, 'v1beta1/{+parent}/recommendations', options)
241
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse::Representation
242
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse
243
+ command.params['parent'] = parent unless parent.nil?
244
+ command.query['filter'] = filter unless filter.nil?
245
+ command.query['pageSize'] = page_size unless page_size.nil?
246
+ command.query['pageToken'] = page_token unless page_token.nil?
247
+ command.query['fields'] = fields unless fields.nil?
248
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
249
+ execute_or_queue_command(command, &block)
250
+ end
251
+
252
+ # Marks the Recommendation State as Claimed. Users can use this method to
253
+ # indicate to the Recommender API that they are starting to apply the
254
+ # recommendation themselves. This stops the recommendation content from being
255
+ # updated. Associated insights are frozen and placed in the ACCEPTED state.
256
+ # MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
257
+ # ACTIVE state. Requires the recommender.*.update IAM permission for the
258
+ # specified recommender.
259
+ # @param [String] name
260
+ # Required. Name of the recommendation.
261
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest] google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object
262
+ # @param [String] fields
263
+ # Selector specifying which fields to include in a partial response.
264
+ # @param [String] quota_user
265
+ # Available to use for quota purposes for server-side applications. Can be any
266
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
267
+ # @param [Google::Apis::RequestOptions] options
268
+ # Request-specific options
269
+ #
270
+ # @yield [result, err] Result & error if block supplied
271
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
272
+ # @yieldparam err [StandardError] error object if request failed
273
+ #
274
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
275
+ #
276
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
277
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
278
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
279
+ def mark_billing_account_location_recommender_recommendation_claimed(name, google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:post, 'v1beta1/{+name}:markClaimed', options)
281
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest::Representation
282
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object
283
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
284
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
285
+ command.params['name'] = name unless name.nil?
286
+ command.query['fields'] = fields unless fields.nil?
287
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
288
+ execute_or_queue_command(command, &block)
289
+ end
290
+
291
+ # Marks the Recommendation State as Failed. Users can use this method to
292
+ # indicate to the Recommender API that they have applied the recommendation
293
+ # themselves, and the operation failed. This stops the recommendation content
294
+ # from being updated. Associated insights are frozen and placed in the ACCEPTED
295
+ # state. MarkRecommendationFailed can be applied to recommendations in ACTIVE,
296
+ # CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM
297
+ # permission for the specified recommender.
298
+ # @param [String] name
299
+ # Required. Name of the recommendation.
300
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest] google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object
301
+ # @param [String] fields
302
+ # Selector specifying which fields to include in a partial response.
303
+ # @param [String] quota_user
304
+ # Available to use for quota purposes for server-side applications. Can be any
305
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
306
+ # @param [Google::Apis::RequestOptions] options
307
+ # Request-specific options
308
+ #
309
+ # @yield [result, err] Result & error if block supplied
310
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
311
+ # @yieldparam err [StandardError] error object if request failed
312
+ #
313
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
314
+ #
315
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
316
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
317
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
318
+ def mark_billing_account_location_recommender_recommendation_failed(name, google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
319
+ command = make_simple_command(:post, 'v1beta1/{+name}:markFailed', options)
320
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest::Representation
321
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object
322
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
323
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
324
+ command.params['name'] = name unless name.nil?
325
+ command.query['fields'] = fields unless fields.nil?
326
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
327
+ execute_or_queue_command(command, &block)
328
+ end
329
+
330
+ # Marks the Recommendation State as Succeeded. Users can use this method to
331
+ # indicate to the Recommender API that they have applied the recommendation
332
+ # themselves, and the operation was successful. This stops the recommendation
333
+ # content from being updated. Associated insights are frozen and placed in the
334
+ # ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations
335
+ # in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.
336
+ # update IAM permission for the specified recommender.
337
+ # @param [String] name
338
+ # Required. Name of the recommendation.
339
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest] google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object
340
+ # @param [String] fields
341
+ # Selector specifying which fields to include in a partial response.
342
+ # @param [String] quota_user
343
+ # Available to use for quota purposes for server-side applications. Can be any
344
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
345
+ # @param [Google::Apis::RequestOptions] options
346
+ # Request-specific options
347
+ #
348
+ # @yield [result, err] Result & error if block supplied
349
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
350
+ # @yieldparam err [StandardError] error object if request failed
351
+ #
352
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
353
+ #
354
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
355
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
356
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
357
+ def mark_billing_account_location_recommender_recommendation_succeeded(name, google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
358
+ command = make_simple_command(:post, 'v1beta1/{+name}:markSucceeded', options)
359
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest::Representation
360
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object
361
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
362
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
363
+ command.params['name'] = name unless name.nil?
364
+ command.query['fields'] = fields unless fields.nil?
365
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
366
+ execute_or_queue_command(command, &block)
367
+ end
368
+
369
+ # Gets the requested insight. Requires the recommender.*.get IAM permission for
370
+ # the specified insight type.
371
+ # @param [String] name
372
+ # Required. Name of the insight.
373
+ # @param [String] fields
374
+ # Selector specifying which fields to include in a partial response.
375
+ # @param [String] quota_user
376
+ # Available to use for quota purposes for server-side applications. Can be any
377
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
378
+ # @param [Google::Apis::RequestOptions] options
379
+ # Request-specific options
380
+ #
381
+ # @yield [result, err] Result & error if block supplied
382
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight] parsed result object
383
+ # @yieldparam err [StandardError] error object if request failed
384
+ #
385
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight]
386
+ #
387
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
388
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
389
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
390
+ def get_project_location_insight_type_insight(name, fields: nil, quota_user: nil, options: nil, &block)
391
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
392
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight::Representation
393
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight
394
+ command.params['name'] = name unless name.nil?
395
+ command.query['fields'] = fields unless fields.nil?
396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
397
+ execute_or_queue_command(command, &block)
398
+ end
399
+
400
+ # Lists insights for a Cloud project. Requires the recommender.*.list IAM
401
+ # permission for the specified insight type.
402
+ # @param [String] parent
403
+ # Required. The container resource on which to execute the request. Acceptable
404
+ # formats: 1. "projects/[PROJECT_NUMBER]/locations/[LOCATION]/insightTypes/[
405
+ # INSIGHT_TYPE_ID]", LOCATION here refers to GCP Locations: https://cloud.google.
406
+ # com/about/locations/ INSIGHT_TYPE_ID refers to supported insight types: https:/
407
+ # /cloud.google.com/recommender/docs/insights/insight-types.
408
+ # @param [String] filter
409
+ # Optional. Filter expression to restrict the insights returned. Supported
410
+ # filter fields: state Eg: `state:"DISMISSED" or state:"ACTIVE"
411
+ # @param [Fixnum] page_size
412
+ # Optional. The maximum number of results to return from this request. Non-
413
+ # positive values are ignored. If not specified, the server will determine the
414
+ # number of results to return.
415
+ # @param [String] page_token
416
+ # Optional. If present, retrieves the next batch of results from the preceding
417
+ # call to this method. `page_token` must be the value of `next_page_token` from
418
+ # the previous response. The values of other method parameters must be identical
419
+ # to those in the previous call.
420
+ # @param [String] fields
421
+ # Selector specifying which fields to include in a partial response.
422
+ # @param [String] quota_user
423
+ # Available to use for quota purposes for server-side applications. Can be any
424
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
425
+ # @param [Google::Apis::RequestOptions] options
426
+ # Request-specific options
427
+ #
428
+ # @yield [result, err] Result & error if block supplied
429
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse] parsed result object
430
+ # @yieldparam err [StandardError] error object if request failed
431
+ #
432
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse]
433
+ #
434
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
435
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
436
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
437
+ def list_project_location_insight_type_insights(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
438
+ command = make_simple_command(:get, 'v1beta1/{+parent}/insights', options)
439
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse::Representation
440
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListInsightsResponse
441
+ command.params['parent'] = parent unless parent.nil?
442
+ command.query['filter'] = filter unless filter.nil?
443
+ command.query['pageSize'] = page_size unless page_size.nil?
444
+ command.query['pageToken'] = page_token unless page_token.nil?
445
+ command.query['fields'] = fields unless fields.nil?
446
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
447
+ execute_or_queue_command(command, &block)
448
+ end
449
+
450
+ # Marks the Insight State as Accepted. Users can use this method to indicate to
451
+ # the Recommender API that they have applied some action based on the insight.
452
+ # This stops the insight content from being updated. MarkInsightAccepted can be
453
+ # applied to insights in ACTIVE state. Requires the recommender.*.update IAM
454
+ # permission for the specified insight.
455
+ # @param [String] name
456
+ # Required. Name of the insight.
457
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest] google_cloud_recommender_v1beta1_mark_insight_accepted_request_object
458
+ # @param [String] fields
459
+ # Selector specifying which fields to include in a partial response.
460
+ # @param [String] quota_user
461
+ # Available to use for quota purposes for server-side applications. Can be any
462
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
463
+ # @param [Google::Apis::RequestOptions] options
464
+ # Request-specific options
465
+ #
466
+ # @yield [result, err] Result & error if block supplied
467
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight] parsed result object
468
+ # @yieldparam err [StandardError] error object if request failed
469
+ #
470
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight]
471
+ #
472
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
473
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
474
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
475
+ def mark_project_location_insight_type_insight_accepted(name, google_cloud_recommender_v1beta1_mark_insight_accepted_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
476
+ command = make_simple_command(:post, 'v1beta1/{+name}:markAccepted', options)
477
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkInsightAcceptedRequest::Representation
478
+ command.request_object = google_cloud_recommender_v1beta1_mark_insight_accepted_request_object
479
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight::Representation
480
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Insight
481
+ command.params['name'] = name unless name.nil?
482
+ command.query['fields'] = fields unless fields.nil?
483
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
484
+ execute_or_queue_command(command, &block)
485
+ end
486
+
487
+ # Gets the requested recommendation. Requires the recommender.*.get IAM
488
+ # permission for the specified recommender.
489
+ # @param [String] name
490
+ # Required. Name of the recommendation.
491
+ # @param [String] fields
492
+ # Selector specifying which fields to include in a partial response.
493
+ # @param [String] quota_user
494
+ # Available to use for quota purposes for server-side applications. Can be any
495
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
496
+ # @param [Google::Apis::RequestOptions] options
497
+ # Request-specific options
498
+ #
499
+ # @yield [result, err] Result & error if block supplied
500
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
501
+ # @yieldparam err [StandardError] error object if request failed
502
+ #
503
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
504
+ #
505
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
506
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
507
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
508
+ def get_project_location_recommender_recommendation(name, fields: nil, quota_user: nil, options: nil, &block)
509
+ command = make_simple_command(:get, 'v1beta1/{+name}', options)
510
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
511
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
512
+ command.params['name'] = name unless name.nil?
513
+ command.query['fields'] = fields unless fields.nil?
514
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
515
+ execute_or_queue_command(command, &block)
516
+ end
517
+
518
+ # Lists recommendations for a Cloud project. Requires the recommender.*.list IAM
519
+ # permission for the specified recommender.
520
+ # @param [String] parent
521
+ # Required. The container resource on which to execute the request. Acceptable
522
+ # formats: 1. "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[
523
+ # RECOMMENDER_ID]", LOCATION here refers to GCP Locations: https://cloud.google.
524
+ # com/about/locations/ RECOMMENDER_ID refers to supported recommenders: https://
525
+ # cloud.google.com/recommender/docs/recommenders.
526
+ # @param [String] filter
527
+ # Filter expression to restrict the recommendations returned. Supported filter
528
+ # fields: state_info.state Eg: `state_info.state:"DISMISSED" or state_info.state:
529
+ # "FAILED"
530
+ # @param [Fixnum] page_size
531
+ # Optional. The maximum number of results to return from this request. Non-
532
+ # positive values are ignored. If not specified, the server will determine the
533
+ # number of results to return.
534
+ # @param [String] page_token
535
+ # Optional. If present, retrieves the next batch of results from the preceding
536
+ # call to this method. `page_token` must be the value of `next_page_token` from
537
+ # the previous response. The values of other method parameters must be identical
538
+ # to those in the previous call.
539
+ # @param [String] fields
540
+ # Selector specifying which fields to include in a partial response.
541
+ # @param [String] quota_user
542
+ # Available to use for quota purposes for server-side applications. Can be any
543
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
544
+ # @param [Google::Apis::RequestOptions] options
545
+ # Request-specific options
546
+ #
547
+ # @yield [result, err] Result & error if block supplied
548
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse] parsed result object
549
+ # @yieldparam err [StandardError] error object if request failed
550
+ #
551
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse]
552
+ #
553
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
554
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
555
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
556
+ def list_project_location_recommender_recommendations(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
557
+ command = make_simple_command(:get, 'v1beta1/{+parent}/recommendations', options)
558
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse::Representation
559
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1ListRecommendationsResponse
560
+ command.params['parent'] = parent unless parent.nil?
561
+ command.query['filter'] = filter unless filter.nil?
562
+ command.query['pageSize'] = page_size unless page_size.nil?
563
+ command.query['pageToken'] = page_token unless page_token.nil?
564
+ command.query['fields'] = fields unless fields.nil?
565
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
566
+ execute_or_queue_command(command, &block)
567
+ end
568
+
569
+ # Marks the Recommendation State as Claimed. Users can use this method to
570
+ # indicate to the Recommender API that they are starting to apply the
571
+ # recommendation themselves. This stops the recommendation content from being
572
+ # updated. Associated insights are frozen and placed in the ACCEPTED state.
573
+ # MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
574
+ # ACTIVE state. Requires the recommender.*.update IAM permission for the
575
+ # specified recommender.
576
+ # @param [String] name
577
+ # Required. Name of the recommendation.
578
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest] google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # Available to use for quota purposes for server-side applications. Can be any
583
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
584
+ # @param [Google::Apis::RequestOptions] options
585
+ # Request-specific options
586
+ #
587
+ # @yield [result, err] Result & error if block supplied
588
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
589
+ # @yieldparam err [StandardError] error object if request failed
590
+ #
591
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
592
+ #
593
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
594
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
595
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
596
+ def mark_project_location_recommender_recommendation_claimed(name, google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
597
+ command = make_simple_command(:post, 'v1beta1/{+name}:markClaimed', options)
598
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationClaimedRequest::Representation
599
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_claimed_request_object
600
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
601
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
602
+ command.params['name'] = name unless name.nil?
603
+ command.query['fields'] = fields unless fields.nil?
604
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
605
+ execute_or_queue_command(command, &block)
606
+ end
607
+
608
+ # Marks the Recommendation State as Failed. Users can use this method to
609
+ # indicate to the Recommender API that they have applied the recommendation
610
+ # themselves, and the operation failed. This stops the recommendation content
611
+ # from being updated. Associated insights are frozen and placed in the ACCEPTED
612
+ # state. MarkRecommendationFailed can be applied to recommendations in ACTIVE,
613
+ # CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM
614
+ # permission for the specified recommender.
615
+ # @param [String] name
616
+ # Required. Name of the recommendation.
617
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest] google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object
618
+ # @param [String] fields
619
+ # Selector specifying which fields to include in a partial response.
620
+ # @param [String] quota_user
621
+ # Available to use for quota purposes for server-side applications. Can be any
622
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
623
+ # @param [Google::Apis::RequestOptions] options
624
+ # Request-specific options
625
+ #
626
+ # @yield [result, err] Result & error if block supplied
627
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
628
+ # @yieldparam err [StandardError] error object if request failed
629
+ #
630
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
631
+ #
632
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
633
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
634
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
635
+ def mark_project_location_recommender_recommendation_failed(name, google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
636
+ command = make_simple_command(:post, 'v1beta1/{+name}:markFailed', options)
637
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationFailedRequest::Representation
638
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_failed_request_object
639
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
640
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
641
+ command.params['name'] = name unless name.nil?
642
+ command.query['fields'] = fields unless fields.nil?
643
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
644
+ execute_or_queue_command(command, &block)
645
+ end
646
+
647
+ # Marks the Recommendation State as Succeeded. Users can use this method to
648
+ # indicate to the Recommender API that they have applied the recommendation
649
+ # themselves, and the operation was successful. This stops the recommendation
650
+ # content from being updated. Associated insights are frozen and placed in the
651
+ # ACCEPTED state. MarkRecommendationSucceeded can be applied to recommendations
652
+ # in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.
653
+ # update IAM permission for the specified recommender.
654
+ # @param [String] name
655
+ # Required. Name of the recommendation.
656
+ # @param [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest] google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object
657
+ # @param [String] fields
658
+ # Selector specifying which fields to include in a partial response.
659
+ # @param [String] quota_user
660
+ # Available to use for quota purposes for server-side applications. Can be any
661
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
662
+ # @param [Google::Apis::RequestOptions] options
663
+ # Request-specific options
664
+ #
665
+ # @yield [result, err] Result & error if block supplied
666
+ # @yieldparam result [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation] parsed result object
667
+ # @yieldparam err [StandardError] error object if request failed
668
+ #
669
+ # @return [Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation]
670
+ #
671
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
672
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
673
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
674
+ def mark_project_location_recommender_recommendation_succeeded(name, google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
675
+ command = make_simple_command(:post, 'v1beta1/{+name}:markSucceeded', options)
676
+ command.request_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1MarkRecommendationSucceededRequest::Representation
677
+ command.request_object = google_cloud_recommender_v1beta1_mark_recommendation_succeeded_request_object
678
+ command.response_representation = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation::Representation
679
+ command.response_class = Google::Apis::RecommenderV1beta1::GoogleCloudRecommenderV1beta1Recommendation
680
+ command.params['name'] = name unless name.nil?
681
+ command.query['fields'] = fields unless fields.nil?
682
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
683
+ execute_or_queue_command(command, &block)
684
+ end
685
+
686
+ protected
687
+
688
+ def apply_command_defaults(command)
689
+ command.query['key'] = key unless key.nil?
690
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
691
+ end
692
+ end
693
+ end
694
+ end
695
+ end