google-apis-cloudfunctions_v2 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,305 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudfunctionsV2
23
+ # Cloud Functions API
24
+ #
25
+ # Manages lightweight user-provided functions executed in response to events.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudfunctions_v2'
29
+ #
30
+ # Cloudfunctions = Google::Apis::CloudfunctionsV2 # Alias the module
31
+ # service = Cloudfunctions::CloudFunctionsService.new
32
+ #
33
+ # @see https://cloud.google.com/functions
34
+ class CloudFunctionsService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://cloudfunctions.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudfunctions_v2',
48
+ client_version: Google::Apis::CloudfunctionsV2::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Lists information about the supported locations for this service.
53
+ # @param [String] name
54
+ # The resource that owns the locations collection, if applicable.
55
+ # @param [String] filter
56
+ # A filter to narrow down results to a preferred subset. The filtering language
57
+ # accepts strings like `"displayName=tokyo"`, and is documented in more detail
58
+ # in [AIP-160](https://google.aip.dev/160).
59
+ # @param [Fixnum] page_size
60
+ # The maximum number of results to return. If not set, the service selects a
61
+ # default.
62
+ # @param [String] page_token
63
+ # A page token received from the `next_page_token` field in the response. Send
64
+ # that page token to receive the subsequent page.
65
+ # @param [String] fields
66
+ # Selector specifying which fields to include in a partial response.
67
+ # @param [String] quota_user
68
+ # Available to use for quota purposes for server-side applications. Can be any
69
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
70
+ # @param [Google::Apis::RequestOptions] options
71
+ # Request-specific options
72
+ #
73
+ # @yield [result, err] Result & error if block supplied
74
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::ListLocationsResponse] parsed result object
75
+ # @yieldparam err [StandardError] error object if request failed
76
+ #
77
+ # @return [Google::Apis::CloudfunctionsV2::ListLocationsResponse]
78
+ #
79
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
80
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
81
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
82
+ def list_project_locations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
83
+ command = make_simple_command(:get, 'v2/{+name}/locations', options)
84
+ command.response_representation = Google::Apis::CloudfunctionsV2::ListLocationsResponse::Representation
85
+ command.response_class = Google::Apis::CloudfunctionsV2::ListLocationsResponse
86
+ command.params['name'] = name unless name.nil?
87
+ command.query['filter'] = filter unless filter.nil?
88
+ command.query['pageSize'] = page_size unless page_size.nil?
89
+ command.query['pageToken'] = page_token unless page_token.nil?
90
+ command.query['fields'] = fields unless fields.nil?
91
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
92
+ execute_or_queue_command(command, &block)
93
+ end
94
+
95
+ # Gets the access control policy for a resource. Returns an empty policy if the
96
+ # resource exists and does not have a policy set.
97
+ # @param [String] resource
98
+ # REQUIRED: The resource for which the policy is being requested. See the
99
+ # operation documentation for the appropriate value for this field.
100
+ # @param [Fixnum] options_requested_policy_version
101
+ # Optional. The maximum policy version that will be used to format the policy.
102
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
103
+ # rejected. Requests for policies with any conditional role bindings must
104
+ # specify version 3. Policies with no conditional role bindings may specify any
105
+ # valid value or leave the field unset. The policy in the response might use the
106
+ # policy version that you specified, or it might use a lower policy version. For
107
+ # example, if you specify version 3, but the policy has no conditional role
108
+ # bindings, the response uses version 1. To learn which resources support
109
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
110
+ # google.com/iam/help/conditions/resource-policies).
111
+ # @param [String] fields
112
+ # Selector specifying which fields to include in a partial response.
113
+ # @param [String] quota_user
114
+ # Available to use for quota purposes for server-side applications. Can be any
115
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
116
+ # @param [Google::Apis::RequestOptions] options
117
+ # Request-specific options
118
+ #
119
+ # @yield [result, err] Result & error if block supplied
120
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::Policy] parsed result object
121
+ # @yieldparam err [StandardError] error object if request failed
122
+ #
123
+ # @return [Google::Apis::CloudfunctionsV2::Policy]
124
+ #
125
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
126
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
127
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
128
+ def get_project_location_function_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
129
+ command = make_simple_command(:get, 'v2/{+resource}:getIamPolicy', options)
130
+ command.response_representation = Google::Apis::CloudfunctionsV2::Policy::Representation
131
+ command.response_class = Google::Apis::CloudfunctionsV2::Policy
132
+ command.params['resource'] = resource unless resource.nil?
133
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
134
+ command.query['fields'] = fields unless fields.nil?
135
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
136
+ execute_or_queue_command(command, &block)
137
+ end
138
+
139
+ # Sets the access control policy on the specified resource. Replaces any
140
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
141
+ # PERMISSION_DENIED` errors.
142
+ # @param [String] resource
143
+ # REQUIRED: The resource for which the policy is being specified. See the
144
+ # operation documentation for the appropriate value for this field.
145
+ # @param [Google::Apis::CloudfunctionsV2::SetIamPolicyRequest] set_iam_policy_request_object
146
+ # @param [String] fields
147
+ # Selector specifying which fields to include in a partial response.
148
+ # @param [String] quota_user
149
+ # Available to use for quota purposes for server-side applications. Can be any
150
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
151
+ # @param [Google::Apis::RequestOptions] options
152
+ # Request-specific options
153
+ #
154
+ # @yield [result, err] Result & error if block supplied
155
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::Policy] parsed result object
156
+ # @yieldparam err [StandardError] error object if request failed
157
+ #
158
+ # @return [Google::Apis::CloudfunctionsV2::Policy]
159
+ #
160
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
161
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
162
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
163
+ def set_function_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
164
+ command = make_simple_command(:post, 'v2/{+resource}:setIamPolicy', options)
165
+ command.request_representation = Google::Apis::CloudfunctionsV2::SetIamPolicyRequest::Representation
166
+ command.request_object = set_iam_policy_request_object
167
+ command.response_representation = Google::Apis::CloudfunctionsV2::Policy::Representation
168
+ command.response_class = Google::Apis::CloudfunctionsV2::Policy
169
+ command.params['resource'] = resource unless resource.nil?
170
+ command.query['fields'] = fields unless fields.nil?
171
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
172
+ execute_or_queue_command(command, &block)
173
+ end
174
+
175
+ # Returns permissions that a caller has on the specified resource. If the
176
+ # resource does not exist, this will return an empty set of permissions, not a `
177
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
178
+ # permission-aware UIs and command-line tools, not for authorization checking.
179
+ # This operation may "fail open" without warning.
180
+ # @param [String] resource
181
+ # REQUIRED: The resource for which the policy detail is being requested. See the
182
+ # operation documentation for the appropriate value for this field.
183
+ # @param [Google::Apis::CloudfunctionsV2::TestIamPermissionsRequest] test_iam_permissions_request_object
184
+ # @param [String] fields
185
+ # Selector specifying which fields to include in a partial response.
186
+ # @param [String] quota_user
187
+ # Available to use for quota purposes for server-side applications. Can be any
188
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
189
+ # @param [Google::Apis::RequestOptions] options
190
+ # Request-specific options
191
+ #
192
+ # @yield [result, err] Result & error if block supplied
193
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::TestIamPermissionsResponse] parsed result object
194
+ # @yieldparam err [StandardError] error object if request failed
195
+ #
196
+ # @return [Google::Apis::CloudfunctionsV2::TestIamPermissionsResponse]
197
+ #
198
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
199
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
200
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
201
+ def test_function_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
202
+ command = make_simple_command(:post, 'v2/{+resource}:testIamPermissions', options)
203
+ command.request_representation = Google::Apis::CloudfunctionsV2::TestIamPermissionsRequest::Representation
204
+ command.request_object = test_iam_permissions_request_object
205
+ command.response_representation = Google::Apis::CloudfunctionsV2::TestIamPermissionsResponse::Representation
206
+ command.response_class = Google::Apis::CloudfunctionsV2::TestIamPermissionsResponse
207
+ command.params['resource'] = resource unless resource.nil?
208
+ command.query['fields'] = fields unless fields.nil?
209
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
210
+ execute_or_queue_command(command, &block)
211
+ end
212
+
213
+ # Gets the latest state of a long-running operation. Clients can use this method
214
+ # to poll the operation result at intervals as recommended by the API service.
215
+ # @param [String] name
216
+ # The name of the operation resource.
217
+ # @param [String] fields
218
+ # Selector specifying which fields to include in a partial response.
219
+ # @param [String] quota_user
220
+ # Available to use for quota purposes for server-side applications. Can be any
221
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
222
+ # @param [Google::Apis::RequestOptions] options
223
+ # Request-specific options
224
+ #
225
+ # @yield [result, err] Result & error if block supplied
226
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::Operation] parsed result object
227
+ # @yieldparam err [StandardError] error object if request failed
228
+ #
229
+ # @return [Google::Apis::CloudfunctionsV2::Operation]
230
+ #
231
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
232
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
233
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
234
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
235
+ command = make_simple_command(:get, 'v2/{+name}', options)
236
+ command.response_representation = Google::Apis::CloudfunctionsV2::Operation::Representation
237
+ command.response_class = Google::Apis::CloudfunctionsV2::Operation
238
+ command.params['name'] = name unless name.nil?
239
+ command.query['fields'] = fields unless fields.nil?
240
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
241
+ execute_or_queue_command(command, &block)
242
+ end
243
+
244
+ # Lists operations that match the specified filter in the request. If the server
245
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
246
+ # binding allows API services to override the binding to use different resource
247
+ # name schemes, such as `users/*/operations`. To override the binding, API
248
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
249
+ # service configuration. For backwards compatibility, the default name includes
250
+ # the operations collection id, however overriding users must ensure the name
251
+ # binding is the parent resource, without the operations collection id.
252
+ # @param [String] name
253
+ # Must not be set.
254
+ # @param [String] filter
255
+ # Required. A filter for matching the requested operations. The supported
256
+ # formats of *filter* are: To query for a specific function: project:*,location:*
257
+ # ,function:* To query for all of the latest operations for a project: project:*,
258
+ # latest:true
259
+ # @param [Fixnum] page_size
260
+ # The maximum number of records that should be returned. Requested page size
261
+ # cannot exceed 100. If not set, the default page size is 100. Pagination is
262
+ # only supported when querying for a specific function.
263
+ # @param [String] page_token
264
+ # Token identifying which result to start with, which is returned by a previous
265
+ # list call. Pagination is only supported when querying for a specific function.
266
+ # @param [String] fields
267
+ # Selector specifying which fields to include in a partial response.
268
+ # @param [String] quota_user
269
+ # Available to use for quota purposes for server-side applications. Can be any
270
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
271
+ # @param [Google::Apis::RequestOptions] options
272
+ # Request-specific options
273
+ #
274
+ # @yield [result, err] Result & error if block supplied
275
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::ListOperationsResponse] parsed result object
276
+ # @yieldparam err [StandardError] error object if request failed
277
+ #
278
+ # @return [Google::Apis::CloudfunctionsV2::ListOperationsResponse]
279
+ #
280
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
281
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
282
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
283
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
284
+ command = make_simple_command(:get, 'v2/{+name}/operations', options)
285
+ command.response_representation = Google::Apis::CloudfunctionsV2::ListOperationsResponse::Representation
286
+ command.response_class = Google::Apis::CloudfunctionsV2::ListOperationsResponse
287
+ command.params['name'] = name unless name.nil?
288
+ command.query['filter'] = filter unless filter.nil?
289
+ command.query['pageSize'] = page_size unless page_size.nil?
290
+ command.query['pageToken'] = page_token unless page_token.nil?
291
+ command.query['fields'] = fields unless fields.nil?
292
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
293
+ execute_or_queue_command(command, &block)
294
+ end
295
+
296
+ protected
297
+
298
+ def apply_command_defaults(command)
299
+ command.query['key'] = key unless key.nil?
300
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
301
+ end
302
+ end
303
+ end
304
+ end
305
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/cloudfunctions_v2/service.rb'
16
+ require 'google/apis/cloudfunctions_v2/classes.rb'
17
+ require 'google/apis/cloudfunctions_v2/representations.rb'
18
+ require 'google/apis/cloudfunctions_v2/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Cloud Functions API
23
+ #
24
+ # Manages lightweight user-provided functions executed in response to events.
25
+ #
26
+ # @see https://cloud.google.com/functions
27
+ module CloudfunctionsV2
28
+ # Version of the Cloud Functions API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V2'
31
+
32
+ # See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
33
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/cloudfunctions_v2"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-cloudfunctions_v2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-05-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.4'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.a
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.4'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.a
33
+ description: This is the simple REST client for Cloud Functions API V2. Simple REST
34
+ clients are Ruby client libraries that provide access to Google services via their
35
+ HTTP REST API endpoints. These libraries are generated and updated automatically
36
+ based on the discovery documents published by the service, and they handle most
37
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
38
+ use this client to access the Cloud Functions API, but note that some services may
39
+ provide a separate modern client that is easier to use.
40
+ email: googleapis-packages@google.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".yardopts"
46
+ - CHANGELOG.md
47
+ - LICENSE.md
48
+ - OVERVIEW.md
49
+ - lib/google-apis-cloudfunctions_v2.rb
50
+ - lib/google/apis/cloudfunctions_v2.rb
51
+ - lib/google/apis/cloudfunctions_v2/classes.rb
52
+ - lib/google/apis/cloudfunctions_v2/gem_version.rb
53
+ - lib/google/apis/cloudfunctions_v2/representations.rb
54
+ - lib/google/apis/cloudfunctions_v2/service.rb
55
+ homepage: https://github.com/google/google-api-ruby-client
56
+ licenses:
57
+ - Apache-2.0
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-cloudfunctions_v2/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudfunctions_v2/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-cloudfunctions_v2
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '2.5'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.3.5
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Simple REST client for Cloud Functions API V2
82
+ test_files: []