google-cloud-functions-v1 0.8.1 → 0.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f78939bfbf642e23e782ed4e8171f899728147d9f2def093781a83926d57c900
4
- data.tar.gz: ca6f1a60ff26a62072bfb7e564c60439bbef97e2b96d557bd72a7ded9759c8bc
3
+ metadata.gz: 133bdb41fa5847f2a169ab5b0b744c7c953c16d0b3cf8be94f797b5aad70db2c
4
+ data.tar.gz: 7b3d55d42cfe0df7b29ae045405dd806cff0dc9370db1c9015bc7d75de8fd06d
5
5
  SHA512:
6
- metadata.gz: 157bf1a5cdc4e61d1c604bd59cc4fbd56612ca56148bdd402bfaada08abd349656b3252e1997dc6f56e1fab3537bb17d9460b2db57bee53da7218b49a0178cd1
7
- data.tar.gz: 2085b5381bbbb694306412f652dd3e19c669835a3cb92422ed512216c951a1e3987dbb0be239ed77d33c345e0b5e65d659cb6af39d31804a713bc40dd5a07f18
6
+ metadata.gz: 21ac38859d881bcbfb5cccc6c377e5fc3de1c7bbd2f27058831a316c03e8072eaf1d298114c8f957d89abf9fd95754c140ab16bca3bef4dcbbaaf868e76f6148
7
+ data.tar.gz: eb2d5c20d73f555e73be0109a03b9b6e18b6b0cc7479ff9b7c1b6d297e7a05282c71c88d6ec5d93249716532257a441f0c6f7b02cde8f909bf06af6a1529d1db
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Functions V1 API
2
2
 
3
- API Client library for the Cloud Functions V1 API
3
+ Manages lightweight user-provided functions executed in response to events.
4
4
 
5
5
  The Cloud Functions API manages lightweight user-provided functions executed in response to events.
6
6
 
@@ -47,7 +47,7 @@ for general usage information.
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
49
  The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/config"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Functions
24
+ ##
25
+ # @example Loading just the REST part of this package, including all its services, and instantiating a REST client
26
+ #
27
+ # require "google/cloud/functions/v1/rest"
28
+ # client = ::Google::Cloud::Functions::V1::CloudFunctionsService::Rest::Client.new
29
+ #
30
+ module V1
31
+ ##
32
+ # @private
33
+ # Initialize the mixin bindings configuration
34
+ #
35
+ def self.configure
36
+ @configure ||= begin
37
+ namespace = ["Google", "Cloud", "Functions"]
38
+ parent_config = while namespace.any?
39
+ parent_name = namespace.join "::"
40
+ parent_const = const_get parent_name
41
+ break parent_const.configure if parent_const.respond_to? :configure
42
+ namespace.pop
43
+ end
44
+
45
+ default_config = Configuration.new parent_config
46
+ default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
47
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
48
+ uri_method: :get,
49
+ uri_template: "/v1/{name}/locations",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config
57
+ end
58
+ yield @configure if block_given?
59
+ @configure
60
+ end
61
+
62
+ ##
63
+ # @private
64
+ # Configuration class for the google.cloud.functions.v1 package.
65
+ #
66
+ # This class contains common configuration for all services
67
+ # of the google.cloud.functions.v1 package.
68
+ #
69
+ # This configuration is for internal use of the client library classes,
70
+ # and it is not intended that the end-users will read or change it.
71
+ #
72
+ class Configuration
73
+ extend ::Gapic::Config
74
+
75
+ # @private
76
+ # Overrides for http bindings for the RPC of the mixins for this package.
77
+ # Services in this package should use these when creating clients for the mixin services.
78
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
79
+ config_attr :bindings_override, {}, ::Hash, nil
80
+
81
+ # @private
82
+ def initialize parent_config = nil
83
+ @parent_config = parent_config unless parent_config.nil?
84
+
85
+ yield self if block_given?
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -18,6 +18,8 @@
18
18
 
19
19
  require "google/cloud/errors"
20
20
  require "google/cloud/functions/v1/functions_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
21
23
 
22
24
  module Google
23
25
  module Cloud
@@ -163,6 +165,18 @@ module Google
163
165
  config.endpoint = @config.endpoint
164
166
  end
165
167
 
168
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @config.endpoint
172
+ end
173
+
174
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @config.endpoint
178
+ end
179
+
166
180
  @cloud_functions_service_stub = ::Gapic::ServiceStub.new(
167
181
  ::Google::Cloud::Functions::V1::CloudFunctionsService::Stub,
168
182
  credentials: credentials,
@@ -179,6 +193,20 @@ module Google
179
193
  #
180
194
  attr_reader :operations_client
181
195
 
196
+ ##
197
+ # Get the associated client for mix-in of the Locations.
198
+ #
199
+ # @return [Google::Cloud::Location::Locations::Client]
200
+ #
201
+ attr_reader :location_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the IAMPolicy.
205
+ #
206
+ # @return [Google::Iam::V1::IAMPolicy::Client]
207
+ #
208
+ attr_reader :iam_policy_client
209
+
182
210
  # Service calls
183
211
 
184
212
  ##
@@ -370,7 +398,7 @@ module Google
370
398
 
371
399
  ##
372
400
  # Creates a new function. If a function with the given name already exists in
373
- # the specified project, the long running operation will return
401
+ # the specified project, the long running operation returns an
374
402
  # `ALREADY_EXISTS` error.
375
403
  #
376
404
  # @overload create_function(request, options = nil)
@@ -389,8 +417,8 @@ module Google
389
417
  # the default parameter values, pass an empty Hash as a request object (see above).
390
418
  #
391
419
  # @param location [::String]
392
- # Required. The project and location in which the function should be created, specified
393
- # in the format `projects/*/locations/*`
420
+ # Required. The project and location in which the function should be created,
421
+ # specified in the format `projects/*/locations/*`
394
422
  # @param function [::Google::Cloud::Functions::V1::CloudFunction, ::Hash]
395
423
  # Required. Function to be created.
396
424
  #
@@ -563,7 +591,7 @@ module Google
563
591
 
564
592
  ##
565
593
  # Deletes a function with the given name from the specified project. If the
566
- # given function is used by some trigger, the trigger will be updated to
594
+ # given function is used by some trigger, the trigger is updated to
567
595
  # remove this function.
568
596
  #
569
597
  # @overload delete_function(request, options = nil)
@@ -764,12 +792,12 @@ module Google
764
792
  # attached, the identity from the credentials would be used, but that
765
793
  # identity does not have permissions to upload files to the URL.
766
794
  #
767
- # When making a HTTP PUT request, these two headers need to be specified:
795
+ # When making an HTTP PUT request, these two headers must be specified:
768
796
  #
769
797
  # * `content-type: application/zip`
770
798
  # * `x-goog-content-length-range: 0,104857600`
771
799
  #
772
- # And this header SHOULD NOT be specified:
800
+ # And this header must NOT be specified:
773
801
  #
774
802
  # * `Authorization: Bearer YOUR_TOKEN`
775
803
  #
@@ -876,9 +904,9 @@ module Google
876
904
 
877
905
  ##
878
906
  # Returns a signed URL for downloading deployed function source code.
879
- # The URL is only valid for a limited period and should be used within
907
+ # The URL is only valid for a limited period and must be used within
880
908
  # minutes after generation.
881
- # For more information about the signed URL usage see:
909
+ # For more information about the signed URL usage, see:
882
910
  # https://cloud.google.com/storage/docs/access-control/signed-urls
883
911
  #
884
912
  # @overload generate_download_url(request, options = nil)
@@ -1159,7 +1187,7 @@ module Google
1159
1187
  ##
1160
1188
  # Tests the specified permissions against the IAM access control policy
1161
1189
  # for a function.
1162
- # If the function does not exist, this will return an empty set of
1190
+ # If the function does not exist, this returns an empty set of
1163
1191
  # permissions, not a NOT_FOUND error.
1164
1192
  #
1165
1193
  # @overload test_iam_permissions(request, options = nil)
@@ -1288,9 +1316,9 @@ module Google
1288
1316
  # * (`String`) The path to a service account key file in JSON format
1289
1317
  # * (`Hash`) A service account key as a Hash
1290
1318
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1291
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1319
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1292
1320
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1293
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1321
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1294
1322
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1295
1323
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1296
1324
  # * (`nil`) indicating no credentials
@@ -612,9 +612,9 @@ module Google
612
612
  # * (`String`) The path to a service account key file in JSON format
613
613
  # * (`Hash`) A service account key as a Hash
614
614
  # * (`Google::Auth::Credentials`) A googleauth credentials object
615
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
615
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
616
616
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
617
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
617
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
618
618
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
619
619
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
620
620
  # * (`nil`) indicating no credentials