google-apis-cloudsupport_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,590 @@
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 CloudsupportV2
23
+ # Google Cloud Support API
24
+ #
25
+ # Manages Google Cloud technical support cases for Customer Care support
26
+ # offerings.
27
+ #
28
+ # @example
29
+ # require 'google/apis/cloudsupport_v2'
30
+ #
31
+ # Cloudsupport = Google::Apis::CloudsupportV2 # Alias the module
32
+ # service = Cloudsupport::CloudSupportService.new
33
+ #
34
+ # @see https://cloud.google.com/support/docs/apis
35
+ class CloudSupportService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://cloudsupport.googleapis.com/', '',
48
+ client_name: 'google-apis-cloudsupport_v2',
49
+ client_version: Google::Apis::CloudsupportV2::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Retrieve valid classifications to be used when creating a support case. The
54
+ # classications are hierarchical, with each classification containing all levels
55
+ # of the hierarchy, separated by `" > "`. For example `"Technical Issue >
56
+ # Compute > Compute Engine"`. Classification IDs returned by `
57
+ # caseClassifications.search` are guaranteed to be valid for at least 6 months.
58
+ # If a given classification is deactiveated, it will immediately stop being
59
+ # returned. After 6 months, `case.create` requests using the classification ID
60
+ # will fail.
61
+ # @param [Fixnum] page_size
62
+ # The maximum number of cases fetched with each request.
63
+ # @param [String] page_token
64
+ # A token identifying the page of results to return. If unspecified, the first
65
+ # page is retrieved.
66
+ # @param [String] query
67
+ # An expression written in the Google Cloud filter language. If non-empty, then
68
+ # only cases whose fields match the filter are returned. If empty, then no
69
+ # messages are filtered out.
70
+ # @param [String] fields
71
+ # Selector specifying which fields to include in a partial response.
72
+ # @param [String] quota_user
73
+ # Available to use for quota purposes for server-side applications. Can be any
74
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
75
+ # @param [Google::Apis::RequestOptions] options
76
+ # Request-specific options
77
+ #
78
+ # @yield [result, err] Result & error if block supplied
79
+ # @yieldparam result [Google::Apis::CloudsupportV2::SearchCaseClassificationsResponse] parsed result object
80
+ # @yieldparam err [StandardError] error object if request failed
81
+ #
82
+ # @return [Google::Apis::CloudsupportV2::SearchCaseClassificationsResponse]
83
+ #
84
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
85
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
86
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
87
+ def search_case_classifications(page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
88
+ command = make_simple_command(:get, 'v2/caseClassifications:search', options)
89
+ command.response_representation = Google::Apis::CloudsupportV2::SearchCaseClassificationsResponse::Representation
90
+ command.response_class = Google::Apis::CloudsupportV2::SearchCaseClassificationsResponse
91
+ command.query['pageSize'] = page_size unless page_size.nil?
92
+ command.query['pageToken'] = page_token unless page_token.nil?
93
+ command.query['query'] = query unless query.nil?
94
+ command.query['fields'] = fields unless fields.nil?
95
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
96
+ execute_or_queue_command(command, &block)
97
+ end
98
+
99
+ # Close the specified case.
100
+ # @param [String] name
101
+ # Required. The fully qualified name of the case resource to be closed.
102
+ # @param [Google::Apis::CloudsupportV2::CloseCaseRequest] close_case_request_object
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::CloudsupportV2::Case] parsed result object
113
+ # @yieldparam err [StandardError] error object if request failed
114
+ #
115
+ # @return [Google::Apis::CloudsupportV2::Case]
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 close_case(name, close_case_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
121
+ command = make_simple_command(:post, 'v2/{+name}:close', options)
122
+ command.request_representation = Google::Apis::CloudsupportV2::CloseCaseRequest::Representation
123
+ command.request_object = close_case_request_object
124
+ command.response_representation = Google::Apis::CloudsupportV2::Case::Representation
125
+ command.response_class = Google::Apis::CloudsupportV2::Case
126
+ command.params['name'] = name unless name.nil?
127
+ command.query['fields'] = fields unless fields.nil?
128
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
129
+ execute_or_queue_command(command, &block)
130
+ end
131
+
132
+ # Create a new case and associate it with the given Google Cloud Resource. The
133
+ # case object must have the following fields set: `display_name`, `description`,
134
+ # `classification`, and `priority`.
135
+ # @param [String] parent
136
+ # Required. The name of the Google Cloud Resource under which the case should be
137
+ # created.
138
+ # @param [Google::Apis::CloudsupportV2::Case] case_object
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
141
+ # @param [String] quota_user
142
+ # Available to use for quota purposes for server-side applications. Can be any
143
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
144
+ # @param [Google::Apis::RequestOptions] options
145
+ # Request-specific options
146
+ #
147
+ # @yield [result, err] Result & error if block supplied
148
+ # @yieldparam result [Google::Apis::CloudsupportV2::Case] parsed result object
149
+ # @yieldparam err [StandardError] error object if request failed
150
+ #
151
+ # @return [Google::Apis::CloudsupportV2::Case]
152
+ #
153
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
154
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
155
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
156
+ def create_case(parent, case_object = nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:post, 'v2/{+parent}/cases', options)
158
+ command.request_representation = Google::Apis::CloudsupportV2::Case::Representation
159
+ command.request_object = case_object
160
+ command.response_representation = Google::Apis::CloudsupportV2::Case::Representation
161
+ command.response_class = Google::Apis::CloudsupportV2::Case
162
+ command.params['parent'] = parent unless parent.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Escalate a case. Escalating a case will initiate the Google Cloud Support
169
+ # escalation management process. This operation is only available to certain
170
+ # Customer Care tiers. Go to https://cloud.google.com/support and look for '
171
+ # Technical support escalations' in the feature list to find out which tiers are
172
+ # able to perform escalations.
173
+ # @param [String] name
174
+ # Required. The fully qualified name of the Case resource to be escalated.
175
+ # @param [Google::Apis::CloudsupportV2::EscalateCaseRequest] escalate_case_request_object
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::CloudsupportV2::Case] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::CloudsupportV2::Case]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def escalate_case(name, escalate_case_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:post, 'v2/{+name}:escalate', options)
195
+ command.request_representation = Google::Apis::CloudsupportV2::EscalateCaseRequest::Representation
196
+ command.request_object = escalate_case_request_object
197
+ command.response_representation = Google::Apis::CloudsupportV2::Case::Representation
198
+ command.response_class = Google::Apis::CloudsupportV2::Case
199
+ command.params['name'] = name unless name.nil?
200
+ command.query['fields'] = fields unless fields.nil?
201
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
202
+ execute_or_queue_command(command, &block)
203
+ end
204
+
205
+ # Retrieve the specified case.
206
+ # @param [String] name
207
+ # Required. The fully qualified name of a case to be retrieved.
208
+ # @param [String] fields
209
+ # Selector specifying which fields to include in a partial response.
210
+ # @param [String] quota_user
211
+ # Available to use for quota purposes for server-side applications. Can be any
212
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
213
+ # @param [Google::Apis::RequestOptions] options
214
+ # Request-specific options
215
+ #
216
+ # @yield [result, err] Result & error if block supplied
217
+ # @yieldparam result [Google::Apis::CloudsupportV2::Case] parsed result object
218
+ # @yieldparam err [StandardError] error object if request failed
219
+ #
220
+ # @return [Google::Apis::CloudsupportV2::Case]
221
+ #
222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
225
+ def get_case(name, fields: nil, quota_user: nil, options: nil, &block)
226
+ command = make_simple_command(:get, 'v2/{+name}', options)
227
+ command.response_representation = Google::Apis::CloudsupportV2::Case::Representation
228
+ command.response_class = Google::Apis::CloudsupportV2::Case
229
+ command.params['name'] = name unless name.nil?
230
+ command.query['fields'] = fields unless fields.nil?
231
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
232
+ execute_or_queue_command(command, &block)
233
+ end
234
+
235
+ # Retrieve all cases under the specified parent. Note: Listing cases under an
236
+ # Organization returns only the cases directly parented by that organization. To
237
+ # retrieve all cases under an organization, including cases parented by projects
238
+ # under that organization, use `cases.search`.
239
+ # @param [String] parent
240
+ # Required. The fully qualified name of parent resource to list cases under.
241
+ # @param [String] filter
242
+ # An expression written in filter language. If non-empty, the query returns the
243
+ # cases that match the filter. Else, the query doesn't filter the cases. Filter
244
+ # expressions use the following fields with the operators equals (`=`) and `AND`:
245
+ # - `state`: The accepted values are `OPEN` or `CLOSED`. - `priority`: The
246
+ # accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You can specify multiple
247
+ # values for priority using the `OR` operator. For example, `priority=P1 OR
248
+ # priority=P2`. - `creator.email`: The email address of the case creator.
249
+ # Examples: - `state=CLOSED` - `state=OPEN AND creator.email="tester@example.com"
250
+ # ` - `state=OPEN AND (priority=P0 OR priority=P1)`
251
+ # @param [Fixnum] page_size
252
+ # The maximum number of cases fetched with each request. Defaults to 10.
253
+ # @param [String] page_token
254
+ # A token identifying the page of results to return. If unspecified, the first
255
+ # page is retrieved.
256
+ # @param [String] fields
257
+ # Selector specifying which fields to include in a partial response.
258
+ # @param [String] quota_user
259
+ # Available to use for quota purposes for server-side applications. Can be any
260
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
261
+ # @param [Google::Apis::RequestOptions] options
262
+ # Request-specific options
263
+ #
264
+ # @yield [result, err] Result & error if block supplied
265
+ # @yieldparam result [Google::Apis::CloudsupportV2::ListCasesResponse] parsed result object
266
+ # @yieldparam err [StandardError] error object if request failed
267
+ #
268
+ # @return [Google::Apis::CloudsupportV2::ListCasesResponse]
269
+ #
270
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
271
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
272
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
273
+ def list_cases(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
274
+ command = make_simple_command(:get, 'v2/{+parent}/cases', options)
275
+ command.response_representation = Google::Apis::CloudsupportV2::ListCasesResponse::Representation
276
+ command.response_class = Google::Apis::CloudsupportV2::ListCasesResponse
277
+ command.params['parent'] = parent unless parent.nil?
278
+ command.query['filter'] = filter unless filter.nil?
279
+ command.query['pageSize'] = page_size unless page_size.nil?
280
+ command.query['pageToken'] = page_token unless page_token.nil?
281
+ command.query['fields'] = fields unless fields.nil?
282
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
283
+ execute_or_queue_command(command, &block)
284
+ end
285
+
286
+ # Update the specified case. Only a subset of fields can be updated.
287
+ # @param [String] name
288
+ # The resource name for the case.
289
+ # @param [Google::Apis::CloudsupportV2::Case] case_object
290
+ # @param [String] update_mask
291
+ # A list of attributes of the case object that should be updated as part of this
292
+ # request. Supported values are `priority`, `display_name`, and `
293
+ # subscriber_email_addresses`. If no fields are specified, all supported fields
294
+ # are updated. WARNING: If you do not provide a field mask, then you might
295
+ # accidentally clear some fields. For example, if you leave the field mask empty
296
+ # and do not provide a value for `subscriber_email_addresses`, then `
297
+ # subscriber_email_addresses` is updated to empty.
298
+ # @param [String] fields
299
+ # Selector specifying which fields to include in a partial response.
300
+ # @param [String] quota_user
301
+ # Available to use for quota purposes for server-side applications. Can be any
302
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
303
+ # @param [Google::Apis::RequestOptions] options
304
+ # Request-specific options
305
+ #
306
+ # @yield [result, err] Result & error if block supplied
307
+ # @yieldparam result [Google::Apis::CloudsupportV2::Case] parsed result object
308
+ # @yieldparam err [StandardError] error object if request failed
309
+ #
310
+ # @return [Google::Apis::CloudsupportV2::Case]
311
+ #
312
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
313
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
314
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
315
+ def patch_case(name, case_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
316
+ command = make_simple_command(:patch, 'v2/{+name}', options)
317
+ command.request_representation = Google::Apis::CloudsupportV2::Case::Representation
318
+ command.request_object = case_object
319
+ command.response_representation = Google::Apis::CloudsupportV2::Case::Representation
320
+ command.response_class = Google::Apis::CloudsupportV2::Case
321
+ command.params['name'] = name unless name.nil?
322
+ command.query['updateMask'] = update_mask unless update_mask.nil?
323
+ command.query['fields'] = fields unless fields.nil?
324
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
325
+ execute_or_queue_command(command, &block)
326
+ end
327
+
328
+ # Search cases using the specified query.
329
+ # @param [String] parent
330
+ # The fully qualified name of parent resource to search cases under.
331
+ # @param [Fixnum] page_size
332
+ # The maximum number of cases fetched with each request. The default page size
333
+ # is 10.
334
+ # @param [String] page_token
335
+ # A token identifying the page of results to return. If unspecified, the first
336
+ # page is retrieved.
337
+ # @param [String] query
338
+ # An expression written in filter language. A query uses the following fields
339
+ # with the operators equals (`=`) and `AND`: - `organization`: An organization
340
+ # name in the form `organizations/`. - `project`: A project name in the form `
341
+ # projects/`. - `state`: The accepted values are `OPEN` or `CLOSED`. - `priority`
342
+ # : The accepted values are `P0`, `P1`, `P2`, `P3`, or `P4`. You can specify
343
+ # multiple values for priority using the `OR` operator. For example, `priority=
344
+ # P1 OR priority=P2`. - `creator.email`: The email address of the case creator. -
345
+ # `billingAccount`: A billing account in the form `billingAccounts/` You must
346
+ # specify either `organization` or `project`. To search across `displayName`, `
347
+ # description`, and comments, use a global restriction with no keyword or
348
+ # operator. For example, `"my search"`. To search only cases updated after a
349
+ # certain date, use `update_time` restricted with that particular date, time,
350
+ # and timezone in ISO datetime format. For example, `update_time>"2020-01-01T00:
351
+ # 00:00-05:00"`. `update_time` only supports the greater than operator (`>`).
352
+ # Examples: - `organization="organizations/123456789"` - `project="projects/my-
353
+ # project-id"` - `project="projects/123456789"` - `billing_account="
354
+ # billingAccounts/123456-A0B0C0-CUZ789"` - `organization="organizations/
355
+ # 123456789" AND state=CLOSED` - `project="projects/my-project-id" AND creator.
356
+ # email="tester@example.com"` - `project="projects/my-project-id" AND (priority=
357
+ # P0 OR priority=P1)`
358
+ # @param [String] fields
359
+ # Selector specifying which fields to include in a partial response.
360
+ # @param [String] quota_user
361
+ # Available to use for quota purposes for server-side applications. Can be any
362
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
363
+ # @param [Google::Apis::RequestOptions] options
364
+ # Request-specific options
365
+ #
366
+ # @yield [result, err] Result & error if block supplied
367
+ # @yieldparam result [Google::Apis::CloudsupportV2::SearchCasesResponse] parsed result object
368
+ # @yieldparam err [StandardError] error object if request failed
369
+ #
370
+ # @return [Google::Apis::CloudsupportV2::SearchCasesResponse]
371
+ #
372
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
373
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
374
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
375
+ def search_cases(parent, page_size: nil, page_token: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
376
+ command = make_simple_command(:get, 'v2/{+parent}/cases:search', options)
377
+ command.response_representation = Google::Apis::CloudsupportV2::SearchCasesResponse::Representation
378
+ command.response_class = Google::Apis::CloudsupportV2::SearchCasesResponse
379
+ command.params['parent'] = parent unless parent.nil?
380
+ command.query['pageSize'] = page_size unless page_size.nil?
381
+ command.query['pageToken'] = page_token unless page_token.nil?
382
+ command.query['query'] = query unless query.nil?
383
+ command.query['fields'] = fields unless fields.nil?
384
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
385
+ execute_or_queue_command(command, &block)
386
+ end
387
+
388
+ # Retrieve all attachments associated with a support case.
389
+ # @param [String] parent
390
+ # Required. The resource name of Case object for which attachments should be
391
+ # listed.
392
+ # @param [Fixnum] page_size
393
+ # The maximum number of attachments fetched with each request. If not provided,
394
+ # the default is 10. The maximum page size that will be returned is 100.
395
+ # @param [String] page_token
396
+ # A token identifying the page of results to return. If unspecified, the first
397
+ # page is retrieved.
398
+ # @param [String] fields
399
+ # Selector specifying which fields to include in a partial response.
400
+ # @param [String] quota_user
401
+ # Available to use for quota purposes for server-side applications. Can be any
402
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
403
+ # @param [Google::Apis::RequestOptions] options
404
+ # Request-specific options
405
+ #
406
+ # @yield [result, err] Result & error if block supplied
407
+ # @yieldparam result [Google::Apis::CloudsupportV2::ListAttachmentsResponse] parsed result object
408
+ # @yieldparam err [StandardError] error object if request failed
409
+ #
410
+ # @return [Google::Apis::CloudsupportV2::ListAttachmentsResponse]
411
+ #
412
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
413
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
414
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
415
+ def list_case_attachments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
416
+ command = make_simple_command(:get, 'v2/{+parent}/attachments', options)
417
+ command.response_representation = Google::Apis::CloudsupportV2::ListAttachmentsResponse::Representation
418
+ command.response_class = Google::Apis::CloudsupportV2::ListAttachmentsResponse
419
+ command.params['parent'] = parent unless parent.nil?
420
+ command.query['pageSize'] = page_size unless page_size.nil?
421
+ command.query['pageToken'] = page_token unless page_token.nil?
422
+ command.query['fields'] = fields unless fields.nil?
423
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
424
+ execute_or_queue_command(command, &block)
425
+ end
426
+
427
+ # Add a new comment to the specified Case. The comment object must have the
428
+ # following fields set: body.
429
+ # @param [String] parent
430
+ # Required. The resource name of Case to which this comment should be added.
431
+ # @param [Google::Apis::CloudsupportV2::Comment] comment_object
432
+ # @param [String] fields
433
+ # Selector specifying which fields to include in a partial response.
434
+ # @param [String] quota_user
435
+ # Available to use for quota purposes for server-side applications. Can be any
436
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
437
+ # @param [Google::Apis::RequestOptions] options
438
+ # Request-specific options
439
+ #
440
+ # @yield [result, err] Result & error if block supplied
441
+ # @yieldparam result [Google::Apis::CloudsupportV2::Comment] parsed result object
442
+ # @yieldparam err [StandardError] error object if request failed
443
+ #
444
+ # @return [Google::Apis::CloudsupportV2::Comment]
445
+ #
446
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
447
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
448
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
449
+ def create_case_comment(parent, comment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
450
+ command = make_simple_command(:post, 'v2/{+parent}/comments', options)
451
+ command.request_representation = Google::Apis::CloudsupportV2::Comment::Representation
452
+ command.request_object = comment_object
453
+ command.response_representation = Google::Apis::CloudsupportV2::Comment::Representation
454
+ command.response_class = Google::Apis::CloudsupportV2::Comment
455
+ command.params['parent'] = parent unless parent.nil?
456
+ command.query['fields'] = fields unless fields.nil?
457
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
458
+ execute_or_queue_command(command, &block)
459
+ end
460
+
461
+ # Retrieve all Comments associated with the Case object.
462
+ # @param [String] parent
463
+ # Required. The resource name of Case object for which comments should be listed.
464
+ # @param [Fixnum] page_size
465
+ # The maximum number of comments fetched with each request. Defaults to 10.
466
+ # @param [String] page_token
467
+ # A token identifying the page of results to return. If unspecified, the first
468
+ # page is retrieved.
469
+ # @param [String] fields
470
+ # Selector specifying which fields to include in a partial response.
471
+ # @param [String] quota_user
472
+ # Available to use for quota purposes for server-side applications. Can be any
473
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
474
+ # @param [Google::Apis::RequestOptions] options
475
+ # Request-specific options
476
+ #
477
+ # @yield [result, err] Result & error if block supplied
478
+ # @yieldparam result [Google::Apis::CloudsupportV2::ListCommentsResponse] parsed result object
479
+ # @yieldparam err [StandardError] error object if request failed
480
+ #
481
+ # @return [Google::Apis::CloudsupportV2::ListCommentsResponse]
482
+ #
483
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
484
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
485
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
486
+ def list_case_comments(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
487
+ command = make_simple_command(:get, 'v2/{+parent}/comments', options)
488
+ command.response_representation = Google::Apis::CloudsupportV2::ListCommentsResponse::Representation
489
+ command.response_class = Google::Apis::CloudsupportV2::ListCommentsResponse
490
+ command.params['parent'] = parent unless parent.nil?
491
+ command.query['pageSize'] = page_size unless page_size.nil?
492
+ command.query['pageToken'] = page_token unless page_token.nil?
493
+ command.query['fields'] = fields unless fields.nil?
494
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
495
+ execute_or_queue_command(command, &block)
496
+ end
497
+
498
+ # Download a file attachment on a case. Note: HTTP requests must append "?alt=
499
+ # media" to the URL.
500
+ # @param [String] name
501
+ # The resource name of the attachment to be downloaded.
502
+ # @param [String] fields
503
+ # Selector specifying which fields to include in a partial response.
504
+ # @param [String] quota_user
505
+ # Available to use for quota purposes for server-side applications. Can be any
506
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
507
+ # @param [IO, String] download_dest
508
+ # IO stream or filename to receive content download
509
+ # @param [Google::Apis::RequestOptions] options
510
+ # Request-specific options
511
+ #
512
+ # @yield [result, err] Result & error if block supplied
513
+ # @yieldparam result [Google::Apis::CloudsupportV2::Media] parsed result object
514
+ # @yieldparam err [StandardError] error object if request failed
515
+ #
516
+ # @return [Google::Apis::CloudsupportV2::Media]
517
+ #
518
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
519
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
520
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
521
+ def download_medium(name, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
522
+ if download_dest.nil?
523
+ command = make_simple_command(:get, 'v2/{+name}:download', options)
524
+ else
525
+ command = make_download_command(:get, 'v2/{+name}:download', options)
526
+ command.download_dest = download_dest
527
+ end
528
+ command.response_representation = Google::Apis::CloudsupportV2::Media::Representation
529
+ command.response_class = Google::Apis::CloudsupportV2::Media
530
+ command.params['name'] = name unless name.nil?
531
+ command.query['fields'] = fields unless fields.nil?
532
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
533
+ execute_or_queue_command(command, &block)
534
+ end
535
+
536
+ # Create a file attachment on a case or Cloud resource. The attachment object
537
+ # must have the following fields set: filename.
538
+ # @param [String] parent
539
+ # Required. The resource name of the case (or case parent) to which the
540
+ # attachment should be attached.
541
+ # @param [Google::Apis::CloudsupportV2::CreateAttachmentRequest] create_attachment_request_object
542
+ # @param [String] fields
543
+ # Selector specifying which fields to include in a partial response.
544
+ # @param [String] quota_user
545
+ # Available to use for quota purposes for server-side applications. Can be any
546
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
547
+ # @param [IO, String] upload_source
548
+ # IO stream or filename containing content to upload
549
+ # @param [String] content_type
550
+ # Content type of the uploaded content.
551
+ # @param [Google::Apis::RequestOptions] options
552
+ # Request-specific options
553
+ #
554
+ # @yield [result, err] Result & error if block supplied
555
+ # @yieldparam result [Google::Apis::CloudsupportV2::Attachment] parsed result object
556
+ # @yieldparam err [StandardError] error object if request failed
557
+ #
558
+ # @return [Google::Apis::CloudsupportV2::Attachment]
559
+ #
560
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
561
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
562
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
563
+ def upload_medium(parent, create_attachment_request_object = nil, fields: nil, quota_user: nil, upload_source: nil, content_type: nil, options: nil, &block)
564
+ if upload_source.nil?
565
+ command = make_simple_command(:post, 'v2/{+parent}/attachments', options)
566
+ else
567
+ command = make_upload_command(:post, 'v2/{+parent}/attachments', options)
568
+ command.upload_source = upload_source
569
+ command.upload_content_type = content_type
570
+ end
571
+ command.request_representation = Google::Apis::CloudsupportV2::CreateAttachmentRequest::Representation
572
+ command.request_object = create_attachment_request_object
573
+ command.response_representation = Google::Apis::CloudsupportV2::Attachment::Representation
574
+ command.response_class = Google::Apis::CloudsupportV2::Attachment
575
+ command.params['parent'] = parent unless parent.nil?
576
+ command.query['fields'] = fields unless fields.nil?
577
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
578
+ execute_or_queue_command(command, &block)
579
+ end
580
+
581
+ protected
582
+
583
+ def apply_command_defaults(command)
584
+ command.query['key'] = key unless key.nil?
585
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
586
+ end
587
+ end
588
+ end
589
+ end
590
+ end
@@ -0,0 +1,37 @@
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/cloudsupport_v2/service.rb'
16
+ require 'google/apis/cloudsupport_v2/classes.rb'
17
+ require 'google/apis/cloudsupport_v2/representations.rb'
18
+ require 'google/apis/cloudsupport_v2/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Google Cloud Support API
23
+ #
24
+ # Manages Google Cloud technical support cases for Customer Care support
25
+ # offerings.
26
+ #
27
+ # @see https://cloud.google.com/support/docs/apis
28
+ module CloudsupportV2
29
+ # Version of the Google Cloud Support API this client connects to.
30
+ # This is NOT the gem version.
31
+ VERSION = 'V2'
32
+
33
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
34
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,15 @@
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/cloudsupport_v2"