google-cloud-support-v2 0.a → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/support/v2/actor_pb.rb +44 -0
  6. data/lib/google/cloud/support/v2/attachment_pb.rb +49 -0
  7. data/lib/google/cloud/support/v2/attachment_service_pb.rb +50 -0
  8. data/lib/google/cloud/support/v2/attachment_service_services_pb.rb +45 -0
  9. data/lib/google/cloud/support/v2/case_attachment_service/client.rb +416 -0
  10. data/lib/google/cloud/support/v2/case_attachment_service/credentials.rb +47 -0
  11. data/lib/google/cloud/support/v2/case_attachment_service/paths.rb +72 -0
  12. data/lib/google/cloud/support/v2/case_attachment_service.rb +49 -0
  13. data/lib/google/cloud/support/v2/case_pb.rb +52 -0
  14. data/lib/google/cloud/support/v2/case_service/client.rb +1180 -0
  15. data/lib/google/cloud/support/v2/case_service/credentials.rb +47 -0
  16. data/lib/google/cloud/support/v2/case_service/paths.rb +100 -0
  17. data/lib/google/cloud/support/v2/case_service.rb +49 -0
  18. data/lib/google/cloud/support/v2/case_service_pb.rb +63 -0
  19. data/lib/google/cloud/support/v2/case_service_services_pb.rb +75 -0
  20. data/lib/google/cloud/support/v2/comment_pb.rb +49 -0
  21. data/lib/google/cloud/support/v2/comment_service/client.rb +511 -0
  22. data/lib/google/cloud/support/v2/comment_service/credentials.rb +47 -0
  23. data/lib/google/cloud/support/v2/comment_service/paths.rb +115 -0
  24. data/lib/google/cloud/support/v2/comment_service.rb +49 -0
  25. data/lib/google/cloud/support/v2/comment_service_pb.rb +51 -0
  26. data/lib/google/cloud/support/v2/comment_service_services_pb.rb +48 -0
  27. data/lib/google/cloud/support/v2/escalation_pb.rb +45 -0
  28. data/lib/google/cloud/support/v2/version.rb +7 -2
  29. data/lib/google/cloud/support/v2.rb +42 -0
  30. data/lib/google-cloud-support-v2.rb +21 -0
  31. data/proto_docs/README.md +4 -0
  32. data/proto_docs/google/api/client.rb +381 -0
  33. data/proto_docs/google/api/field_behavior.rb +85 -0
  34. data/proto_docs/google/api/launch_stage.rb +71 -0
  35. data/proto_docs/google/api/resource.rb +222 -0
  36. data/proto_docs/google/cloud/support/v2/actor.rb +49 -0
  37. data/proto_docs/google/cloud/support/v2/attachment.rb +51 -0
  38. data/proto_docs/google/cloud/support/v2/attachment_service.rb +59 -0
  39. data/proto_docs/google/cloud/support/v2/case.rb +152 -0
  40. data/proto_docs/google/cloud/support/v2/case_service.rb +240 -0
  41. data/proto_docs/google/cloud/support/v2/comment.rb +49 -0
  42. data/proto_docs/google/cloud/support/v2/comment_service.rb +69 -0
  43. data/proto_docs/google/cloud/support/v2/escalation.rb +55 -0
  44. data/proto_docs/google/protobuf/duration.rb +98 -0
  45. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  46. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  47. metadata +201 -13
@@ -0,0 +1,416 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/v2/attachment_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Support
25
+ module V2
26
+ module CaseAttachmentService
27
+ ##
28
+ # Client for the CaseAttachmentService service.
29
+ #
30
+ # A service to manage file attachment for Google Cloud support cases.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :case_attachment_service_stub
37
+
38
+ ##
39
+ # Configure the CaseAttachmentService Client class.
40
+ #
41
+ # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # @example
45
+ #
46
+ # # Modify the configuration for all CaseAttachmentService clients
47
+ # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
50
+ #
51
+ # @yield [config] Configure the Client client.
52
+ # @yieldparam config [Client::Configuration]
53
+ #
54
+ # @return [Client::Configuration]
55
+ #
56
+ def self.configure
57
+ @configure ||= begin
58
+ namespace = ["Google", "Cloud", "Support", "V2"]
59
+ parent_config = while namespace.any?
60
+ parent_name = namespace.join "::"
61
+ parent_const = const_get parent_name
62
+ break parent_const.configure if parent_const.respond_to? :configure
63
+ namespace.pop
64
+ end
65
+ default_config = Client::Configuration.new parent_config
66
+
67
+ default_config.rpcs.list_attachments.timeout = 60.0
68
+ default_config.rpcs.list_attachments.retry_policy = {
69
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
70
+ }
71
+
72
+ default_config
73
+ end
74
+ yield @configure if block_given?
75
+ @configure
76
+ end
77
+
78
+ ##
79
+ # Configure the CaseAttachmentService Client instance.
80
+ #
81
+ # The configuration is set to the derived mode, meaning that values can be changed,
82
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
83
+ # should be made on {Client.configure}.
84
+ #
85
+ # See {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration}
86
+ # for a description of the configuration fields.
87
+ #
88
+ # @yield [config] Configure the Client client.
89
+ # @yieldparam config [Client::Configuration]
90
+ #
91
+ # @return [Client::Configuration]
92
+ #
93
+ def configure
94
+ yield @config if block_given?
95
+ @config
96
+ end
97
+
98
+ ##
99
+ # Create a new CaseAttachmentService client object.
100
+ #
101
+ # @example
102
+ #
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new
105
+ #
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
110
+ #
111
+ # @yield [config] Configure the CaseAttachmentService client.
112
+ # @yieldparam config [Client::Configuration]
113
+ #
114
+ def initialize
115
+ # These require statements are intentionally placed here to initialize
116
+ # the gRPC module only when it's required.
117
+ # See https://github.com/googleapis/toolkit/issues/446
118
+ require "gapic/grpc"
119
+ require "google/cloud/support/v2/attachment_service_services_pb"
120
+
121
+ # Create the configuration object
122
+ @config = Configuration.new Client.configure
123
+
124
+ # Yield the configuration if needed
125
+ yield @config if block_given?
126
+
127
+ # Create credentials
128
+ credentials = @config.credentials
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
130
+ # but only if the default endpoint does not have a region prefix.
131
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
132
+ !@config.endpoint.split(".").first.include?("-")
133
+ credentials ||= Credentials.default scope: @config.scope,
134
+ enable_self_signed_jwt: enable_self_signed_jwt
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
136
+ credentials = Credentials.new credentials, scope: @config.scope
137
+ end
138
+ @quota_project_id = @config.quota_project
139
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
140
+
141
+ @case_attachment_service_stub = ::Gapic::ServiceStub.new(
142
+ ::Google::Cloud::Support::V2::CaseAttachmentService::Stub,
143
+ credentials: credentials,
144
+ endpoint: @config.endpoint,
145
+ channel_args: @config.channel_args,
146
+ interceptors: @config.interceptors,
147
+ channel_pool_config: @config.channel_pool
148
+ )
149
+ end
150
+
151
+ # Service calls
152
+
153
+ ##
154
+ # Retrieve all attachments associated with a support case.
155
+ #
156
+ # @overload list_attachments(request, options = nil)
157
+ # Pass arguments to `list_attachments` via a request object, either of type
158
+ # {::Google::Cloud::Support::V2::ListAttachmentsRequest} or an equivalent Hash.
159
+ #
160
+ # @param request [::Google::Cloud::Support::V2::ListAttachmentsRequest, ::Hash]
161
+ # A request object representing the call parameters. Required. To specify no
162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
163
+ # @param options [::Gapic::CallOptions, ::Hash]
164
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
165
+ #
166
+ # @overload list_attachments(parent: nil, page_size: nil, page_token: nil)
167
+ # Pass arguments to `list_attachments` via keyword arguments. Note that at
168
+ # least one keyword argument is required. To specify no parameters, or to keep all
169
+ # the default parameter values, pass an empty Hash as a request object (see above).
170
+ #
171
+ # @param parent [::String]
172
+ # Required. The resource name of Case object for which attachments should be
173
+ # listed.
174
+ # @param page_size [::Integer]
175
+ # The maximum number of attachments fetched with each request. If not
176
+ # provided, the default is 10. The maximum page size that will be returned is
177
+ # 100.
178
+ # @param page_token [::String]
179
+ # A token identifying the page of results to return. If unspecified, the
180
+ # first page is retrieved.
181
+ #
182
+ # @yield [response, operation] Access the result along with the RPC operation
183
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>]
184
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
185
+ #
186
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Support::V2::Attachment>]
187
+ #
188
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
189
+ #
190
+ # @example Basic example
191
+ # require "google/cloud/support/v2"
192
+ #
193
+ # # Create a client object. The client can be reused for multiple calls.
194
+ # client = Google::Cloud::Support::V2::CaseAttachmentService::Client.new
195
+ #
196
+ # # Create a request. To set request fields, pass in keyword arguments.
197
+ # request = Google::Cloud::Support::V2::ListAttachmentsRequest.new
198
+ #
199
+ # # Call the list_attachments method.
200
+ # result = client.list_attachments request
201
+ #
202
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
203
+ # # over elements, and API calls will be issued to fetch pages as needed.
204
+ # result.each do |item|
205
+ # # Each element is of type ::Google::Cloud::Support::V2::Attachment.
206
+ # p item
207
+ # end
208
+ #
209
+ def list_attachments request, options = nil
210
+ raise ::ArgumentError, "request must be provided" if request.nil?
211
+
212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Support::V2::ListAttachmentsRequest
213
+
214
+ # Converts hash and nil to an options object
215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
216
+
217
+ # Customize the options with defaults
218
+ metadata = @config.rpcs.list_attachments.metadata.to_h
219
+
220
+ # Set x-goog-api-client and x-goog-user-project headers
221
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
223
+ gapic_version: ::Google::Cloud::Support::V2::VERSION
224
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
225
+
226
+ header_params = {}
227
+ if request.parent
228
+ header_params["parent"] = request.parent
229
+ end
230
+
231
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
232
+ metadata[:"x-goog-request-params"] ||= request_params_header
233
+
234
+ options.apply_defaults timeout: @config.rpcs.list_attachments.timeout,
235
+ metadata: metadata,
236
+ retry_policy: @config.rpcs.list_attachments.retry_policy
237
+
238
+ options.apply_defaults timeout: @config.timeout,
239
+ metadata: @config.metadata,
240
+ retry_policy: @config.retry_policy
241
+
242
+ @case_attachment_service_stub.call_rpc :list_attachments, request, options: options do |response, operation|
243
+ response = ::Gapic::PagedEnumerable.new @case_attachment_service_stub, :list_attachments, request, response, operation, options
244
+ yield response, operation if block_given?
245
+ return response
246
+ end
247
+ rescue ::GRPC::BadStatus => e
248
+ raise ::Google::Cloud::Error.from_error(e)
249
+ end
250
+
251
+ ##
252
+ # Configuration class for the CaseAttachmentService API.
253
+ #
254
+ # This class represents the configuration for CaseAttachmentService,
255
+ # providing control over timeouts, retry behavior, logging, transport
256
+ # parameters, and other low-level controls. Certain parameters can also be
257
+ # applied individually to specific RPCs. See
258
+ # {::Google::Cloud::Support::V2::CaseAttachmentService::Client::Configuration::Rpcs}
259
+ # for a list of RPCs that can be configured independently.
260
+ #
261
+ # Configuration can be applied globally to all clients, or to a single client
262
+ # on construction.
263
+ #
264
+ # @example
265
+ #
266
+ # # Modify the global config, setting the timeout for
267
+ # # list_attachments to 20 seconds,
268
+ # # and all remaining timeouts to 10 seconds.
269
+ # ::Google::Cloud::Support::V2::CaseAttachmentService::Client.configure do |config|
270
+ # config.timeout = 10.0
271
+ # config.rpcs.list_attachments.timeout = 20.0
272
+ # end
273
+ #
274
+ # # Apply the above configuration only to a new client.
275
+ # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new do |config|
276
+ # config.timeout = 10.0
277
+ # config.rpcs.list_attachments.timeout = 20.0
278
+ # end
279
+ #
280
+ # @!attribute [rw] endpoint
281
+ # The hostname or hostname:port of the service endpoint.
282
+ # Defaults to `"cloudsupport.googleapis.com"`.
283
+ # @return [::String]
284
+ # @!attribute [rw] credentials
285
+ # Credentials to send with calls. You may provide any of the following types:
286
+ # * (`String`) The path to a service account key file in JSON format
287
+ # * (`Hash`) A service account key as a Hash
288
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
289
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
290
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
291
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
292
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
293
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
294
+ # * (`nil`) indicating no credentials
295
+ # @return [::Object]
296
+ # @!attribute [rw] scope
297
+ # The OAuth scopes
298
+ # @return [::Array<::String>]
299
+ # @!attribute [rw] lib_name
300
+ # The library name as recorded in instrumentation and logging
301
+ # @return [::String]
302
+ # @!attribute [rw] lib_version
303
+ # The library version as recorded in instrumentation and logging
304
+ # @return [::String]
305
+ # @!attribute [rw] channel_args
306
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
307
+ # `GRPC::Core::Channel` object is provided as the credential.
308
+ # @return [::Hash]
309
+ # @!attribute [rw] interceptors
310
+ # An array of interceptors that are run before calls are executed.
311
+ # @return [::Array<::GRPC::ClientInterceptor>]
312
+ # @!attribute [rw] timeout
313
+ # The call timeout in seconds.
314
+ # @return [::Numeric]
315
+ # @!attribute [rw] metadata
316
+ # Additional gRPC headers to be sent with the call.
317
+ # @return [::Hash{::Symbol=>::String}]
318
+ # @!attribute [rw] retry_policy
319
+ # The retry policy. The value is a hash with the following keys:
320
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
321
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
322
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
323
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
324
+ # trigger a retry.
325
+ # @return [::Hash]
326
+ # @!attribute [rw] quota_project
327
+ # A separate project against which to charge quota.
328
+ # @return [::String]
329
+ #
330
+ class Configuration
331
+ extend ::Gapic::Config
332
+
333
+ DEFAULT_ENDPOINT = "cloudsupport.googleapis.com"
334
+
335
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
336
+ config_attr :credentials, nil do |value|
337
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
338
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
339
+ allowed.any? { |klass| klass === value }
340
+ end
341
+ config_attr :scope, nil, ::String, ::Array, nil
342
+ config_attr :lib_name, nil, ::String, nil
343
+ config_attr :lib_version, nil, ::String, nil
344
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
345
+ config_attr :interceptors, nil, ::Array, nil
346
+ config_attr :timeout, nil, ::Numeric, nil
347
+ config_attr :metadata, nil, ::Hash, nil
348
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
349
+ config_attr :quota_project, nil, ::String, nil
350
+
351
+ # @private
352
+ def initialize parent_config = nil
353
+ @parent_config = parent_config unless parent_config.nil?
354
+
355
+ yield self if block_given?
356
+ end
357
+
358
+ ##
359
+ # Configurations for individual RPCs
360
+ # @return [Rpcs]
361
+ #
362
+ def rpcs
363
+ @rpcs ||= begin
364
+ parent_rpcs = nil
365
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
366
+ Rpcs.new parent_rpcs
367
+ end
368
+ end
369
+
370
+ ##
371
+ # Configuration for the channel pool
372
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
373
+ #
374
+ def channel_pool
375
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
376
+ end
377
+
378
+ ##
379
+ # Configuration RPC class for the CaseAttachmentService API.
380
+ #
381
+ # Includes fields providing the configuration for each RPC in this service.
382
+ # Each configuration object is of type `Gapic::Config::Method` and includes
383
+ # the following configuration fields:
384
+ #
385
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
386
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
387
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
388
+ # include the following keys:
389
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
390
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
391
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
392
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
393
+ # trigger a retry.
394
+ #
395
+ class Rpcs
396
+ ##
397
+ # RPC-specific configuration for `list_attachments`
398
+ # @return [::Gapic::Config::Method]
399
+ #
400
+ attr_reader :list_attachments
401
+
402
+ # @private
403
+ def initialize parent_rpcs = nil
404
+ list_attachments_config = parent_rpcs.list_attachments if parent_rpcs.respond_to? :list_attachments
405
+ @list_attachments = ::Gapic::Config::Method.new list_attachments_config
406
+
407
+ yield self if block_given?
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
414
+ end
415
+ end
416
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Support
24
+ module V2
25
+ module CaseAttachmentService
26
+ # Credentials for the CaseAttachmentService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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
+
20
+ module Google
21
+ module Cloud
22
+ module Support
23
+ module V2
24
+ module CaseAttachmentService
25
+ # Path helper methods for the CaseAttachmentService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Case resource string.
29
+ #
30
+ # @overload case_path(organization:, case:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `organizations/{organization}/cases/{case}`
34
+ #
35
+ # @param organization [String]
36
+ # @param case [String]
37
+ #
38
+ # @overload case_path(project:, case:)
39
+ # The resource will be in the following format:
40
+ #
41
+ # `projects/{project}/cases/{case}`
42
+ #
43
+ # @param project [String]
44
+ # @param case [String]
45
+ #
46
+ # @return [::String]
47
+ def case_path **args
48
+ resources = {
49
+ "case:organization" => (proc do |organization:, case:|
50
+ raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
51
+
52
+ "organizations/#{organization}/cases/#{binding.local_variable_get :case}"
53
+ end),
54
+ "case:project" => (proc do |project:, case:|
55
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
56
+
57
+ "projects/#{project}/cases/#{binding.local_variable_get :case}"
58
+ end)
59
+ }
60
+
61
+ resource = resources[args.keys.sort.join(":")]
62
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
63
+ resource.call(**args)
64
+ end
65
+
66
+ extend self
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/support/v2/version"
24
+
25
+ require "google/cloud/support/v2/case_attachment_service/credentials"
26
+ require "google/cloud/support/v2/case_attachment_service/paths"
27
+ require "google/cloud/support/v2/case_attachment_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Support
32
+ module V2
33
+ ##
34
+ # A service to manage file attachment for Google Cloud support cases.
35
+ #
36
+ # @example Load this service and instantiate a gRPC client
37
+ #
38
+ # require "google/cloud/support/v2/case_attachment_service"
39
+ # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new
40
+ #
41
+ module CaseAttachmentService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "case_attachment_service", "helpers.rb"
49
+ require "google/cloud/support/v2/case_attachment_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/cloud/support/v2/case.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/api/resource_pb'
9
+ require 'google/cloud/support/v2/actor_pb'
10
+ require 'google/protobuf/timestamp_pb'
11
+
12
+
13
+ descriptor_data = "\n\"google/cloud/support/v2/case.proto\x12\x17google.cloud.support.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/support/v2/actor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xe1\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\x12\x43\n\x0e\x63lassification\x18\x04 \x01(\x0b\x32+.google.cloud.support.v2.CaseClassification\x12\x11\n\ttime_zone\x18\x08 \x01(\t\x12\"\n\x1asubscriber_email_addresses\x18\t \x03(\t\x12\x37\n\x05state\x18\x0c \x01(\x0e\x32#.google.cloud.support.v2.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/\n\x07\x63reator\x18\x0f \x01(\x0b\x32\x1e.google.cloud.support.v2.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\x38\n\x08priority\x18 \x01(\x0e\x32&.google.cloud.support.v2.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}\"6\n\x12\x43\x61seClassification\x12\n\n\x02id\x18\x03 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\tB\xb2\x01\n\x1b\x63om.google.cloud.support.v2B\tCaseProtoP\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"
14
+
15
+ pool = Google::Protobuf::DescriptorPool.generated_pool
16
+
17
+ begin
18
+ pool.add_serialized_file(descriptor_data)
19
+ rescue TypeError => e
20
+ # Compatibility code: will be removed in the next major version.
21
+ require 'google/protobuf/descriptor_pb'
22
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
23
+ parsed.clear_dependency
24
+ serialized = parsed.class.encode(parsed)
25
+ file = pool.add_serialized_file(serialized)
26
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
27
+ imports = [
28
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
29
+ ["google.cloud.support.v2.Actor", "google/cloud/support/v2/actor.proto"],
30
+ ]
31
+ imports.each do |type_name, expected_filename|
32
+ import_file = pool.lookup(type_name).file_descriptor
33
+ if import_file.name != expected_filename
34
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
35
+ end
36
+ end
37
+ warn "Each proto file must use a consistent fully-qualified name."
38
+ warn "This will become an error in the next major version."
39
+ end
40
+
41
+ module Google
42
+ module Cloud
43
+ module Support
44
+ module V2
45
+ Case = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case").msgclass
46
+ Case::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.State").enummodule
47
+ Case::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.Case.Priority").enummodule
48
+ CaseClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.support.v2.CaseClassification").msgclass
49
+ end
50
+ end
51
+ end
52
+ end