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

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 +420 -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 +227 -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,443 @@
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
+
22
+ module Google
23
+ module Cloud
24
+ module Security
25
+ module PublicCA
26
+ module V1
27
+ module PublicCertificateAuthorityService
28
+ ##
29
+ # Client for the PublicCertificateAuthorityService service.
30
+ #
31
+ # Manages the resources required for ACME [external account
32
+ # binding](https://tools.ietf.org/html/rfc8555#section-7.3.4) for
33
+ # the public certificate authority service.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "publicca.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :public_certificate_authority_service_stub
46
+
47
+ ##
48
+ # Configure the PublicCertificateAuthorityService Client class.
49
+ #
50
+ # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all PublicCertificateAuthorityService clients
56
+ # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "Security", "PublicCA", "V1"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the PublicCertificateAuthorityService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @public_certificate_authority_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new PublicCertificateAuthorityService client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the PublicCertificateAuthorityService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # These require statements are intentionally placed here to initialize
134
+ # the gRPC module only when it's required.
135
+ # See https://github.com/googleapis/toolkit/issues/446
136
+ require "gapic/grpc"
137
+ require "google/cloud/security/publicca/v1/service_services_pb"
138
+
139
+ # Create the configuration object
140
+ @config = Configuration.new Client.configure
141
+
142
+ # Yield the configuration if needed
143
+ yield @config if block_given?
144
+
145
+ # Create credentials
146
+ credentials = @config.credentials
147
+ # Use self-signed JWT if the endpoint is unchanged from default,
148
+ # but only if the default endpoint does not have a region prefix.
149
+ enable_self_signed_jwt = @config.endpoint.nil? ||
150
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
151
+ !@config.endpoint.split(".").first.include?("-"))
152
+ credentials ||= Credentials.default scope: @config.scope,
153
+ enable_self_signed_jwt: enable_self_signed_jwt
154
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
155
+ credentials = Credentials.new credentials, scope: @config.scope
156
+ end
157
+ @quota_project_id = @config.quota_project
158
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
159
+
160
+ @public_certificate_authority_service_stub = ::Gapic::ServiceStub.new(
161
+ ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Stub,
162
+ credentials: credentials,
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ channel_args: @config.channel_args,
167
+ interceptors: @config.interceptors,
168
+ channel_pool_config: @config.channel_pool
169
+ )
170
+ end
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # Creates a new
176
+ # {::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey ExternalAccountKey}
177
+ # bound to the project.
178
+ #
179
+ # @overload create_external_account_key(request, options = nil)
180
+ # Pass arguments to `create_external_account_key` via a request object, either of type
181
+ # {::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest} or an equivalent Hash.
182
+ #
183
+ # @param request [::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest, ::Hash]
184
+ # A request object representing the call parameters. Required. To specify no
185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
186
+ # @param options [::Gapic::CallOptions, ::Hash]
187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
188
+ #
189
+ # @overload create_external_account_key(parent: nil, external_account_key: nil)
190
+ # Pass arguments to `create_external_account_key` via keyword arguments. Note that at
191
+ # least one keyword argument is required. To specify no parameters, or to keep all
192
+ # the default parameter values, pass an empty Hash as a request object (see above).
193
+ #
194
+ # @param parent [::String]
195
+ # Required. The parent resource where this external_account_key will be
196
+ # created. Format: projects/[project_id]/locations/[location]. At present
197
+ # only the "global" location is supported.
198
+ # @param external_account_key [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey, ::Hash]
199
+ # Required. The external account key to create. This field only exists to
200
+ # future-proof the API. At present, all fields in ExternalAccountKey are
201
+ # output only and all values are ignored. For the purpose of the
202
+ # CreateExternalAccountKeyRequest, set it to a default/empty value.
203
+ #
204
+ # @yield [response, operation] Access the result along with the RPC operation
205
+ # @yieldparam response [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
206
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
207
+ #
208
+ # @return [::Google::Cloud::Security::PublicCA::V1::ExternalAccountKey]
209
+ #
210
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
211
+ #
212
+ # @example Basic example
213
+ # require "google/cloud/security/public_ca/v1"
214
+ #
215
+ # # Create a client object. The client can be reused for multiple calls.
216
+ # client = Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new
217
+ #
218
+ # # Create a request. To set request fields, pass in keyword arguments.
219
+ # request = Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest.new
220
+ #
221
+ # # Call the create_external_account_key method.
222
+ # result = client.create_external_account_key request
223
+ #
224
+ # # The returned object is of type Google::Cloud::Security::PublicCA::V1::ExternalAccountKey.
225
+ # p result
226
+ #
227
+ def create_external_account_key request, options = nil
228
+ raise ::ArgumentError, "request must be provided" if request.nil?
229
+
230
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Security::PublicCA::V1::CreateExternalAccountKeyRequest
231
+
232
+ # Converts hash and nil to an options object
233
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
234
+
235
+ # Customize the options with defaults
236
+ metadata = @config.rpcs.create_external_account_key.metadata.to_h
237
+
238
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
239
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
240
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
241
+ gapic_version: ::Google::Cloud::Security::PublicCA::V1::VERSION
242
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
243
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
+
245
+ header_params = {}
246
+ if request.parent
247
+ header_params["parent"] = request.parent
248
+ end
249
+
250
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
251
+ metadata[:"x-goog-request-params"] ||= request_params_header
252
+
253
+ options.apply_defaults timeout: @config.rpcs.create_external_account_key.timeout,
254
+ metadata: metadata,
255
+ retry_policy: @config.rpcs.create_external_account_key.retry_policy
256
+
257
+ options.apply_defaults timeout: @config.timeout,
258
+ metadata: @config.metadata,
259
+ retry_policy: @config.retry_policy
260
+
261
+ @public_certificate_authority_service_stub.call_rpc :create_external_account_key, request, options: options do |response, operation|
262
+ yield response, operation if block_given?
263
+ return response
264
+ end
265
+ rescue ::GRPC::BadStatus => e
266
+ raise ::Google::Cloud::Error.from_error(e)
267
+ end
268
+
269
+ ##
270
+ # Configuration class for the PublicCertificateAuthorityService API.
271
+ #
272
+ # This class represents the configuration for PublicCertificateAuthorityService,
273
+ # providing control over timeouts, retry behavior, logging, transport
274
+ # parameters, and other low-level controls. Certain parameters can also be
275
+ # applied individually to specific RPCs. See
276
+ # {::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client::Configuration::Rpcs}
277
+ # for a list of RPCs that can be configured independently.
278
+ #
279
+ # Configuration can be applied globally to all clients, or to a single client
280
+ # on construction.
281
+ #
282
+ # @example
283
+ #
284
+ # # Modify the global config, setting the timeout for
285
+ # # create_external_account_key to 20 seconds,
286
+ # # and all remaining timeouts to 10 seconds.
287
+ # ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.configure do |config|
288
+ # config.timeout = 10.0
289
+ # config.rpcs.create_external_account_key.timeout = 20.0
290
+ # end
291
+ #
292
+ # # Apply the above configuration only to a new client.
293
+ # client = ::Google::Cloud::Security::PublicCA::V1::PublicCertificateAuthorityService::Client.new do |config|
294
+ # config.timeout = 10.0
295
+ # config.rpcs.create_external_account_key.timeout = 20.0
296
+ # end
297
+ #
298
+ # @!attribute [rw] endpoint
299
+ # A custom service endpoint, as a hostname or hostname:port. The default is
300
+ # nil, indicating to use the default endpoint in the current universe domain.
301
+ # @return [::String,nil]
302
+ # @!attribute [rw] credentials
303
+ # Credentials to send with calls. You may provide any of the following types:
304
+ # * (`String`) The path to a service account key file in JSON format
305
+ # * (`Hash`) A service account key as a Hash
306
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
307
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
308
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
309
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
310
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
311
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
312
+ # * (`nil`) indicating no credentials
313
+ # @return [::Object]
314
+ # @!attribute [rw] scope
315
+ # The OAuth scopes
316
+ # @return [::Array<::String>]
317
+ # @!attribute [rw] lib_name
318
+ # The library name as recorded in instrumentation and logging
319
+ # @return [::String]
320
+ # @!attribute [rw] lib_version
321
+ # The library version as recorded in instrumentation and logging
322
+ # @return [::String]
323
+ # @!attribute [rw] channel_args
324
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
325
+ # `GRPC::Core::Channel` object is provided as the credential.
326
+ # @return [::Hash]
327
+ # @!attribute [rw] interceptors
328
+ # An array of interceptors that are run before calls are executed.
329
+ # @return [::Array<::GRPC::ClientInterceptor>]
330
+ # @!attribute [rw] timeout
331
+ # The call timeout in seconds.
332
+ # @return [::Numeric]
333
+ # @!attribute [rw] metadata
334
+ # Additional gRPC headers to be sent with the call.
335
+ # @return [::Hash{::Symbol=>::String}]
336
+ # @!attribute [rw] retry_policy
337
+ # The retry policy. The value is a hash with the following keys:
338
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
339
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
340
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
341
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
342
+ # trigger a retry.
343
+ # @return [::Hash]
344
+ # @!attribute [rw] quota_project
345
+ # A separate project against which to charge quota.
346
+ # @return [::String]
347
+ # @!attribute [rw] universe_domain
348
+ # The universe domain within which to make requests. This determines the
349
+ # default endpoint URL. The default value of nil uses the environment
350
+ # universe (usually the default "googleapis.com" universe).
351
+ # @return [::String,nil]
352
+ #
353
+ class Configuration
354
+ extend ::Gapic::Config
355
+
356
+ # @private
357
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
358
+ DEFAULT_ENDPOINT = "publicca.googleapis.com"
359
+
360
+ config_attr :endpoint, nil, ::String, nil
361
+ config_attr :credentials, nil do |value|
362
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
363
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
364
+ allowed.any? { |klass| klass === value }
365
+ end
366
+ config_attr :scope, nil, ::String, ::Array, nil
367
+ config_attr :lib_name, nil, ::String, nil
368
+ config_attr :lib_version, nil, ::String, nil
369
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
370
+ config_attr :interceptors, nil, ::Array, nil
371
+ config_attr :timeout, nil, ::Numeric, nil
372
+ config_attr :metadata, nil, ::Hash, nil
373
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
374
+ config_attr :quota_project, nil, ::String, nil
375
+ config_attr :universe_domain, nil, ::String, nil
376
+
377
+ # @private
378
+ def initialize parent_config = nil
379
+ @parent_config = parent_config unless parent_config.nil?
380
+
381
+ yield self if block_given?
382
+ end
383
+
384
+ ##
385
+ # Configurations for individual RPCs
386
+ # @return [Rpcs]
387
+ #
388
+ def rpcs
389
+ @rpcs ||= begin
390
+ parent_rpcs = nil
391
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
392
+ Rpcs.new parent_rpcs
393
+ end
394
+ end
395
+
396
+ ##
397
+ # Configuration for the channel pool
398
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
399
+ #
400
+ def channel_pool
401
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
402
+ end
403
+
404
+ ##
405
+ # Configuration RPC class for the PublicCertificateAuthorityService API.
406
+ #
407
+ # Includes fields providing the configuration for each RPC in this service.
408
+ # Each configuration object is of type `Gapic::Config::Method` and includes
409
+ # the following configuration fields:
410
+ #
411
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
412
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
413
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
414
+ # include the following keys:
415
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
416
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
417
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
418
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
419
+ # trigger a retry.
420
+ #
421
+ class Rpcs
422
+ ##
423
+ # RPC-specific configuration for `create_external_account_key`
424
+ # @return [::Gapic::Config::Method]
425
+ #
426
+ attr_reader :create_external_account_key
427
+
428
+ # @private
429
+ def initialize parent_rpcs = nil
430
+ create_external_account_key_config = parent_rpcs.create_external_account_key if parent_rpcs.respond_to? :create_external_account_key
431
+ @create_external_account_key = ::Gapic::Config::Method.new create_external_account_key_config
432
+
433
+ yield self if block_given?
434
+ end
435
+ end
436
+ end
437
+ end
438
+ end
439
+ end
440
+ end
441
+ end
442
+ end
443
+ end
@@ -0,0 +1,49 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Security
24
+ module PublicCA
25
+ module V1
26
+ module PublicCertificateAuthorityService
27
+ # Credentials for the PublicCertificateAuthorityService API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,71 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Security
23
+ module PublicCA
24
+ module V1
25
+ module PublicCertificateAuthorityService
26
+ # Path helper methods for the PublicCertificateAuthorityService API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified ExternalAccountKey resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/externalAccountKeys/{external_account_key}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param external_account_key [String]
38
+ #
39
+ # @return [::String]
40
+ def external_account_key_path project:, location:, external_account_key:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+
44
+ "projects/#{project}/locations/#{location}/externalAccountKeys/#{external_account_key}"
45
+ end
46
+
47
+ ##
48
+ # Create a fully-qualified Location resource string.
49
+ #
50
+ # The resource will be in the following format:
51
+ #
52
+ # `projects/{project}/locations/{location}`
53
+ #
54
+ # @param project [String]
55
+ # @param location [String]
56
+ #
57
+ # @return [::String]
58
+ def location_path project:, location:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+
61
+ "projects/#{project}/locations/#{location}"
62
+ end
63
+
64
+ extend self
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end