google-cloud-security-public_ca-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/client.rb +443 -0
  6. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials.rb +49 -0
  7. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/paths.rb +71 -0
  8. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client.rb +410 -0
  9. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub.rb +131 -0
  10. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service/rest.rb +56 -0
  11. data/lib/google/cloud/security/public_ca/v1/public_certificate_authority_service.rb +59 -0
  12. data/lib/google/cloud/security/public_ca/v1/rest.rb +39 -0
  13. data/lib/google/cloud/security/public_ca/v1/version.rb +8 -3
  14. data/lib/google/cloud/security/public_ca/v1.rb +47 -0
  15. data/lib/google/cloud/security/publicca/v1/resources_pb.rb +47 -0
  16. data/lib/google/cloud/security/publicca/v1/service_pb.rb +51 -0
  17. data/lib/google/cloud/security/publicca/v1/service_services_pb.rb +51 -0
  18. data/lib/google-cloud-security-public_ca-v1.rb +21 -0
  19. data/proto_docs/README.md +4 -0
  20. data/proto_docs/google/api/client.rb +399 -0
  21. data/proto_docs/google/api/field_behavior.rb +85 -0
  22. data/proto_docs/google/api/launch_stage.rb +71 -0
  23. data/proto_docs/google/api/resource.rb +222 -0
  24. data/proto_docs/google/cloud/security/publicca/v1/resources.rb +49 -0
  25. data/proto_docs/google/cloud/security/publicca/v1/service.rb +47 -0
  26. data/proto_docs/google/protobuf/duration.rb +98 -0
  27. metadata +70 -10
@@ -0,0 +1,410 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/security/publicca/v1/service_pb"
21
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Security
26
+ module PublicCA
27
+ module V1
28
+ module PublicCertificateAuthorityService
29
+ module Rest
30
+ ##
31
+ # REST client for the PublicCertificateAuthorityService service.
32
+ #
33
+ # Manages the resources required for ACME [external account
34
+ # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for
35
+ # the public certificate authority service.
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :public_certificate_authority_service_stub
48
+
49
+ ##
50
+ # Configure the PublicCertificateAuthorityService Client class.
51
+ #
52
+ # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all PublicCertificateAuthorityService clients
58
+ # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.timeout = 60.0
79
+ default_config.retry_policy = {
80
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the PublicCertificateAuthorityService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @public_certificate_authority_service_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new PublicCertificateAuthorityService REST client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the PublicCertificateAuthorityService client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @public_certificate_authority_service_stub = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials
162
+ )
163
+ end
164
+
165
+ # Service calls
166
+
167
+ ##
168
+ # Creates a new
169
+ # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey}
170
+ # bound to the project.
171
+ #
172
+ # @overload create_external_account_key(request, options = nil)
173
+ # Pass arguments to `create_external_account_key` via a request object, either of type
174
+ # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
181
+ #
182
+ # @overload create_external_account_key(parent: nil, external_account_key: nil)
183
+ # Pass arguments to `create_external_account_key` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param parent [::String]
188
+ # Required. The parent resource where this external_account_key will be
189
+ # created. Format: projects/[project_id]/locations/[location]. At present
190
+ # only the "global" location is supported.
191
+ # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash]
192
+ # Required. The external account key to create. This field only exists to
193
+ # future-proof the API. At present, all fields in ExternalAccountKey are
194
+ # output only and all values are ignored. For the purpose of the
195
+ # CreateExternalAccountKeyRequest, set it to a default/empty value.
196
+ # @yield [result, operation] Access the result along with the TransportOperation object
197
+ # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
198
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
199
+ #
200
+ # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
201
+ #
202
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
203
+ #
204
+ # @example Basic example
205
+ # require "google/cloud/security/public_ca/v1"
206
+ #
207
+ # # Create a client object. The client can be reused for multiple calls.
208
+ # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new
209
+ #
210
+ # # Create a request. To set request fields, pass in keyword arguments.
211
+ # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new
212
+ #
213
+ # # Call the create_external_account_key method.
214
+ # result = client.create_external_account_key request
215
+ #
216
+ # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.
217
+ # p result
218
+ #
219
+ def create_external_account_key request, options = nil
220
+ raise ::ArgumentError, "request must be provided" if request.nil?
221
+
222
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest
223
+
224
+ # Converts hash and nil to an options object
225
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
226
+
227
+ # Customize the options with defaults
228
+ call_metadata = @config.rpcs.create_external_account_key.metadata.to_h
229
+
230
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
231
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
232
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
233
+ gapic_version: ::Google::Cloud::Security::PublicCA::V1::VERSION,
234
+ transports_version_send: [:rest]
235
+
236
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
237
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
238
+
239
+ options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout,
240
+ metadata: call_metadata,
241
+ retry_policy: @config.rpcs.create_external_account_key.retry_policy
242
+
243
+ options.apply_defaults timeout: @config.timeout,
244
+ metadata: @config.metadata,
245
+ retry_policy: @config.retry_policy
246
+
247
+ @public_certificate_authority_service_stub.create_external_account_key request, options do |result, operation|
248
+ yield result, operation if block_given?
249
+ return result
250
+ end
251
+ rescue ::Gapic::Rest::Error => e
252
+ raise ::Google::Cloud::Error.from_error(e)
253
+ end
254
+
255
+ ##
256
+ # Configuration class for the PublicCertificateAuthorityService REST API.
257
+ #
258
+ # This class represents the configuration for PublicCertificateAuthorityService REST,
259
+ # providing control over timeouts, retry behavior, logging, transport
260
+ # parameters, and other low-level controls. Certain parameters can also be
261
+ # applied individually to specific RPCs. See
262
+ # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client::Configuration::Rpcs}
263
+ # for a list of RPCs that can be configured independently.
264
+ #
265
+ # Configuration can be applied globally to all clients, or to a single client
266
+ # on construction.
267
+ #
268
+ # @example
269
+ #
270
+ # # Modify the global config, setting the timeout for
271
+ # # create_external_account_key to 20 seconds,
272
+ # # and all remaining timeouts to 10 seconds.
273
+ # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.configure do |config|
274
+ # config.timeout = 10.0
275
+ # config.rpcs.create_external_account_key.timeout = 20.0
276
+ # end
277
+ #
278
+ # # Apply the above configuration only to a new client.
279
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new do |config|
280
+ # config.timeout = 10.0
281
+ # config.rpcs.create_external_account_key.timeout = 20.0
282
+ # end
283
+ #
284
+ # @!attribute [rw] endpoint
285
+ # A custom service endpoint, as a hostname or hostname:port. The default is
286
+ # nil, indicating to use the default endpoint in the current universe domain.
287
+ # @return [::String,nil]
288
+ # @!attribute [rw] credentials
289
+ # Credentials to send with calls. You may provide any of the following types:
290
+ # * (`String`) The path to a service account key file in JSON format
291
+ # * (`Hash`) A service account key as a Hash
292
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
293
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
294
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
295
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
296
+ # * (`nil`) indicating no credentials
297
+ # @return [::Object]
298
+ # @!attribute [rw] scope
299
+ # The OAuth scopes
300
+ # @return [::Array<::String>]
301
+ # @!attribute [rw] lib_name
302
+ # The library name as recorded in instrumentation and logging
303
+ # @return [::String]
304
+ # @!attribute [rw] lib_version
305
+ # The library version as recorded in instrumentation and logging
306
+ # @return [::String]
307
+ # @!attribute [rw] timeout
308
+ # The call timeout in seconds.
309
+ # @return [::Numeric]
310
+ # @!attribute [rw] metadata
311
+ # Additional headers to be sent with the call.
312
+ # @return [::Hash{::Symbol=>::String}]
313
+ # @!attribute [rw] retry_policy
314
+ # The retry policy. The value is a hash with the following keys:
315
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
316
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
317
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
318
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
319
+ # trigger a retry.
320
+ # @return [::Hash]
321
+ # @!attribute [rw] quota_project
322
+ # A separate project against which to charge quota.
323
+ # @return [::String]
324
+ # @!attribute [rw] universe_domain
325
+ # The universe domain within which to make requests. This determines the
326
+ # default endpoint URL. The default value of nil uses the environment
327
+ # universe (usually the default "googleapis.com" universe).
328
+ # @return [::String,nil]
329
+ #
330
+ class Configuration
331
+ extend ::Gapic::Config
332
+
333
+ # @private
334
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
335
+ DEFAULT_ENDPOINT = "publicca.googleapis.com"
336
+
337
+ config_attr :endpoint, nil, ::String, nil
338
+ config_attr :credentials, nil do |value|
339
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
340
+ allowed.any? { |klass| klass === value }
341
+ end
342
+ config_attr :scope, nil, ::String, ::Array, nil
343
+ config_attr :lib_name, nil, ::String, nil
344
+ config_attr :lib_version, nil, ::String, nil
345
+ config_attr :timeout, nil, ::Numeric, nil
346
+ config_attr :metadata, nil, ::Hash, nil
347
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
348
+ config_attr :quota_project, nil, ::String, nil
349
+ config_attr :universe_domain, 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 RPC class for the PublicCertificateAuthorityService API.
372
+ #
373
+ # Includes fields providing the configuration for each RPC in this service.
374
+ # Each configuration object is of type `Gapic::Config::Method` and includes
375
+ # the following configuration fields:
376
+ #
377
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
378
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
379
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
380
+ # include the following keys:
381
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
382
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
383
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
384
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
385
+ # trigger a retry.
386
+ #
387
+ class Rpcs
388
+ ##
389
+ # RPC-specific configuration for `create_external_account_key`
390
+ # @return [::Gapic::Config::Method]
391
+ #
392
+ attr_reader :create_external_account_key
393
+
394
+ # @private
395
+ def initialize parent_rpcs = nil
396
+ create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key
397
+ @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config
398
+
399
+ yield self if block_given?
400
+ end
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/security/publicca/v1/service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Security
24
+ module PublicCA
25
+ module V1
26
+ module PublicCertificateAuthorityService
27
+ module Rest
28
+ ##
29
+ # REST service stub for the PublicCertificateAuthorityService service.
30
+ # Service stub contains baseline method implementations
31
+ # including transcoding, making the REST call, and deserialing the response.
32
+ #
33
+ class ServiceStub
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
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
+ raise_faraday_errors: false
45
+ end
46
+
47
+ ##
48
+ # The effective universe domain
49
+ #
50
+ # @return [String]
51
+ #
52
+ def universe_domain
53
+ @client_stub.universe_domain
54
+ end
55
+
56
+ ##
57
+ # The effective endpoint
58
+ #
59
+ # @return [String]
60
+ #
61
+ def endpoint
62
+ @client_stub.endpoint
63
+ end
64
+
65
+ ##
66
+ # Baseline implementation for the create_external_account_key REST call
67
+ #
68
+ # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest]
69
+ # A request object representing the call parameters. Required.
70
+ # @param options [::Gapic::CallOptions]
71
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
72
+ #
73
+ # @yield [result, operation] Access the result along with the TransportOperation object
74
+ # @yieldparam result [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
75
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
76
+ #
77
+ # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
78
+ # A result object deserialized from the server's reply
79
+ def create_external_account_key request_pb, options = nil
80
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
81
+
82
+ verb, uri, query_string_params, body = ServiceStub.transcode_create_external_account_key_request request_pb
83
+ query_string_params = if query_string_params.any?
84
+ query_string_params.to_h { |p| p.split "=", 2 }
85
+ else
86
+ {}
87
+ end
88
+
89
+ response = @client_stub.make_http_request(
90
+ verb,
91
+ uri: uri,
92
+ body: body || "",
93
+ params: query_string_params,
94
+ options: options
95
+ )
96
+ operation = ::Gapic::Rest::TransportOperation.new response
97
+ result = ::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.decode_json response.body, ignore_unknown_fields: true
98
+
99
+ yield result, operation if block_given?
100
+ result
101
+ end
102
+
103
+ ##
104
+ # @private
105
+ #
106
+ # GRPC transcoding helper method for the create_external_account_key REST call
107
+ #
108
+ # @param request_pb [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest]
109
+ # A request object representing the call parameters. Required.
110
+ # @return [Array(String, [String, nil], Hash{String => String})]
111
+ # Uri, Body, Query string parameters
112
+ def self.transcode_create_external_account_key_request request_pb
113
+ transcoder = Gapic::Rest::GrpcTranscoder.new
114
+ .with_bindings(
115
+ uri_method: :post,
116
+ uri_template: "/v1/{parent}/externalAccountKeys",
117
+ body: "external_account_key",
118
+ matches: [
119
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
120
+ ]
121
+ )
122
+ transcoder.transcode request_pb
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/security/public_ca/v1/version"
24
+
25
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials"
26
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths"
27
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Security
32
+ module PublicCA
33
+ module V1
34
+ ##
35
+ # Manages the resources required for ACME [external account
36
+ # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for
37
+ # the public certificate authority service.
38
+ #
39
+ # To load this service and instantiate a REST client:
40
+ #
41
+ # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest"
42
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new
43
+ #
44
+ module PublicCertificateAuthorityService
45
+ # Client for the REST transport
46
+ module Rest
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
55
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
56
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/security/public_ca/v1/version"
24
+
25
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/credentials"
26
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/paths"
27
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/client"
28
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Security
33
+ module PublicCA
34
+ module V1
35
+ ##
36
+ # Manages the resources required for ACME [external account
37
+ # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for
38
+ # the public certificate authority service.
39
+ #
40
+ # @example Load this service and instantiate a gRPC client
41
+ #
42
+ # require "google/cloud/security/public_ca/v1/public_certificate_authority_service"
43
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new
44
+ #
45
+ # @example Load this service and instantiate a REST client
46
+ #
47
+ # require "google/cloud/security/public_ca/v1/public_certificate_authority_service/rest"
48
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Rest::Client.new
49
+ #
50
+ module PublicCertificateAuthorityService
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+
58
+ helper_path = ::File.join __dir__, "public_certificate_authority_service", "helpers.rb"
59
+ require "google/cloud/security/public_ca/v1/public_certificate_authority_service/helpers" if ::File.file? helper_path