google-cloud-functions-v1 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2cf74213fbdd2baf3be4bd28c3f06e11e4de253a168aa82e66fdcac81ff69dc
4
- data.tar.gz: 3337f91356501519dec70e0be7b39467b3127a88334a1d0122a3ee761f961c4a
3
+ metadata.gz: 4d6e2dd300e2a69aacd17e83e836edabd70ac59e121760509941cc6eb96bd91e
4
+ data.tar.gz: b0af785d3a9c0a03b2011a63cf6fe7690d1bd859a49a80ab2b67329b97380c32
5
5
  SHA512:
6
- metadata.gz: 3aec811f3bef44a7410fe1c6ca1401d30af6a498b3f977ccb7841627634e1ffe10b47c706c9966daa39dfbe8248a309510c76e3d9cb630b311aac131966f06c1
7
- data.tar.gz: 1fc0ce81ced55bcbc461fa0760dc0c716076766ce88133a6ca4dcf199f3aea7e6bc9a813d96347a0ffabbc96622c13cc89f67e92582c058b627f57de1311ad73
6
+ metadata.gz: dd5f9fdcb00aff9dd799ecd0891b5d412aa952b5319bc7092636c0d2fb46622f2cad93689d521243eaf23a516e9b2add9fd97869335e66378fb618c90171be91
7
+ data.tar.gz: d96488272340992dd1bc2d3471fb5bf788f89278817405f656a3666d28ef83c971a899d533d73514a2ba8c68f4ca0a38011655a09db228ba1cbde1c5c1527234
@@ -221,6 +221,27 @@ module Google
221
221
  #
222
222
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
223
223
  #
224
+ # @example Basic example
225
+ # require "google/cloud/functions/v1"
226
+ #
227
+ # # Create a client object. The client can be reused for multiple calls.
228
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
229
+ #
230
+ # # Create a request. To set request fields, pass in keyword arguments.
231
+ # request = Google::Cloud::Functions::V1::ListFunctionsRequest.new
232
+ #
233
+ # # Call the list_functions method.
234
+ # result = client.list_functions request
235
+ #
236
+ # # The returned object is of type Gapic::PagedEnumerable. You can
237
+ # # iterate over all elements by calling #each, and the enumerable
238
+ # # will lazily make API calls to fetch subsequent pages. Other
239
+ # # methods are also available for managing paging directly.
240
+ # result.each do |response|
241
+ # # Each element is of type ::Google::Cloud::Functions::V1::CloudFunction.
242
+ # p response
243
+ # end
244
+ #
224
245
  def list_functions request, options = nil
225
246
  raise ::ArgumentError, "request must be provided" if request.nil?
226
247
 
@@ -238,9 +259,11 @@ module Google
238
259
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
239
260
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
240
261
 
241
- header_params = {
242
- "parent" => request.parent
243
- }
262
+ header_params = {}
263
+ if request.parent
264
+ header_params["parent"] = request.parent
265
+ end
266
+
244
267
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
245
268
  metadata[:"x-goog-request-params"] ||= request_params_header
246
269
 
@@ -290,6 +313,21 @@ module Google
290
313
  #
291
314
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
292
315
  #
316
+ # @example Basic example
317
+ # require "google/cloud/functions/v1"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Cloud::Functions::V1::GetFunctionRequest.new
324
+ #
325
+ # # Call the get_function method.
326
+ # result = client.get_function request
327
+ #
328
+ # # The returned object is of type Google::Cloud::Functions::V1::CloudFunction.
329
+ # p result
330
+ #
293
331
  def get_function request, options = nil
294
332
  raise ::ArgumentError, "request must be provided" if request.nil?
295
333
 
@@ -307,9 +345,11 @@ module Google
307
345
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
308
346
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
347
 
310
- header_params = {
311
- "name" => request.name
312
- }
348
+ header_params = {}
349
+ if request.name
350
+ header_params["name"] = request.name
351
+ end
352
+
313
353
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
314
354
  metadata[:"x-goog-request-params"] ||= request_params_header
315
355
 
@@ -363,6 +403,28 @@ module Google
363
403
  #
364
404
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
365
405
  #
406
+ # @example Basic example
407
+ # require "google/cloud/functions/v1"
408
+ #
409
+ # # Create a client object. The client can be reused for multiple calls.
410
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
411
+ #
412
+ # # Create a request. To set request fields, pass in keyword arguments.
413
+ # request = Google::Cloud::Functions::V1::CreateFunctionRequest.new
414
+ #
415
+ # # Call the create_function method.
416
+ # result = client.create_function request
417
+ #
418
+ # # The returned object is of type Gapic::Operation. You can use this
419
+ # # object to check the status of an operation, cancel it, or wait
420
+ # # for results. Here is how to block until completion:
421
+ # result.wait_until_done! timeout: 60
422
+ # if result.response?
423
+ # p result.response
424
+ # else
425
+ # puts "Error!"
426
+ # end
427
+ #
366
428
  def create_function request, options = nil
367
429
  raise ::ArgumentError, "request must be provided" if request.nil?
368
430
 
@@ -380,9 +442,11 @@ module Google
380
442
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
381
443
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
444
 
383
- header_params = {
384
- "location" => request.location
385
- }
445
+ header_params = {}
446
+ if request.location
447
+ header_params["location"] = request.location
448
+ end
449
+
386
450
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
387
451
  metadata[:"x-goog-request-params"] ||= request_params_header
388
452
 
@@ -434,6 +498,28 @@ module Google
434
498
  #
435
499
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
436
500
  #
501
+ # @example Basic example
502
+ # require "google/cloud/functions/v1"
503
+ #
504
+ # # Create a client object. The client can be reused for multiple calls.
505
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
506
+ #
507
+ # # Create a request. To set request fields, pass in keyword arguments.
508
+ # request = Google::Cloud::Functions::V1::UpdateFunctionRequest.new
509
+ #
510
+ # # Call the update_function method.
511
+ # result = client.update_function request
512
+ #
513
+ # # The returned object is of type Gapic::Operation. You can use this
514
+ # # object to check the status of an operation, cancel it, or wait
515
+ # # for results. Here is how to block until completion:
516
+ # result.wait_until_done! timeout: 60
517
+ # if result.response?
518
+ # p result.response
519
+ # else
520
+ # puts "Error!"
521
+ # end
522
+ #
437
523
  def update_function request, options = nil
438
524
  raise ::ArgumentError, "request must be provided" if request.nil?
439
525
 
@@ -451,9 +537,11 @@ module Google
451
537
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
452
538
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
453
539
 
454
- header_params = {
455
- "function.name" => request.function.name
456
- }
540
+ header_params = {}
541
+ if request.function&.name
542
+ header_params["function.name"] = request.function.name
543
+ end
544
+
457
545
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
458
546
  metadata[:"x-goog-request-params"] ||= request_params_header
459
547
 
@@ -505,6 +593,28 @@ module Google
505
593
  #
506
594
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
507
595
  #
596
+ # @example Basic example
597
+ # require "google/cloud/functions/v1"
598
+ #
599
+ # # Create a client object. The client can be reused for multiple calls.
600
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
601
+ #
602
+ # # Create a request. To set request fields, pass in keyword arguments.
603
+ # request = Google::Cloud::Functions::V1::DeleteFunctionRequest.new
604
+ #
605
+ # # Call the delete_function method.
606
+ # result = client.delete_function request
607
+ #
608
+ # # The returned object is of type Gapic::Operation. You can use this
609
+ # # object to check the status of an operation, cancel it, or wait
610
+ # # for results. Here is how to block until completion:
611
+ # result.wait_until_done! timeout: 60
612
+ # if result.response?
613
+ # p result.response
614
+ # else
615
+ # puts "Error!"
616
+ # end
617
+ #
508
618
  def delete_function request, options = nil
509
619
  raise ::ArgumentError, "request must be provided" if request.nil?
510
620
 
@@ -522,9 +632,11 @@ module Google
522
632
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
523
633
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
524
634
 
525
- header_params = {
526
- "name" => request.name
527
- }
635
+ header_params = {}
636
+ if request.name
637
+ header_params["name"] = request.name
638
+ end
639
+
528
640
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
529
641
  metadata[:"x-goog-request-params"] ||= request_params_header
530
642
 
@@ -579,6 +691,21 @@ module Google
579
691
  #
580
692
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
581
693
  #
694
+ # @example Basic example
695
+ # require "google/cloud/functions/v1"
696
+ #
697
+ # # Create a client object. The client can be reused for multiple calls.
698
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
699
+ #
700
+ # # Create a request. To set request fields, pass in keyword arguments.
701
+ # request = Google::Cloud::Functions::V1::CallFunctionRequest.new
702
+ #
703
+ # # Call the call_function method.
704
+ # result = client.call_function request
705
+ #
706
+ # # The returned object is of type Google::Cloud::Functions::V1::CallFunctionResponse.
707
+ # p result
708
+ #
582
709
  def call_function request, options = nil
583
710
  raise ::ArgumentError, "request must be provided" if request.nil?
584
711
 
@@ -596,9 +723,11 @@ module Google
596
723
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
597
724
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
598
725
 
599
- header_params = {
600
- "name" => request.name
601
- }
726
+ header_params = {}
727
+ if request.name
728
+ header_params["name"] = request.name
729
+ end
730
+
602
731
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
603
732
  metadata[:"x-goog-request-params"] ||= request_params_header
604
733
 
@@ -672,6 +801,21 @@ module Google
672
801
  #
673
802
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
674
803
  #
804
+ # @example Basic example
805
+ # require "google/cloud/functions/v1"
806
+ #
807
+ # # Create a client object. The client can be reused for multiple calls.
808
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
809
+ #
810
+ # # Create a request. To set request fields, pass in keyword arguments.
811
+ # request = Google::Cloud::Functions::V1::GenerateUploadUrlRequest.new
812
+ #
813
+ # # Call the generate_upload_url method.
814
+ # result = client.generate_upload_url request
815
+ #
816
+ # # The returned object is of type Google::Cloud::Functions::V1::GenerateUploadUrlResponse.
817
+ # p result
818
+ #
675
819
  def generate_upload_url request, options = nil
676
820
  raise ::ArgumentError, "request must be provided" if request.nil?
677
821
 
@@ -689,9 +833,11 @@ module Google
689
833
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
690
834
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
835
 
692
- header_params = {
693
- "parent" => request.parent
694
- }
836
+ header_params = {}
837
+ if request.parent
838
+ header_params["parent"] = request.parent
839
+ end
840
+
695
841
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
696
842
  metadata[:"x-goog-request-params"] ||= request_params_header
697
843
 
@@ -748,6 +894,21 @@ module Google
748
894
  #
749
895
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
750
896
  #
897
+ # @example Basic example
898
+ # require "google/cloud/functions/v1"
899
+ #
900
+ # # Create a client object. The client can be reused for multiple calls.
901
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
902
+ #
903
+ # # Create a request. To set request fields, pass in keyword arguments.
904
+ # request = Google::Cloud::Functions::V1::GenerateDownloadUrlRequest.new
905
+ #
906
+ # # Call the generate_download_url method.
907
+ # result = client.generate_download_url request
908
+ #
909
+ # # The returned object is of type Google::Cloud::Functions::V1::GenerateDownloadUrlResponse.
910
+ # p result
911
+ #
751
912
  def generate_download_url request, options = nil
752
913
  raise ::ArgumentError, "request must be provided" if request.nil?
753
914
 
@@ -765,9 +926,11 @@ module Google
765
926
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
766
927
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
767
928
 
768
- header_params = {
769
- "name" => request.name
770
- }
929
+ header_params = {}
930
+ if request.name
931
+ header_params["name"] = request.name
932
+ end
933
+
771
934
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
772
935
  metadata[:"x-goog-request-params"] ||= request_params_header
773
936
 
@@ -823,6 +986,21 @@ module Google
823
986
  #
824
987
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
825
988
  #
989
+ # @example Basic example
990
+ # require "google/cloud/functions/v1"
991
+ #
992
+ # # Create a client object. The client can be reused for multiple calls.
993
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
994
+ #
995
+ # # Create a request. To set request fields, pass in keyword arguments.
996
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
997
+ #
998
+ # # Call the set_iam_policy method.
999
+ # result = client.set_iam_policy request
1000
+ #
1001
+ # # The returned object is of type Google::Iam::V1::Policy.
1002
+ # p result
1003
+ #
826
1004
  def set_iam_policy request, options = nil
827
1005
  raise ::ArgumentError, "request must be provided" if request.nil?
828
1006
 
@@ -840,9 +1018,11 @@ module Google
840
1018
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
841
1019
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
842
1020
 
843
- header_params = {
844
- "resource" => request.resource
845
- }
1021
+ header_params = {}
1022
+ if request.resource
1023
+ header_params["resource"] = request.resource
1024
+ end
1025
+
846
1026
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
847
1027
  metadata[:"x-goog-request-params"] ||= request_params_header
848
1028
 
@@ -897,6 +1077,21 @@ module Google
897
1077
  #
898
1078
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
899
1079
  #
1080
+ # @example Basic example
1081
+ # require "google/cloud/functions/v1"
1082
+ #
1083
+ # # Create a client object. The client can be reused for multiple calls.
1084
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
1085
+ #
1086
+ # # Create a request. To set request fields, pass in keyword arguments.
1087
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1088
+ #
1089
+ # # Call the get_iam_policy method.
1090
+ # result = client.get_iam_policy request
1091
+ #
1092
+ # # The returned object is of type Google::Iam::V1::Policy.
1093
+ # p result
1094
+ #
900
1095
  def get_iam_policy request, options = nil
901
1096
  raise ::ArgumentError, "request must be provided" if request.nil?
902
1097
 
@@ -914,9 +1109,11 @@ module Google
914
1109
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
915
1110
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
916
1111
 
917
- header_params = {
918
- "resource" => request.resource
919
- }
1112
+ header_params = {}
1113
+ if request.resource
1114
+ header_params["resource"] = request.resource
1115
+ end
1116
+
920
1117
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
921
1118
  metadata[:"x-goog-request-params"] ||= request_params_header
922
1119
 
@@ -974,6 +1171,21 @@ module Google
974
1171
  #
975
1172
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
976
1173
  #
1174
+ # @example Basic example
1175
+ # require "google/cloud/functions/v1"
1176
+ #
1177
+ # # Create a client object. The client can be reused for multiple calls.
1178
+ # client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new
1179
+ #
1180
+ # # Create a request. To set request fields, pass in keyword arguments.
1181
+ # request = Google::Iam::V1::TestIamPermissionsRequest.new
1182
+ #
1183
+ # # Call the test_iam_permissions method.
1184
+ # result = client.test_iam_permissions request
1185
+ #
1186
+ # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
1187
+ # p result
1188
+ #
977
1189
  def test_iam_permissions request, options = nil
978
1190
  raise ::ArgumentError, "request must be provided" if request.nil?
979
1191
 
@@ -991,9 +1203,11 @@ module Google
991
1203
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
992
1204
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
993
1205
 
994
- header_params = {
995
- "resource" => request.resource
996
- }
1206
+ header_params = {}
1207
+ if request.resource
1208
+ header_params["resource"] = request.resource
1209
+ end
1210
+
997
1211
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
998
1212
  metadata[:"x-goog-request-params"] ||= request_params_header
999
1213
 
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::Functions::V1::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552
 
@@ -43,6 +43,27 @@ module Google
43
43
  "projects/#{project}/locations/#{location}/functions/#{function}"
44
44
  end
45
45
 
46
+ ##
47
+ # Create a fully-qualified CryptoKey resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param key_ring [String]
56
+ # @param crypto_key [String]
57
+ #
58
+ # @return [::String]
59
+ def crypto_key_path project:, location:, key_ring:, crypto_key:
60
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
61
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
62
+ raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
63
+
64
+ "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
65
+ end
66
+
46
67
  ##
47
68
  # Create a fully-qualified Location resource string.
48
69
  #
@@ -60,6 +81,25 @@ module Google
60
81
  "projects/#{project}/locations/#{location}"
61
82
  end
62
83
 
84
+ ##
85
+ # Create a fully-qualified Repository resource string.
86
+ #
87
+ # The resource will be in the following format:
88
+ #
89
+ # `projects/{project}/locations/{location}/repositories/{repository}`
90
+ #
91
+ # @param project [String]
92
+ # @param location [String]
93
+ # @param repository [String]
94
+ #
95
+ # @return [::String]
96
+ def repository_path project:, location:, repository:
97
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
98
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
99
+
100
+ "projects/#{project}/locations/#{location}/repositories/#{repository}"
101
+ end
102
+
63
103
  extend self
64
104
  end
65
105
  end
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/functions/v1/functions.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -13,6 +11,8 @@ require 'google/longrunning/operations_pb'
13
11
  require 'google/protobuf/duration_pb'
14
12
  require 'google/protobuf/field_mask_pb'
15
13
  require 'google/protobuf/timestamp_pb'
14
+ require 'google/protobuf'
15
+
16
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  add_file("google/cloud/functions/v1/functions.proto", :syntax => :proto3) do
18
18
  add_message "google.cloud.functions.v1.CloudFunction" do
@@ -28,12 +28,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
28
  optional :version_id, :int64, 14
29
29
  map :labels, :string, :string, 15
30
30
  map :environment_variables, :string, :string, 17
31
+ map :build_environment_variables, :string, :string, 28
31
32
  optional :network, :string, 18
32
33
  optional :max_instances, :int32, 20
34
+ optional :min_instances, :int32, 32
33
35
  optional :vpc_connector, :string, 22
34
36
  optional :vpc_connector_egress_settings, :enum, 23, "google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings"
35
37
  optional :ingress_settings, :enum, 24, "google.cloud.functions.v1.CloudFunction.IngressSettings"
38
+ optional :kms_key_name, :string, 25
39
+ optional :build_worker_pool, :string, 26
36
40
  optional :build_id, :string, 27
41
+ optional :build_name, :string, 33
42
+ repeated :secret_environment_variables, :message, 29, "google.cloud.functions.v1.SecretEnvVar"
43
+ repeated :secret_volumes, :message, 30, "google.cloud.functions.v1.SecretVolume"
44
+ optional :source_token, :string, 31
45
+ optional :docker_repository, :string, 34
37
46
  oneof :source_code do
38
47
  optional :source_archive_url, :string, 3
39
48
  optional :source_repository, :message, 4, "google.cloud.functions.v1.SourceRepository"
@@ -81,6 +90,22 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
81
90
  end
82
91
  add_message "google.cloud.functions.v1.FailurePolicy.Retry" do
83
92
  end
93
+ add_message "google.cloud.functions.v1.SecretEnvVar" do
94
+ optional :key, :string, 1
95
+ optional :project_id, :string, 2
96
+ optional :secret, :string, 3
97
+ optional :version, :string, 4
98
+ end
99
+ add_message "google.cloud.functions.v1.SecretVolume" do
100
+ optional :mount_path, :string, 1
101
+ optional :project_id, :string, 2
102
+ optional :secret, :string, 3
103
+ repeated :versions, :message, 4, "google.cloud.functions.v1.SecretVolume.SecretVersion"
104
+ end
105
+ add_message "google.cloud.functions.v1.SecretVolume.SecretVersion" do
106
+ optional :version, :string, 1
107
+ optional :path, :string, 2
108
+ end
84
109
  add_message "google.cloud.functions.v1.CreateFunctionRequest" do
85
110
  optional :location, :string, 1
86
111
  optional :function, :message, 2, "google.cloud.functions.v1.CloudFunction"
@@ -151,6 +176,9 @@ module Google
151
176
  EventTrigger = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.EventTrigger").msgclass
152
177
  FailurePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.FailurePolicy").msgclass
153
178
  FailurePolicy::Retry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.FailurePolicy.Retry").msgclass
179
+ SecretEnvVar = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.SecretEnvVar").msgclass
180
+ SecretVolume = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.SecretVolume").msgclass
181
+ SecretVolume::SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.SecretVolume.SecretVersion").msgclass
154
182
  CreateFunctionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.CreateFunctionRequest").msgclass
155
183
  UpdateFunctionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.UpdateFunctionRequest").msgclass
156
184
  GetFunctionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.functions.v1.GetFunctionRequest").msgclass
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/functions/v1/operations.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/protobuf/any_pb'
7
5
  require 'google/protobuf/timestamp_pb'
8
6
  require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/cloud/functions/v1/operations.proto", :syntax => :proto3) do
11
11
  add_message "google.cloud.functions.v1.OperationMetadataV1" do
@@ -15,6 +15,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  optional :version_id, :int64, 4
16
16
  optional :update_time, :message, 5, "google.protobuf.Timestamp"
17
17
  optional :build_id, :string, 6
18
+ optional :source_token, :string, 7
19
+ optional :build_name, :string, 8
18
20
  end
19
21
  add_enum "google.cloud.functions.v1.OperationType" do
20
22
  value :OPERATION_UNSPECIFIED, 0
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Functions
23
23
  module V1
24
- VERSION = "0.4.0"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -23,6 +23,7 @@ module Google
23
23
  module V1
24
24
  # Describes a Cloud Function that contains user computation executed in
25
25
  # response to an event. It encapsulate function and triggers configurations.
26
+ # Next tag: 36
26
27
  # @!attribute [rw] name
27
28
  # @return [::String]
28
29
  # A user-defined name of the function. Function names must be unique
@@ -97,6 +98,9 @@ module Google
97
98
  # @!attribute [rw] environment_variables
98
99
  # @return [::Google::Protobuf::Map{::String => ::String}]
99
100
  # Environment variables that shall be available during function execution.
101
+ # @!attribute [rw] build_environment_variables
102
+ # @return [::Google::Protobuf::Map{::String => ::String}]
103
+ # Build environment variables that shall be available during build time.
100
104
  # @!attribute [rw] network
101
105
  # @return [::String]
102
106
  # The VPC Network that this cloud function can connect to. It can be
@@ -117,6 +121,20 @@ module Google
117
121
  # @return [::Integer]
118
122
  # The limit on the maximum number of function instances that may coexist at a
119
123
  # given time.
124
+ #
125
+ # In some cases, such as rapid traffic surges, Cloud Functions may, for a
126
+ # short period of time, create more instances than the specified max
127
+ # instances limit. If your function cannot tolerate this temporary behavior,
128
+ # you may want to factor in a safety margin and set a lower max instances
129
+ # value than your function can tolerate.
130
+ #
131
+ # See the [Max
132
+ # Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
133
+ # more details.
134
+ # @!attribute [rw] min_instances
135
+ # @return [::Integer]
136
+ # A lower bound for the number function instances that may coexist at a
137
+ # given time.
120
138
  # @!attribute [rw] vpc_connector
121
139
  # @return [::String]
122
140
  # The VPC Network Connector that this cloud function can connect to. It can
@@ -137,10 +155,83 @@ module Google
137
155
  # @return [::Google::Cloud::Functions::V1::CloudFunction::IngressSettings]
138
156
  # The ingress settings for the function, controlling what traffic can reach
139
157
  # it.
158
+ # @!attribute [rw] kms_key_name
159
+ # @return [::String]
160
+ # Resource name of a KMS crypto key (managed by the user) used to
161
+ # encrypt/decrypt function resources.
162
+ #
163
+ # It must match the pattern
164
+ # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
165
+ #
166
+ # If specified, you must also provide an artifact registry repository using
167
+ # the `docker_repository` field that was created with the same KMS crypto
168
+ # key.
169
+ #
170
+ # The following service accounts need to be granted Cloud KMS crypto key
171
+ # encrypter/decrypter roles on the key.
172
+ #
173
+ # 1. Google Cloud Functions service account
174
+ # (service-\\{project_number}@gcf-admin-robot.iam.gserviceaccount.com) -
175
+ # Required to protect the function's image.
176
+ # 2. Google Storage service account
177
+ # (service-\\{project_number}@gs-project-accounts.iam.gserviceaccount.com) -
178
+ # Required to protect the function's source code.
179
+ # If this service account does not exist, deploying a function without a
180
+ # KMS key or retrieving the service agent name provisions it. For more
181
+ # information, see
182
+ # https://cloud.google.com/storage/docs/projects#service-agents and
183
+ # https://cloud.google.com/storage/docs/getting-service-agent#gsutil.
184
+ #
185
+ # Google Cloud Functions delegates access to service agents to protect
186
+ # function resources in internal projects that are not accessible by the
187
+ # end user.
188
+ # @!attribute [rw] build_worker_pool
189
+ # @return [::String]
190
+ # Name of the Cloud Build Custom Worker Pool that should be used to build the
191
+ # function. The format of this field is
192
+ # `projects/{project}/locations/{region}/workerPools/{workerPool}` where
193
+ # `{project}` and `{region}` are the project id and region respectively where
194
+ # the worker pool is defined and `{workerPool}` is the short name of the
195
+ # worker pool.
196
+ #
197
+ # If the project id is not the same as the function, then the Cloud
198
+ # Functions Service Agent
199
+ # (`service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com`) must
200
+ # be granted the role Cloud Build Custom Workers Builder
201
+ # (`roles/cloudbuild.customworkers.builder`) in the project.
140
202
  # @!attribute [r] build_id
141
203
  # @return [::String]
142
204
  # Output only. The Cloud Build ID of the latest successful deployment of the
143
205
  # function.
206
+ # @!attribute [r] build_name
207
+ # @return [::String]
208
+ # Output only. The Cloud Build Name of the function deployment.
209
+ # `projects/<project-number>/locations/<region>/builds/<build-id>`.
210
+ # @!attribute [rw] secret_environment_variables
211
+ # @return [::Array<::Google::Cloud::Functions::V1::SecretEnvVar>]
212
+ # Secret environment variables configuration.
213
+ # @!attribute [rw] secret_volumes
214
+ # @return [::Array<::Google::Cloud::Functions::V1::SecretVolume>]
215
+ # Secret volumes configuration.
216
+ # @!attribute [rw] source_token
217
+ # @return [::String]
218
+ # Input only. An identifier for Firebase function sources. Disclaimer: This field is only
219
+ # supported for Firebase function deployments.
220
+ # @!attribute [rw] docker_repository
221
+ # @return [::String]
222
+ # User managed repository created in Artifact Registry optionally with a
223
+ # customer managed encryption key. If specified, deployments will use
224
+ # Artifact Registry. If unspecified and the deployment is eligible to use
225
+ # Artifact Registry, GCF will create and use a repository named
226
+ # 'gcf-artifacts' for every deployed region. This is the repository to which
227
+ # the function docker image will be pushed after it is built by Cloud Build.
228
+ #
229
+ # It must match the pattern
230
+ # `projects/{project}/locations/{location}/repositories/{repository}`.
231
+ #
232
+ # Cross-project repositories are not supported.
233
+ # Cross-location repositories are not supported.
234
+ # Repository format must be 'DOCKER'.
144
235
  class CloudFunction
145
236
  include ::Google::Protobuf::MessageExts
146
237
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -163,6 +254,15 @@ module Google
163
254
  extend ::Google::Protobuf::MessageExts::ClassMethods
164
255
  end
165
256
 
257
+ # @!attribute [rw] key
258
+ # @return [::String]
259
+ # @!attribute [rw] value
260
+ # @return [::String]
261
+ class BuildEnvironmentVariablesEntry
262
+ include ::Google::Protobuf::MessageExts
263
+ extend ::Google::Protobuf::MessageExts::ClassMethods
264
+ end
265
+
166
266
  # Available egress settings.
167
267
  #
168
268
  # This controls what traffic is diverted through the VPC Access Connector
@@ -332,6 +432,82 @@ module Google
332
432
  end
333
433
  end
334
434
 
435
+ # Configuration for a secret environment variable. It has the information
436
+ # necessary to fetch the secret value from secret manager and expose it as an
437
+ # environment variable. Secret value is not a part of the configuration. Secret
438
+ # values are only fetched when a new clone starts.
439
+ # @!attribute [rw] key
440
+ # @return [::String]
441
+ # Name of the environment variable.
442
+ # @!attribute [rw] project_id
443
+ # @return [::String]
444
+ # Project identifier (preferrably project number but can also be the project
445
+ # ID) of the project that contains the secret. If not set, it will be
446
+ # populated with the function's project assuming that the secret exists in
447
+ # the same project as of the function.
448
+ # @!attribute [rw] secret
449
+ # @return [::String]
450
+ # Name of the secret in secret manager (not the full resource name).
451
+ # @!attribute [rw] version
452
+ # @return [::String]
453
+ # Version of the secret (version number or the string 'latest'). It is
454
+ # recommended to use a numeric version for secret environment variables as
455
+ # any updates to the secret value is not reflected until new clones start.
456
+ class SecretEnvVar
457
+ include ::Google::Protobuf::MessageExts
458
+ extend ::Google::Protobuf::MessageExts::ClassMethods
459
+ end
460
+
461
+ # Configuration for a secret volume. It has the information necessary to fetch
462
+ # the secret value from secret manager and make it available as files mounted
463
+ # at the requested paths within the application container. Secret value is not
464
+ # a part of the configuration. Every filesystem read operation performs a
465
+ # lookup in secret manager to retrieve the secret value.
466
+ # @!attribute [rw] mount_path
467
+ # @return [::String]
468
+ # The path within the container to mount the secret volume. For example,
469
+ # setting the mount_path as `/etc/secrets` would mount the secret value files
470
+ # under the `/etc/secrets` directory. This directory will also be completely
471
+ # shadowed and unavailable to mount any other secrets.
472
+ #
473
+ # Recommended mount paths: /etc/secrets
474
+ # Restricted mount paths: /cloudsql, /dev/log, /pod, /proc, /var/log
475
+ # @!attribute [rw] project_id
476
+ # @return [::String]
477
+ # Project identifier (preferrably project number but can also be the project
478
+ # ID) of the project that contains the secret. If not set, it will be
479
+ # populated with the function's project assuming that the secret exists in
480
+ # the same project as of the function.
481
+ # @!attribute [rw] secret
482
+ # @return [::String]
483
+ # Name of the secret in secret manager (not the full resource name).
484
+ # @!attribute [rw] versions
485
+ # @return [::Array<::Google::Cloud::Functions::V1::SecretVolume::SecretVersion>]
486
+ # List of secret versions to mount for this secret. If empty, the `latest`
487
+ # version of the secret will be made available in a file named after the
488
+ # secret under the mount point.
489
+ class SecretVolume
490
+ include ::Google::Protobuf::MessageExts
491
+ extend ::Google::Protobuf::MessageExts::ClassMethods
492
+
493
+ # Configuration for a single version.
494
+ # @!attribute [rw] version
495
+ # @return [::String]
496
+ # Version of the secret (version number or the string 'latest'). It is
497
+ # preferrable to use `latest` version with secret volumes as secret value
498
+ # changes are reflected immediately.
499
+ # @!attribute [rw] path
500
+ # @return [::String]
501
+ # Relative path of the file under the mount path where the secret value for
502
+ # this version will be fetched and made available. For example, setting the
503
+ # mount_path as '/etc/secrets' and path as `/secret_foo` would mount the
504
+ # secret value file at `/etc/secrets/secret_foo`.
505
+ class SecretVersion
506
+ include ::Google::Protobuf::MessageExts
507
+ extend ::Google::Protobuf::MessageExts::ClassMethods
508
+ end
509
+ end
510
+
335
511
  # Request for the `CreateFunction` method.
336
512
  # @!attribute [rw] location
337
513
  # @return [::String]
@@ -43,6 +43,15 @@ module Google
43
43
  # @return [::String]
44
44
  # The Cloud Build ID of the function created or updated by an API call.
45
45
  # This field is only populated for Create and Update operations.
46
+ # @!attribute [rw] source_token
47
+ # @return [::String]
48
+ # An identifier for Firebase function sources. Disclaimer: This field is only
49
+ # supported for Firebase function deployments.
50
+ # @!attribute [rw] build_name
51
+ # @return [::String]
52
+ # The Cloud Build Name of the function deployment.
53
+ # This field is only populated for Create and Update operations.
54
+ # `projects/<project-number>/locations/<region>/builds/<build-id>`.
46
55
  class OperationMetadataV1
47
56
  include ::Google::Protobuf::MessageExts
48
57
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-functions-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.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: 2021-09-22 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common