google-cloud-workflows-v1 1.0.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa946cd2bbcf93bd610ab7f2748c24fab123f7e5c146a695304461caa589768c
4
- data.tar.gz: eca9a66e1f13f975921daf89f040e48518b8e26e0e3405cc90d5ef2db242455d
3
+ metadata.gz: 91d2bac803f356b61600f54e5379ec6b18ad4a4c9c4b2eebf7fddc9d1aa40b3b
4
+ data.tar.gz: b3693ae39f55740af4430f7a9be5ab2419b6522778a0555ca623a2a96674715f
5
5
  SHA512:
6
- metadata.gz: b7a61a46c38bae3cfd46d58bd790c6790dbf6a719eb464320dd07e36ca90588866d8a29fd665535cd856eaf144be54b0c5efc43832cb8ea1ba71ba9c5a8829ab
7
- data.tar.gz: 60b5010885104bae6b7e83651e0304e7faeb6c3e46f8b1555b7223a8492176a1b93a9d1402bb16bc5d7495d5377df8d54c1ec15cdc5329ab68640eb8713e9496
6
+ metadata.gz: bcd18449bac0af3f7822f198820e58f92dc5dfc58f5c8e8865ed9005b2cf24723e250db2afb766efd11dbe87f5c2197c8ceb5702f822852f4b2ef6ce85fa240b
7
+ data.tar.gz: a9bb3b5b335d9bc28b1f1ecadea50875fa082be4d854f4898d0bd73669f5c79c0f64d2b3852b4db5b742519ea3671f3313e5cfe1c72a2723ee0b6d2199414ae8
data/README.md CHANGED
@@ -43,40 +43,50 @@ for class and method documentation.
43
43
  See also the [Product Documentation](https://cloud.google.com/workflows/)
44
44
  for general usage information.
45
45
 
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
46
+ ## Debug Logging
47
+
48
+ This library comes with opt-in Debug Logging that can help you troubleshoot
49
+ your application's integration with the API. When logging is activated, key
50
+ events such as requests and responses, along with data payloads and metadata
51
+ such as headers and client configuration, are logged to the standard error
52
+ stream.
53
+
54
+ **WARNING:** Client Library Debug Logging includes your data payloads in
55
+ plaintext, which could include sensitive data such as PII for yourself or your
56
+ customers, private keys, or other security data that could be compromising if
57
+ leaked. Always practice good data hygiene with your application logs, and follow
58
+ the principle of least access. Google also recommends that Client Library Debug
59
+ Logging be enabled only temporarily during active debugging, and not used
60
+ permanently in production.
61
+
62
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
63
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
64
+ list of client library gem names. This will select the default logging behavior,
65
+ which writes logs to the standard error stream. On a local workstation, this may
66
+ result in logs appearing on the console. When running on a Google Cloud hosting
67
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
68
+ results in logs appearing alongside your application logs in the
69
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
70
+
71
+ You can customize logging by modifying the `logger` configuration when
72
+ constructing a client object. For example:
55
73
 
56
74
  ```ruby
75
+ require "google/cloud/workflows/v1"
57
76
  require "logger"
58
77
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
78
+ client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config|
79
+ config.logger = Logger.new "my-app.log"
69
80
  end
70
81
  ```
71
82
 
72
-
73
83
  ## Google Cloud Samples
74
84
 
75
85
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
86
 
77
87
  ## Supported Ruby Versions
78
88
 
79
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
80
90
 
81
91
  Google provides official support for Ruby versions that are actively supported
82
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Workflows
23
23
  module V1
24
- VERSION = "1.0.2"
24
+ VERSION = "1.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -167,14 +167,26 @@ module Google
167
167
  universe_domain: @config.universe_domain,
168
168
  channel_args: @config.channel_args,
169
169
  interceptors: @config.interceptors,
170
- channel_pool_config: @config.channel_pool
170
+ channel_pool_config: @config.channel_pool,
171
+ logger: @config.logger
171
172
  )
172
173
 
174
+ @workflows_stub.stub_logger&.info do |entry|
175
+ entry.set_system_name
176
+ entry.set_service
177
+ entry.message = "Created client for #{entry.service}"
178
+ entry.set_credentials_fields credentials
179
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
180
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
181
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
182
+ end
183
+
173
184
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
174
185
  config.credentials = credentials
175
186
  config.quota_project = @quota_project_id
176
187
  config.endpoint = @workflows_stub.endpoint
177
188
  config.universe_domain = @workflows_stub.universe_domain
189
+ config.logger = @workflows_stub.logger if config.respond_to? :logger=
178
190
  end
179
191
  end
180
192
 
@@ -192,6 +204,15 @@ module Google
192
204
  #
193
205
  attr_reader :location_client
194
206
 
207
+ ##
208
+ # The logger used for request/response debug logging.
209
+ #
210
+ # @return [Logger]
211
+ #
212
+ def logger
213
+ @workflows_stub.logger
214
+ end
215
+
195
216
  # Service calls
196
217
 
197
218
  ##
@@ -299,7 +320,7 @@ module Google
299
320
  @workflows_stub.call_rpc :list_workflows, request, options: options do |response, operation|
300
321
  response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflows, request, response, operation, options
301
322
  yield response, operation if block_given?
302
- return response
323
+ throw :response, response
303
324
  end
304
325
  rescue ::GRPC::BadStatus => e
305
326
  raise ::Google::Cloud::Error.from_error(e)
@@ -392,7 +413,6 @@ module Google
392
413
 
393
414
  @workflows_stub.call_rpc :get_workflow, request, options: options do |response, operation|
394
415
  yield response, operation if block_given?
395
- return response
396
416
  end
397
417
  rescue ::GRPC::BadStatus => e
398
418
  raise ::Google::Cloud::Error.from_error(e)
@@ -500,7 +520,7 @@ module Google
500
520
  @workflows_stub.call_rpc :create_workflow, request, options: options do |response, operation|
501
521
  response = ::Gapic::Operation.new response, @operations_client, options: options
502
522
  yield response, operation if block_given?
503
- return response
523
+ throw :response, response
504
524
  end
505
525
  rescue ::GRPC::BadStatus => e
506
526
  raise ::Google::Cloud::Error.from_error(e)
@@ -597,7 +617,7 @@ module Google
597
617
  @workflows_stub.call_rpc :delete_workflow, request, options: options do |response, operation|
598
618
  response = ::Gapic::Operation.new response, @operations_client, options: options
599
619
  yield response, operation if block_given?
600
- return response
620
+ throw :response, response
601
621
  end
602
622
  rescue ::GRPC::BadStatus => e
603
623
  raise ::Google::Cloud::Error.from_error(e)
@@ -698,7 +718,7 @@ module Google
698
718
  @workflows_stub.call_rpc :update_workflow, request, options: options do |response, operation|
699
719
  response = ::Gapic::Operation.new response, @operations_client, options: options
700
720
  yield response, operation if block_given?
701
- return response
721
+ throw :response, response
702
722
  end
703
723
  rescue ::GRPC::BadStatus => e
704
724
  raise ::Google::Cloud::Error.from_error(e)
@@ -748,6 +768,13 @@ module Google
748
768
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
749
769
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
750
770
  # * (`nil`) indicating no credentials
771
+ #
772
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
773
+ # external source for authentication to Google Cloud, you must validate it before
774
+ # providing it to a Google API client library. Providing an unvalidated credential
775
+ # configuration to Google APIs can compromise the security of your systems and data.
776
+ # For more information, refer to [Validate credential configurations from external
777
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
751
778
  # @return [::Object]
752
779
  # @!attribute [rw] scope
753
780
  # The OAuth scopes
@@ -787,6 +814,11 @@ module Google
787
814
  # default endpoint URL. The default value of nil uses the environment
788
815
  # universe (usually the default "googleapis.com" universe).
789
816
  # @return [::String,nil]
817
+ # @!attribute [rw] logger
818
+ # A custom logger to use for request/response debug logging, or the value
819
+ # `:default` (the default) to construct a default logger, or `nil` to
820
+ # explicitly disable logging.
821
+ # @return [::Logger,:default,nil]
790
822
  #
791
823
  class Configuration
792
824
  extend ::Gapic::Config
@@ -811,6 +843,7 @@ module Google
811
843
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
812
844
  config_attr :quota_project, nil, ::String, nil
813
845
  config_attr :universe_domain, nil, ::String, nil
846
+ config_attr :logger, :default, ::Logger, nil, :default
814
847
 
815
848
  # @private
816
849
  def initialize parent_config = nil
@@ -213,7 +213,7 @@ module Google
213
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
215
  yield response, operation if block_given?
216
- return response
216
+ throw :response, response
217
217
  end
218
218
  rescue ::GRPC::BadStatus => e
219
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +309,7 @@ module Google
309
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
311
  yield response, operation if block_given?
312
- return response
312
+ throw :response, response
313
313
  end
314
314
  rescue ::GRPC::BadStatus => e
315
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +398,6 @@ module Google
398
398
 
399
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
400
  yield response, operation if block_given?
401
- return response
402
401
  end
403
402
  rescue ::GRPC::BadStatus => e
404
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,7 +590,7 @@ module Google
592
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
592
  yield response, operation if block_given?
595
- return response
593
+ throw :response, response
596
594
  end
597
595
  rescue ::GRPC::BadStatus => e
598
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -642,6 +640,13 @@ module Google
642
640
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
643
641
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
644
642
  # * (`nil`) indicating no credentials
643
+ #
644
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
645
+ # external source for authentication to Google Cloud, you must validate it before
646
+ # providing it to a Google API client library. Providing an unvalidated credential
647
+ # configuration to Google APIs can compromise the security of your systems and data.
648
+ # For more information, refer to [Validate credential configurations from external
649
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
645
650
  # @return [::Object]
646
651
  # @!attribute [rw] scope
647
652
  # The OAuth scopes
@@ -681,6 +686,11 @@ module Google
681
686
  # default endpoint URL. The default value of nil uses the environment
682
687
  # universe (usually the default "googleapis.com" universe).
683
688
  # @return [::String,nil]
689
+ # @!attribute [rw] logger
690
+ # A custom logger to use for request/response debug logging, or the value
691
+ # `:default` (the default) to construct a default logger, or `nil` to
692
+ # explicitly disable logging.
693
+ # @return [::Logger,:default,nil]
684
694
  #
685
695
  class Configuration
686
696
  extend ::Gapic::Config
@@ -705,6 +715,7 @@ module Google
705
715
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
716
  config_attr :quota_project, nil, ::String, nil
707
717
  config_attr :universe_domain, nil, ::String, nil
718
+ config_attr :logger, :default, ::Logger, nil, :default
708
719
 
709
720
  # @private
710
721
  def initialize parent_config = nil
@@ -160,15 +160,27 @@ module Google
160
160
  endpoint: @config.endpoint,
161
161
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
162
162
  universe_domain: @config.universe_domain,
163
- credentials: credentials
163
+ credentials: credentials,
164
+ logger: @config.logger
164
165
  )
165
166
 
167
+ @workflows_stub.logger(stub: true)&.info do |entry|
168
+ entry.set_system_name
169
+ entry.set_service
170
+ entry.message = "Created client for #{entry.service}"
171
+ entry.set_credentials_fields credentials
172
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
173
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
174
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
175
+ end
176
+
166
177
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
178
  config.credentials = credentials
168
179
  config.quota_project = @quota_project_id
169
180
  config.endpoint = @workflows_stub.endpoint
170
181
  config.universe_domain = @workflows_stub.universe_domain
171
182
  config.bindings_override = @config.bindings_override
183
+ config.logger = @workflows_stub.logger if config.respond_to? :logger=
172
184
  end
173
185
  end
174
186
 
@@ -186,6 +198,15 @@ module Google
186
198
  #
187
199
  attr_reader :location_client
188
200
 
201
+ ##
202
+ # The logger used for request/response debug logging.
203
+ #
204
+ # @return [Logger]
205
+ #
206
+ def logger
207
+ @workflows_stub.logger
208
+ end
209
+
189
210
  # Service calls
190
211
 
191
212
  ##
@@ -285,7 +306,6 @@ module Google
285
306
 
286
307
  @workflows_stub.list_workflows request, options do |result, operation|
287
308
  yield result, operation if block_given?
288
- return result
289
309
  end
290
310
  rescue ::Gapic::Rest::Error => e
291
311
  raise ::Google::Cloud::Error.from_error(e)
@@ -371,7 +391,6 @@ module Google
371
391
 
372
392
  @workflows_stub.get_workflow request, options do |result, operation|
373
393
  yield result, operation if block_given?
374
- return result
375
394
  end
376
395
  rescue ::Gapic::Rest::Error => e
377
396
  raise ::Google::Cloud::Error.from_error(e)
@@ -472,7 +491,7 @@ module Google
472
491
  @workflows_stub.create_workflow request, options do |result, operation|
473
492
  result = ::Gapic::Operation.new result, @operations_client, options: options
474
493
  yield result, operation if block_given?
475
- return result
494
+ throw :response, result
476
495
  end
477
496
  rescue ::Gapic::Rest::Error => e
478
497
  raise ::Google::Cloud::Error.from_error(e)
@@ -562,7 +581,7 @@ module Google
562
581
  @workflows_stub.delete_workflow request, options do |result, operation|
563
582
  result = ::Gapic::Operation.new result, @operations_client, options: options
564
583
  yield result, operation if block_given?
565
- return result
584
+ throw :response, result
566
585
  end
567
586
  rescue ::Gapic::Rest::Error => e
568
587
  raise ::Google::Cloud::Error.from_error(e)
@@ -656,7 +675,7 @@ module Google
656
675
  @workflows_stub.update_workflow request, options do |result, operation|
657
676
  result = ::Gapic::Operation.new result, @operations_client, options: options
658
677
  yield result, operation if block_given?
659
- return result
678
+ throw :response, result
660
679
  end
661
680
  rescue ::Gapic::Rest::Error => e
662
681
  raise ::Google::Cloud::Error.from_error(e)
@@ -704,6 +723,13 @@ module Google
704
723
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
705
724
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
706
725
  # * (`nil`) indicating no credentials
726
+ #
727
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
728
+ # external source for authentication to Google Cloud, you must validate it before
729
+ # providing it to a Google API client library. Providing an unvalidated credential
730
+ # configuration to Google APIs can compromise the security of your systems and data.
731
+ # For more information, refer to [Validate credential configurations from external
732
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
707
733
  # @return [::Object]
708
734
  # @!attribute [rw] scope
709
735
  # The OAuth scopes
@@ -736,6 +762,11 @@ module Google
736
762
  # default endpoint URL. The default value of nil uses the environment
737
763
  # universe (usually the default "googleapis.com" universe).
738
764
  # @return [::String,nil]
765
+ # @!attribute [rw] logger
766
+ # A custom logger to use for request/response debug logging, or the value
767
+ # `:default` (the default) to construct a default logger, or `nil` to
768
+ # explicitly disable logging.
769
+ # @return [::Logger,:default,nil]
739
770
  #
740
771
  class Configuration
741
772
  extend ::Gapic::Config
@@ -764,6 +795,7 @@ module Google
764
795
  # by the host service.
765
796
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
766
797
  config_attr :bindings_override, {}, ::Hash, nil
798
+ config_attr :logger, :default, ::Logger, nil, :default
767
799
 
768
800
  # @private
769
801
  def initialize parent_config = nil
@@ -196,7 +196,7 @@ module Google
196
196
  @operations_stub.list_operations request, options do |result, operation|
197
197
  result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options
198
198
  yield result, operation if block_given?
199
- return result
199
+ throw :response, result
200
200
  end
201
201
  rescue ::Gapic::Rest::Error => e
202
202
  raise ::Google::Cloud::Error.from_error(e)
@@ -285,7 +285,7 @@ module Google
285
285
  @operations_stub.get_operation request, options do |result, operation|
286
286
  result = ::Gapic::Operation.new result, @operations_client, options: options
287
287
  yield result, operation if block_given?
288
- return result
288
+ throw :response, result
289
289
  end
290
290
  rescue ::Gapic::Rest::Error => e
291
291
  raise ::Google::Cloud::Error.from_error(e)
@@ -367,7 +367,6 @@ module Google
367
367
 
368
368
  @operations_stub.delete_operation request, options do |result, operation|
369
369
  yield result, operation if block_given?
370
- return result
371
370
  end
372
371
  rescue ::Gapic::Rest::Error => e
373
372
  raise ::Google::Cloud::Error.from_error(e)
@@ -456,7 +455,6 @@ module Google
456
455
 
457
456
  @operations_stub.cancel_operation request, options do |result, operation|
458
457
  yield result, operation if block_given?
459
- return result
460
458
  end
461
459
  rescue ::Gapic::Rest::Error => e
462
460
  raise ::Google::Cloud::Error.from_error(e)
@@ -504,6 +502,13 @@ module Google
504
502
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
505
503
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
506
504
  # * (`nil`) indicating no credentials
505
+ #
506
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
507
+ # external source for authentication to Google Cloud, you must validate it before
508
+ # providing it to a Google API client library. Providing an unvalidated credential
509
+ # configuration to Google APIs can compromise the security of your systems and data.
510
+ # For more information, refer to [Validate credential configurations from external
511
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
507
512
  # @return [::Object]
508
513
  # @!attribute [rw] scope
509
514
  # The OAuth scopes
@@ -536,6 +541,11 @@ module Google
536
541
  # default endpoint URL. The default value of nil uses the environment
537
542
  # universe (usually the default "googleapis.com" universe).
538
543
  # @return [::String,nil]
544
+ # @!attribute [rw] logger
545
+ # A custom logger to use for request/response debug logging, or the value
546
+ # `:default` (the default) to construct a default logger, or `nil` to
547
+ # explicitly disable logging.
548
+ # @return [::Logger,:default,nil]
539
549
  #
540
550
  class Configuration
541
551
  extend ::Gapic::Config
@@ -557,6 +567,7 @@ module Google
557
567
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
558
568
  config_attr :quota_project, nil, ::String, nil
559
569
  config_attr :universe_domain, nil, ::String, nil
570
+ config_attr :logger, :default, ::Logger, nil, :default
560
571
 
561
572
  # @private
562
573
  def initialize parent_config = nil
@@ -676,16 +687,18 @@ module Google
676
687
 
677
688
  response = @client_stub.make_http_request(
678
689
  verb,
679
- uri: uri,
680
- body: body || "",
681
- params: query_string_params,
690
+ uri: uri,
691
+ body: body || "",
692
+ params: query_string_params,
693
+ method_name: "list_operations",
682
694
  options: options
683
695
  )
684
696
  operation = ::Gapic::Rest::TransportOperation.new response
685
697
  result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true
686
-
687
- yield result, operation if block_given?
688
- result
698
+ catch :response do
699
+ yield result, operation if block_given?
700
+ result
701
+ end
689
702
  end
690
703
 
691
704
  ##
@@ -714,16 +727,18 @@ module Google
714
727
 
715
728
  response = @client_stub.make_http_request(
716
729
  verb,
717
- uri: uri,
718
- body: body || "",
719
- params: query_string_params,
730
+ uri: uri,
731
+ body: body || "",
732
+ params: query_string_params,
733
+ method_name: "get_operation",
720
734
  options: options
721
735
  )
722
736
  operation = ::Gapic::Rest::TransportOperation.new response
723
737
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
724
-
725
- yield result, operation if block_given?
726
- result
738
+ catch :response do
739
+ yield result, operation if block_given?
740
+ result
741
+ end
727
742
  end
728
743
 
729
744
  ##
@@ -752,16 +767,18 @@ module Google
752
767
 
753
768
  response = @client_stub.make_http_request(
754
769
  verb,
755
- uri: uri,
756
- body: body || "",
757
- params: query_string_params,
770
+ uri: uri,
771
+ body: body || "",
772
+ params: query_string_params,
773
+ method_name: "delete_operation",
758
774
  options: options
759
775
  )
760
776
  operation = ::Gapic::Rest::TransportOperation.new response
761
777
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
762
-
763
- yield result, operation if block_given?
764
- result
778
+ catch :response do
779
+ yield result, operation if block_given?
780
+ result
781
+ end
765
782
  end
766
783
 
767
784
  ##
@@ -790,16 +807,18 @@ module Google
790
807
 
791
808
  response = @client_stub.make_http_request(
792
809
  verb,
793
- uri: uri,
794
- body: body || "",
795
- params: query_string_params,
810
+ uri: uri,
811
+ body: body || "",
812
+ params: query_string_params,
813
+ method_name: "cancel_operation",
796
814
  options: options
797
815
  )
798
816
  operation = ::Gapic::Rest::TransportOperation.new response
799
817
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
800
-
801
- yield result, operation if block_given?
802
- result
818
+ catch :response do
819
+ yield result, operation if block_given?
820
+ result
821
+ end
803
822
  end
804
823
 
805
824
  ##
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the list_workflows REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "list_workflows",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_workflow",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::Workflows::V1::Workflow.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "create_workflow",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "delete_workflow",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "update_workflow",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -40,6 +40,8 @@ module Google
40
40
  # @!attribute [rw] error
41
41
  # @return [::Google::Rpc::Status]
42
42
  # The error result of the operation in case of failure or cancellation.
43
+ #
44
+ # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared.
43
45
  # @!attribute [rw] response
44
46
  # @return [::Google::Protobuf::Any]
45
47
  # The normal, successful response of the operation. If the original
@@ -50,6 +52,8 @@ module Google
50
52
  # is the original method name. For example, if the original method name
51
53
  # is `TakeSnapshot()`, the inferred response type is
52
54
  # `TakeSnapshotResponse`.
55
+ #
56
+ # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared.
53
57
  class Operation
54
58
  include ::Google::Protobuf::MessageExts
55
59
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-workflows-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-05 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -113,7 +112,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
113
112
  licenses:
114
113
  - Apache-2.0
115
114
  metadata: {}
116
- post_install_message:
117
115
  rdoc_options: []
118
116
  require_paths:
119
117
  - lib
@@ -121,15 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
119
  requirements:
122
120
  - - ">="
123
121
  - !ruby/object:Gem::Version
124
- version: '2.7'
122
+ version: '3.0'
125
123
  required_rubygems_version: !ruby/object:Gem::Requirement
126
124
  requirements:
127
125
  - - ">="
128
126
  - !ruby/object:Gem::Version
129
127
  version: '0'
130
128
  requirements: []
131
- rubygems_version: 3.5.23
132
- signing_key:
129
+ rubygems_version: 3.6.2
133
130
  specification_version: 4
134
131
  summary: Manage workflow definitions. To execute workflows and manage executions,
135
132
  see the Workflows Executions API.