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