google-cloud-artifact_registry-v1 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.
@@ -0,0 +1,544 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/devtools/artifactregistry/v1/service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module ArtifactRegistry
25
+ module V1
26
+ module ArtifactRegistry
27
+ ##
28
+ # Client for the ArtifactRegistry service.
29
+ #
30
+ # The Artifact Registry API service.
31
+ #
32
+ # Artifact Registry is an artifact management system for storing artifacts
33
+ # from different package management systems.
34
+ #
35
+ # The resources managed by this API are:
36
+ #
37
+ # * Repositories, which group packages and their data.
38
+ # * Packages, which group versions and their tags.
39
+ # * Versions, which are specific forms of a package.
40
+ # * Tags, which represent alternative names for versions.
41
+ # * Files, which contain content and are optionally associated with a Package
42
+ # or Version.
43
+ #
44
+ class Client
45
+ include Paths
46
+
47
+ # @private
48
+ attr_reader :artifact_registry_stub
49
+
50
+ ##
51
+ # Configure the ArtifactRegistry Client class.
52
+ #
53
+ # See {::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client::Configuration}
54
+ # for a description of the configuration fields.
55
+ #
56
+ # @example
57
+ #
58
+ # # Modify the configuration for all ArtifactRegistry clients
59
+ # ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.configure do |config|
60
+ # config.timeout = 10.0
61
+ # end
62
+ #
63
+ # @yield [config] Configure the Client client.
64
+ # @yieldparam config [Client::Configuration]
65
+ #
66
+ # @return [Client::Configuration]
67
+ #
68
+ def self.configure
69
+ @configure ||= begin
70
+ namespace = ["Google", "Cloud", "ArtifactRegistry", "V1"]
71
+ parent_config = while namespace.any?
72
+ parent_name = namespace.join "::"
73
+ parent_const = const_get parent_name
74
+ break parent_const.configure if parent_const.respond_to? :configure
75
+ namespace.pop
76
+ end
77
+ default_config = Client::Configuration.new parent_config
78
+
79
+ default_config.timeout = 60.0
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the ArtifactRegistry 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::ArtifactRegistry::V1::ArtifactRegistry::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
+ # Create a new ArtifactRegistry client object.
109
+ #
110
+ # @example
111
+ #
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new
114
+ #
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
119
+ #
120
+ # @yield [config] Configure the ArtifactRegistry client.
121
+ # @yieldparam config [Client::Configuration]
122
+ #
123
+ def initialize
124
+ # These require statements are intentionally placed here to initialize
125
+ # the gRPC module only when it's required.
126
+ # See https://github.com/googleapis/toolkit/issues/446
127
+ require "gapic/grpc"
128
+ require "google/devtools/artifactregistry/v1/service_services_pb"
129
+
130
+ # Create the configuration object
131
+ @config = Configuration.new Client.configure
132
+
133
+ # Yield the configuration if needed
134
+ yield @config if block_given?
135
+
136
+ # Create credentials
137
+ credentials = @config.credentials
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
139
+ # but only if the default endpoint does not have a region prefix.
140
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
+ !@config.endpoint.split(".").first.include?("-")
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @artifact_registry_stub = ::Gapic::ServiceStub.new(
151
+ ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Stub,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ channel_args: @config.channel_args,
155
+ interceptors: @config.interceptors
156
+ )
157
+ end
158
+
159
+ # Service calls
160
+
161
+ ##
162
+ # Lists docker images.
163
+ #
164
+ # @overload list_docker_images(request, options = nil)
165
+ # Pass arguments to `list_docker_images` via a request object, either of type
166
+ # {::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest} or an equivalent Hash.
167
+ #
168
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest, ::Hash]
169
+ # A request object representing the call parameters. Required. To specify no
170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
171
+ # @param options [::Gapic::CallOptions, ::Hash]
172
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
173
+ #
174
+ # @overload list_docker_images(parent: nil, page_size: nil, page_token: nil)
175
+ # Pass arguments to `list_docker_images` via keyword arguments. Note that at
176
+ # least one keyword argument is required. To specify no parameters, or to keep all
177
+ # the default parameter values, pass an empty Hash as a request object (see above).
178
+ #
179
+ # @param parent [::String]
180
+ # Required. The name of the parent resource whose docker images will be listed.
181
+ # @param page_size [::Integer]
182
+ # The maximum number of artifacts to return.
183
+ # @param page_token [::String]
184
+ # The next_page_token value returned from a previous list request, if any.
185
+ #
186
+ # @yield [response, operation] Access the result along with the RPC operation
187
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
188
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
189
+ #
190
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::DockerImage>]
191
+ #
192
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
193
+ #
194
+ def list_docker_images request, options = nil
195
+ raise ::ArgumentError, "request must be provided" if request.nil?
196
+
197
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest
198
+
199
+ # Converts hash and nil to an options object
200
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
201
+
202
+ # Customize the options with defaults
203
+ metadata = @config.rpcs.list_docker_images.metadata.to_h
204
+
205
+ # Set x-goog-api-client and x-goog-user-project headers
206
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
207
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
208
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
209
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
210
+
211
+ header_params = {
212
+ "parent" => request.parent
213
+ }
214
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
215
+ metadata[:"x-goog-request-params"] ||= request_params_header
216
+
217
+ options.apply_defaults timeout: @config.rpcs.list_docker_images.timeout,
218
+ metadata: metadata,
219
+ retry_policy: @config.rpcs.list_docker_images.retry_policy
220
+
221
+ options.apply_defaults timeout: @config.timeout,
222
+ metadata: @config.metadata,
223
+ retry_policy: @config.retry_policy
224
+
225
+ @artifact_registry_stub.call_rpc :list_docker_images, request, options: options do |response, operation|
226
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_docker_images, request, response, operation, options
227
+ yield response, operation if block_given?
228
+ return response
229
+ end
230
+ rescue ::GRPC::BadStatus => e
231
+ raise ::Google::Cloud::Error.from_error(e)
232
+ end
233
+
234
+ ##
235
+ # Lists repositories.
236
+ #
237
+ # @overload list_repositories(request, options = nil)
238
+ # Pass arguments to `list_repositories` via a request object, either of type
239
+ # {::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest} or an equivalent Hash.
240
+ #
241
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest, ::Hash]
242
+ # A request object representing the call parameters. Required. To specify no
243
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
244
+ # @param options [::Gapic::CallOptions, ::Hash]
245
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
246
+ #
247
+ # @overload list_repositories(parent: nil, page_size: nil, page_token: nil)
248
+ # Pass arguments to `list_repositories` via keyword arguments. Note that at
249
+ # least one keyword argument is required. To specify no parameters, or to keep all
250
+ # the default parameter values, pass an empty Hash as a request object (see above).
251
+ #
252
+ # @param parent [::String]
253
+ # Required. The name of the parent resource whose repositories will be listed.
254
+ # @param page_size [::Integer]
255
+ # The maximum number of repositories to return.
256
+ # @param page_token [::String]
257
+ # The next_page_token value returned from a previous list request, if any.
258
+ #
259
+ # @yield [response, operation] Access the result along with the RPC operation
260
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
261
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
262
+ #
263
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ArtifactRegistry::V1::Repository>]
264
+ #
265
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
266
+ #
267
+ def list_repositories request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ metadata = @config.rpcs.list_repositories.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
282
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
283
+
284
+ header_params = {
285
+ "parent" => request.parent
286
+ }
287
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
288
+ metadata[:"x-goog-request-params"] ||= request_params_header
289
+
290
+ options.apply_defaults timeout: @config.rpcs.list_repositories.timeout,
291
+ metadata: metadata,
292
+ retry_policy: @config.rpcs.list_repositories.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @artifact_registry_stub.call_rpc :list_repositories, request, options: options do |response, operation|
299
+ response = ::Gapic::PagedEnumerable.new @artifact_registry_stub, :list_repositories, request, response, operation, options
300
+ yield response, operation if block_given?
301
+ return response
302
+ end
303
+ rescue ::GRPC::BadStatus => e
304
+ raise ::Google::Cloud::Error.from_error(e)
305
+ end
306
+
307
+ ##
308
+ # Gets a repository.
309
+ #
310
+ # @overload get_repository(request, options = nil)
311
+ # Pass arguments to `get_repository` via a request object, either of type
312
+ # {::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
319
+ #
320
+ # @overload get_repository(name: nil)
321
+ # Pass arguments to `get_repository` via keyword arguments. Note that at
322
+ # least one keyword argument is required. To specify no parameters, or to keep all
323
+ # the default parameter values, pass an empty Hash as a request object (see above).
324
+ #
325
+ # @param name [::String]
326
+ # Required. The name of the repository to retrieve.
327
+ #
328
+ # @yield [response, operation] Access the result along with the RPC operation
329
+ # @yieldparam response [::Google::Cloud::ArtifactRegistry::V1::Repository]
330
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
331
+ #
332
+ # @return [::Google::Cloud::ArtifactRegistry::V1::Repository]
333
+ #
334
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
335
+ #
336
+ def get_repository request, options = nil
337
+ raise ::ArgumentError, "request must be provided" if request.nil?
338
+
339
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest
340
+
341
+ # Converts hash and nil to an options object
342
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
+
344
+ # Customize the options with defaults
345
+ metadata = @config.rpcs.get_repository.metadata.to_h
346
+
347
+ # Set x-goog-api-client and x-goog-user-project headers
348
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
350
+ gapic_version: ::Google::Cloud::ArtifactRegistry::V1::VERSION
351
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
+
353
+ header_params = {
354
+ "name" => request.name
355
+ }
356
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
357
+ metadata[:"x-goog-request-params"] ||= request_params_header
358
+
359
+ options.apply_defaults timeout: @config.rpcs.get_repository.timeout,
360
+ metadata: metadata,
361
+ retry_policy: @config.rpcs.get_repository.retry_policy
362
+
363
+ options.apply_defaults timeout: @config.timeout,
364
+ metadata: @config.metadata,
365
+ retry_policy: @config.retry_policy
366
+
367
+ @artifact_registry_stub.call_rpc :get_repository, request, options: options do |response, operation|
368
+ yield response, operation if block_given?
369
+ return response
370
+ end
371
+ rescue ::GRPC::BadStatus => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Configuration class for the ArtifactRegistry API.
377
+ #
378
+ # This class represents the configuration for ArtifactRegistry,
379
+ # providing control over timeouts, retry behavior, logging, transport
380
+ # parameters, and other low-level controls. Certain parameters can also be
381
+ # applied individually to specific RPCs. See
382
+ # {::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client::Configuration::Rpcs}
383
+ # for a list of RPCs that can be configured independently.
384
+ #
385
+ # Configuration can be applied globally to all clients, or to a single client
386
+ # on construction.
387
+ #
388
+ # @example
389
+ #
390
+ # # Modify the global config, setting the timeout for
391
+ # # list_docker_images to 20 seconds,
392
+ # # and all remaining timeouts to 10 seconds.
393
+ # ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.configure do |config|
394
+ # config.timeout = 10.0
395
+ # config.rpcs.list_docker_images.timeout = 20.0
396
+ # end
397
+ #
398
+ # # Apply the above configuration only to a new client.
399
+ # client = ::Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new do |config|
400
+ # config.timeout = 10.0
401
+ # config.rpcs.list_docker_images.timeout = 20.0
402
+ # end
403
+ #
404
+ # @!attribute [rw] endpoint
405
+ # The hostname or hostname:port of the service endpoint.
406
+ # Defaults to `"artifactregistry.googleapis.com"`.
407
+ # @return [::String]
408
+ # @!attribute [rw] credentials
409
+ # Credentials to send with calls. You may provide any of the following types:
410
+ # * (`String`) The path to a service account key file in JSON format
411
+ # * (`Hash`) A service account key as a Hash
412
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
413
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
414
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
415
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
416
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
417
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
418
+ # * (`nil`) indicating no credentials
419
+ # @return [::Object]
420
+ # @!attribute [rw] scope
421
+ # The OAuth scopes
422
+ # @return [::Array<::String>]
423
+ # @!attribute [rw] lib_name
424
+ # The library name as recorded in instrumentation and logging
425
+ # @return [::String]
426
+ # @!attribute [rw] lib_version
427
+ # The library version as recorded in instrumentation and logging
428
+ # @return [::String]
429
+ # @!attribute [rw] channel_args
430
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
431
+ # `GRPC::Core::Channel` object is provided as the credential.
432
+ # @return [::Hash]
433
+ # @!attribute [rw] interceptors
434
+ # An array of interceptors that are run before calls are executed.
435
+ # @return [::Array<::GRPC::ClientInterceptor>]
436
+ # @!attribute [rw] timeout
437
+ # The call timeout in seconds.
438
+ # @return [::Numeric]
439
+ # @!attribute [rw] metadata
440
+ # Additional gRPC headers to be sent with the call.
441
+ # @return [::Hash{::Symbol=>::String}]
442
+ # @!attribute [rw] retry_policy
443
+ # The retry policy. The value is a hash with the following keys:
444
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
445
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
446
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
447
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
448
+ # trigger a retry.
449
+ # @return [::Hash]
450
+ # @!attribute [rw] quota_project
451
+ # A separate project against which to charge quota.
452
+ # @return [::String]
453
+ #
454
+ class Configuration
455
+ extend ::Gapic::Config
456
+
457
+ config_attr :endpoint, "artifactregistry.googleapis.com", ::String
458
+ config_attr :credentials, nil do |value|
459
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
460
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
461
+ allowed.any? { |klass| klass === value }
462
+ end
463
+ config_attr :scope, nil, ::String, ::Array, nil
464
+ config_attr :lib_name, nil, ::String, nil
465
+ config_attr :lib_version, nil, ::String, nil
466
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
467
+ config_attr :interceptors, nil, ::Array, nil
468
+ config_attr :timeout, nil, ::Numeric, nil
469
+ config_attr :metadata, nil, ::Hash, nil
470
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
471
+ config_attr :quota_project, nil, ::String, nil
472
+
473
+ # @private
474
+ def initialize parent_config = nil
475
+ @parent_config = parent_config unless parent_config.nil?
476
+
477
+ yield self if block_given?
478
+ end
479
+
480
+ ##
481
+ # Configurations for individual RPCs
482
+ # @return [Rpcs]
483
+ #
484
+ def rpcs
485
+ @rpcs ||= begin
486
+ parent_rpcs = nil
487
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
488
+ Rpcs.new parent_rpcs
489
+ end
490
+ end
491
+
492
+ ##
493
+ # Configuration RPC class for the ArtifactRegistry API.
494
+ #
495
+ # Includes fields providing the configuration for each RPC in this service.
496
+ # Each configuration object is of type `Gapic::Config::Method` and includes
497
+ # the following configuration fields:
498
+ #
499
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
500
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
501
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
502
+ # include the following keys:
503
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
504
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
505
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
506
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
507
+ # trigger a retry.
508
+ #
509
+ class Rpcs
510
+ ##
511
+ # RPC-specific configuration for `list_docker_images`
512
+ # @return [::Gapic::Config::Method]
513
+ #
514
+ attr_reader :list_docker_images
515
+ ##
516
+ # RPC-specific configuration for `list_repositories`
517
+ # @return [::Gapic::Config::Method]
518
+ #
519
+ attr_reader :list_repositories
520
+ ##
521
+ # RPC-specific configuration for `get_repository`
522
+ # @return [::Gapic::Config::Method]
523
+ #
524
+ attr_reader :get_repository
525
+
526
+ # @private
527
+ def initialize parent_rpcs = nil
528
+ list_docker_images_config = parent_rpcs.list_docker_images if parent_rpcs.respond_to? :list_docker_images
529
+ @list_docker_images = ::Gapic::Config::Method.new list_docker_images_config
530
+ list_repositories_config = parent_rpcs.list_repositories if parent_rpcs.respond_to? :list_repositories
531
+ @list_repositories = ::Gapic::Config::Method.new list_repositories_config
532
+ get_repository_config = parent_rpcs.get_repository if parent_rpcs.respond_to? :get_repository
533
+ @get_repository = ::Gapic::Config::Method.new get_repository_config
534
+
535
+ yield self if block_given?
536
+ end
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 ArtifactRegistry
24
+ module V1
25
+ module ArtifactRegistry
26
+ # Credentials for the ArtifactRegistry API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/cloud-platform.read-only"
31
+ ]
32
+ self.env_vars = [
33
+ "ARTIFACT_REGISTRY_CREDENTIALS",
34
+ "ARTIFACT_REGISTRY_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "ARTIFACT_REGISTRY_CREDENTIALS_JSON",
39
+ "ARTIFACT_REGISTRY_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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 ArtifactRegistry
23
+ module V1
24
+ module ArtifactRegistry
25
+ # Path helper methods for the ArtifactRegistry API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Location resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ #
37
+ # @return [::String]
38
+ def location_path project:, location:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/locations/#{location}"
42
+ end
43
+
44
+ extend self
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end