google-cloud-run-client 1.2.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5644274d40da43b05b91eaac3055ae9339628a5092f0b6de4812de31c4c633fd
4
- data.tar.gz: 9736074a4db0bce96daf58f322c6c2de5db10641e9c002e6f2aaf6c6689d4123
3
+ metadata.gz: 83ec48aa543fedbde16fe74a8448d07953af89eb4797dc06e4ab398825ee7aad
4
+ data.tar.gz: b3280abe889dcafdd7f6a0582979f8701bd1bc16c1cd806efba2d32b1e5c2ecd
5
5
  SHA512:
6
- metadata.gz: c97f7d98e7ecd956e8c97790644a4fc10a870d91c26bfd562fc4e1675d9735eec0bae35f365dff52069e205e113e14e42619c7e81af1690659c81da87dd81424
7
- data.tar.gz: 3252e2a901131f680a4ef7c1c40b4ca1338fd62ef1dc87419f746c0ab985dc0300a624f5acfff17cc01fcc8a88bb2b9299bd879eea437fbd6f5bbc6445853c4f
6
+ metadata.gz: 84a2f8d4ed72ac9019b002b42007454779c9584f1a78a722f4997d99f6fab4bdb53e041c5e658c046376875bf72e67a373a6b99626044189b958e74146164176
7
+ data.tar.gz: f1795b28827c67601c1887c0155e2075a00035c0c740822d71a6afd8903c8abdc1f0f95ccbb1e5a2c858178f89138c5d5b2d2c5dea2d2bf9612d1ce56e4f8c81
data/AUTHENTICATION.md CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
56
56
  ```ruby
57
57
  require "google/cloud/run"
58
58
 
59
- client = Google::Cloud::Run.executions do |config|
59
+ client = Google::Cloud::Run.builds do |config|
60
60
  config.credentials = "path/to/credentialfile.json"
61
61
  end
62
62
  ```
@@ -70,7 +70,7 @@ Google::Cloud::Run.configure do |config|
70
70
  config.credentials = "path/to/credentialfile.json"
71
71
  end
72
72
 
73
- client = Google::Cloud::Run.executions
73
+ client = Google::Cloud::Run.builds
74
74
  ```
75
75
 
76
76
  ### Environment Variables
@@ -100,7 +100,7 @@ require "google/cloud/run"
100
100
 
101
101
  ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
102
102
 
103
- client = Google::Cloud::Run.executions
103
+ client = Google::Cloud::Run.builds
104
104
  ```
105
105
 
106
106
  ### Local ADC file
data/README.md CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/run.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-run-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -18,7 +18,7 @@ module Google
18
18
  module Cloud
19
19
  module Run
20
20
  module Client
21
- VERSION = "1.2.1"
21
+ VERSION = "1.4.0"
22
22
  end
23
23
  end
24
24
  end
@@ -45,6 +45,76 @@ end
45
45
  module Google
46
46
  module Cloud
47
47
  module Run
48
+ ##
49
+ # Create a new client object for Builds.
50
+ #
51
+ # By default, this returns an instance of
52
+ # [Google::Cloud::Run::V2::Builds::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest/Google-Cloud-Run-V2-Builds-Client)
53
+ # for a gRPC client for version V2 of the API.
54
+ # However, you can specify a different API version by passing it in the
55
+ # `version` parameter. If the Builds service is
56
+ # supported by that API version, and the corresponding gem is available, the
57
+ # appropriate versioned client will be returned.
58
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
59
+ # the `transport` parameter.
60
+ #
61
+ # Raises an exception if the currently installed versioned client gem for the
62
+ # given API version does not support the given transport of the Builds service.
63
+ # You can determine whether the method will succeed by calling
64
+ # {Google::Cloud::Run.builds_available?}.
65
+ #
66
+ # ## About Builds
67
+ #
68
+ # Cloud Run Build Control Plane API
69
+ #
70
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
71
+ # Defaults to `:v2`.
72
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
73
+ # @return [::Object] A client object for the specified version.
74
+ #
75
+ def self.builds version: :v2, transport: :grpc, &block
76
+ require "google/cloud/run/#{version.to_s.downcase}"
77
+
78
+ package_name = Google::Cloud::Run
79
+ .constants
80
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
81
+ .first
82
+ service_module = Google::Cloud::Run.const_get(package_name).const_get(:Builds)
83
+ service_module = service_module.const_get(:Rest) if transport == :rest
84
+ service_module.const_get(:Client).new(&block)
85
+ end
86
+
87
+ ##
88
+ # Determines whether the Builds service is supported by the current client.
89
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.builds}.
90
+ # If false, that method will raise an exception. This could happen if the given
91
+ # API version does not exist or does not support the Builds service,
92
+ # or if the versioned client gem needs an update to support the Builds service.
93
+ #
94
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
95
+ # Defaults to `:v2`.
96
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
97
+ # @return [boolean] Whether the service is available.
98
+ #
99
+ def self.builds_available? version: :v2, transport: :grpc
100
+ require "google/cloud/run/#{version.to_s.downcase}"
101
+ package_name = Google::Cloud::Run
102
+ .constants
103
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
104
+ .first
105
+ return false unless package_name
106
+ service_module = Google::Cloud::Run.const_get package_name
107
+ return false unless service_module.const_defined? :Builds
108
+ service_module = service_module.const_get :Builds
109
+ if transport == :rest
110
+ return false unless service_module.const_defined? :Rest
111
+ service_module = service_module.const_get :Rest
112
+ end
113
+ service_module.const_defined? :Client
114
+ rescue ::LoadError
115
+ false
116
+ end
117
+
48
118
  ##
49
119
  # Create a new client object for Executions.
50
120
  #
@@ -58,6 +128,11 @@ module Google
58
128
  # You can also specify a different transport by passing `:rest` or `:grpc` in
59
129
  # the `transport` parameter.
60
130
  #
131
+ # Raises an exception if the currently installed versioned client gem for the
132
+ # given API version does not support the given transport of the Executions service.
133
+ # You can determine whether the method will succeed by calling
134
+ # {Google::Cloud::Run.executions_available?}.
135
+ #
61
136
  # ## About Executions
62
137
  #
63
138
  # Cloud Run Execution Control Plane API.
@@ -79,6 +154,37 @@ module Google
79
154
  service_module.const_get(:Client).new(&block)
80
155
  end
81
156
 
157
+ ##
158
+ # Determines whether the Executions service is supported by the current client.
159
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.executions}.
160
+ # If false, that method will raise an exception. This could happen if the given
161
+ # API version does not exist or does not support the Executions service,
162
+ # or if the versioned client gem needs an update to support the Executions service.
163
+ #
164
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
165
+ # Defaults to `:v2`.
166
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
167
+ # @return [boolean] Whether the service is available.
168
+ #
169
+ def self.executions_available? version: :v2, transport: :grpc
170
+ require "google/cloud/run/#{version.to_s.downcase}"
171
+ package_name = Google::Cloud::Run
172
+ .constants
173
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
174
+ .first
175
+ return false unless package_name
176
+ service_module = Google::Cloud::Run.const_get package_name
177
+ return false unless service_module.const_defined? :Executions
178
+ service_module = service_module.const_get :Executions
179
+ if transport == :rest
180
+ return false unless service_module.const_defined? :Rest
181
+ service_module = service_module.const_get :Rest
182
+ end
183
+ service_module.const_defined? :Client
184
+ rescue ::LoadError
185
+ false
186
+ end
187
+
82
188
  ##
83
189
  # Create a new client object for Jobs.
84
190
  #
@@ -92,6 +198,11 @@ module Google
92
198
  # You can also specify a different transport by passing `:rest` or `:grpc` in
93
199
  # the `transport` parameter.
94
200
  #
201
+ # Raises an exception if the currently installed versioned client gem for the
202
+ # given API version does not support the given transport of the Jobs service.
203
+ # You can determine whether the method will succeed by calling
204
+ # {Google::Cloud::Run.jobs_available?}.
205
+ #
95
206
  # ## About Jobs
96
207
  #
97
208
  # Cloud Run Job Control Plane API.
@@ -113,6 +224,37 @@ module Google
113
224
  service_module.const_get(:Client).new(&block)
114
225
  end
115
226
 
227
+ ##
228
+ # Determines whether the Jobs service is supported by the current client.
229
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.jobs}.
230
+ # If false, that method will raise an exception. This could happen if the given
231
+ # API version does not exist or does not support the Jobs service,
232
+ # or if the versioned client gem needs an update to support the Jobs service.
233
+ #
234
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
235
+ # Defaults to `:v2`.
236
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
237
+ # @return [boolean] Whether the service is available.
238
+ #
239
+ def self.jobs_available? version: :v2, transport: :grpc
240
+ require "google/cloud/run/#{version.to_s.downcase}"
241
+ package_name = Google::Cloud::Run
242
+ .constants
243
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
244
+ .first
245
+ return false unless package_name
246
+ service_module = Google::Cloud::Run.const_get package_name
247
+ return false unless service_module.const_defined? :Jobs
248
+ service_module = service_module.const_get :Jobs
249
+ if transport == :rest
250
+ return false unless service_module.const_defined? :Rest
251
+ service_module = service_module.const_get :Rest
252
+ end
253
+ service_module.const_defined? :Client
254
+ rescue ::LoadError
255
+ false
256
+ end
257
+
116
258
  ##
117
259
  # Create a new client object for Revisions.
118
260
  #
@@ -126,6 +268,11 @@ module Google
126
268
  # You can also specify a different transport by passing `:rest` or `:grpc` in
127
269
  # the `transport` parameter.
128
270
  #
271
+ # Raises an exception if the currently installed versioned client gem for the
272
+ # given API version does not support the given transport of the Revisions service.
273
+ # You can determine whether the method will succeed by calling
274
+ # {Google::Cloud::Run.revisions_available?}.
275
+ #
129
276
  # ## About Revisions
130
277
  #
131
278
  # Cloud Run Revision Control Plane API.
@@ -147,6 +294,37 @@ module Google
147
294
  service_module.const_get(:Client).new(&block)
148
295
  end
149
296
 
297
+ ##
298
+ # Determines whether the Revisions service is supported by the current client.
299
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.revisions}.
300
+ # If false, that method will raise an exception. This could happen if the given
301
+ # API version does not exist or does not support the Revisions service,
302
+ # or if the versioned client gem needs an update to support the Revisions service.
303
+ #
304
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
305
+ # Defaults to `:v2`.
306
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
307
+ # @return [boolean] Whether the service is available.
308
+ #
309
+ def self.revisions_available? version: :v2, transport: :grpc
310
+ require "google/cloud/run/#{version.to_s.downcase}"
311
+ package_name = Google::Cloud::Run
312
+ .constants
313
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
314
+ .first
315
+ return false unless package_name
316
+ service_module = Google::Cloud::Run.const_get package_name
317
+ return false unless service_module.const_defined? :Revisions
318
+ service_module = service_module.const_get :Revisions
319
+ if transport == :rest
320
+ return false unless service_module.const_defined? :Rest
321
+ service_module = service_module.const_get :Rest
322
+ end
323
+ service_module.const_defined? :Client
324
+ rescue ::LoadError
325
+ false
326
+ end
327
+
150
328
  ##
151
329
  # Create a new client object for Services.
152
330
  #
@@ -160,6 +338,11 @@ module Google
160
338
  # You can also specify a different transport by passing `:rest` or `:grpc` in
161
339
  # the `transport` parameter.
162
340
  #
341
+ # Raises an exception if the currently installed versioned client gem for the
342
+ # given API version does not support the given transport of the Services service.
343
+ # You can determine whether the method will succeed by calling
344
+ # {Google::Cloud::Run.services_available?}.
345
+ #
163
346
  # ## About Services
164
347
  #
165
348
  # Cloud Run Service Control Plane API
@@ -181,6 +364,37 @@ module Google
181
364
  service_module.const_get(:Client).new(&block)
182
365
  end
183
366
 
367
+ ##
368
+ # Determines whether the Services service is supported by the current client.
369
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.services}.
370
+ # If false, that method will raise an exception. This could happen if the given
371
+ # API version does not exist or does not support the Services service,
372
+ # or if the versioned client gem needs an update to support the Services service.
373
+ #
374
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
375
+ # Defaults to `:v2`.
376
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
377
+ # @return [boolean] Whether the service is available.
378
+ #
379
+ def self.services_available? version: :v2, transport: :grpc
380
+ require "google/cloud/run/#{version.to_s.downcase}"
381
+ package_name = Google::Cloud::Run
382
+ .constants
383
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
384
+ .first
385
+ return false unless package_name
386
+ service_module = Google::Cloud::Run.const_get package_name
387
+ return false unless service_module.const_defined? :Services
388
+ service_module = service_module.const_get :Services
389
+ if transport == :rest
390
+ return false unless service_module.const_defined? :Rest
391
+ service_module = service_module.const_get :Rest
392
+ end
393
+ service_module.const_defined? :Client
394
+ rescue ::LoadError
395
+ false
396
+ end
397
+
184
398
  ##
185
399
  # Create a new client object for Tasks.
186
400
  #
@@ -194,6 +408,11 @@ module Google
194
408
  # You can also specify a different transport by passing `:rest` or `:grpc` in
195
409
  # the `transport` parameter.
196
410
  #
411
+ # Raises an exception if the currently installed versioned client gem for the
412
+ # given API version does not support the given transport of the Tasks service.
413
+ # You can determine whether the method will succeed by calling
414
+ # {Google::Cloud::Run.tasks_available?}.
415
+ #
197
416
  # ## About Tasks
198
417
  #
199
418
  # Cloud Run Task Control Plane API.
@@ -215,6 +434,37 @@ module Google
215
434
  service_module.const_get(:Client).new(&block)
216
435
  end
217
436
 
437
+ ##
438
+ # Determines whether the Tasks service is supported by the current client.
439
+ # If true, you can retrieve a client object by calling {Google::Cloud::Run.tasks}.
440
+ # If false, that method will raise an exception. This could happen if the given
441
+ # API version does not exist or does not support the Tasks service,
442
+ # or if the versioned client gem needs an update to support the Tasks service.
443
+ #
444
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
445
+ # Defaults to `:v2`.
446
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
447
+ # @return [boolean] Whether the service is available.
448
+ #
449
+ def self.tasks_available? version: :v2, transport: :grpc
450
+ require "google/cloud/run/#{version.to_s.downcase}"
451
+ package_name = Google::Cloud::Run
452
+ .constants
453
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
454
+ .first
455
+ return false unless package_name
456
+ service_module = Google::Cloud::Run.const_get package_name
457
+ return false unless service_module.const_defined? :Tasks
458
+ service_module = service_module.const_get :Tasks
459
+ if transport == :rest
460
+ return false unless service_module.const_defined? :Rest
461
+ service_module = service_module.const_get :Rest
462
+ end
463
+ service_module.const_defined? :Client
464
+ rescue ::LoadError
465
+ false
466
+ end
467
+
218
468
  ##
219
469
  # Configure the google-cloud-run-client library.
220
470
  #
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-run-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -30,7 +29,7 @@ dependencies:
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '0.13'
32
+ version: '0.17'
34
33
  - - "<"
35
34
  - !ruby/object:Gem::Version
36
35
  version: 2.a
@@ -40,7 +39,7 @@ dependencies:
40
39
  requirements:
41
40
  - - ">="
42
41
  - !ruby/object:Gem::Version
43
- version: '0.13'
42
+ version: '0.17'
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.a
@@ -62,7 +61,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
62
61
  licenses:
63
62
  - Apache-2.0
64
63
  metadata: {}
65
- post_install_message:
66
64
  rdoc_options: []
67
65
  require_paths:
68
66
  - lib
@@ -70,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
68
  requirements:
71
69
  - - ">="
72
70
  - !ruby/object:Gem::Version
73
- version: '2.7'
71
+ version: '3.0'
74
72
  required_rubygems_version: !ruby/object:Gem::Requirement
75
73
  requirements:
76
74
  - - ">="
77
75
  - !ruby/object:Gem::Version
78
76
  version: '0'
79
77
  requirements: []
80
- rubygems_version: 3.5.6
81
- signing_key:
78
+ rubygems_version: 3.6.2
82
79
  specification_version: 4
83
80
  summary: API Client library for the Cloud Run API
84
81
  test_files: []