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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a147606ed630ac447b27d86b593304747deb2f2336c17c7722c331322e49260
4
- data.tar.gz: 4aa0522472c07fe282827efbccec6e33235accc5feff8f7cada4ba3cc8a51de7
3
+ metadata.gz: b9d746d1242f5b01b588e420f2b782791bc0cb77feacf6953302d90adcb54291
4
+ data.tar.gz: feeba47599b92f332dcf7b6401b3b21c4a76d7121a2131239c54345c59289014
5
5
  SHA512:
6
- metadata.gz: ae83e3a9163160bdfe2feb264519c7f0066f53e00f4ffb8c40c4a8a60885b7ba7c7b05b1601eb8bef19981052f7cb76122f4b58d8dfbfe412b3bde24ced39bdf
7
- data.tar.gz: d6d6a8001b0504d4f30ed72377bfd0524a07c5570bd2ce6f784821cd200c4f72949bfad0a9dafa07e9d0e518e7f8e1786dac4bdca3a0a1d375db2f46b266f825
6
+ metadata.gz: 92a72fd830b2e87ed1dd46bfe890862ff430ce9ffc7c04bcd1a6630ec6c84b7f2dbbf610bb9998936ac855b853d1e6e26278902b954f3ef40c1c9cc515005135
7
+ data.tar.gz: 3af8aa05bc344239a42b7488bce5d8822779351b29a0cd2527740d08151e4f5d3dd38f7bafb94c74e1c4a5ee2d023e8836e0632b5cbe16ef075922433fda5f95
@@ -10,7 +10,7 @@ require 'google/cloud/support/v2beta/actor_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
11
 
12
12
 
13
- descriptor_data = "\n,google/cloud/support/v2beta/attachment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x85\x03\n\nAttachment\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x41ttachmentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
13
+ descriptor_data = "\n,google/cloud/support/v2beta/attachment.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x88\x03\n\nAttachment\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x08\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x07\x63reator\x18\x03 \x01(\x0b\x32\".google.cloud.support.v2beta.ActorB\x03\xe0\x41\x03\x12\x10\n\x08\x66ilename\x18\x04 \x01(\t\x12\x16\n\tmime_type\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03:\xb0\x01\xea\x41\xac\x01\n&cloudsupport.googleapis.com/Attachment\x12\x45organizations/{organization}/cases/{case}/attachments/{attachment_id}\x12;projects/{project}/cases/{case}/attachments/{attachment_id}B\xcc\x01\n\x1f\x63om.google.cloud.support.v2betaB\x0f\x41ttachmentProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
14
14
 
15
15
  pool = Google::Protobuf::DescriptorPool.generated_pool
16
16
 
@@ -11,7 +11,7 @@ require 'google/api/resource_pb'
11
11
  require 'google/cloud/support/v2beta/attachment_pb'
12
12
 
13
13
 
14
- descriptor_data = "\n4google/cloud/support/v2beta/attachment_service.proto\x12\x1bgoogle.cloud.support.v2beta\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/v2beta/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\"p\n\x17ListAttachmentsResponse\x12<\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32\'.google.cloud.support.v2beta.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\xe1\x02\n\x15\x43\x61seAttachmentService\x12\xf6\x01\n\x0fListAttachments\x12\x33.google.cloud.support.v2beta.ListAttachmentsRequest\x1a\x34.google.cloud.support.v2beta.ListAttachmentsResponse\"x\xda\x41\x06parent\x82\xd3\xe4\x93\x02i\x12//v2beta/{parent=projects/*/cases/*}/attachmentsZ6\x12\x34/v2beta/{parent=organizations/*/cases/*}/attachments\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1f\x63om.google.cloud.support.v2betaB\x16\x41ttachmentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
14
+ descriptor_data = "\n4google/cloud/support/v2beta/attachment_service.proto\x12\x1bgoogle.cloud.support.v2beta\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/v2beta/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\"p\n\x17ListAttachmentsResponse\x12<\n\x0b\x61ttachments\x18\x01 \x03(\x0b\x32\'.google.cloud.support.v2beta.Attachment\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t2\x88\x04\n\x15\x43\x61seAttachmentService\x12\xf6\x01\n\x0fListAttachments\x12\x33.google.cloud.support.v2beta.ListAttachmentsRequest\x1a\x34.google.cloud.support.v2beta.ListAttachmentsResponse\"x\xda\x41\x06parent\x82\xd3\xe4\x93\x02i\x12//v2beta/{parent=projects/*/cases/*}/attachmentsZ6\x12\x34/v2beta/{parent=organizations/*/cases/*}/attachments\x12\xa4\x01\n\rGetAttachment\x12\x31.google.cloud.support.v2beta.GetAttachmentRequest\x1a\'.google.cloud.support.v2beta.Attachment\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v2beta/{name=*/*/cases/*/attachments/*}\x1aO\xca\x41\x1b\x63loudsupport.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xd3\x01\n\x1f\x63om.google.cloud.support.v2betaB\x16\x41ttachmentServiceProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
15
15
 
16
16
  pool = Google::Protobuf::DescriptorPool.generated_pool
17
17
 
@@ -43,6 +43,7 @@ module Google
43
43
  module Support
44
44
  module V2beta
45
45
  ListAttachmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsRequest").msgclass
46
+ GetAttachmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.GetAttachmentRequest").msgclass
46
47
  ListAttachmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2beta.ListAttachmentsResponse").msgclass
47
48
  end
48
49
  end
@@ -34,37 +34,9 @@ module Google
34
34
  self.service_name = 'google.cloud.support.v2beta.CaseAttachmentService'
35
35
 
36
36
  # List all the attachments associated with a support case.
37
- #
38
- # EXAMPLES:
39
- #
40
- # cURL:
41
- #
42
- # ```shell
43
- # case="projects/some-project/cases/23598314"
44
- # curl \
45
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
46
- # "https://cloudsupport.googleapis.com/v2/$case/attachments"
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
- # request = (
61
- # supportApiService.cases()
62
- # .attachments()
63
- # .list(parent="projects/some-project/cases/43595344")
64
- # )
65
- # print(request.execute())
66
- # ```
67
37
  rpc :ListAttachments, ::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Google::Cloud::Support::V2beta::ListAttachmentsResponse
38
+ # Retrieve an attachment.
39
+ rpc :GetAttachment, ::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Google::Cloud::Support::V2beta::Attachment
68
40
  end
69
41
 
70
42
  Stub = Service.rpc_stub_class
@@ -191,36 +191,6 @@ module Google
191
191
  ##
192
192
  # List all the attachments associated with a support case.
193
193
  #
194
- # EXAMPLES:
195
- #
196
- # cURL:
197
- #
198
- # ```shell
199
- # case="projects/some-project/cases/23598314"
200
- # curl \
201
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
202
- # "https://cloudsupport.googleapis.com/v2/$case/attachments"
203
- # ```
204
- #
205
- # Python:
206
- #
207
- # ```python
208
- # import googleapiclient.discovery
209
- #
210
- # api_version = "v2"
211
- # supportApiService = googleapiclient.discovery.build(
212
- # serviceName="cloudsupport",
213
- # version=api_version,
214
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
215
- # )
216
- # request = (
217
- # supportApiService.cases()
218
- # .attachments()
219
- # .list(parent="projects/some-project/cases/43595344")
220
- # )
221
- # print(request.execute())
222
- # ```
223
- #
224
194
  # @overload list_attachments(request, options = nil)
225
195
  # Pass arguments to `list_attachments` via a request object, either of type
226
196
  # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash.
@@ -321,6 +291,91 @@ module Google
321
291
  raise ::Google::Cloud::Error.from_error(e)
322
292
  end
323
293
 
294
+ ##
295
+ # Retrieve an attachment.
296
+ #
297
+ # @overload get_attachment(request, options = nil)
298
+ # Pass arguments to `get_attachment` via a request object, either of type
299
+ # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash.
300
+ #
301
+ # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash]
302
+ # A request object representing the call parameters. Required. To specify no
303
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
304
+ # @param options [::Gapic::CallOptions, ::Hash]
305
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
306
+ #
307
+ # @overload get_attachment(name: nil)
308
+ # Pass arguments to `get_attachment` via keyword arguments. Note that at
309
+ # least one keyword argument is required. To specify no parameters, or to keep all
310
+ # the default parameter values, pass an empty Hash as a request object (see above).
311
+ #
312
+ # @param name [::String]
313
+ # Required. The name of the attachment to get.
314
+ #
315
+ # @yield [response, operation] Access the result along with the RPC operation
316
+ # @yieldparam response [::Google::Cloud::Support::V2beta::Attachment]
317
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
318
+ #
319
+ # @return [::Google::Cloud::Support::V2beta::Attachment]
320
+ #
321
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
322
+ #
323
+ # @example Basic example
324
+ # require "google/cloud/support/v2beta"
325
+ #
326
+ # # Create a client object. The client can be reused for multiple calls.
327
+ # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Client.new
328
+ #
329
+ # # Create a request. To set request fields, pass in keyword arguments.
330
+ # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new
331
+ #
332
+ # # Call the get_attachment method.
333
+ # result = client.get_attachment request
334
+ #
335
+ # # The returned object is of type Google::Cloud::Support::V2beta::Attachment.
336
+ # p result
337
+ #
338
+ def get_attachment request, options = nil
339
+ raise ::ArgumentError, "request must be provided" if request.nil?
340
+
341
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest
342
+
343
+ # Converts hash and nil to an options object
344
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
345
+
346
+ # Customize the options with defaults
347
+ metadata = @config.rpcs.get_attachment.metadata.to_h
348
+
349
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
350
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
351
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
352
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION
353
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
354
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
355
+
356
+ header_params = {}
357
+ if request.name
358
+ header_params["name"] = request.name
359
+ end
360
+
361
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
362
+ metadata[:"x-goog-request-params"] ||= request_params_header
363
+
364
+ options.apply_defaults timeout: @config.rpcs.get_attachment.timeout,
365
+ metadata: metadata,
366
+ retry_policy: @config.rpcs.get_attachment.retry_policy
367
+
368
+ options.apply_defaults timeout: @config.timeout,
369
+ metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @case_attachment_service_stub.call_rpc :get_attachment, request, options: options do |response, operation|
373
+ yield response, operation if block_given?
374
+ end
375
+ rescue ::GRPC::BadStatus => e
376
+ raise ::Google::Cloud::Error.from_error(e)
377
+ end
378
+
324
379
  ##
325
380
  # Configuration class for the CaseAttachmentService API.
326
381
  #
@@ -492,11 +547,18 @@ module Google
492
547
  # @return [::Gapic::Config::Method]
493
548
  #
494
549
  attr_reader :list_attachments
550
+ ##
551
+ # RPC-specific configuration for `get_attachment`
552
+ # @return [::Gapic::Config::Method]
553
+ #
554
+ attr_reader :get_attachment
495
555
 
496
556
  # @private
497
557
  def initialize parent_rpcs = nil
498
558
  list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments
499
559
  @list_attachments = ::Gapic::Config::Method.new list_attachments_config
560
+ get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment
561
+ @get_attachment = ::Gapic::Config::Method.new get_attachment_config
500
562
 
501
563
  yield self if block_given?
502
564
  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
  #
@@ -184,36 +184,6 @@ module Google
184
184
  ##
185
185
  # List all the attachments associated with a support case.
186
186
  #
187
- # EXAMPLES:
188
- #
189
- # cURL:
190
- #
191
- # ```shell
192
- # case="projects/some-project/cases/23598314"
193
- # curl \
194
- # --header "Authorization: Bearer $(gcloud auth print-access-token)" \
195
- # "https://cloudsupport.googleapis.com/v2/$case/attachments"
196
- # ```
197
- #
198
- # Python:
199
- #
200
- # ```python
201
- # import googleapiclient.discovery
202
- #
203
- # api_version = "v2"
204
- # supportApiService = googleapiclient.discovery.build(
205
- # serviceName="cloudsupport",
206
- # version=api_version,
207
- # discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=\\{api_version}",
208
- # )
209
- # request = (
210
- # supportApiService.cases()
211
- # .attachments()
212
- # .list(parent="projects/some-project/cases/43595344")
213
- # )
214
- # print(request.execute())
215
- # ```
216
- #
217
187
  # @overload list_attachments(request, options = nil)
218
188
  # Pass arguments to `list_attachments` via a request object, either of type
219
189
  # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash.
@@ -307,6 +277,84 @@ module Google
307
277
  raise ::Google::Cloud::Error.from_error(e)
308
278
  end
309
279
 
280
+ ##
281
+ # Retrieve an attachment.
282
+ #
283
+ # @overload get_attachment(request, options = nil)
284
+ # Pass arguments to `get_attachment` via a request object, either of type
285
+ # {::Google::Cloud::Support::V2beta::GetAttachmentRequest} or an equivalent Hash.
286
+ #
287
+ # @param request [::Google::Cloud::Support::V2beta::GetAttachmentRequest, ::Hash]
288
+ # A request object representing the call parameters. Required. To specify no
289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
290
+ # @param options [::Gapic::CallOptions, ::Hash]
291
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
292
+ #
293
+ # @overload get_attachment(name: nil)
294
+ # Pass arguments to `get_attachment` via keyword arguments. Note that at
295
+ # least one keyword argument is required. To specify no parameters, or to keep all
296
+ # the default parameter values, pass an empty Hash as a request object (see above).
297
+ #
298
+ # @param name [::String]
299
+ # Required. The name of the attachment to get.
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::Support::V2beta::Attachment]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
307
+ #
308
+ # @example Basic example
309
+ # require "google/cloud/support/v2beta"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Cloud::Support::V2beta::GetAttachmentRequest.new
316
+ #
317
+ # # Call the get_attachment method.
318
+ # result = client.get_attachment request
319
+ #
320
+ # # The returned object is of type Google::Cloud::Support::V2beta::Attachment.
321
+ # p result
322
+ #
323
+ def get_attachment request, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request.nil?
325
+
326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::GetAttachmentRequest
327
+
328
+ # Converts hash and nil to an options object
329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
330
+
331
+ # Customize the options with defaults
332
+ call_metadata = @config.rpcs.get_attachment.metadata.to_h
333
+
334
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
335
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
337
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION,
338
+ transports_version_send: [:rest]
339
+
340
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
341
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ options.apply_defaults timeout: @config.rpcs.get_attachment.timeout,
344
+ metadata: call_metadata,
345
+ retry_policy: @config.rpcs.get_attachment.retry_policy
346
+
347
+ options.apply_defaults timeout: @config.timeout,
348
+ metadata: @config.metadata,
349
+ retry_policy: @config.retry_policy
350
+
351
+ @case_attachment_service_stub.get_attachment request, options do |result, operation|
352
+ yield result, operation if block_given?
353
+ end
354
+ rescue ::Gapic::Rest::Error => e
355
+ raise ::Google::Cloud::Error.from_error(e)
356
+ end
357
+
310
358
  ##
311
359
  # Configuration class for the CaseAttachmentService REST API.
312
360
  #
@@ -458,11 +506,18 @@ module Google
458
506
  # @return [::Gapic::Config::Method]
459
507
  #
460
508
  attr_reader :list_attachments
509
+ ##
510
+ # RPC-specific configuration for `get_attachment`
511
+ # @return [::Gapic::Config::Method]
512
+ #
513
+ attr_reader :get_attachment
461
514
 
462
515
  # @private
463
516
  def initialize parent_rpcs = nil
464
517
  list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments
465
518
  @list_attachments = ::Gapic::Config::Method.new list_attachments_config
519
+ get_attachment_config = parent_rpcs.get_attachment if parent_rpcs.respond_to? :get_attachment
520
+ @get_attachment = ::Gapic::Config::Method.new get_attachment_config
466
521
 
467
522
  yield self if block_given?
468
523
  end
@@ -113,6 +113,46 @@ module Google
113
113
  end
114
114
  end
115
115
 
116
+ ##
117
+ # Baseline implementation for the get_attachment REST call
118
+ #
119
+ # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest]
120
+ # A request object representing the call parameters. Required.
121
+ # @param options [::Gapic::CallOptions]
122
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
123
+ #
124
+ # @yield [result, operation] Access the result along with the TransportOperation object
125
+ # @yieldparam result [::Google::Cloud::Support::V2beta::Attachment]
126
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
127
+ #
128
+ # @return [::Google::Cloud::Support::V2beta::Attachment]
129
+ # A result object deserialized from the server's reply
130
+ def get_attachment request_pb, options = nil
131
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
132
+
133
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_attachment_request request_pb
134
+ query_string_params = if query_string_params.any?
135
+ query_string_params.to_h { |p| p.split "=", 2 }
136
+ else
137
+ {}
138
+ end
139
+
140
+ response = @client_stub.make_http_request(
141
+ verb,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_attachment",
146
+ options: options
147
+ )
148
+ operation = ::Gapic::Rest::TransportOperation.new response
149
+ result = ::Google::Cloud::Support::V2beta::Attachment.decode_json response.body, ignore_unknown_fields: true
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
154
+ end
155
+
116
156
  ##
117
157
  # @private
118
158
  #
@@ -140,6 +180,27 @@ module Google
140
180
  )
141
181
  transcoder.transcode request_pb
142
182
  end
183
+
184
+ ##
185
+ # @private
186
+ #
187
+ # GRPC transcoding helper method for the get_attachment REST call
188
+ #
189
+ # @param request_pb [::Google::Cloud::Support::V2beta::GetAttachmentRequest]
190
+ # A request object representing the call parameters. Required.
191
+ # @return [Array(String, [String, nil], Hash{String => String})]
192
+ # Uri, Body, Query string parameters
193
+ def self.transcode_get_attachment_request request_pb
194
+ transcoder = Gapic::Rest::GrpcTranscoder.new
195
+ .with_bindings(
196
+ uri_method: :get,
197
+ uri_template: "/v2beta/{name}",
198
+ matches: [
199
+ ["name", %r{^[^/]+/[^/]+/cases/[^/]+/attachments/[^/]+/?$}, false]
200
+ ]
201
+ )
202
+ transcoder.transcode request_pb
203
+ end
143
204
  end
144
205
  end
145
206
  end
@@ -10,7 +10,7 @@ require 'google/cloud/support/v2beta/actor_pb'
10
10
  require 'google/protobuf/timestamp_pb'
11
11
 
12
12
 
13
- descriptor_data = "\n&google/cloud/support/v2beta/case.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf1\x06\n\x04\x43\x61se\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12G\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12;\n\x05state\x18\x0c \x01(\x0e\x32\'.google.cloud.support.v2beta.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\x07\x63reator\x18\x0f \x01(\x0b\x32\".google.cloud.support.v2beta.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12<\n\x08priority\x18 \x01(\x0e\x32*.google.cloud.support.v2beta.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"m\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x35\n\x07product\x18\n \x01(\x0b\x32$.google.cloud.support.v2beta.Product\"I\n\x07Product\x12>\n\x0cproduct_line\x18\x01 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLine*N\n\x0bProductLine\x12\x1c\n\x18PRODUCT_LINE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_CLOUD\x10\x01\x12\x0f\n\x0bGOOGLE_MAPS\x10\x02\x42\xc6\x01\n\x1f\x63om.google.cloud.support.v2betaB\tCaseProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
13
+ descriptor_data = "\n&google/cloud/support/v2beta/case.proto\x12\x1bgoogle.cloud.support.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\'google/cloud/support/v2beta/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf6\x06\n\x04\x43\x61se\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12G\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32/.google.cloud.support.v2beta.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12;\n\x05state\x18\x0c \x01(\x0e\x32\'.google.cloud.support.v2beta.Case.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\x07\x63reator\x18\x0f \x01(\x0b\x32\".google.cloud.support.v2beta.Actor\x12\x15\n\rcontact_email\x18# \x01(\t\x12\x11\n\tescalated\x18\x11 \x01(\x08\x12\x11\n\ttest_case\x18\x13 \x01(\x08\x12\x15\n\rlanguage_code\x18\x17 \x01(\t\x12<\n\x08priority\x18 \x01(\x0e\x32*.google.cloud.support.v2beta.Case.Priority\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\x1e\n\x1aIN_PROGRESS_GOOGLE_SUPPORT\x10\x02\x12\x13\n\x0f\x41\x43TION_REQUIRED\x10\x03\x12\x15\n\x11SOLUTION_PROVIDED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05\"L\n\x08Priority\x12\x18\n\x14PRIORITY_UNSPECIFIED\x10\x00\x12\x06\n\x02P0\x10\x01\x12\x06\n\x02P1\x10\x02\x12\x06\n\x02P2\x10\x03\x12\x06\n\x02P3\x10\x04\x12\x06\n\x02P4\x10\x05:q\xea\x41n\n cloudsupport.googleapis.com/Case\x12)organizations/{organization}/cases/{case}\x12\x1fprojects/{project}/cases/{case}\"m\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12\x35\n\x07product\x18\n \x01(\x0b\x32$.google.cloud.support.v2beta.Product\"I\n\x07Product\x12>\n\x0cproduct_line\x18\x01 \x01(\x0e\x32(.google.cloud.support.v2beta.ProductLine*N\n\x0bProductLine\x12\x1c\n\x18PRODUCT_LINE_UNSPECIFIED\x10\x00\x12\x10\n\x0cGOOGLE_CLOUD\x10\x01\x12\x0f\n\x0bGOOGLE_MAPS\x10\x02\x42\xc6\x01\n\x1f\x63om.google.cloud.support.v2betaB\tCaseProtoP\x01Z9cloud.google.com/go/support/apiv2beta/supportpb;supportpb\xaa\x02\x1bGoogle.Cloud.Support.V2Beta\xca\x02\x1bGoogle\\Cloud\\Support\\V2beta\xea\x02\x1eGoogle::Cloud::Support::V2betab\x06proto3"
14
14
 
15
15
  pool = Google::Protobuf::DescriptorPool.generated_pool
16
16