google-cloud-support-v2beta 0.a → 0.1.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/support/v2beta/actor_pb.rb +44 -0
  6. data/lib/google/cloud/support/v2beta/attachment_pb.rb +49 -0
  7. data/lib/google/cloud/support/v2beta/attachment_service_pb.rb +50 -0
  8. data/lib/google/cloud/support/v2beta/attachment_service_services_pb.rb +75 -0
  9. data/lib/google/cloud/support/v2beta/case_attachment_service/client.rb +510 -0
  10. data/lib/google/cloud/support/v2beta/case_attachment_service/credentials.rb +47 -0
  11. data/lib/google/cloud/support/v2beta/case_attachment_service/paths.rb +72 -0
  12. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/client.rb +477 -0
  13. data/lib/google/cloud/support/v2beta/case_attachment_service/rest/service_stub.rb +149 -0
  14. data/lib/google/cloud/support/v2beta/case_attachment_service/rest.rb +52 -0
  15. data/lib/google/cloud/support/v2beta/case_attachment_service.rb +55 -0
  16. data/lib/google/cloud/support/v2beta/case_pb.rb +54 -0
  17. data/lib/google/cloud/support/v2beta/case_service/client.rb +1526 -0
  18. data/lib/google/cloud/support/v2beta/case_service/credentials.rb +47 -0
  19. data/lib/google/cloud/support/v2beta/case_service/paths.rb +100 -0
  20. data/lib/google/cloud/support/v2beta/case_service/rest/client.rb +1452 -0
  21. data/lib/google/cloud/support/v2beta/case_service/rest/service_stub.rb +624 -0
  22. data/lib/google/cloud/support/v2beta/case_service/rest.rb +52 -0
  23. data/lib/google/cloud/support/v2beta/case_service.rb +55 -0
  24. data/lib/google/cloud/support/v2beta/case_service_pb.rb +63 -0
  25. data/lib/google/cloud/support/v2beta/case_service_services_pb.rb +356 -0
  26. data/lib/google/cloud/support/v2beta/comment_pb.rb +49 -0
  27. data/lib/google/cloud/support/v2beta/comment_service/client.rb +639 -0
  28. data/lib/google/cloud/support/v2beta/comment_service/credentials.rb +47 -0
  29. data/lib/google/cloud/support/v2beta/comment_service/paths.rb +115 -0
  30. data/lib/google/cloud/support/v2beta/comment_service/rest/client.rb +599 -0
  31. data/lib/google/cloud/support/v2beta/comment_service/rest/service_stub.rb +219 -0
  32. data/lib/google/cloud/support/v2beta/comment_service/rest.rb +52 -0
  33. data/lib/google/cloud/support/v2beta/comment_service.rb +55 -0
  34. data/lib/google/cloud/support/v2beta/comment_service_pb.rb +51 -0
  35. data/lib/google/cloud/support/v2beta/comment_service_services_pb.rb +117 -0
  36. data/lib/google/cloud/support/v2beta/content_pb.rb +42 -0
  37. data/lib/google/cloud/support/v2beta/email_message_pb.rb +51 -0
  38. data/lib/google/cloud/support/v2beta/escalation_pb.rb +45 -0
  39. data/lib/google/cloud/support/v2beta/feed_item_pb.rb +52 -0
  40. data/lib/google/cloud/support/v2beta/feed_service/client.rb +482 -0
  41. data/lib/google/cloud/support/v2beta/feed_service/credentials.rb +47 -0
  42. data/lib/google/cloud/support/v2beta/feed_service/paths.rb +72 -0
  43. data/lib/google/cloud/support/v2beta/feed_service/rest/client.rb +449 -0
  44. data/lib/google/cloud/support/v2beta/feed_service/rest/service_stub.rb +149 -0
  45. data/lib/google/cloud/support/v2beta/feed_service/rest.rb +52 -0
  46. data/lib/google/cloud/support/v2beta/feed_service.rb +55 -0
  47. data/lib/google/cloud/support/v2beta/feed_service_pb.rb +50 -0
  48. data/lib/google/cloud/support/v2beta/feed_service_services_pb.rb +46 -0
  49. data/lib/google/cloud/support/v2beta/rest.rb +40 -0
  50. data/lib/google/cloud/support/v2beta/version.rb +7 -2
  51. data/lib/google/cloud/support/v2beta.rb +48 -0
  52. data/lib/google-cloud-support-v2beta.rb +21 -0
  53. data/proto_docs/README.md +4 -0
  54. data/proto_docs/google/api/client.rb +473 -0
  55. data/proto_docs/google/api/field_behavior.rb +85 -0
  56. data/proto_docs/google/api/launch_stage.rb +71 -0
  57. data/proto_docs/google/api/resource.rb +227 -0
  58. data/proto_docs/google/cloud/support/v2beta/actor.rb +59 -0
  59. data/proto_docs/google/cloud/support/v2beta/attachment.rb +58 -0
  60. data/proto_docs/google/cloud/support/v2beta/attachment_service.rb +63 -0
  61. data/proto_docs/google/cloud/support/v2beta/case.rb +215 -0
  62. data/proto_docs/google/cloud/support/v2beta/case_service.rb +245 -0
  63. data/proto_docs/google/cloud/support/v2beta/comment.rb +58 -0
  64. data/proto_docs/google/cloud/support/v2beta/comment_service.rb +68 -0
  65. data/proto_docs/google/cloud/support/v2beta/content.rb +35 -0
  66. data/proto_docs/google/cloud/support/v2beta/email_message.rb +55 -0
  67. data/proto_docs/google/cloud/support/v2beta/escalation.rb +55 -0
  68. data/proto_docs/google/cloud/support/v2beta/feed_item.rb +56 -0
  69. data/proto_docs/google/cloud/support/v2beta/feed_service.rb +65 -0
  70. data/proto_docs/google/protobuf/duration.rb +98 -0
  71. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  72. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  73. metadata +105 -9
@@ -0,0 +1,477 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/support/v2beta/attachment_service_pb"
21
+ require "google/cloud/support/v2beta/case_attachment_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Support
26
+ module V2beta
27
+ module CaseAttachmentService
28
+ module Rest
29
+ ##
30
+ # REST client for the CaseAttachmentService service.
31
+ #
32
+ # A service to manage file attachments for Google Cloud support cases.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudsupport.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :case_attachment_service_stub
45
+
46
+ ##
47
+ # Configure the CaseAttachmentService Client class.
48
+ #
49
+ # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all CaseAttachmentService clients
55
+ # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Support", "V2beta"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.list_attachments.timeout = 60.0
76
+ default_config.rpcs.list_attachments.retry_policy = {
77
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
78
+ }
79
+
80
+ default_config
81
+ end
82
+ yield @configure if block_given?
83
+ @configure
84
+ end
85
+
86
+ ##
87
+ # Configure the CaseAttachmentService Client instance.
88
+ #
89
+ # The configuration is set to the derived mode, meaning that values can be changed,
90
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
91
+ # should be made on {Client.configure}.
92
+ #
93
+ # See {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration}
94
+ # for a description of the configuration fields.
95
+ #
96
+ # @yield [config] Configure the Client client.
97
+ # @yieldparam config [Client::Configuration]
98
+ #
99
+ # @return [Client::Configuration]
100
+ #
101
+ def configure
102
+ yield @config if block_given?
103
+ @config
104
+ end
105
+
106
+ ##
107
+ # The effective universe domain
108
+ #
109
+ # @return [String]
110
+ #
111
+ def universe_domain
112
+ @case_attachment_service_stub.universe_domain
113
+ end
114
+
115
+ ##
116
+ # Create a new CaseAttachmentService REST client object.
117
+ #
118
+ # @example
119
+ #
120
+ # # Create a client using the default configuration
121
+ # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new
122
+ #
123
+ # # Create a client using a custom configuration
124
+ # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config|
125
+ # config.timeout = 10.0
126
+ # end
127
+ #
128
+ # @yield [config] Configure the CaseAttachmentService client.
129
+ # @yieldparam config [Client::Configuration]
130
+ #
131
+ def initialize
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+
151
+ @quota_project_id = @config.quota_project
152
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
+
154
+ @case_attachment_service_stub = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials,
159
+ logger: @config.logger
160
+ )
161
+
162
+ @case_attachment_service_stub.logger(stub: true)&.info do |entry|
163
+ entry.set_system_name
164
+ entry.set_service
165
+ entry.message = "Created client for #{entry.service}"
166
+ entry.set_credentials_fields credentials
167
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
168
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
169
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
170
+ end
171
+ end
172
+
173
+ ##
174
+ # The logger used for request/response debug logging.
175
+ #
176
+ # @return [Logger]
177
+ #
178
+ def logger
179
+ @case_attachment_service_stub.logger
180
+ end
181
+
182
+ # Service calls
183
+
184
+ ##
185
+ # List all the attachments associated with a support case.
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
+ # @overload list_attachments(request, options = nil)
218
+ # Pass arguments to `list_attachments` via a request object, either of type
219
+ # {::Google::Cloud::Support::V2beta::ListAttachmentsRequest} or an equivalent Hash.
220
+ #
221
+ # @param request [::Google::Cloud::Support::V2beta::ListAttachmentsRequest, ::Hash]
222
+ # A request object representing the call parameters. Required. To specify no
223
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
224
+ # @param options [::Gapic::CallOptions, ::Hash]
225
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
226
+ #
227
+ # @overload list_attachments(parent: nil, page_size: nil, page_token: nil)
228
+ # Pass arguments to `list_attachments` via keyword arguments. Note that at
229
+ # least one keyword argument is required. To specify no parameters, or to keep all
230
+ # the default parameter values, pass an empty Hash as a request object (see above).
231
+ #
232
+ # @param parent [::String]
233
+ # Required. The name of the case for which attachments should be listed.
234
+ # @param page_size [::Integer]
235
+ # The maximum number of attachments fetched with each request.
236
+ #
237
+ # If not provided, the default is 10. The maximum page size that will be
238
+ # returned is 100.
239
+ #
240
+ # The size of each page can be smaller than the requested page size and can
241
+ # include zero. For example, you could request 100 attachments on one page,
242
+ # receive 0, and then on the next page, receive 90.
243
+ # @param page_token [::String]
244
+ # A token identifying the page of results to return. If unspecified, the
245
+ # first page is retrieved.
246
+ # @yield [result, operation] Access the result along with the TransportOperation object
247
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>]
248
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
249
+ #
250
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Support::V2beta::Attachment>]
251
+ #
252
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
253
+ #
254
+ # @example Basic example
255
+ # require "google/cloud/support/v2beta"
256
+ #
257
+ # # Create a client object. The client can be reused for multiple calls.
258
+ # client = Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new
259
+ #
260
+ # # Create a request. To set request fields, pass in keyword arguments.
261
+ # request = Google::Cloud::Support::V2beta::ListAttachmentsRequest.new
262
+ #
263
+ # # Call the list_attachments method.
264
+ # result = client.list_attachments request
265
+ #
266
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
267
+ # # over elements, and API calls will be issued to fetch pages as needed.
268
+ # result.each do |item|
269
+ # # Each element is of type ::Google::Cloud::Support::V2beta::Attachment.
270
+ # p item
271
+ # end
272
+ #
273
+ def list_attachments request, options = nil
274
+ raise ::ArgumentError, "request must be provided" if request.nil?
275
+
276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2beta::ListAttachmentsRequest
277
+
278
+ # Converts hash and nil to an options object
279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
280
+
281
+ # Customize the options with defaults
282
+ call_metadata = @config.rpcs.list_attachments.metadata.to_h
283
+
284
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
285
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
287
+ gapic_version: ::Google::Cloud::Support::V2beta::VERSION,
288
+ transports_version_send: [:rest]
289
+
290
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
291
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
292
+
293
+ options.apply_defaults timeout: @config.rpcs.list_attachments.timeout,
294
+ metadata: call_metadata,
295
+ retry_policy: @config.rpcs.list_attachments.retry_policy
296
+
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata,
299
+ retry_policy: @config.retry_policy
300
+
301
+ @case_attachment_service_stub.list_attachments request, options do |result, operation|
302
+ result = ::Gapic::Rest::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, "attachments", request, result, options
303
+ yield result, operation if block_given?
304
+ throw :response, result
305
+ end
306
+ rescue ::Gapic::Rest::Error => e
307
+ raise ::Google::Cloud::Error.from_error(e)
308
+ end
309
+
310
+ ##
311
+ # Configuration class for the CaseAttachmentService REST API.
312
+ #
313
+ # This class represents the configuration for CaseAttachmentService REST,
314
+ # providing control over timeouts, retry behavior, logging, transport
315
+ # parameters, and other low-level controls. Certain parameters can also be
316
+ # applied individually to specific RPCs. See
317
+ # {::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client::Configuration::Rpcs}
318
+ # for a list of RPCs that can be configured independently.
319
+ #
320
+ # Configuration can be applied globally to all clients, or to a single client
321
+ # on construction.
322
+ #
323
+ # @example
324
+ #
325
+ # # Modify the global config, setting the timeout for
326
+ # # list_attachments to 20 seconds,
327
+ # # and all remaining timeouts to 10 seconds.
328
+ # ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.configure do |config|
329
+ # config.timeout = 10.0
330
+ # config.rpcs.list_attachments.timeout = 20.0
331
+ # end
332
+ #
333
+ # # Apply the above configuration only to a new client.
334
+ # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new do |config|
335
+ # config.timeout = 10.0
336
+ # config.rpcs.list_attachments.timeout = 20.0
337
+ # end
338
+ #
339
+ # @!attribute [rw] endpoint
340
+ # A custom service endpoint, as a hostname or hostname:port. The default is
341
+ # nil, indicating to use the default endpoint in the current universe domain.
342
+ # @return [::String,nil]
343
+ # @!attribute [rw] credentials
344
+ # Credentials to send with calls. You may provide any of the following types:
345
+ # * (`String`) The path to a service account key file in JSON format
346
+ # * (`Hash`) A service account key as a Hash
347
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
348
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
349
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
350
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
351
+ # * (`nil`) indicating no credentials
352
+ #
353
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
354
+ # external source for authentication to Google Cloud, you must validate it before
355
+ # providing it to a Google API client library. Providing an unvalidated credential
356
+ # configuration to Google APIs can compromise the security of your systems and data.
357
+ # For more information, refer to [Validate credential configurations from external
358
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
359
+ # @return [::Object]
360
+ # @!attribute [rw] scope
361
+ # The OAuth scopes
362
+ # @return [::Array<::String>]
363
+ # @!attribute [rw] lib_name
364
+ # The library name as recorded in instrumentation and logging
365
+ # @return [::String]
366
+ # @!attribute [rw] lib_version
367
+ # The library version as recorded in instrumentation and logging
368
+ # @return [::String]
369
+ # @!attribute [rw] timeout
370
+ # The call timeout in seconds.
371
+ # @return [::Numeric]
372
+ # @!attribute [rw] metadata
373
+ # Additional headers to be sent with the call.
374
+ # @return [::Hash{::Symbol=>::String}]
375
+ # @!attribute [rw] retry_policy
376
+ # The retry policy. The value is a hash with the following keys:
377
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
378
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
379
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
380
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
381
+ # trigger a retry.
382
+ # @return [::Hash]
383
+ # @!attribute [rw] quota_project
384
+ # A separate project against which to charge quota.
385
+ # @return [::String]
386
+ # @!attribute [rw] universe_domain
387
+ # The universe domain within which to make requests. This determines the
388
+ # default endpoint URL. The default value of nil uses the environment
389
+ # universe (usually the default "googleapis.com" universe).
390
+ # @return [::String,nil]
391
+ # @!attribute [rw] logger
392
+ # A custom logger to use for request/response debug logging, or the value
393
+ # `:default` (the default) to construct a default logger, or `nil` to
394
+ # explicitly disable logging.
395
+ # @return [::Logger,:default,nil]
396
+ #
397
+ class Configuration
398
+ extend ::Gapic::Config
399
+
400
+ # @private
401
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
402
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
403
+
404
+ config_attr :endpoint, nil, ::String, nil
405
+ config_attr :credentials, nil do |value|
406
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
407
+ allowed.any? { |klass| klass === value }
408
+ end
409
+ config_attr :scope, nil, ::String, ::Array, nil
410
+ config_attr :lib_name, nil, ::String, nil
411
+ config_attr :lib_version, nil, ::String, nil
412
+ config_attr :timeout, nil, ::Numeric, nil
413
+ config_attr :metadata, nil, ::Hash, nil
414
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
415
+ config_attr :quota_project, nil, ::String, nil
416
+ config_attr :universe_domain, nil, ::String, nil
417
+ config_attr :logger, :default, ::Logger, nil, :default
418
+
419
+ # @private
420
+ def initialize parent_config = nil
421
+ @parent_config = parent_config unless parent_config.nil?
422
+
423
+ yield self if block_given?
424
+ end
425
+
426
+ ##
427
+ # Configurations for individual RPCs
428
+ # @return [Rpcs]
429
+ #
430
+ def rpcs
431
+ @rpcs ||= begin
432
+ parent_rpcs = nil
433
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
434
+ Rpcs.new parent_rpcs
435
+ end
436
+ end
437
+
438
+ ##
439
+ # Configuration RPC class for the CaseAttachmentService API.
440
+ #
441
+ # Includes fields providing the configuration for each RPC in this service.
442
+ # Each configuration object is of type `Gapic::Config::Method` and includes
443
+ # the following configuration fields:
444
+ #
445
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
446
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
447
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
448
+ # include the following keys:
449
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
450
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
451
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
452
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
453
+ # trigger a retry.
454
+ #
455
+ class Rpcs
456
+ ##
457
+ # RPC-specific configuration for `list_attachments`
458
+ # @return [::Gapic::Config::Method]
459
+ #
460
+ attr_reader :list_attachments
461
+
462
+ # @private
463
+ def initialize parent_rpcs = nil
464
+ list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments
465
+ @list_attachments = ::Gapic::Config::Method.new list_attachments_config
466
+
467
+ yield self if block_given?
468
+ end
469
+ end
470
+ end
471
+ end
472
+ end
473
+ end
474
+ end
475
+ end
476
+ end
477
+ end
@@ -0,0 +1,149 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/support/v2beta/attachment_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Support
24
+ module V2beta
25
+ module CaseAttachmentService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the CaseAttachmentService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the list_attachments REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Cloud::Support::V2beta::ListAttachmentsResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::Support::V2beta::ListAttachmentsResponse]
89
+ # A result object deserialized from the server's reply
90
+ def list_attachments request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_attachments_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_attachments",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Cloud::Support::V2beta::ListAttachmentsResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the list_attachments REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Support::V2beta::ListAttachmentsRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_list_attachments_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :get,
129
+ uri_template: "/v2beta/{parent}/attachments",
130
+ matches: [
131
+ ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false]
132
+ ]
133
+ )
134
+ .with_bindings(
135
+ uri_method: :get,
136
+ uri_template: "/v2beta/{parent}/attachments",
137
+ matches: [
138
+ ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false]
139
+ ]
140
+ )
141
+ transcoder.transcode request_pb
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/support/v2beta/version"
24
+
25
+ require "google/cloud/support/v2beta/case_attachment_service/credentials"
26
+ require "google/cloud/support/v2beta/case_attachment_service/paths"
27
+ require "google/cloud/support/v2beta/case_attachment_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Support
32
+ module V2beta
33
+ ##
34
+ # A service to manage file attachments for Google Cloud support cases.
35
+ #
36
+ # To load this service and instantiate a REST client:
37
+ #
38
+ # require "google/cloud/support/v2beta/case_attachment_service/rest"
39
+ # client = ::Google::Cloud::Support::V2beta::CaseAttachmentService::Rest::Client.new
40
+ #
41
+ module CaseAttachmentService
42
+ # Client for the REST transport
43
+ module Rest
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
52
+ require "google/cloud/support/v2beta/case_attachment_service/rest/helpers" if ::File.file? helper_path