google-cloud-support-v2 1.7.1 → 1.8.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.
- checksums.yaml +4 -4
- data/lib/google/cloud/support/v2/attachment_service_pb.rb +2 -1
- data/lib/google/cloud/support/v2/attachment_service_services_pb.rb +32 -0
- data/lib/google/cloud/support/v2/case_attachment_service/client.rb +122 -0
- data/lib/google/cloud/support/v2/case_attachment_service/paths.rb +43 -0
- data/lib/google/cloud/support/v2/comment_service/client.rb +121 -0
- data/lib/google/cloud/support/v2/comment_service_pb.rb +2 -1
- data/lib/google/cloud/support/v2/comment_service_services_pb.rb +31 -0
- data/lib/google/cloud/support/v2/version.rb +1 -1
- data/proto_docs/google/cloud/support/v2/attachment_service.rb +9 -0
- data/proto_docs/google/cloud/support/v2/comment_service.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 077da7f0ce2853f2c891fcc56fa8d25e7e5ff69d464f3d5e144584885ccf8418
|
|
4
|
+
data.tar.gz: 205c5e48a57cf21ba6b60f0ac5aca6d9ceb8367500d479f093fbcdfb223158a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 98250ea956928fb4165cddf09581ffbefa0e6d4ce2582c0730ed078e2f1d602fd01c6b30b42945cb9197eff8aaa79df2794be17cbe8c85c7b31865dd7f259b3b
|
|
7
|
+
data.tar.gz: 923dea493e0aac6578c3b6e38b9ab9a495dc73cc65252c605ff9af82b8acd15779df8739f8affef299ed368601ccc428aedc15178cba9397ef862263c3375328
|
|
@@ -11,7 +11,7 @@ require 'google/api/resource_pb'
|
|
|
11
11
|
require 'google/cloud/support/v2/attachment_pb'
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
descriptor_data = "\n0google/cloud/support/v2/attachment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/support/v2/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"l\n\x17ListAttachmentsResponse\x12\x38\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32#.google.cloud.support.v2.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\
|
|
14
|
+
descriptor_data = "\n0google/cloud/support/v2/attachment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/support/v2/attachment.proto\"y\n\x16ListAttachmentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"T\n\x14GetAttachmentRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&cloudsupport.googleapis.com/Attachment\"l\n\x17ListAttachmentsResponse\x12\x38\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32#.google.cloud.support.v2.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xec\x03\n\x15\x43\x61seAttachmentService\x12\xe6\x01\n\x0fListAttachments\x12/.google.cloud.support.v2.ListAttachmentsRequest\x1a\x30.google.cloud.support.v2.ListAttachmentsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12+/v2/{parent=projects/*/cases/*}/attachmentsZ2\x12\x30/v2/{parent=organizations/*/cases/*}/attachments\x12\x98\x01\n\rGetAttachment\x12-.google.cloud.support.v2.GetAttachmentRequest\x1a#.google.cloud.support.v2.Attachment\"3\xda\x41\x04name\x82\xd3\xe4\x93\x02&\x12$/v2/{name=*/*/cases/*/attachments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x01\n\x1b\x63om.google.cloud.support.v2B\x16\x41ttachmentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3"
|
|
15
15
|
|
|
16
16
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
17
17
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -21,6 +21,7 @@ module Google
|
|
|
21
21
|
module Support
|
|
22
22
|
module V2
|
|
23
23
|
ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsRequest").msgclass
|
|
24
|
+
GetAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.GetAttachmentRequest").msgclass
|
|
24
25
|
ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListAttachmentsResponse").msgclass
|
|
25
26
|
end
|
|
26
27
|
end
|
|
@@ -35,6 +35,38 @@ module Google
|
|
|
35
35
|
|
|
36
36
|
# List all the attachments associated with a support case.
|
|
37
37
|
rpc :ListAttachments, ::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Google::Cloud::Support::V2::ListAttachmentsResponse
|
|
38
|
+
# Retrieve an attachment associated with a support case.
|
|
39
|
+
#
|
|
40
|
+
# EXAMPLES:
|
|
41
|
+
#
|
|
42
|
+
# cURL:
|
|
43
|
+
#
|
|
44
|
+
# ```shell
|
|
45
|
+
# attachment="projects/some-project/cases/23598314/attachments/0684M00000P3h1fQAB"
|
|
46
|
+
# curl \
|
|
47
|
+
# --header "Authorization: Bearer $(gcloud auth print-access-token)" \
|
|
48
|
+
# "https://cloudsupport.googleapis.com/v2/$attachment"
|
|
49
|
+
# ```
|
|
50
|
+
#
|
|
51
|
+
# Python:
|
|
52
|
+
#
|
|
53
|
+
# ```python
|
|
54
|
+
# import googleapiclient.discovery
|
|
55
|
+
#
|
|
56
|
+
# api_version = "v2"
|
|
57
|
+
# supportApiService = googleapiclient.discovery.build(
|
|
58
|
+
# serviceName="cloudsupport",
|
|
59
|
+
# version=api_version,
|
|
60
|
+
# discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
|
|
61
|
+
# )
|
|
62
|
+
# request = (
|
|
63
|
+
# supportApiService.cases()
|
|
64
|
+
# .attachments()
|
|
65
|
+
# .get(name="projects/some-project/cases/43595344/attachments/0684M00000P3h1fQAB")
|
|
66
|
+
# )
|
|
67
|
+
# print(request.execute())
|
|
68
|
+
# ```
|
|
69
|
+
rpc :GetAttachment, ::Google::Cloud::Support::V2::GetAttachmentRequest, ::Google::Cloud::Support::V2::Attachment
|
|
38
70
|
end
|
|
39
71
|
|
|
40
72
|
Stub = Service.rpc_stub_class
|
|
@@ -291,6 +291,121 @@ module Google
|
|
|
291
291
|
raise ::Google::Cloud::Error.from_error(e)
|
|
292
292
|
end
|
|
293
293
|
|
|
294
|
+
##
|
|
295
|
+
# Retrieve an attachment associated with a support case.
|
|
296
|
+
#
|
|
297
|
+
# EXAMPLES:
|
|
298
|
+
#
|
|
299
|
+
# cURL:
|
|
300
|
+
#
|
|
301
|
+
# ```shell
|
|
302
|
+
# attachment="projects/some-project/cases/23598314/attachments/0684M00000P3h1fQAB"
|
|
303
|
+
# curl \
|
|
304
|
+
# --header "Authorization: Bearer $(gcloud auth print-access-token)" \
|
|
305
|
+
# "https://cloudsupport.googleapis.com/v2/$attachment"
|
|
306
|
+
# ```
|
|
307
|
+
#
|
|
308
|
+
# Python:
|
|
309
|
+
#
|
|
310
|
+
# ```python
|
|
311
|
+
# import googleapiclient.discovery
|
|
312
|
+
#
|
|
313
|
+
# api_version = "v2"
|
|
314
|
+
# supportApiService = googleapiclient.discovery.build(
|
|
315
|
+
# serviceName="cloudsupport",
|
|
316
|
+
# version=api_version,
|
|
317
|
+
# discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
|
|
318
|
+
# )
|
|
319
|
+
# request = (
|
|
320
|
+
# supportApiService.cases()
|
|
321
|
+
# .attachments()
|
|
322
|
+
# .get(name="projects/some-project/cases/43595344/attachments/0684M00000P3h1fQAB")
|
|
323
|
+
# )
|
|
324
|
+
# print(request.execute())
|
|
325
|
+
# ```
|
|
326
|
+
#
|
|
327
|
+
# @overload get_attachment(request, options = nil)
|
|
328
|
+
# Pass arguments to `get_attachment` via a request object, either of type
|
|
329
|
+
# {::Google::Cloud::Support::V2::GetAttachmentRequest} or an equivalent Hash.
|
|
330
|
+
#
|
|
331
|
+
# @param request [::Google::Cloud::Support::V2::GetAttachmentRequest, ::Hash]
|
|
332
|
+
# A request object representing the call parameters. Required. To specify no
|
|
333
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
334
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
335
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
336
|
+
#
|
|
337
|
+
# @overload get_attachment(name: nil)
|
|
338
|
+
# Pass arguments to `get_attachment` via keyword arguments. Note that at
|
|
339
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
340
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
341
|
+
#
|
|
342
|
+
# @param name [::String]
|
|
343
|
+
# Required. The name of the attachment to get.
|
|
344
|
+
#
|
|
345
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
346
|
+
# @yieldparam response [::Google::Cloud::Support::V2::Attachment]
|
|
347
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
348
|
+
#
|
|
349
|
+
# @return [::Google::Cloud::Support::V2::Attachment]
|
|
350
|
+
#
|
|
351
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
352
|
+
#
|
|
353
|
+
# @example Basic example
|
|
354
|
+
# require "google/cloud/support/v2"
|
|
355
|
+
#
|
|
356
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
357
|
+
# client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new
|
|
358
|
+
#
|
|
359
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
360
|
+
# request = Google::Cloud::Support::V2::GetAttachmentRequest.new
|
|
361
|
+
#
|
|
362
|
+
# # Call the get_attachment method.
|
|
363
|
+
# result = client.get_attachment request
|
|
364
|
+
#
|
|
365
|
+
# # The returned object is of type Google::Cloud::Support::V2::Attachment.
|
|
366
|
+
# p result
|
|
367
|
+
#
|
|
368
|
+
def get_attachment request, options = nil
|
|
369
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
370
|
+
|
|
371
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetAttachmentRequest
|
|
372
|
+
|
|
373
|
+
# Converts hash and nil to an options object
|
|
374
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
375
|
+
|
|
376
|
+
# Customize the options with defaults
|
|
377
|
+
metadata = @config.rpcs.get_attachment.metadata.to_h
|
|
378
|
+
|
|
379
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
380
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
381
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
382
|
+
gapic_version: ::Google::Cloud::Support::V2::VERSION
|
|
383
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
384
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
385
|
+
|
|
386
|
+
header_params = {}
|
|
387
|
+
if request.name
|
|
388
|
+
header_params["name"] = request.name
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
392
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
393
|
+
|
|
394
|
+
options.apply_defaults timeout: @config.rpcs.get_attachment.timeout,
|
|
395
|
+
metadata: metadata,
|
|
396
|
+
retry_policy: @config.rpcs.get_attachment.retry_policy
|
|
397
|
+
|
|
398
|
+
options.apply_defaults timeout: @config.timeout,
|
|
399
|
+
metadata: @config.metadata,
|
|
400
|
+
retry_policy: @config.retry_policy
|
|
401
|
+
|
|
402
|
+
@case_attachment_service_stub.call_rpc :get_attachment, request, options: options do |response, operation|
|
|
403
|
+
yield response, operation if block_given?
|
|
404
|
+
end
|
|
405
|
+
rescue ::GRPC::BadStatus => e
|
|
406
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
407
|
+
end
|
|
408
|
+
|
|
294
409
|
##
|
|
295
410
|
# Configuration class for the CaseAttachmentService API.
|
|
296
411
|
#
|
|
@@ -479,11 +594,18 @@ module Google
|
|
|
479
594
|
# @return [::Gapic::Config::Method]
|
|
480
595
|
#
|
|
481
596
|
attr_reader :list_attachments
|
|
597
|
+
##
|
|
598
|
+
# RPC-specific configuration for `get_attachment`
|
|
599
|
+
# @return [::Gapic::Config::Method]
|
|
600
|
+
#
|
|
601
|
+
attr_reader :get_attachment
|
|
482
602
|
|
|
483
603
|
# @private
|
|
484
604
|
def initialize parent_rpcs = nil
|
|
485
605
|
list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments
|
|
486
606
|
@list_attachments = ::Gapic::Config::Method.new list_attachments_config
|
|
607
|
+
get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment
|
|
608
|
+
@get_attachment = ::Gapic::Config::Method.new get_attachment_config
|
|
487
609
|
|
|
488
610
|
yield self if block_given?
|
|
489
611
|
end
|
|
@@ -24,6 +24,49 @@ module Google
|
|
|
24
24
|
module CaseAttachmentService
|
|
25
25
|
# Path helper methods for the CaseAttachmentService API.
|
|
26
26
|
module Paths
|
|
27
|
+
##
|
|
28
|
+
# Create a fully-qualified Attachment resource string.
|
|
29
|
+
#
|
|
30
|
+
# @overload attachment_path(organization:, case:, attachment_id:)
|
|
31
|
+
# The resource will be in the following format:
|
|
32
|
+
#
|
|
33
|
+
# `organizations/{organization}/cases/{case}/attachments/{attachment_id}`
|
|
34
|
+
#
|
|
35
|
+
# @param organization [String]
|
|
36
|
+
# @param case [String]
|
|
37
|
+
# @param attachment_id [String]
|
|
38
|
+
#
|
|
39
|
+
# @overload attachment_path(project:, case:, attachment_id:)
|
|
40
|
+
# The resource will be in the following format:
|
|
41
|
+
#
|
|
42
|
+
# `projects/{project}/cases/{case}/attachments/{attachment_id}`
|
|
43
|
+
#
|
|
44
|
+
# @param project [String]
|
|
45
|
+
# @param case [String]
|
|
46
|
+
# @param attachment_id [String]
|
|
47
|
+
#
|
|
48
|
+
# @return [::String]
|
|
49
|
+
def attachment_path **args
|
|
50
|
+
resources = {
|
|
51
|
+
"attachment_id:case:organization" => (proc do |organization:, case:, attachment_id:|
|
|
52
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
|
53
|
+
raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/"
|
|
54
|
+
|
|
55
|
+
"organizations/#{organization}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}"
|
|
56
|
+
end),
|
|
57
|
+
"attachment_id:case:project" => (proc do |project:, case:, attachment_id:|
|
|
58
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
|
59
|
+
raise ::ArgumentError, "case cannot contain /" if binding.local_variable_get(:case).to_s.include? "/"
|
|
60
|
+
|
|
61
|
+
"projects/#{project}/cases/#{binding.local_variable_get :case}/attachments/#{attachment_id}"
|
|
62
|
+
end)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
resource = resources[args.keys.sort.join(":")]
|
|
66
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
|
67
|
+
resource.call(**args)
|
|
68
|
+
end
|
|
69
|
+
|
|
27
70
|
##
|
|
28
71
|
# Create a fully-qualified Case resource string.
|
|
29
72
|
#
|
|
@@ -375,6 +375,120 @@ module Google
|
|
|
375
375
|
raise ::Google::Cloud::Error.from_error(e)
|
|
376
376
|
end
|
|
377
377
|
|
|
378
|
+
##
|
|
379
|
+
# Retrieve a comment.
|
|
380
|
+
#
|
|
381
|
+
# EXAMPLES:
|
|
382
|
+
#
|
|
383
|
+
# cURL:
|
|
384
|
+
#
|
|
385
|
+
# ```shell
|
|
386
|
+
# comment="projects/some-project/cases/43595344/comments/234567890"
|
|
387
|
+
# curl \
|
|
388
|
+
# --header "Authorization: Bearer $(gcloud auth print-access-token)" \
|
|
389
|
+
# "https://cloudsupport.googleapis.com/v2/$comment"
|
|
390
|
+
# ```
|
|
391
|
+
#
|
|
392
|
+
# Python:
|
|
393
|
+
#
|
|
394
|
+
# ```python
|
|
395
|
+
# import googleapiclient.discovery
|
|
396
|
+
#
|
|
397
|
+
# api_version = "v2"
|
|
398
|
+
# supportApiService = googleapiclient.discovery.build(
|
|
399
|
+
# serviceName="cloudsupport",
|
|
400
|
+
# version=api_version,
|
|
401
|
+
# discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
|
|
402
|
+
# )
|
|
403
|
+
#
|
|
404
|
+
# request = supportApiService.cases().comments().get(
|
|
405
|
+
# name="projects/some-project/cases/43595344/comments/234567890",
|
|
406
|
+
# )
|
|
407
|
+
# print(request.execute())
|
|
408
|
+
# ```
|
|
409
|
+
#
|
|
410
|
+
# @overload get_comment(request, options = nil)
|
|
411
|
+
# Pass arguments to `get_comment` via a request object, either of type
|
|
412
|
+
# {::Google::Cloud::Support::V2::GetCommentRequest} or an equivalent Hash.
|
|
413
|
+
#
|
|
414
|
+
# @param request [::Google::Cloud::Support::V2::GetCommentRequest, ::Hash]
|
|
415
|
+
# A request object representing the call parameters. Required. To specify no
|
|
416
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
417
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
418
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
419
|
+
#
|
|
420
|
+
# @overload get_comment(name: nil)
|
|
421
|
+
# Pass arguments to `get_comment` via keyword arguments. Note that at
|
|
422
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
423
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
424
|
+
#
|
|
425
|
+
# @param name [::String]
|
|
426
|
+
# Required. The name of the comment to retrieve.
|
|
427
|
+
#
|
|
428
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
429
|
+
# @yieldparam response [::Google::Cloud::Support::V2::Comment]
|
|
430
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
431
|
+
#
|
|
432
|
+
# @return [::Google::Cloud::Support::V2::Comment]
|
|
433
|
+
#
|
|
434
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
435
|
+
#
|
|
436
|
+
# @example Basic example
|
|
437
|
+
# require "google/cloud/support/v2"
|
|
438
|
+
#
|
|
439
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
440
|
+
# client = Google::Cloud::Support::V2::CommentService::Client.new
|
|
441
|
+
#
|
|
442
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
443
|
+
# request = Google::Cloud::Support::V2::GetCommentRequest.new
|
|
444
|
+
#
|
|
445
|
+
# # Call the get_comment method.
|
|
446
|
+
# result = client.get_comment request
|
|
447
|
+
#
|
|
448
|
+
# # The returned object is of type Google::Cloud::Support::V2::Comment.
|
|
449
|
+
# p result
|
|
450
|
+
#
|
|
451
|
+
def get_comment request, options = nil
|
|
452
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
453
|
+
|
|
454
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::GetCommentRequest
|
|
455
|
+
|
|
456
|
+
# Converts hash and nil to an options object
|
|
457
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
458
|
+
|
|
459
|
+
# Customize the options with defaults
|
|
460
|
+
metadata = @config.rpcs.get_comment.metadata.to_h
|
|
461
|
+
|
|
462
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
463
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
464
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
465
|
+
gapic_version: ::Google::Cloud::Support::V2::VERSION
|
|
466
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
467
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
468
|
+
|
|
469
|
+
header_params = {}
|
|
470
|
+
if request.name
|
|
471
|
+
header_params["name"] = request.name
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
475
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
476
|
+
|
|
477
|
+
options.apply_defaults timeout: @config.rpcs.get_comment.timeout,
|
|
478
|
+
metadata: metadata,
|
|
479
|
+
retry_policy: @config.rpcs.get_comment.retry_policy
|
|
480
|
+
|
|
481
|
+
options.apply_defaults timeout: @config.timeout,
|
|
482
|
+
metadata: @config.metadata,
|
|
483
|
+
retry_policy: @config.retry_policy
|
|
484
|
+
|
|
485
|
+
@comment_service_stub.call_rpc :get_comment, request, options: options do |response, operation|
|
|
486
|
+
yield response, operation if block_given?
|
|
487
|
+
end
|
|
488
|
+
rescue ::GRPC::BadStatus => e
|
|
489
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
490
|
+
end
|
|
491
|
+
|
|
378
492
|
##
|
|
379
493
|
# Configuration class for the CommentService API.
|
|
380
494
|
#
|
|
@@ -568,6 +682,11 @@ module Google
|
|
|
568
682
|
# @return [::Gapic::Config::Method]
|
|
569
683
|
#
|
|
570
684
|
attr_reader :create_comment
|
|
685
|
+
##
|
|
686
|
+
# RPC-specific configuration for `get_comment`
|
|
687
|
+
# @return [::Gapic::Config::Method]
|
|
688
|
+
#
|
|
689
|
+
attr_reader :get_comment
|
|
571
690
|
|
|
572
691
|
# @private
|
|
573
692
|
def initialize parent_rpcs = nil
|
|
@@ -575,6 +694,8 @@ module Google
|
|
|
575
694
|
@list_comments = ::Gapic::Config::Method.new list_comments_config
|
|
576
695
|
create_comment_config = parent_rpcs.create_comment if parent_rpcs.respond_to? :create_comment
|
|
577
696
|
@create_comment = ::Gapic::Config::Method.new create_comment_config
|
|
697
|
+
get_comment_config = parent_rpcs.get_comment if parent_rpcs.respond_to? :get_comment
|
|
698
|
+
@get_comment = ::Gapic::Config::Method.new get_comment_config
|
|
578
699
|
|
|
579
700
|
yield self if block_given?
|
|
580
701
|
end
|
|
@@ -11,7 +11,7 @@ require 'google/api/resource_pb'
|
|
|
11
11
|
require 'google/cloud/support/v2/comment_pb'
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
descriptor_data = "\n-google/cloud/support/v2/comment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/support/v2/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"c\n\x14ListCommentsResponse\x12\x32\n\x08\x63omments\x18\x01 \x03(\x0b\x32 .google.cloud.support.v2.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x36\n\x07\x63omment\x18\x02 \x01(\x0b\x32 .google.cloud.support.v2.CommentB\x03\xe0\x41\x02\
|
|
14
|
+
descriptor_data = "\n-google/cloud/support/v2/comment_service.proto\x12\x17google.cloud.support.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a%google/cloud/support/v2/comment.proto\"v\n\x13ListCommentsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"c\n\x14ListCommentsResponse\x12\x32\n\x08\x63omments\x18\x01 \x03(\x0b\x32 .google.cloud.support.v2.Comment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x88\x01\n\x14\x43reateCommentRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n cloudsupport.googleapis.com/Case\x12\x36\n\x07\x63omment\x18\x02 \x01(\x0b\x32 .google.cloud.support.v2.CommentB\x03\xe0\x41\x02\"N\n\x11GetCommentRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#cloudsupport.googleapis.com/Comment2\xb4\x05\n\x0e\x43ommentService\x12\xd7\x01\n\x0cListComments\x12,.google.cloud.support.v2.ListCommentsRequest\x1a-.google.cloud.support.v2.ListCommentsResponse\"j\xda\x41\x06parent\x82\xd3\xe4\x93\x02[\x12(/v2/{parent=projects/*/cases/*}/commentsZ/\x12-/v2/{parent=organizations/*/cases/*}/comments\x12\xe7\x01\n\rCreateComment\x12-.google.cloud.support.v2.CreateCommentRequest\x1a .google.cloud.support.v2.Comment\"\x84\x01\xda\x41\x0eparent,comment\x82\xd3\xe4\x93\x02m\"(/v2/{parent=projects/*/cases/*}/comments:\x07\x63ommentZ8\"-/v2/{parent=organizations/*/cases/*}/comments:\x07\x63omment\x12\x8c\x01\n\nGetComment\x12*.google.cloud.support.v2.GetCommentRequest\x1a .google.cloud.support.v2.Comment\"0\xda\x41\x04name\x82\xd3\xe4\x93\x02#\x12!/v2/{name=*/*/cases/*/comments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbc\x01\n\x1b\x63om.google.cloud.support.v2B\x13\x43ommentServiceProtoP\x01Z5cloud.google.com/go/support/apiv2/supportpb;supportpb\xaa\x02\x17Google.Cloud.Support.V2\xca\x02\x17Google\\Cloud\\Support\\V2\xea\x02\x1aGoogle::Cloud::Support::V2b\x06proto3"
|
|
15
15
|
|
|
16
16
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
17
17
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -23,6 +23,7 @@ module Google
|
|
|
23
23
|
ListCommentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsRequest").msgclass
|
|
24
24
|
ListCommentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.ListCommentsResponse").msgclass
|
|
25
25
|
CreateCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CreateCommentRequest").msgclass
|
|
26
|
+
GetCommentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.GetCommentRequest").msgclass
|
|
26
27
|
end
|
|
27
28
|
end
|
|
28
29
|
end
|
|
@@ -39,6 +39,37 @@ module Google
|
|
|
39
39
|
#
|
|
40
40
|
# The comment must have the following fields set: `body`.
|
|
41
41
|
rpc :CreateComment, ::Google::Cloud::Support::V2::CreateCommentRequest, ::Google::Cloud::Support::V2::Comment
|
|
42
|
+
# Retrieve a comment.
|
|
43
|
+
#
|
|
44
|
+
# EXAMPLES:
|
|
45
|
+
#
|
|
46
|
+
# cURL:
|
|
47
|
+
#
|
|
48
|
+
# ```shell
|
|
49
|
+
# comment="projects/some-project/cases/43595344/comments/234567890"
|
|
50
|
+
# curl \
|
|
51
|
+
# --header "Authorization: Bearer $(gcloud auth print-access-token)" \
|
|
52
|
+
# "https://cloudsupport.googleapis.com/v2/$comment"
|
|
53
|
+
# ```
|
|
54
|
+
#
|
|
55
|
+
# Python:
|
|
56
|
+
#
|
|
57
|
+
# ```python
|
|
58
|
+
# import googleapiclient.discovery
|
|
59
|
+
#
|
|
60
|
+
# api_version = "v2"
|
|
61
|
+
# supportApiService = googleapiclient.discovery.build(
|
|
62
|
+
# serviceName="cloudsupport",
|
|
63
|
+
# version=api_version,
|
|
64
|
+
# discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}",
|
|
65
|
+
# )
|
|
66
|
+
#
|
|
67
|
+
# request = supportApiService.cases().comments().get(
|
|
68
|
+
# name="projects/some-project/cases/43595344/comments/234567890",
|
|
69
|
+
# )
|
|
70
|
+
# print(request.execute())
|
|
71
|
+
# ```
|
|
72
|
+
rpc :GetComment, ::Google::Cloud::Support::V2::GetCommentRequest, ::Google::Cloud::Support::V2::Comment
|
|
42
73
|
end
|
|
43
74
|
|
|
44
75
|
Stub = Service.rpc_stub_class
|
|
@@ -44,6 +44,15 @@ module Google
|
|
|
44
44
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
# Request for getting an attachment.
|
|
48
|
+
# @!attribute [rw] name
|
|
49
|
+
# @return [::String]
|
|
50
|
+
# Required. The name of the attachment to get.
|
|
51
|
+
class GetAttachmentRequest
|
|
52
|
+
include ::Google::Protobuf::MessageExts
|
|
53
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
54
|
+
end
|
|
55
|
+
|
|
47
56
|
# The response message for the ListAttachments endpoint.
|
|
48
57
|
# @!attribute [rw] attachments
|
|
49
58
|
# @return [::Array<::Google::Cloud::Support::V2::Attachment>]
|
|
@@ -62,6 +62,15 @@ module Google
|
|
|
62
62
|
include ::Google::Protobuf::MessageExts
|
|
63
63
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
64
64
|
end
|
|
65
|
+
|
|
66
|
+
# The request message for the GetComment endpoint.
|
|
67
|
+
# @!attribute [rw] name
|
|
68
|
+
# @return [::String]
|
|
69
|
+
# Required. The name of the comment to retrieve.
|
|
70
|
+
class GetCommentRequest
|
|
71
|
+
include ::Google::Protobuf::MessageExts
|
|
72
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
|
73
|
+
end
|
|
65
74
|
end
|
|
66
75
|
end
|
|
67
76
|
end
|