google-cloud-support-v2 1.11.2 → 1.11.3

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.
@@ -0,0 +1,210 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/v2/attachment_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Support
24
+ module V2
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::V2::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::V2::ListAttachmentsResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::Support::V2::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::V2::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
+ # Baseline implementation for the get_attachment REST call
118
+ #
119
+ # @param request_pb [::Google::Cloud::Support::V2::GetAttachmentRequest]
120
+ # A request object representing the call parameters. Required.
121
+ # @param options [::Gapic::CallOptions]
122
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
123
+ #
124
+ # @yield [result, operation] Access the result along with the TransportOperation object
125
+ # @yieldparam result [::Google::Cloud::Support::V2::Attachment]
126
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
127
+ #
128
+ # @return [::Google::Cloud::Support::V2::Attachment]
129
+ # A result object deserialized from the server's reply
130
+ def get_attachment request_pb, options = nil
131
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
132
+
133
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_attachment_request request_pb
134
+ query_string_params = if query_string_params.any?
135
+ query_string_params.to_h { |p| p.split "=", 2 }
136
+ else
137
+ {}
138
+ end
139
+
140
+ response = @client_stub.make_http_request(
141
+ verb,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_attachment",
146
+ options: options
147
+ )
148
+ operation = ::Gapic::Rest::TransportOperation.new response
149
+ result = ::Google::Cloud::Support::V2::Attachment.decode_json response.body, ignore_unknown_fields: true
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
154
+ end
155
+
156
+ ##
157
+ # @private
158
+ #
159
+ # GRPC transcoding helper method for the list_attachments REST call
160
+ #
161
+ # @param request_pb [::Google::Cloud::Support::V2::ListAttachmentsRequest]
162
+ # A request object representing the call parameters. Required.
163
+ # @return [Array(String, [String, nil], Hash{String => String})]
164
+ # Uri, Body, Query string parameters
165
+ def self.transcode_list_attachments_request request_pb
166
+ transcoder = Gapic::Rest::GrpcTranscoder.new
167
+ .with_bindings(
168
+ uri_method: :get,
169
+ uri_template: "/v2/{parent}/attachments",
170
+ matches: [
171
+ ["parent", %r{^projects/[^/]+/cases/[^/]+/?$}, false]
172
+ ]
173
+ )
174
+ .with_bindings(
175
+ uri_method: :get,
176
+ uri_template: "/v2/{parent}/attachments",
177
+ matches: [
178
+ ["parent", %r{^organizations/[^/]+/cases/[^/]+/?$}, false]
179
+ ]
180
+ )
181
+ transcoder.transcode request_pb
182
+ end
183
+
184
+ ##
185
+ # @private
186
+ #
187
+ # GRPC transcoding helper method for the get_attachment REST call
188
+ #
189
+ # @param request_pb [::Google::Cloud::Support::V2::GetAttachmentRequest]
190
+ # A request object representing the call parameters. Required.
191
+ # @return [Array(String, [String, nil], Hash{String => String})]
192
+ # Uri, Body, Query string parameters
193
+ def self.transcode_get_attachment_request request_pb
194
+ transcoder = Gapic::Rest::GrpcTranscoder.new
195
+ .with_bindings(
196
+ uri_method: :get,
197
+ uri_template: "/v2/{name}",
198
+ matches: [
199
+ ["name", %r{^[^/]+/[^/]+/cases/[^/]+/attachments/[^/]+/?$}, false]
200
+ ]
201
+ )
202
+ transcoder.transcode request_pb
203
+ end
204
+ end
205
+ end
206
+ end
207
+ end
208
+ end
209
+ end
210
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/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/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Support
32
+ module V2
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/v2/case_attachment_service/rest"
39
+ # client = ::Google::Cloud::Support::V2::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/v2/case_attachment_service/rest/helpers" if ::File.file? helper_path
@@ -25,6 +25,7 @@ require "google/cloud/support/v2/version"
25
25
  require "google/cloud/support/v2/case_attachment_service/credentials"
26
26
  require "google/cloud/support/v2/case_attachment_service/paths"
27
27
  require "google/cloud/support/v2/case_attachment_service/client"
28
+ require "google/cloud/support/v2/case_attachment_service/rest"
28
29
 
29
30
  module Google
30
31
  module Cloud
@@ -38,6 +39,11 @@ module Google
38
39
  # require "google/cloud/support/v2/case_attachment_service"
39
40
  # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Client.new
40
41
  #
42
+ # @example Load this service and instantiate a REST client
43
+ #
44
+ # require "google/cloud/support/v2/case_attachment_service/rest"
45
+ # client = ::Google::Cloud::Support::V2::CaseAttachmentService::Rest::Client.new
46
+ #
41
47
  module CaseAttachmentService
42
48
  end
43
49
  end