google-apis-recommender_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 RecommenderV1
18
+ # Version of the google-apis-recommender_v1 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 = "20201113"
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 RecommenderV1
24
+
25
+ class GoogleCloudRecommenderV1CostProjection
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleCloudRecommenderV1Impact
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleCloudRecommenderV1Insight
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleCloudRecommenderV1InsightRecommendationReference
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleCloudRecommenderV1InsightStateInfo
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleCloudRecommenderV1ListInsightsResponse
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleCloudRecommenderV1ListRecommendationsResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleCloudRecommenderV1MarkInsightAcceptedRequest
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleCloudRecommenderV1MarkRecommendationClaimedRequest
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleCloudRecommenderV1MarkRecommendationFailedRequest
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleCloudRecommenderV1MarkRecommendationSucceededRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleCloudRecommenderV1Operation
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleCloudRecommenderV1OperationGroup
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleCloudRecommenderV1Recommendation
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleCloudRecommenderV1RecommendationContent
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleCloudRecommenderV1RecommendationInsightReference
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class GoogleCloudRecommenderV1RecommendationStateInfo
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class GoogleCloudRecommenderV1ValueMatcher
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 GoogleCloudRecommenderV1CostProjection
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :cost, as: 'cost', class: Google::Apis::RecommenderV1::GoogleTypeMoney, decorator: Google::Apis::RecommenderV1::GoogleTypeMoney::Representation
143
+
144
+ property :duration, as: 'duration'
145
+ end
146
+ end
147
+
148
+ class GoogleCloudRecommenderV1Impact
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ property :category, as: 'category'
152
+ property :cost_projection, as: 'costProjection', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1CostProjection, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1CostProjection::Representation
153
+
154
+ end
155
+ end
156
+
157
+ class GoogleCloudRecommenderV1Insight
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ collection :associated_recommendations, as: 'associatedRecommendations', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1InsightRecommendationReference, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1InsightRecommendationReference::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::RecommenderV1::GoogleCloudRecommenderV1InsightStateInfo, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1InsightStateInfo::Representation
171
+
172
+ collection :target_resources, as: 'targetResources'
173
+ end
174
+ end
175
+
176
+ class GoogleCloudRecommenderV1InsightRecommendationReference
177
+ # @private
178
+ class Representation < Google::Apis::Core::JsonRepresentation
179
+ property :recommendation, as: 'recommendation'
180
+ end
181
+ end
182
+
183
+ class GoogleCloudRecommenderV1InsightStateInfo
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 GoogleCloudRecommenderV1ListInsightsResponse
192
+ # @private
193
+ class Representation < Google::Apis::Core::JsonRepresentation
194
+ collection :insights, as: 'insights', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight::Representation
195
+
196
+ property :next_page_token, as: 'nextPageToken'
197
+ end
198
+ end
199
+
200
+ class GoogleCloudRecommenderV1ListRecommendationsResponse
201
+ # @private
202
+ class Representation < Google::Apis::Core::JsonRepresentation
203
+ property :next_page_token, as: 'nextPageToken'
204
+ collection :recommendations, as: 'recommendations', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation::Representation
205
+
206
+ end
207
+ end
208
+
209
+ class GoogleCloudRecommenderV1MarkInsightAcceptedRequest
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 GoogleCloudRecommenderV1MarkRecommendationClaimedRequest
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 GoogleCloudRecommenderV1MarkRecommendationFailedRequest
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 GoogleCloudRecommenderV1MarkRecommendationSucceededRequest
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 GoogleCloudRecommenderV1Operation
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::RecommenderV1::GoogleCloudRecommenderV1ValueMatcher, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ValueMatcher::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::RecommenderV1::GoogleCloudRecommenderV1ValueMatcher, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ValueMatcher::Representation
255
+
256
+ end
257
+ end
258
+
259
+ class GoogleCloudRecommenderV1OperationGroup
260
+ # @private
261
+ class Representation < Google::Apis::Core::JsonRepresentation
262
+ collection :operations, as: 'operations', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Operation, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Operation::Representation
263
+
264
+ end
265
+ end
266
+
267
+ class GoogleCloudRecommenderV1Recommendation
268
+ # @private
269
+ class Representation < Google::Apis::Core::JsonRepresentation
270
+ collection :additional_impact, as: 'additionalImpact', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Impact, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Impact::Representation
271
+
272
+ collection :associated_insights, as: 'associatedInsights', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationInsightReference, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationInsightReference::Representation
273
+
274
+ property :content, as: 'content', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationContent, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationContent::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::RecommenderV1::GoogleCloudRecommenderV1Impact, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Impact::Representation
281
+
282
+ property :recommender_subtype, as: 'recommenderSubtype'
283
+ property :state_info, as: 'stateInfo', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationStateInfo, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1RecommendationStateInfo::Representation
284
+
285
+ end
286
+ end
287
+
288
+ class GoogleCloudRecommenderV1RecommendationContent
289
+ # @private
290
+ class Representation < Google::Apis::Core::JsonRepresentation
291
+ collection :operation_groups, as: 'operationGroups', class: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1OperationGroup, decorator: Google::Apis::RecommenderV1::GoogleCloudRecommenderV1OperationGroup::Representation
292
+
293
+ end
294
+ end
295
+
296
+ class GoogleCloudRecommenderV1RecommendationInsightReference
297
+ # @private
298
+ class Representation < Google::Apis::Core::JsonRepresentation
299
+ property :insight, as: 'insight'
300
+ end
301
+ end
302
+
303
+ class GoogleCloudRecommenderV1RecommendationStateInfo
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 GoogleCloudRecommenderV1ValueMatcher
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,378 @@
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 RecommenderV1
23
+ # Recommender API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/recommender_v1'
29
+ #
30
+ # Recommender = Google::Apis::RecommenderV1 # 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_v1',
48
+ client_version: Google::Apis::RecommenderV1::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::RecommenderV1::GoogleCloudRecommenderV1Insight] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight]
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_project_location_insight_type_insight(name, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:get, 'v1/{+name}', options)
75
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight::Representation
76
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight
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::RecommenderV1::GoogleCloudRecommenderV1ListInsightsResponse] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListInsightsResponse]
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_project_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, 'v1/{+parent}/insights', options)
122
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListInsightsResponse::Representation
123
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListInsightsResponse
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::RecommenderV1::GoogleCloudRecommenderV1MarkInsightAcceptedRequest] google_cloud_recommender_v1_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::RecommenderV1::GoogleCloudRecommenderV1Insight] parsed result object
151
+ # @yieldparam err [StandardError] error object if request failed
152
+ #
153
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight]
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_project_location_insight_type_insight_accepted(name, google_cloud_recommender_v1_mark_insight_accepted_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
159
+ command = make_simple_command(:post, 'v1/{+name}:markAccepted', options)
160
+ command.request_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1MarkInsightAcceptedRequest::Representation
161
+ command.request_object = google_cloud_recommender_v1_mark_insight_accepted_request_object
162
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight::Representation
163
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Insight
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::RecommenderV1::GoogleCloudRecommenderV1Recommendation] parsed result object
184
+ # @yieldparam err [StandardError] error object if request failed
185
+ #
186
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation]
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_project_location_recommender_recommendation(name, fields: nil, quota_user: nil, options: nil, &block)
192
+ command = make_simple_command(:get, 'v1/{+name}', options)
193
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation::Representation
194
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation
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::RecommenderV1::GoogleCloudRecommenderV1ListRecommendationsResponse] parsed result object
232
+ # @yieldparam err [StandardError] error object if request failed
233
+ #
234
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListRecommendationsResponse]
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_project_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, 'v1/{+parent}/recommendations', options)
241
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListRecommendationsResponse::Representation
242
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1ListRecommendationsResponse
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,
257
+ # SUCCEEDED, FAILED, or ACTIVE state. Requires the recommender.*.update IAM
258
+ # permission for the specified recommender.
259
+ # @param [String] name
260
+ # Required. Name of the recommendation.
261
+ # @param [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationClaimedRequest] google_cloud_recommender_v1_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::RecommenderV1::GoogleCloudRecommenderV1Recommendation] parsed result object
272
+ # @yieldparam err [StandardError] error object if request failed
273
+ #
274
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation]
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_project_location_recommender_recommendation_claimed(name, google_cloud_recommender_v1_mark_recommendation_claimed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
280
+ command = make_simple_command(:post, 'v1/{+name}:markClaimed', options)
281
+ command.request_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationClaimedRequest::Representation
282
+ command.request_object = google_cloud_recommender_v1_mark_recommendation_claimed_request_object
283
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation::Representation
284
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation
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::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationFailedRequest] google_cloud_recommender_v1_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::RecommenderV1::GoogleCloudRecommenderV1Recommendation] parsed result object
311
+ # @yieldparam err [StandardError] error object if request failed
312
+ #
313
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation]
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_project_location_recommender_recommendation_failed(name, google_cloud_recommender_v1_mark_recommendation_failed_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
319
+ command = make_simple_command(:post, 'v1/{+name}:markFailed', options)
320
+ command.request_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationFailedRequest::Representation
321
+ command.request_object = google_cloud_recommender_v1_mark_recommendation_failed_request_object
322
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation::Representation
323
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation
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::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationSucceededRequest] google_cloud_recommender_v1_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::RecommenderV1::GoogleCloudRecommenderV1Recommendation] parsed result object
350
+ # @yieldparam err [StandardError] error object if request failed
351
+ #
352
+ # @return [Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation]
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_project_location_recommender_recommendation_succeeded(name, google_cloud_recommender_v1_mark_recommendation_succeeded_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
358
+ command = make_simple_command(:post, 'v1/{+name}:markSucceeded', options)
359
+ command.request_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1MarkRecommendationSucceededRequest::Representation
360
+ command.request_object = google_cloud_recommender_v1_mark_recommendation_succeeded_request_object
361
+ command.response_representation = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation::Representation
362
+ command.response_class = Google::Apis::RecommenderV1::GoogleCloudRecommenderV1Recommendation
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
+ protected
370
+
371
+ def apply_command_defaults(command)
372
+ command.query['key'] = key unless key.nil?
373
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
374
+ end
375
+ end
376
+ end
377
+ end
378
+ end