google-cloud-functions 1.5.1 → 2.0.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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +3 -3
- data/README.md +34 -4
- data/lib/google/cloud/functions/version.rb +1 -1
- data/lib/google/cloud/functions.rb +50 -9
- metadata +9 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d5b637c7d621652354e1db54578ccef905ee3b294434d97927d0235288892a1
|
4
|
+
data.tar.gz: a03d8aa071cdddb842415ffb24da12be31a0dc6e18fc4e59e4a9627357b96baa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e4e240d3ae9cafd41071be58ddad7a298187eba5931c62bd0e40a4ca6f062d99de0e33108c1e68f89b577ac14a403a2e7715db710738ea47c8ae3a27512314b
|
7
|
+
data.tar.gz: 11f144be7723db696542475dc9a26b9de6b5e76b3ac0bb4b246c20155c479d02051de598df8c7760247d4ff7710f7e114a075b9e229a4a6bbf404ee2b78b03c2
|
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/functions"
|
58
58
|
|
59
|
-
client = Google::Cloud::Functions.
|
59
|
+
client = Google::Cloud::Functions.function_service do |config|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
61
61
|
end
|
62
62
|
```
|
@@ -70,7 +70,7 @@ Google::Cloud::Functions.configure do |config|
|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
71
71
|
end
|
72
72
|
|
73
|
-
client = Google::Cloud::Functions.
|
73
|
+
client = Google::Cloud::Functions.function_service
|
74
74
|
```
|
75
75
|
|
76
76
|
### Environment Variables
|
@@ -100,7 +100,7 @@ require "google/cloud/functions"
|
|
100
100
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
102
102
|
|
103
|
-
client = Google::Cloud::Functions.
|
103
|
+
client = Google::Cloud::Functions.function_service
|
104
104
|
```
|
105
105
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ for this library, google-cloud-functions, to see the convenience methods for
|
|
16
16
|
constructing client objects. Reference documentation for the client objects
|
17
17
|
themselves can be found in the client library documentation for the versioned
|
18
18
|
client gems:
|
19
|
-
[google-cloud-functions-
|
19
|
+
[google-cloud-functions-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest).
|
20
20
|
|
21
21
|
See also the [Product Documentation](https://cloud.google.com/functions)
|
22
22
|
for more usage information.
|
@@ -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/cloudfunctions.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-functions-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest).
|
66
|
+
|
37
67
|
## Supported Ruby Versions
|
38
68
|
|
39
|
-
This library is supported on Ruby
|
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
|
@@ -50,7 +80,7 @@ support schedule.
|
|
50
80
|
Most modern Ruby client libraries for Google APIs come in two flavors: the main
|
51
81
|
client library with a name such as `google-cloud-functions`,
|
52
82
|
and lower-level _versioned_ client libraries with names such as
|
53
|
-
`google-cloud-functions-
|
83
|
+
`google-cloud-functions-v2`.
|
54
84
|
_In most cases, you should install the main client._
|
55
85
|
|
56
86
|
### What's the difference between the main client and a versioned client?
|
@@ -88,7 +118,7 @@ You can use a versioned client if you are content with a possibly lower-level
|
|
88
118
|
class interface, you explicitly want to avoid features provided by the main
|
89
119
|
client, or you want to access a specific service version not be covered by the
|
90
120
|
main client. You can identify versioned client gems because the service version
|
91
|
-
is part of the name, e.g. `google-cloud-functions-
|
121
|
+
is part of the name, e.g. `google-cloud-functions-v2`.
|
92
122
|
|
93
123
|
### What about the google-apis-<name> clients?
|
94
124
|
|
@@ -46,39 +46,80 @@ module Google
|
|
46
46
|
module Cloud
|
47
47
|
module Functions
|
48
48
|
##
|
49
|
-
# Create a new client object for
|
49
|
+
# Create a new client object for FunctionService.
|
50
50
|
#
|
51
51
|
# By default, this returns an instance of
|
52
|
-
# [Google::Cloud::Functions::
|
53
|
-
# for a gRPC client for version
|
52
|
+
# [Google::Cloud::Functions::V2::FunctionService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-FunctionService-Client)
|
53
|
+
# for a gRPC client for version V2 of the API.
|
54
54
|
# However, you can specify a different API version by passing it in the
|
55
|
-
# `version` parameter. If the
|
55
|
+
# `version` parameter. If the FunctionService service is
|
56
56
|
# supported by that API version, and the corresponding gem is available, the
|
57
57
|
# appropriate versioned client will be returned.
|
58
58
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
59
|
# the `transport` parameter.
|
60
60
|
#
|
61
|
-
#
|
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 FunctionService service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::Functions.function_service_available?}.
|
62
65
|
#
|
63
|
-
#
|
66
|
+
# ## About FunctionService
|
67
|
+
#
|
68
|
+
# Google Cloud Functions is used to deploy functions that are executed by
|
69
|
+
# Google in response to various events. Data connected with that event is
|
70
|
+
# passed to a function as the input data.
|
71
|
+
#
|
72
|
+
# A **function** is a resource which describes a function that should be
|
73
|
+
# executed and how it is triggered.
|
64
74
|
#
|
65
75
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
66
|
-
# Defaults to `:
|
76
|
+
# Defaults to `:v2`.
|
67
77
|
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
68
78
|
# @return [::Object] A client object for the specified version.
|
69
79
|
#
|
70
|
-
def self.
|
80
|
+
def self.function_service version: :v2, transport: :grpc, &block
|
71
81
|
require "google/cloud/functions/#{version.to_s.downcase}"
|
72
82
|
|
73
83
|
package_name = Google::Cloud::Functions
|
74
84
|
.constants
|
75
85
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
76
86
|
.first
|
77
|
-
service_module = Google::Cloud::Functions.const_get(package_name).const_get(:
|
87
|
+
service_module = Google::Cloud::Functions.const_get(package_name).const_get(:FunctionService)
|
78
88
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
79
89
|
service_module.const_get(:Client).new(&block)
|
80
90
|
end
|
81
91
|
|
92
|
+
##
|
93
|
+
# Determines whether the FunctionService service is supported by the current client.
|
94
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Functions.function_service}.
|
95
|
+
# If false, that method will raise an exception. This could happen if the given
|
96
|
+
# API version does not exist or does not support the FunctionService service,
|
97
|
+
# or if the versioned client gem needs an update to support the FunctionService service.
|
98
|
+
#
|
99
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
100
|
+
# Defaults to `:v2`.
|
101
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
102
|
+
# @return [boolean] Whether the service is available.
|
103
|
+
#
|
104
|
+
def self.function_service_available? version: :v2, transport: :grpc
|
105
|
+
require "google/cloud/functions/#{version.to_s.downcase}"
|
106
|
+
package_name = Google::Cloud::Functions
|
107
|
+
.constants
|
108
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
109
|
+
.first
|
110
|
+
return false unless package_name
|
111
|
+
service_module = Google::Cloud::Functions.const_get package_name
|
112
|
+
return false unless service_module.const_defined? :FunctionService
|
113
|
+
service_module = service_module.const_get :FunctionService
|
114
|
+
if transport == :rest
|
115
|
+
return false unless service_module.const_defined? :Rest
|
116
|
+
service_module = service_module.const_get :Rest
|
117
|
+
end
|
118
|
+
service_module.const_defined? :Client
|
119
|
+
rescue ::LoadError
|
120
|
+
false
|
121
|
+
end
|
122
|
+
|
82
123
|
##
|
83
124
|
# Configure the google-cloud-functions library.
|
84
125
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-functions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -25,25 +24,19 @@ dependencies:
|
|
25
24
|
- !ruby/object:Gem::Version
|
26
25
|
version: '1.6'
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name: google-cloud-functions-
|
27
|
+
name: google-cloud-functions-v2
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.13'
|
34
|
-
- - "<"
|
30
|
+
- - "~>"
|
35
31
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
32
|
+
version: '1.0'
|
37
33
|
type: :runtime
|
38
34
|
prerelease: false
|
39
35
|
version_requirements: !ruby/object:Gem::Requirement
|
40
36
|
requirements:
|
41
|
-
- - "
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0.13'
|
44
|
-
- - "<"
|
37
|
+
- - "~>"
|
45
38
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
39
|
+
version: '1.0'
|
47
40
|
description: The Cloud Functions API manages lightweight user-provided functions executed
|
48
41
|
in response to events.
|
49
42
|
email: googleapis-packages@google.com
|
@@ -62,7 +55,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
62
55
|
licenses:
|
63
56
|
- Apache-2.0
|
64
57
|
metadata: {}
|
65
|
-
post_install_message:
|
66
58
|
rdoc_options: []
|
67
59
|
require_paths:
|
68
60
|
- lib
|
@@ -70,15 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
62
|
requirements:
|
71
63
|
- - ">="
|
72
64
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
65
|
+
version: '3.0'
|
74
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
67
|
requirements:
|
76
68
|
- - ">="
|
77
69
|
- !ruby/object:Gem::Version
|
78
70
|
version: '0'
|
79
71
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
81
|
-
signing_key:
|
72
|
+
rubygems_version: 3.6.3
|
82
73
|
specification_version: 4
|
83
74
|
summary: API Client library for the Cloud Functions API
|
84
75
|
test_files: []
|