google-cloud-support-v2beta 0.1.0 → 0.2.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.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/support/v2beta/attachment_pb.rb +1 -1
  3. data/lib/google/cloud/support/v2beta/attachment_service_pb.rb +2 -1
  4. data/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb +2 -30
  5. data/lib/google/cloud/support/v2beta/case_attachment_service/client.rb +92 -30
  6. data/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb +43 -0
  7. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb +85 -30
  8. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb +61 -0
  9. data/lib/google/cloud/support/v2beta/case_pb.rb +1 -1
  10. data/lib/google/cloud/support/v2beta/case_service/client.rb +0 -274
  11. data/lib/google/cloud/support/v2beta/case_service/rest/client.rb +0 -274
  12. data/lib/google/cloud/support/v2beta/case_service_services_pb.rb +0 -274
  13. data/lib/google/cloud/support/v2beta/comment_service/client.rb +92 -68
  14. data/lib/google/cloud/support/v2beta/comment_service/rest/client.rb +85 -68
  15. data/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb +61 -0
  16. data/lib/google/cloud/support/v2beta/comment_service_pb.rb +2 -1
  17. data/lib/google/cloud/support/v2beta/comment_service_services_pb.rb +2 -68
  18. data/lib/google/cloud/support/v2beta/version.rb +1 -1
  19. data/proto_docs/google/cloud/support/v2beta/actor.rb +1 -1
  20. data/proto_docs/google/cloud/support/v2beta/attachment.rb +1 -1
  21. data/proto_docs/google/cloud/support/v2beta/attachment_service.rb +9 -0
  22. data/proto_docs/google/cloud/support/v2beta/case.rb +1 -1
  23. data/proto_docs/google/cloud/support/v2beta/comment_service.rb +9 -0
  24. metadata +2 -2
@@ -34,199 +34,22 @@ module Google
34
34
  self.service_name = 'google.cloud.support.v2beta.CaseService'
35
35
 
36
36
  # Retrieve a case.
37
- #
38
- # EXAMPLES:
39
- #
40
- # cURL:
41
- #
42
- # ```shell
43
- # case="projects/some-project/cases/16033687"
44
- # curl \
45
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
46
- # "https://cloudsupport.googleapis.com/v2/$case"
47
- # ```
48
- #
49
- # Python:
50
- #
51
- # ```python
52
- # import googleapiclient.discovery
53
- #
54
- # api_version = "v2"
55
- # supportApiService = googleapiclient.discovery.build(
56
- # serviceName="cloudsupport",
57
- # version=api_version,
58
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
59
- # )
60
- #
61
- # request = supportApiService.cases().get(
62
- # name="projects/some-project/cases/43595344",
63
- # )
64
- # print(request.execute())
65
- # ```
66
37
  rpc :GetCase, ::Google::Cloud::Support::V2beta::GetCaseRequest, ::Google::Cloud::Support::V2beta::Case
67
38
  # Retrieve all cases under a parent, but not its children.
68
39
  #
69
40
  # For example, listing cases under an organization only returns the cases
70
41
  # that are directly parented by that organization. To retrieve cases
71
42
  # under an organization and its projects, use `cases.search`.
72
- #
73
- # EXAMPLES:
74
- #
75
- # cURL:
76
- #
77
- # ```shell
78
- # parent="projects/some-project"
79
- # curl \
80
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
81
- # "https://cloudsupport.googleapis.com/v2/$parent/cases"
82
- # ```
83
- #
84
- # Python:
85
- #
86
- # ```python
87
- # import googleapiclient.discovery
88
- #
89
- # api_version = "v2"
90
- # supportApiService = googleapiclient.discovery.build(
91
- # serviceName="cloudsupport",
92
- # version=api_version,
93
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
94
- # )
95
- #
96
- # request =
97
- # supportApiService.cases().list(parent="projects/some-project")
98
- # print(request.execute())
99
- # ```
100
43
  rpc :ListCases, ::Google::Cloud::Support::V2beta::ListCasesRequest, ::Google::Cloud::Support::V2beta::ListCasesResponse
101
44
  # Search for cases using a query.
102
- #
103
- # EXAMPLES:
104
- #
105
- # cURL:
106
- #
107
- # ```shell
108
- # parent="projects/some-project"
109
- # curl \
110
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
111
- # "https://cloudsupport.googleapis.com/v2/$parent/cases:search"
112
- # ```
113
- #
114
- # Python:
115
- #
116
- # ```python
117
- # import googleapiclient.discovery
118
- #
119
- # api_version = "v2"
120
- # supportApiService = googleapiclient.discovery.build(
121
- # serviceName="cloudsupport",
122
- # version=api_version,
123
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
124
- # )
125
- # request = supportApiService.cases().search(
126
- # parent="projects/some-project", query="state=OPEN"
127
- # )
128
- # print(request.execute())
129
- # ```
130
45
  rpc :SearchCases, ::Google::Cloud::Support::V2beta::SearchCasesRequest, ::Google::Cloud::Support::V2beta::SearchCasesResponse
131
46
  # Create a new case and associate it with a parent.
132
47
  #
133
48
  # It must have the following fields set: `display_name`, `description`,
134
49
  # `classification`, and `priority`. If you're just testing the API and don't
135
50
  # want to route your case to an agent, set `testCase=true`.
136
- #
137
- # EXAMPLES:
138
- #
139
- # cURL:
140
- #
141
- # ```shell
142
- # parent="projects/some-project"
143
- # curl \
144
- # --request POST \
145
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
146
- # --header 'Content-Type: application/json' \
147
- # --data '{
148
- # "display_name": "Test case created by me.",
149
- # "description": "a random test case, feel free to close",
150
- # "classification": {
151
- # "id":
152
- # "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
153
- # },
154
- # "time_zone": "-07:00",
155
- # "subscriber_email_addresses": [
156
- # "foo@domain.com",
157
- # "bar@domain.com"
158
- # ],
159
- # "testCase": true,
160
- # "priority": "P3"
161
- # }' \
162
- # "https://cloudsupport.googleapis.com/v2/$parent/cases"
163
- # ```
164
- #
165
- # Python:
166
- #
167
- # ```python
168
- # import googleapiclient.discovery
169
- #
170
- # api_version = "v2"
171
- # supportApiService = googleapiclient.discovery.build(
172
- # serviceName="cloudsupport",
173
- # version=api_version,
174
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
175
- # )
176
- # request = supportApiService.cases().create(
177
- # parent="projects/some-project",
178
- # body={
179
- # "displayName": "A Test Case",
180
- # "description": "This is a test case.",
181
- # "testCase": True,
182
- # "priority": "P2",
183
- # "classification": {
184
- # "id":
185
- # "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
186
- # },
187
- # },
188
- # )
189
- # print(request.execute())
190
- # ```
191
51
  rpc :CreateCase, ::Google::Cloud::Support::V2beta::CreateCaseRequest, ::Google::Cloud::Support::V2beta::Case
192
52
  # Update a case. Only some fields can be updated.
193
- #
194
- # EXAMPLES:
195
- #
196
- # cURL:
197
- #
198
- # ```shell
199
- # case="projects/some-project/cases/43595344"
200
- # curl \
201
- # --request PATCH \
202
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
203
- # --header "Content-Type: application/json" \
204
- # --data '{
205
- # "priority": "P1"
206
- # }' \
207
- # "https://cloudsupport.googleapis.com/v2/$case?updateMask=priority"
208
- # ```
209
- #
210
- # Python:
211
- #
212
- # ```python
213
- # import googleapiclient.discovery
214
- #
215
- # api_version = "v2"
216
- # supportApiService = googleapiclient.discovery.build(
217
- # serviceName="cloudsupport",
218
- # version=api_version,
219
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
220
- # )
221
- # request = supportApiService.cases().patch(
222
- # name="projects/some-project/cases/43112854",
223
- # body={
224
- # "displayName": "This is Now a New Title",
225
- # "priority": "P2",
226
- # },
227
- # )
228
- # print(request.execute())
229
- # ```
230
53
  rpc :UpdateCase, ::Google::Cloud::Support::V2beta::UpdateCaseRequest, ::Google::Cloud::Support::V2beta::Case
231
54
  # Escalate a case, starting the Google Cloud Support escalation management
232
55
  # process.
@@ -235,79 +58,8 @@ module Google
235
58
  # https://cloud.google.com/support and look for 'Technical support
236
59
  # escalations' in the feature list to find out which ones let you
237
60
  # do that.
238
- #
239
- # EXAMPLES:
240
- #
241
- # cURL:
242
- #
243
- # ```shell
244
- # case="projects/some-project/cases/43595344"
245
- # curl \
246
- # --request POST \
247
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
248
- # --header "Content-Type: application/json" \
249
- # --data '{
250
- # "escalation": {
251
- # "reason": "BUSINESS_IMPACT",
252
- # "justification": "This is a test escalation."
253
- # }
254
- # }' \
255
- # "https://cloudsupport.googleapis.com/v2/$case:escalate"
256
- # ```
257
- #
258
- # Python:
259
- #
260
- # ```python
261
- # import googleapiclient.discovery
262
- #
263
- # api_version = "v2"
264
- # supportApiService = googleapiclient.discovery.build(
265
- # serviceName="cloudsupport",
266
- # version=api_version,
267
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
268
- # )
269
- # request = supportApiService.cases().escalate(
270
- # name="projects/some-project/cases/43595344",
271
- # body={
272
- # "escalation": {
273
- # "reason": "BUSINESS_IMPACT",
274
- # "justification": "This is a test escalation.",
275
- # },
276
- # },
277
- # )
278
- # print(request.execute())
279
- # ```
280
61
  rpc :EscalateCase, ::Google::Cloud::Support::V2beta::EscalateCaseRequest, ::Google::Cloud::Support::V2beta::Case
281
62
  # Close a case.
282
- #
283
- # EXAMPLES:
284
- #
285
- # cURL:
286
- #
287
- # ```shell
288
- # case="projects/some-project/cases/43595344"
289
- # curl \
290
- # --request POST \
291
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
292
- # "https://cloudsupport.googleapis.com/v2/$case:close"
293
- # ```
294
- #
295
- # Python:
296
- #
297
- # ```python
298
- # import googleapiclient.discovery
299
- #
300
- # api_version = "v2"
301
- # supportApiService = googleapiclient.discovery.build(
302
- # serviceName="cloudsupport",
303
- # version=api_version,
304
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
305
- # )
306
- # request = supportApiService.cases().close(
307
- # name="projects/some-project/cases/43595344"
308
- # )
309
- # print(request.execute())
310
- # ```
311
63
  rpc :CloseCase, ::Google::Cloud::Support::V2beta::CloseCaseRequest, ::Google::Cloud::Support::V2beta::Case
312
64
  # Retrieve valid classifications to use when creating a support case.
313
65
  #
@@ -319,32 +71,6 @@ module Google
319
71
  # months. When a classification is deactivated, this endpoint immediately
320
72
  # stops returning it. After six months, `case.create` requests using the
321
73
  # classification will fail.
322
- #
323
- # EXAMPLES:
324
- #
325
- # cURL:
326
- #
327
- # ```shell
328
- # curl \
329
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
330
- # 'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"'
331
- # ```
332
- #
333
- # Python:
334
- #
335
- # ```python
336
- # import googleapiclient.discovery
337
- #
338
- # supportApiService = googleapiclient.discovery.build(
339
- # serviceName="cloudsupport",
340
- # version="v2",
341
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=v2",
342
- # )
343
- # request = supportApiService.caseClassifications().search(
344
- # query='display_name:"*Compute Engine*"'
345
- # )
346
- # print(request.execute())
347
- # ```
348
74
  rpc :SearchCaseClassifications, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsRequest, ::Google::Cloud::Support::V2beta::SearchCaseClassificationsResponse
349
75
  end
350
76
 
@@ -193,36 +193,6 @@ module Google
193
193
  ##
194
194
  # List all the comments associated with a case.
195
195
  #
196
- # EXAMPLES:
197
- #
198
- # cURL:
199
- #
200
- # ```shell
201
- # case="projects/some-project/cases/43595344"
202
- # curl \
203
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
204
- # "https://cloudsupport.googleapis.com/v2/$case/comments"
205
- # ```
206
- #
207
- # Python:
208
- #
209
- # ```python
210
- # import googleapiclient.discovery
211
- #
212
- # api_version = "v2"
213
- # supportApiService = googleapiclient.discovery.build(
214
- # serviceName="cloudsupport",
215
- # version=api_version,
216
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
217
- # )
218
- # request = (
219
- # supportApiService.cases()
220
- # .comments()
221
- # .list(parent="projects/some-project/cases/43595344")
222
- # )
223
- # print(request.execute())
224
- # ```
225
- #
226
196
  # @overload list_comments(request, options = nil)
227
197
  # Pass arguments to `list_comments` via a request object, either of type
228
198
  # {::Google::Cloud::Support::V2beta::ListCommentsRequest} or an equivalent Hash.
@@ -321,44 +291,6 @@ module Google
321
291
  #
322
292
  # The comment must have the following fields set: `body`.
323
293
  #
324
- # EXAMPLES:
325
- #
326
- # cURL:
327
- #
328
- # ```shell
329
- # case="projects/some-project/cases/43591344"
330
- # curl \
331
- # --request POST \
332
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
333
- # --header 'Content-Type: application/json' \
334
- # --data '{
335
- # "body": "This is a test comment."
336
- # }' \
337
- # "https://cloudsupport.googleapis.com/v2/$case/comments"
338
- # ```
339
- #
340
- # Python:
341
- #
342
- # ```python
343
- # import googleapiclient.discovery
344
- #
345
- # api_version = "v2"
346
- # supportApiService = googleapiclient.discovery.build(
347
- # serviceName="cloudsupport",
348
- # version=api_version,
349
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
350
- # )
351
- # request = (
352
- # supportApiService.cases()
353
- # .comments()
354
- # .create(
355
- # parent="projects/some-project/cases/43595344",
356
- # body=\\{"body": "This is a test comment."},
357
- # )
358
- # )
359
- # print(request.execute())
360
- # ```
361
- #
362
294
  # @overload create_comment(request, options = nil)
363
295
  # Pass arguments to `create_comment` via a request object, either of type
364
296
  # {::Google::Cloud::Support::V2beta::CreateCommentRequest} or an equivalent Hash.
@@ -443,6 +375,91 @@ module Google
443
375
  raise ::Google::Cloud::Error.from_error(e)
444
376
  end
445
377
 
378
+ ##
379
+ # Retrieve a comment.
380
+ #
381
+ # @overload get_comment(request, options = nil)
382
+ # Pass arguments to `get_comment` via a request object, either of type
383
+ # {::Google::Cloud::Support::V2beta::GetCommentRequest} or an equivalent Hash.
384
+ #
385
+ # @param request [::Google::Cloud::Support::V2beta::GetCommentRequest, ::Hash]
386
+ # A request object representing the call parameters. Required. To specify no
387
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
388
+ # @param options [::Gapic::CallOptions, ::Hash]
389
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
390
+ #
391
+ # @overload get_comment(name: nil)
392
+ # Pass arguments to `get_comment` via keyword arguments. Note that at
393
+ # least one keyword argument is required. To specify no parameters, or to keep all
394
+ # the default parameter values, pass an empty Hash as a request object (see above).
395
+ #
396
+ # @param name [::String]
397
+ # Required. The name of the comment to retrieve.
398
+ #
399
+ # @yield [response, operation] Access the result along with the RPC operation
400
+ # @yieldparam response [::Google::Cloud::Support::V2beta::Comment]
401
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
402
+ #
403
+ # @return [::Google::Cloud::Support::V2beta::Comment]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
+ #
407
+ # @example Basic example
408
+ # require "google/cloud/support/v2beta"
409
+ #
410
+ # # Create a client object. The client can be reused for multiple calls.
411
+ # client = Google::Cloud::Support::V2beta::CommentService::Client.new
412
+ #
413
+ # # Create a request. To set request fields, pass in keyword arguments.
414
+ # request = Google::Cloud::Support::V2beta::GetCommentRequest.new
415
+ #
416
+ # # Call the get_comment method.
417
+ # result = client.get_comment request
418
+ #
419
+ # # The returned object is of type Google::Cloud::Support::V2beta::Comment.
420
+ # p result
421
+ #
422
+ def get_comment request, options = nil
423
+ raise ::ArgumentError, "request must be provided" if request.nil?
424
+
425
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetCommentRequest
426
+
427
+ # Converts hash and nil to an options object
428
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
429
+
430
+ # Customize the options with defaults
431
+ metadata = @config.rpcs.get_comment.metadata.to_h
432
+
433
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
434
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
435
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
436
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION
437
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
438
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
+
440
+ header_params = {}
441
+ if request.name
442
+ header_params["name"] = request.name
443
+ end
444
+
445
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
446
+ metadata[:"x-goog-request-params"] ||= request_params_header
447
+
448
+ options.apply_defaults timeout: @config.rpcs.get_comment.timeout,
449
+ metadata: metadata,
450
+ retry_policy: @config.rpcs.get_comment.retry_policy
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @comment_service_stub.call_rpc :get_comment, request, options: options do |response, operation|
457
+ yield response, operation if block_given?
458
+ end
459
+ rescue ::GRPC::BadStatus => e
460
+ raise ::Google::Cloud::Error.from_error(e)
461
+ end
462
+
446
463
  ##
447
464
  # Configuration class for the CommentService API.
448
465
  #
@@ -619,6 +636,11 @@ module Google
619
636
  # @return [::Gapic::Config::Method]
620
637
  #
621
638
  attr_reader :create_comment
639
+ ##
640
+ # RPC-specific configuration for `get_comment`
641
+ # @return [::Gapic::Config::Method]
642
+ #
643
+ attr_reader :get_comment
622
644
 
623
645
  # @private
624
646
  def initialize parent_rpcs = nil
@@ -626,6 +648,8 @@ module Google
626
648
  @list_comments = ::Gapic::Config::Method.new list_comments_config
627
649
  create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment
628
650
  @create_comment = ::Gapic::Config::Method.new create_comment_config
651
+ get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment
652
+ @get_comment = ::Gapic::Config::Method.new get_comment_config
629
653
 
630
654
  yield self if block_given?
631
655
  end