google-apis-cloudfunctions_v2 0.3.0 → 0.6.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.
@@ -92,6 +92,192 @@ module Google
92
92
  execute_or_queue_command(command, &block)
93
93
  end
94
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::CloudfunctionsV2::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::CloudfunctionsV2::Operation] parsed result object
116
+ # @yieldparam err [StandardError] error object if request failed
117
+ #
118
+ # @return [Google::Apis::CloudfunctionsV2::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, 'v2/{+parent}/functions', options)
125
+ command.request_representation = Google::Apis::CloudfunctionsV2::Function::Representation
126
+ command.request_object = function_object
127
+ command.response_representation = Google::Apis::CloudfunctionsV2::Operation::Representation
128
+ command.response_class = Google::Apis::CloudfunctionsV2::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::CloudfunctionsV2::Operation] parsed result object
151
+ # @yieldparam err [StandardError] error object if request failed
152
+ #
153
+ # @return [Google::Apis::CloudfunctionsV2::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, 'v2/{+name}', options)
160
+ command.response_representation = Google::Apis::CloudfunctionsV2::Operation::Representation
161
+ command.response_class = Google::Apis::CloudfunctionsV2::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::CloudfunctionsV2::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::CloudfunctionsV2::GenerateDownloadUrlResponse] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::CloudfunctionsV2::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, 'v2/{+name}:generateDownloadUrl', options)
195
+ command.request_representation = Google::Apis::CloudfunctionsV2::GenerateDownloadUrlRequest::Representation
196
+ command.request_object = generate_download_url_request_object
197
+ command.response_representation = Google::Apis::CloudfunctionsV2::GenerateDownloadUrlResponse::Representation
198
+ command.response_class = Google::Apis::CloudfunctionsV2::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::CloudfunctionsV2::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::CloudfunctionsV2::GenerateUploadUrlResponse] parsed result object
232
+ # @yieldparam err [StandardError] error object if request failed
233
+ #
234
+ # @return [Google::Apis::CloudfunctionsV2::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, 'v2/{+parent}/functions:generateUploadUrl', options)
241
+ command.request_representation = Google::Apis::CloudfunctionsV2::GenerateUploadUrlRequest::Representation
242
+ command.request_object = generate_upload_url_request_object
243
+ command.response_representation = Google::Apis::CloudfunctionsV2::GenerateUploadUrlResponse::Representation
244
+ command.response_class = Google::Apis::CloudfunctionsV2::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::CloudfunctionsV2::Function] parsed result object
264
+ # @yieldparam err [StandardError] error object if request failed
265
+ #
266
+ # @return [Google::Apis::CloudfunctionsV2::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, 'v2/{+name}', options)
273
+ command.response_representation = Google::Apis::CloudfunctionsV2::Function::Representation
274
+ command.response_class = Google::Apis::CloudfunctionsV2::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
+
95
281
  # Gets the access control policy for a resource. Returns an empty policy if the
96
282
  # resource exists and does not have a policy set.
97
283
  # @param [String] resource
@@ -137,6 +323,96 @@ module Google
137
323
  execute_or_queue_command(command, &block)
138
324
  end
139
325
 
326
+ # Returns a list of functions that belong to the requested project.
327
+ # @param [String] parent
328
+ # Required. The project and location from which the function should be listed,
329
+ # specified in the format `projects/*/locations/*` If you want to list functions
330
+ # in all locations, use "-" in place of a location. When listing functions in
331
+ # all locations, if one or more location(s) are unreachable, the response will
332
+ # contain functions from all reachable locations along with the names of any
333
+ # unreachable locations.
334
+ # @param [String] filter
335
+ # The filter for Functions that match the filter expression, following the
336
+ # syntax outlined in https://google.aip.dev/160.
337
+ # @param [String] order_by
338
+ # The sorting order of the resources returned. Value should be a comma separated
339
+ # list of fields. The default sorting oder is ascending. See https://google.aip.
340
+ # dev/132#ordering.
341
+ # @param [Fixnum] page_size
342
+ # Maximum number of functions to return per call.
343
+ # @param [String] page_token
344
+ # The value returned by the last `ListFunctionsResponse`; indicates that this is
345
+ # a continuation of a prior `ListFunctions` call, and that the system should
346
+ # return the next page of data.
347
+ # @param [String] fields
348
+ # Selector specifying which fields to include in a partial response.
349
+ # @param [String] quota_user
350
+ # Available to use for quota purposes for server-side applications. Can be any
351
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
352
+ # @param [Google::Apis::RequestOptions] options
353
+ # Request-specific options
354
+ #
355
+ # @yield [result, err] Result & error if block supplied
356
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::ListFunctionsResponse] parsed result object
357
+ # @yieldparam err [StandardError] error object if request failed
358
+ #
359
+ # @return [Google::Apis::CloudfunctionsV2::ListFunctionsResponse]
360
+ #
361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
364
+ 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)
365
+ command = make_simple_command(:get, 'v2/{+parent}/functions', options)
366
+ command.response_representation = Google::Apis::CloudfunctionsV2::ListFunctionsResponse::Representation
367
+ command.response_class = Google::Apis::CloudfunctionsV2::ListFunctionsResponse
368
+ command.params['parent'] = parent unless parent.nil?
369
+ command.query['filter'] = filter unless filter.nil?
370
+ command.query['orderBy'] = order_by unless order_by.nil?
371
+ command.query['pageSize'] = page_size unless page_size.nil?
372
+ command.query['pageToken'] = page_token unless page_token.nil?
373
+ command.query['fields'] = fields unless fields.nil?
374
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
375
+ execute_or_queue_command(command, &block)
376
+ end
377
+
378
+ # Updates existing function.
379
+ # @param [String] name
380
+ # A user-defined name of the function. Function names must be unique globally
381
+ # and match pattern `projects/*/locations/*/functions/*`
382
+ # @param [Google::Apis::CloudfunctionsV2::Function] function_object
383
+ # @param [String] update_mask
384
+ # The list of fields to be updated. If no field mask is provided, all provided
385
+ # fields in the request will be updated.
386
+ # @param [String] fields
387
+ # Selector specifying which fields to include in a partial response.
388
+ # @param [String] quota_user
389
+ # Available to use for quota purposes for server-side applications. Can be any
390
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
391
+ # @param [Google::Apis::RequestOptions] options
392
+ # Request-specific options
393
+ #
394
+ # @yield [result, err] Result & error if block supplied
395
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::Operation] parsed result object
396
+ # @yieldparam err [StandardError] error object if request failed
397
+ #
398
+ # @return [Google::Apis::CloudfunctionsV2::Operation]
399
+ #
400
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
401
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
402
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
403
+ def patch_project_location_function(name, function_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
404
+ command = make_simple_command(:patch, 'v2/{+name}', options)
405
+ command.request_representation = Google::Apis::CloudfunctionsV2::Function::Representation
406
+ command.request_object = function_object
407
+ command.response_representation = Google::Apis::CloudfunctionsV2::Operation::Representation
408
+ command.response_class = Google::Apis::CloudfunctionsV2::Operation
409
+ command.params['name'] = name unless name.nil?
410
+ command.query['updateMask'] = update_mask unless update_mask.nil?
411
+ command.query['fields'] = fields unless fields.nil?
412
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
413
+ execute_or_queue_command(command, &block)
414
+ end
415
+
140
416
  # Sets the access control policy on the specified resource. Replaces any
141
417
  # existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `
142
418
  # PERMISSION_DENIED` errors.
@@ -295,6 +571,41 @@ module Google
295
571
  command.query['quotaUser'] = quota_user unless quota_user.nil?
296
572
  execute_or_queue_command(command, &block)
297
573
  end
574
+
575
+ # Returns a list of runtimes that are supported for the requested project.
576
+ # @param [String] parent
577
+ # Required. The project and location from which the runtimes should be listed,
578
+ # specified in the format `projects/*/locations/*`
579
+ # @param [String] filter
580
+ # The filter for Runtimes that match the filter expression, following the syntax
581
+ # outlined in https://google.aip.dev/160.
582
+ # @param [String] fields
583
+ # Selector specifying which fields to include in a partial response.
584
+ # @param [String] quota_user
585
+ # Available to use for quota purposes for server-side applications. Can be any
586
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
587
+ # @param [Google::Apis::RequestOptions] options
588
+ # Request-specific options
589
+ #
590
+ # @yield [result, err] Result & error if block supplied
591
+ # @yieldparam result [Google::Apis::CloudfunctionsV2::ListRuntimesResponse] parsed result object
592
+ # @yieldparam err [StandardError] error object if request failed
593
+ #
594
+ # @return [Google::Apis::CloudfunctionsV2::ListRuntimesResponse]
595
+ #
596
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
597
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
598
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
599
+ def list_project_location_runtimes(parent, filter: nil, fields: nil, quota_user: nil, options: nil, &block)
600
+ command = make_simple_command(:get, 'v2/{+parent}/runtimes', options)
601
+ command.response_representation = Google::Apis::CloudfunctionsV2::ListRuntimesResponse::Representation
602
+ command.response_class = Google::Apis::CloudfunctionsV2::ListRuntimesResponse
603
+ command.params['parent'] = parent unless parent.nil?
604
+ command.query['filter'] = filter unless filter.nil?
605
+ command.query['fields'] = fields unless fields.nil?
606
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
607
+ execute_or_queue_command(command, &block)
608
+ end
298
609
 
299
610
  protected
300
611
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-cloudfunctions_v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-13 00:00:00.000000000 Z
11
+ date: 2022-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-apis-core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -58,7 +58,7 @@ licenses:
58
58
  metadata:
59
59
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
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.3.0
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-cloudfunctions_v2/v0.6.0
62
62
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-cloudfunctions_v2
63
63
  post_install_message:
64
64
  rdoc_options: []