google-apis-cloudfunctions_v2beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,616 @@
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 CloudfunctionsV2beta
23
+ # Cloud Functions API
24
+ #
25
+ # Manages lightweight user-provided functions executed in response to events.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudfunctions_v2beta'
29
+ #
30
+ # Cloudfunctions = Google::Apis::CloudfunctionsV2beta # 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_v2beta',
48
+ client_version: Google::Apis::CloudfunctionsV2beta::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::CloudfunctionsV2beta::ListLocationsResponse] parsed result object
75
+ # @yieldparam err [StandardError] error object if request failed
76
+ #
77
+ # @return [Google::Apis::CloudfunctionsV2beta::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, 'v2beta/{+name}/locations', options)
84
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::ListLocationsResponse::Representation
85
+ command.response_class = Google::Apis::CloudfunctionsV2beta::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
+ # Creates a new function. If a function with the given name already exists in
96
+ # the specified project, the long running operation will return `ALREADY_EXISTS`
97
+ # error.
98
+ # @param [String] parent
99
+ # Required. The project and location in which the function should be created,
100
+ # specified in the format `projects/*/locations/*`
101
+ # @param [Google::Apis::CloudfunctionsV2beta::Function] function_object
102
+ # @param [String] function_id
103
+ # The ID to use for the function, which will become the final component of the
104
+ # function's resource name. This value should be 4-63 characters, and valid
105
+ # characters are /a-z-/.
106
+ # @param [String] fields
107
+ # Selector specifying which fields to include in a partial response.
108
+ # @param [String] quota_user
109
+ # Available to use for quota purposes for server-side applications. Can be any
110
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
111
+ # @param [Google::Apis::RequestOptions] options
112
+ # Request-specific options
113
+ #
114
+ # @yield [result, err] Result & error if block supplied
115
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Operation] parsed result object
116
+ # @yieldparam err [StandardError] error object if request failed
117
+ #
118
+ # @return [Google::Apis::CloudfunctionsV2beta::Operation]
119
+ #
120
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
121
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
122
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
123
+ def create_project_location_function(parent, function_object = nil, function_id: nil, fields: nil, quota_user: nil, options: nil, &block)
124
+ command = make_simple_command(:post, 'v2beta/{+parent}/functions', options)
125
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::Function::Representation
126
+ command.request_object = function_object
127
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Operation::Representation
128
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Operation
129
+ command.params['parent'] = parent unless parent.nil?
130
+ command.query['functionId'] = function_id unless function_id.nil?
131
+ command.query['fields'] = fields unless fields.nil?
132
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
133
+ execute_or_queue_command(command, &block)
134
+ end
135
+
136
+ # Deletes a function with the given name from the specified project. If the
137
+ # given function is used by some trigger, the trigger will be updated to remove
138
+ # this function.
139
+ # @param [String] name
140
+ # Required. The name of the function which should be deleted.
141
+ # @param [String] fields
142
+ # Selector specifying which fields to include in a partial response.
143
+ # @param [String] quota_user
144
+ # Available to use for quota purposes for server-side applications. Can be any
145
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
146
+ # @param [Google::Apis::RequestOptions] options
147
+ # Request-specific options
148
+ #
149
+ # @yield [result, err] Result & error if block supplied
150
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Operation] parsed result object
151
+ # @yieldparam err [StandardError] error object if request failed
152
+ #
153
+ # @return [Google::Apis::CloudfunctionsV2beta::Operation]
154
+ #
155
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
156
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
157
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
158
+ def delete_project_location_function(name, fields: nil, quota_user: nil, options: nil, &block)
159
+ command = make_simple_command(:delete, 'v2beta/{+name}', options)
160
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Operation::Representation
161
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Operation
162
+ command.params['name'] = name unless name.nil?
163
+ command.query['fields'] = fields unless fields.nil?
164
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ execute_or_queue_command(command, &block)
166
+ end
167
+
168
+ # Returns a signed URL for downloading deployed function source code. The URL is
169
+ # only valid for a limited period and should be used within 30 minutes of
170
+ # generation. For more information about the signed URL usage see: https://cloud.
171
+ # google.com/storage/docs/access-control/signed-urls
172
+ # @param [String] name
173
+ # Required. The name of function for which source code Google Cloud Storage
174
+ # signed URL should be generated.
175
+ # @param [Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlRequest] generate_download_url_request_object
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlResponse] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlResponse]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def generate_function_download_url(name, generate_download_url_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:post, 'v2beta/{+name}:generateDownloadUrl', options)
195
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlRequest::Representation
196
+ command.request_object = generate_download_url_request_object
197
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlResponse::Representation
198
+ command.response_class = Google::Apis::CloudfunctionsV2beta::GenerateDownloadUrlResponse
199
+ command.params['name'] = name unless name.nil?
200
+ command.query['fields'] = fields unless fields.nil?
201
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
202
+ execute_or_queue_command(command, &block)
203
+ end
204
+
205
+ # Returns a signed URL for uploading a function source code. For more
206
+ # information about the signed URL usage see: https://cloud.google.com/storage/
207
+ # docs/access-control/signed-urls. Once the function source code upload is
208
+ # complete, the used signed URL should be provided in CreateFunction or
209
+ # UpdateFunction request as a reference to the function source code. When
210
+ # uploading source code to the generated signed URL, please follow these
211
+ # restrictions: * Source file type should be a zip file. * No credentials should
212
+ # be attached - the signed URLs provide access to the target bucket using
213
+ # internal service identity; if credentials were attached, the identity from the
214
+ # credentials would be used, but that identity does not have permissions to
215
+ # upload files to the URL. When making a HTTP PUT request, these two headers
216
+ # need to be specified: * `content-type: application/zip` And this header SHOULD
217
+ # NOT be specified: * `Authorization: Bearer YOUR_TOKEN`
218
+ # @param [String] parent
219
+ # Required. The project and location in which the Google Cloud Storage signed
220
+ # URL should be generated, specified in the format `projects/*/locations/*`.
221
+ # @param [Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlRequest] generate_upload_url_request_object
222
+ # @param [String] fields
223
+ # Selector specifying which fields to include in a partial response.
224
+ # @param [String] quota_user
225
+ # Available to use for quota purposes for server-side applications. Can be any
226
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
227
+ # @param [Google::Apis::RequestOptions] options
228
+ # Request-specific options
229
+ #
230
+ # @yield [result, err] Result & error if block supplied
231
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlResponse] parsed result object
232
+ # @yieldparam err [StandardError] error object if request failed
233
+ #
234
+ # @return [Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlResponse]
235
+ #
236
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
237
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
238
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
239
+ def generate_function_upload_url(parent, generate_upload_url_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
240
+ command = make_simple_command(:post, 'v2beta/{+parent}/functions:generateUploadUrl', options)
241
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlRequest::Representation
242
+ command.request_object = generate_upload_url_request_object
243
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlResponse::Representation
244
+ command.response_class = Google::Apis::CloudfunctionsV2beta::GenerateUploadUrlResponse
245
+ command.params['parent'] = parent unless parent.nil?
246
+ command.query['fields'] = fields unless fields.nil?
247
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
248
+ execute_or_queue_command(command, &block)
249
+ end
250
+
251
+ # Returns a function with the given name from the requested project.
252
+ # @param [String] name
253
+ # Required. The name of the function which details should be obtained.
254
+ # @param [String] fields
255
+ # Selector specifying which fields to include in a partial response.
256
+ # @param [String] quota_user
257
+ # Available to use for quota purposes for server-side applications. Can be any
258
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
259
+ # @param [Google::Apis::RequestOptions] options
260
+ # Request-specific options
261
+ #
262
+ # @yield [result, err] Result & error if block supplied
263
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Function] parsed result object
264
+ # @yieldparam err [StandardError] error object if request failed
265
+ #
266
+ # @return [Google::Apis::CloudfunctionsV2beta::Function]
267
+ #
268
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
269
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
270
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
271
+ def get_project_location_function(name, fields: nil, quota_user: nil, options: nil, &block)
272
+ command = make_simple_command(:get, 'v2beta/{+name}', options)
273
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Function::Representation
274
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Function
275
+ command.params['name'] = name unless name.nil?
276
+ command.query['fields'] = fields unless fields.nil?
277
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
278
+ execute_or_queue_command(command, &block)
279
+ end
280
+
281
+ # Gets the access control policy for a resource. Returns an empty policy if the
282
+ # resource exists and does not have a policy set.
283
+ # @param [String] resource
284
+ # REQUIRED: The resource for which the policy is being requested. See the
285
+ # operation documentation for the appropriate value for this field.
286
+ # @param [Fixnum] options_requested_policy_version
287
+ # Optional. The maximum policy version that will be used to format the policy.
288
+ # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
289
+ # rejected. Requests for policies with any conditional role bindings must
290
+ # specify version 3. Policies with no conditional role bindings may specify any
291
+ # valid value or leave the field unset. The policy in the response might use the
292
+ # policy version that you specified, or it might use a lower policy version. For
293
+ # example, if you specify version 3, but the policy has no conditional role
294
+ # bindings, the response uses version 1. To learn which resources support
295
+ # conditions in their IAM policies, see the [IAM documentation](https://cloud.
296
+ # google.com/iam/help/conditions/resource-policies).
297
+ # @param [String] fields
298
+ # Selector specifying which fields to include in a partial response.
299
+ # @param [String] quota_user
300
+ # Available to use for quota purposes for server-side applications. Can be any
301
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
302
+ # @param [Google::Apis::RequestOptions] options
303
+ # Request-specific options
304
+ #
305
+ # @yield [result, err] Result & error if block supplied
306
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Policy] parsed result object
307
+ # @yieldparam err [StandardError] error object if request failed
308
+ #
309
+ # @return [Google::Apis::CloudfunctionsV2beta::Policy]
310
+ #
311
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
312
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
313
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
314
+ def get_project_location_function_iam_policy(resource, options_requested_policy_version: nil, fields: nil, quota_user: nil, options: nil, &block)
315
+ command = make_simple_command(:get, 'v2beta/{+resource}:getIamPolicy', options)
316
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Policy::Representation
317
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Policy
318
+ command.params['resource'] = resource unless resource.nil?
319
+ command.query['options.requestedPolicyVersion'] = options_requested_policy_version unless options_requested_policy_version.nil?
320
+ command.query['fields'] = fields unless fields.nil?
321
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
322
+ execute_or_queue_command(command, &block)
323
+ end
324
+
325
+ # Returns a list of functions that belong to the requested project.
326
+ # @param [String] parent
327
+ # Required. The project and location from which the function should be listed,
328
+ # specified in the format `projects/*/locations/*` If you want to list functions
329
+ # in all locations, use "-" in place of a location. When listing functions in
330
+ # all locations, if one or more location(s) are unreachable, the response will
331
+ # contain functions from all reachable locations along with the names of any
332
+ # unreachable locations.
333
+ # @param [String] filter
334
+ # The filter for Functions that match the filter expression, following the
335
+ # syntax outlined in https://google.aip.dev/160.
336
+ # @param [String] order_by
337
+ # The sorting order of the resources returned. Value should be a comma separated
338
+ # list of fields. The default sorting oder is ascending. See https://google.aip.
339
+ # dev/132#ordering.
340
+ # @param [Fixnum] page_size
341
+ # Maximum number of functions to return per call.
342
+ # @param [String] page_token
343
+ # The value returned by the last `ListFunctionsResponse`; indicates that this is
344
+ # a continuation of a prior `ListFunctions` call, and that the system should
345
+ # return the next page of data.
346
+ # @param [String] fields
347
+ # Selector specifying which fields to include in a partial response.
348
+ # @param [String] quota_user
349
+ # Available to use for quota purposes for server-side applications. Can be any
350
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
351
+ # @param [Google::Apis::RequestOptions] options
352
+ # Request-specific options
353
+ #
354
+ # @yield [result, err] Result & error if block supplied
355
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::ListFunctionsResponse] parsed result object
356
+ # @yieldparam err [StandardError] error object if request failed
357
+ #
358
+ # @return [Google::Apis::CloudfunctionsV2beta::ListFunctionsResponse]
359
+ #
360
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
361
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
362
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
363
+ def list_project_location_functions(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
364
+ command = make_simple_command(:get, 'v2beta/{+parent}/functions', options)
365
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::ListFunctionsResponse::Representation
366
+ command.response_class = Google::Apis::CloudfunctionsV2beta::ListFunctionsResponse
367
+ command.params['parent'] = parent unless parent.nil?
368
+ command.query['filter'] = filter unless filter.nil?
369
+ command.query['orderBy'] = order_by unless order_by.nil?
370
+ command.query['pageSize'] = page_size unless page_size.nil?
371
+ command.query['pageToken'] = page_token unless page_token.nil?
372
+ command.query['fields'] = fields unless fields.nil?
373
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
374
+ execute_or_queue_command(command, &block)
375
+ end
376
+
377
+ # Updates existing function.
378
+ # @param [String] name
379
+ # A user-defined name of the function. Function names must be unique globally
380
+ # and match pattern `projects/*/locations/*/functions/*`
381
+ # @param [Google::Apis::CloudfunctionsV2beta::Function] function_object
382
+ # @param [String] update_mask
383
+ # The list of fields to be updated. If no field mask is provided, all provided
384
+ # fields in the request will be updated.
385
+ # @param [String] fields
386
+ # Selector specifying which fields to include in a partial response.
387
+ # @param [String] quota_user
388
+ # Available to use for quota purposes for server-side applications. Can be any
389
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
390
+ # @param [Google::Apis::RequestOptions] options
391
+ # Request-specific options
392
+ #
393
+ # @yield [result, err] Result & error if block supplied
394
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Operation] parsed result object
395
+ # @yieldparam err [StandardError] error object if request failed
396
+ #
397
+ # @return [Google::Apis::CloudfunctionsV2beta::Operation]
398
+ #
399
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
400
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
401
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
402
+ def patch_project_location_function(name, function_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
403
+ command = make_simple_command(:patch, 'v2beta/{+name}', options)
404
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::Function::Representation
405
+ command.request_object = function_object
406
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Operation::Representation
407
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Operation
408
+ command.params['name'] = name unless name.nil?
409
+ command.query['updateMask'] = update_mask unless update_mask.nil?
410
+ command.query['fields'] = fields unless fields.nil?
411
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
412
+ execute_or_queue_command(command, &block)
413
+ end
414
+
415
+ # Sets the access control policy on the specified resource. Replaces any
416
+ # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
417
+ # PERMISSION_DENIED` errors.
418
+ # @param [String] resource
419
+ # REQUIRED: The resource for which the policy is being specified. See the
420
+ # operation documentation for the appropriate value for this field.
421
+ # @param [Google::Apis::CloudfunctionsV2beta::SetIamPolicyRequest] set_iam_policy_request_object
422
+ # @param [String] fields
423
+ # Selector specifying which fields to include in a partial response.
424
+ # @param [String] quota_user
425
+ # Available to use for quota purposes for server-side applications. Can be any
426
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
427
+ # @param [Google::Apis::RequestOptions] options
428
+ # Request-specific options
429
+ #
430
+ # @yield [result, err] Result & error if block supplied
431
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Policy] parsed result object
432
+ # @yieldparam err [StandardError] error object if request failed
433
+ #
434
+ # @return [Google::Apis::CloudfunctionsV2beta::Policy]
435
+ #
436
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
437
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
438
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
439
+ def set_function_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
440
+ command = make_simple_command(:post, 'v2beta/{+resource}:setIamPolicy', options)
441
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::SetIamPolicyRequest::Representation
442
+ command.request_object = set_iam_policy_request_object
443
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Policy::Representation
444
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Policy
445
+ command.params['resource'] = resource unless resource.nil?
446
+ command.query['fields'] = fields unless fields.nil?
447
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
448
+ execute_or_queue_command(command, &block)
449
+ end
450
+
451
+ # Returns permissions that a caller has on the specified resource. If the
452
+ # resource does not exist, this will return an empty set of permissions, not a `
453
+ # NOT_FOUND` error. Note: This operation is designed to be used for building
454
+ # permission-aware UIs and command-line tools, not for authorization checking.
455
+ # This operation may "fail open" without warning.
456
+ # @param [String] resource
457
+ # REQUIRED: The resource for which the policy detail is being requested. See the
458
+ # operation documentation for the appropriate value for this field.
459
+ # @param [Google::Apis::CloudfunctionsV2beta::TestIamPermissionsRequest] test_iam_permissions_request_object
460
+ # @param [String] fields
461
+ # Selector specifying which fields to include in a partial response.
462
+ # @param [String] quota_user
463
+ # Available to use for quota purposes for server-side applications. Can be any
464
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
465
+ # @param [Google::Apis::RequestOptions] options
466
+ # Request-specific options
467
+ #
468
+ # @yield [result, err] Result & error if block supplied
469
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::TestIamPermissionsResponse] parsed result object
470
+ # @yieldparam err [StandardError] error object if request failed
471
+ #
472
+ # @return [Google::Apis::CloudfunctionsV2beta::TestIamPermissionsResponse]
473
+ #
474
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
475
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
476
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
477
+ def test_function_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
478
+ command = make_simple_command(:post, 'v2beta/{+resource}:testIamPermissions', options)
479
+ command.request_representation = Google::Apis::CloudfunctionsV2beta::TestIamPermissionsRequest::Representation
480
+ command.request_object = test_iam_permissions_request_object
481
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::TestIamPermissionsResponse::Representation
482
+ command.response_class = Google::Apis::CloudfunctionsV2beta::TestIamPermissionsResponse
483
+ command.params['resource'] = resource unless resource.nil?
484
+ command.query['fields'] = fields unless fields.nil?
485
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
486
+ execute_or_queue_command(command, &block)
487
+ end
488
+
489
+ # Gets the latest state of a long-running operation. Clients can use this method
490
+ # to poll the operation result at intervals as recommended by the API service.
491
+ # @param [String] name
492
+ # The name of the operation resource.
493
+ # @param [String] fields
494
+ # Selector specifying which fields to include in a partial response.
495
+ # @param [String] quota_user
496
+ # Available to use for quota purposes for server-side applications. Can be any
497
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
498
+ # @param [Google::Apis::RequestOptions] options
499
+ # Request-specific options
500
+ #
501
+ # @yield [result, err] Result & error if block supplied
502
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::Operation] parsed result object
503
+ # @yieldparam err [StandardError] error object if request failed
504
+ #
505
+ # @return [Google::Apis::CloudfunctionsV2beta::Operation]
506
+ #
507
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
508
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
509
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
510
+ def get_project_location_operation(name, fields: nil, quota_user: nil, options: nil, &block)
511
+ command = make_simple_command(:get, 'v2beta/{+name}', options)
512
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::Operation::Representation
513
+ command.response_class = Google::Apis::CloudfunctionsV2beta::Operation
514
+ command.params['name'] = name unless name.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ # Lists operations that match the specified filter in the request. If the server
521
+ # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
522
+ # binding allows API services to override the binding to use different resource
523
+ # name schemes, such as `users/*/operations`. To override the binding, API
524
+ # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
525
+ # service configuration. For backwards compatibility, the default name includes
526
+ # the operations collection id, however overriding users must ensure the name
527
+ # binding is the parent resource, without the operations collection id.
528
+ # @param [String] name
529
+ # Must not be set.
530
+ # @param [String] filter
531
+ # Required. A filter for matching the requested operations. The supported
532
+ # formats of *filter* are: To query for a specific function: project:*,location:*
533
+ # ,function:* To query for all of the latest operations for a project: project:*,
534
+ # latest:true
535
+ # @param [Fixnum] page_size
536
+ # The maximum number of records that should be returned. Requested page size
537
+ # cannot exceed 100. If not set, the default page size is 100. Pagination is
538
+ # only supported when querying for a specific function.
539
+ # @param [String] page_token
540
+ # Token identifying which result to start with, which is returned by a previous
541
+ # list call. Pagination is only supported when querying for a specific function.
542
+ # @param [String] fields
543
+ # Selector specifying which fields to include in a partial response.
544
+ # @param [String] quota_user
545
+ # Available to use for quota purposes for server-side applications. Can be any
546
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
547
+ # @param [Google::Apis::RequestOptions] options
548
+ # Request-specific options
549
+ #
550
+ # @yield [result, err] Result & error if block supplied
551
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::ListOperationsResponse] parsed result object
552
+ # @yieldparam err [StandardError] error object if request failed
553
+ #
554
+ # @return [Google::Apis::CloudfunctionsV2beta::ListOperationsResponse]
555
+ #
556
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
557
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
558
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
559
+ def list_project_location_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
560
+ command = make_simple_command(:get, 'v2beta/{+name}/operations', options)
561
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::ListOperationsResponse::Representation
562
+ command.response_class = Google::Apis::CloudfunctionsV2beta::ListOperationsResponse
563
+ command.params['name'] = name unless name.nil?
564
+ command.query['filter'] = filter unless filter.nil?
565
+ command.query['pageSize'] = page_size unless page_size.nil?
566
+ command.query['pageToken'] = page_token unless page_token.nil?
567
+ command.query['fields'] = fields unless fields.nil?
568
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
569
+ execute_or_queue_command(command, &block)
570
+ end
571
+
572
+ # Returns a list of runtimes that are supported for the requested project.
573
+ # @param [String] parent
574
+ # Required. The project and location from which the runtimes should be listed,
575
+ # specified in the format `projects/*/locations/*`
576
+ # @param [String] filter
577
+ # The filter for Runtimes that match the filter expression, following the syntax
578
+ # outlined in https://google.aip.dev/160.
579
+ # @param [String] fields
580
+ # Selector specifying which fields to include in a partial response.
581
+ # @param [String] quota_user
582
+ # Available to use for quota purposes for server-side applications. Can be any
583
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
584
+ # @param [Google::Apis::RequestOptions] options
585
+ # Request-specific options
586
+ #
587
+ # @yield [result, err] Result & error if block supplied
588
+ # @yieldparam result [Google::Apis::CloudfunctionsV2beta::ListRuntimesResponse] parsed result object
589
+ # @yieldparam err [StandardError] error object if request failed
590
+ #
591
+ # @return [Google::Apis::CloudfunctionsV2beta::ListRuntimesResponse]
592
+ #
593
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
594
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
595
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
596
+ def list_project_location_runtimes(parent, filter: nil, fields: nil, quota_user: nil, options: nil, &block)
597
+ command = make_simple_command(:get, 'v2beta/{+parent}/runtimes', options)
598
+ command.response_representation = Google::Apis::CloudfunctionsV2beta::ListRuntimesResponse::Representation
599
+ command.response_class = Google::Apis::CloudfunctionsV2beta::ListRuntimesResponse
600
+ command.params['parent'] = parent unless parent.nil?
601
+ command.query['filter'] = filter unless filter.nil?
602
+ command.query['fields'] = fields unless fields.nil?
603
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
604
+ execute_or_queue_command(command, &block)
605
+ end
606
+
607
+ protected
608
+
609
+ def apply_command_defaults(command)
610
+ command.query['key'] = key unless key.nil?
611
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
612
+ end
613
+ end
614
+ end
615
+ end
616
+ 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_v2beta/service.rb'
16
+ require 'google/apis/cloudfunctions_v2beta/classes.rb'
17
+ require 'google/apis/cloudfunctions_v2beta/representations.rb'
18
+ require 'google/apis/cloudfunctions_v2beta/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 CloudfunctionsV2beta
28
+ # Version of the Cloud Functions API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'V2beta'
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