google-cloud-functions-v2 0.1.0 → 0.2.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: 3d6b6e6359bf56a99485078111cc1ee38d6412d7ef0ae3aeb4cd683254b6d998
4
- data.tar.gz: d87b48663959f691ae3f9ea496f045a2081beb09c5cfacf7f91f50bc8fc4cf2a
3
+ metadata.gz: a84cfe684d197806a2385398444d215cf441c9d344cf5dd9510650ed2bf5a813
4
+ data.tar.gz: 6930a19679bbcccb9128b8ba163dfa767de79067e47c0a26b1c305c987efad12
5
5
  SHA512:
6
- metadata.gz: 9bd6cdf8df9ee900afb2de7e9dfce20d520acb8dcccd8d9a21024c46575d5d1845c2ce63cfa21076927300bd45789b4d93851907b97254ea7abcbfb74ebde82f
7
- data.tar.gz: aef1bb6e4653a7e1b6b3916e29a33cde4e753d8b2e6e8661dc5c1a0d1324465192ee7ee6a82aea5b8fcd2d7b74caacd9d1cf2543230fdc2cbca6d545798eb986
6
+ metadata.gz: 53511fa8acbed5395bc927287cef772e2b8506b85d299750df53fe20793c08acd19630ae3a2a5bbf888c5f0608306149e0b971b634105a7564ee9f2786e5228e
7
+ data.tar.gz: d70201eef45a956c178199549265b5210b4db6f3778581593ea1418129b7aa65fd777f4a3df0a6a4a44940011dc6b5187e9521eaa06c814fac40b7081801848f
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Functions V2 API
2
2
 
3
- API Client library for the Cloud Functions V2 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
 
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
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
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
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
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/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.
@@ -0,0 +1,124 @@
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/v2/rest"
28
+ # client = ::Google::Cloud::Functions::V2::FunctionService::Rest::Client.new
29
+ #
30
+ module V2
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: "/v2/{name}/locations",
50
+ matches: [
51
+ ["name", %r{^projects/[^/]+/?$}, false]
52
+ ],
53
+ body: nil
54
+ )
55
+ ]
56
+ default_config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] = [
57
+
58
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
59
+ uri_method: :get,
60
+ uri_template: "/v2/{resource}:getIamPolicy",
61
+ matches: [
62
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/functions/[^/]+/?$}, false]
63
+ ],
64
+ body: nil
65
+ )
66
+ ]
67
+ default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [
68
+
69
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
70
+ uri_method: :post,
71
+ uri_template: "/v2/{resource}:setIamPolicy",
72
+ matches: [
73
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/functions/[^/]+/?$}, false]
74
+ ],
75
+ body: "*"
76
+ )
77
+ ]
78
+ default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [
79
+
80
+ Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
81
+ uri_method: :post,
82
+ uri_template: "/v2/{resource}:testIamPermissions",
83
+ matches: [
84
+ ["resource", %r{^projects/[^/]+/locations/[^/]+/functions/[^/]+/?$}, false]
85
+ ],
86
+ body: "*"
87
+ )
88
+ ]
89
+ default_config
90
+ end
91
+ yield @configure if block_given?
92
+ @configure
93
+ end
94
+
95
+ ##
96
+ # @private
97
+ # Configuration class for the google.cloud.functions.v2 package.
98
+ #
99
+ # This class contains common configuration for all services
100
+ # of the google.cloud.functions.v2 package.
101
+ #
102
+ # This configuration is for internal use of the client library classes,
103
+ # and it is not intended that the end-users will read or change it.
104
+ #
105
+ class Configuration
106
+ extend ::Gapic::Config
107
+
108
+ # @private
109
+ # Overrides for http bindings for the RPC of the mixins for this package.
110
+ # Services in this package should use these when creating clients for the mixin services.
111
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
112
+ config_attr :bindings_override, {}, ::Hash, nil
113
+
114
+ # @private
115
+ def initialize parent_config = nil
116
+ @parent_config = parent_config unless parent_config.nil?
117
+
118
+ yield self if block_given?
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
@@ -335,13 +335,11 @@ module Google
335
335
  # # Call the list_functions method.
336
336
  # result = client.list_functions request
337
337
  #
338
- # # The returned object is of type Gapic::PagedEnumerable. You can
339
- # # iterate over all elements by calling #each, and the enumerable
340
- # # will lazily make API calls to fetch subsequent pages. Other
341
- # # methods are also available for managing paging directly.
342
- # result.each do |response|
338
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
339
+ # # over elements, and API calls will be issued to fetch pages as needed.
340
+ # result.each do |item|
343
341
  # # Each element is of type ::Google::Cloud::Functions::V2::Function.
344
- # p response
342
+ # p item
345
343
  # end
346
344
  #
347
345
  def list_functions request, options = nil
@@ -438,14 +436,14 @@ module Google
438
436
  # # Call the create_function method.
439
437
  # result = client.create_function request
440
438
  #
441
- # # The returned object is of type Gapic::Operation. You can use this
442
- # # object to check the status of an operation, cancel it, or wait
443
- # # for results. Here is how to block until completion:
439
+ # # The returned object is of type Gapic::Operation. You can use it to
440
+ # # check the status of an operation, cancel it, or wait for results.
441
+ # # Here is how to wait for a response.
444
442
  # result.wait_until_done! timeout: 60
445
443
  # if result.response?
446
444
  # p result.response
447
445
  # else
448
- # puts "Error!"
446
+ # puts "No response received."
449
447
  # end
450
448
  #
451
449
  def create_function request, options = nil
@@ -535,14 +533,14 @@ module Google
535
533
  # # Call the update_function method.
536
534
  # result = client.update_function request
537
535
  #
538
- # # The returned object is of type Gapic::Operation. You can use this
539
- # # object to check the status of an operation, cancel it, or wait
540
- # # for results. Here is how to block until completion:
536
+ # # The returned object is of type Gapic::Operation. You can use it to
537
+ # # check the status of an operation, cancel it, or wait for results.
538
+ # # Here is how to wait for a response.
541
539
  # result.wait_until_done! timeout: 60
542
540
  # if result.response?
543
541
  # p result.response
544
542
  # else
545
- # puts "Error!"
543
+ # puts "No response received."
546
544
  # end
547
545
  #
548
546
  def update_function request, options = nil
@@ -630,14 +628,14 @@ module Google
630
628
  # # Call the delete_function method.
631
629
  # result = client.delete_function request
632
630
  #
633
- # # The returned object is of type Gapic::Operation. You can use this
634
- # # object to check the status of an operation, cancel it, or wait
635
- # # for results. Here is how to block until completion:
631
+ # # The returned object is of type Gapic::Operation. You can use it to
632
+ # # check the status of an operation, cancel it, or wait for results.
633
+ # # Here is how to wait for a response.
636
634
  # result.wait_until_done! timeout: 60
637
635
  # if result.response?
638
636
  # p result.response
639
637
  # else
640
- # puts "Error!"
638
+ # puts "No response received."
641
639
  # end
642
640
  #
643
641
  def delete_function request, options = nil
@@ -158,13 +158,11 @@ module Google
158
158
  # # Call the list_operations method.
159
159
  # result = client.list_operations request
160
160
  #
161
- # # The returned object is of type Gapic::PagedEnumerable. You can
162
- # # iterate over all elements by calling #each, and the enumerable
163
- # # will lazily make API calls to fetch subsequent pages. Other
164
- # # methods are also available for managing paging directly.
165
- # result.each do |response|
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
162
+ # # over elements, and API calls will be issued to fetch pages as needed.
163
+ # result.each do |item|
166
164
  # # Each element is of type ::Google::Longrunning::Operation.
167
- # p response
165
+ # p item
168
166
  # end
169
167
  #
170
168
  def list_operations request, options = nil
@@ -253,14 +251,14 @@ module Google
253
251
  # # Call the get_operation method.
254
252
  # result = client.get_operation request
255
253
  #
256
- # # The returned object is of type Gapic::Operation. You can use this
257
- # # object to check the status of an operation, cancel it, or wait
258
- # # for results. Here is how to block until completion:
254
+ # # The returned object is of type Gapic::Operation. You can use it to
255
+ # # check the status of an operation, cancel it, or wait for results.
256
+ # # Here is how to wait for a response.
259
257
  # result.wait_until_done! timeout: 60
260
258
  # if result.response?
261
259
  # p result.response
262
260
  # else
263
- # puts "Error!"
261
+ # puts "No response received."
264
262
  # end
265
263
  #
266
264
  def get_operation request, options = nil
@@ -540,14 +538,14 @@ module Google
540
538
  # # Call the wait_operation method.
541
539
  # result = client.wait_operation request
542
540
  #
543
- # # The returned object is of type Gapic::Operation. You can use this
544
- # # object to check the status of an operation, cancel it, or wait
545
- # # for results. Here is how to block until completion:
541
+ # # The returned object is of type Gapic::Operation. You can use it to
542
+ # # check the status of an operation, cancel it, or wait for results.
543
+ # # Here is how to wait for a response.
546
544
  # result.wait_until_done! timeout: 60
547
545
  # if result.response?
548
546
  # p result.response
549
547
  # else
550
- # puts "Error!"
548
+ # puts "No response received."
551
549
  # end
552
550
  #
553
551
  def wait_operation request, options = nil