google-cloud-tasks 1.5.1 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -54
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +320 -0
  6. data/README.md +96 -24
  7. data/lib/{google/cloud/tasks/v2beta2/doc/google/protobuf/empty.rb → google-cloud-tasks.rb} +4 -14
  8. data/lib/google/cloud/tasks.rb +88 -117
  9. data/lib/google/cloud/tasks/version.rb +6 -2
  10. metadata +78 -115
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/tasks/v2.rb +0 -147
  13. data/lib/google/cloud/tasks/v2/cloud_tasks_client.rb +0 -1233
  14. data/lib/google/cloud/tasks/v2/cloud_tasks_client_config.json +0 -106
  15. data/lib/google/cloud/tasks/v2/cloudtasks_pb.rb +0 -100
  16. data/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb +0 -203
  17. data/lib/google/cloud/tasks/v2/credentials.rb +0 -41
  18. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/cloudtasks.rb +0 -312
  19. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/queue.rb +0 -348
  20. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/target.rb +0 -414
  21. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/task.rb +0 -175
  22. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/iam_policy.rb +0 -64
  23. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/options.rb +0 -33
  24. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/policy.rb +0 -151
  25. data/lib/google/cloud/tasks/v2/doc/google/protobuf/any.rb +0 -131
  26. data/lib/google/cloud/tasks/v2/doc/google/protobuf/duration.rb +0 -91
  27. data/lib/google/cloud/tasks/v2/doc/google/protobuf/empty.rb +0 -29
  28. data/lib/google/cloud/tasks/v2/doc/google/protobuf/field_mask.rb +0 -222
  29. data/lib/google/cloud/tasks/v2/doc/google/protobuf/timestamp.rb +0 -113
  30. data/lib/google/cloud/tasks/v2/doc/google/rpc/status.rb +0 -39
  31. data/lib/google/cloud/tasks/v2/doc/google/type/expr.rb +0 -45
  32. data/lib/google/cloud/tasks/v2/helpers.rb +0 -49
  33. data/lib/google/cloud/tasks/v2/queue_pb.rb +0 -56
  34. data/lib/google/cloud/tasks/v2/target_pb.rb +0 -66
  35. data/lib/google/cloud/tasks/v2/task_pb.rb +0 -51
  36. data/lib/google/cloud/tasks/v2beta2.rb +0 -147
  37. data/lib/google/cloud/tasks/v2beta2/cloud_tasks_client.rb +0 -1605
  38. data/lib/google/cloud/tasks/v2beta2/cloud_tasks_client_config.json +0 -126
  39. data/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb +0 -133
  40. data/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb +0 -258
  41. data/lib/google/cloud/tasks/v2beta2/credentials.rb +0 -41
  42. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/cloudtasks.rb +0 -483
  43. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/queue.rb +0 -336
  44. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/target.rb +0 -377
  45. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/task.rb +0 -166
  46. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/iam_policy.rb +0 -64
  47. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/options.rb +0 -33
  48. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/policy.rb +0 -151
  49. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/any.rb +0 -131
  50. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/duration.rb +0 -91
  51. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/field_mask.rb +0 -222
  52. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/timestamp.rb +0 -113
  53. data/lib/google/cloud/tasks/v2beta2/doc/google/rpc/status.rb +0 -39
  54. data/lib/google/cloud/tasks/v2beta2/doc/google/type/expr.rb +0 -45
  55. data/lib/google/cloud/tasks/v2beta2/helpers.rb +0 -49
  56. data/lib/google/cloud/tasks/v2beta2/queue_pb.rb +0 -58
  57. data/lib/google/cloud/tasks/v2beta2/target_pb.rb +0 -54
  58. data/lib/google/cloud/tasks/v2beta2/task_pb.rb +0 -54
  59. data/lib/google/cloud/tasks/v2beta3.rb +0 -147
  60. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb +0 -1233
  61. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client_config.json +0 -106
  62. data/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +0 -101
  63. data/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +0 -203
  64. data/lib/google/cloud/tasks/v2beta3/credentials.rb +0 -41
  65. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/cloudtasks.rb +0 -312
  66. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/queue.rb +0 -342
  67. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/target.rb +0 -431
  68. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/task.rb +0 -177
  69. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/iam_policy.rb +0 -64
  70. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/options.rb +0 -33
  71. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/policy.rb +0 -151
  72. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/any.rb +0 -131
  73. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/duration.rb +0 -91
  74. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/empty.rb +0 -29
  75. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/field_mask.rb +0 -222
  76. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/timestamp.rb +0 -113
  77. data/lib/google/cloud/tasks/v2beta3/doc/google/rpc/status.rb +0 -39
  78. data/lib/google/cloud/tasks/v2beta3/doc/google/type/expr.rb +0 -45
  79. data/lib/google/cloud/tasks/v2beta3/helpers.rb +0 -49
  80. data/lib/google/cloud/tasks/v2beta3/queue_pb.rb +0 -59
  81. data/lib/google/cloud/tasks/v2beta3/target_pb.rb +0 -69
  82. data/lib/google/cloud/tasks/v2beta3/task_pb.rb +0 -52
data/README.md CHANGED
@@ -1,41 +1,55 @@
1
- # Ruby Client for Cloud Tasks API
1
+ # Ruby Client for the Cloud Tasks API
2
2
 
3
- [Cloud Tasks API][Product Documentation]:
4
- Manages the execution of large numbers of distributed requests.
5
- - [Client Library Documentation][]
6
- - [Product Documentation][]
3
+ API Client library for the Cloud Tasks API
7
4
 
8
- ## Quick Start
9
- In order to use this library, you first need to go through the following
10
- steps:
5
+ Cloud Tasks is a fully managed service that allows you to manage the execution, dispatch and delivery of a large number of distributed tasks. You can asynchronously perform work outside of a user request. Your tasks can be executed on App Engine or any arbitrary HTTP endpoint.
11
6
 
12
- 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
13
- 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
14
- 3. [Enable the Cloud Tasks API.](https://console.cloud.google.com/apis/library/tasks.googleapis.com)
15
- 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-tasks/latest/file.AUTHENTICATION.html)
7
+ Actual client classes for the various versions of this API are defined in
8
+ _versioned_ client gems, with names of the form `google-cloud-tasks-v*`.
9
+ The gem `google-cloud-tasks` is the main client library that brings the
10
+ verisoned gems in as dependencies, and provides high-level methods for
11
+ constructing clients. More information on versioned clients can be found below
12
+ in the section titled *Which client should I use?*.
13
+
14
+ View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-tasks/latest)
15
+ for this library, google-cloud-tasks, to see the convenience methods for
16
+ constructing client objects. Reference documentation for the client objects
17
+ themselves can be found in the client library documentation for the versioned
18
+ client gems:
19
+ [google-cloud-tasks-v2](https://googleapis.dev/ruby/google-cloud-tasks-v2/latest),
20
+ [google-cloud-tasks-v2beta2](https://googleapis.dev/ruby/google-cloud-tasks-v2beta2/latest),
21
+ [google-cloud-tasks-v2beta3](https://googleapis.dev/ruby/google-cloud-tasks-v2beta3/latest).
22
+
23
+ See also the [Product Documentation](https://cloud.google.com/tasks)
24
+ for more usage information.
25
+
26
+ ## Quick Start
16
27
 
17
- ### Installation
18
28
  ```
19
29
  $ gem install google-cloud-tasks
20
30
  ```
21
31
 
22
- ### Next Steps
23
- - Read the [Client Library Documentation][] for Cloud Tasks API
24
- to see other available methods on the client.
25
- - Read the [Cloud Tasks API Product documentation][Product Documentation]
26
- to learn more about the product and see How-to Guides.
27
- - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
28
- to see the full list of Cloud APIs that we cover.
32
+ In order to use this library, you first need to go through the following steps:
29
33
 
30
- [Client Library Documentation]: https://googleapis.dev/ruby/google-cloud-tasks/latest
31
- [Product Documentation]: https://cloud.google.com/tasks
34
+ 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
35
+ 1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
36
+ 1. [Enable the API.](https://console.cloud.google.com/apis/library/cloudtasks.googleapis.com)
37
+ 1. {file:AUTHENTICATION.md Set up authentication.}
38
+
39
+ ## Migrating from 1.x versions
40
+
41
+ The 2.0 release of the google-cloud-tasks client is a significant upgrade
42
+ based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
43
+ and includes substantial interface changes. Existing code written for earlier
44
+ versions of this library will likely require updates to use this version.
45
+ See the {file:MIGRATING.md MIGRATING.md} document for more information.
32
46
 
33
47
  ## Enabling Logging
34
48
 
35
49
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
36
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
50
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
37
51
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
38
- that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
+ 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)
39
53
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
40
54
 
41
55
  Configuring a Ruby stdlib logger:
@@ -66,3 +80,61 @@ in security maintenance, and not end of life. Currently, this means Ruby 2.4
66
80
  and later. Older versions of Ruby _may_ still work, but are unsupported and not
67
81
  recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
68
82
  about the Ruby support schedule.
83
+
84
+ ## Which client should I use?
85
+
86
+ Most modern Ruby client libraries for Google APIs come in two flavors: the main
87
+ client library with a name such as `google-cloud-tasks`,
88
+ and lower-level _versioned_ client libraries with names such as
89
+ `google-cloud-tasks-v2`.
90
+ _In most cases, you should install the main client._
91
+
92
+ ### What's the difference between the main client and a versioned client?
93
+
94
+ A _versioned client_ provides a basic set of data types and client classes for
95
+ a _single version_ of a specific service. (That is, for a service with multiple
96
+ versions, there might be a separate versioned client for each service version.)
97
+ Most versioned clients are written and maintained by a code generator.
98
+
99
+ The _main client_ is designed to provide you with the _recommended_ client
100
+ interfaces for the service. There will be only one main client for any given
101
+ service, even a service with multiple versions. The main client includes
102
+ factory methods for constructing the client objects we recommend for most
103
+ users. In some cases, those will be classes provided by an underlying versioned
104
+ client; in other cases, they will be handwritten higher-level client objects
105
+ with additional capabilities, convenience methods, or best practices built in.
106
+ Generally, the main client will default to a recommended service version,
107
+ although in some cases you can override this if you need to talk to a specific
108
+ service version.
109
+
110
+ ### Why would I want to use the main client?
111
+
112
+ We recommend that most users install the main client gem for a service. You can
113
+ identify this gem as the one _without_ a version in its name, e.g.
114
+ `google-cloud-tasks`.
115
+ The main client is recommended because it will embody the best practices for
116
+ accessing the service, and may also provide more convenient interfaces or
117
+ tighter integration into frameworks and third-party libraries. In addition, the
118
+ documentation and samples published by Google will generally demonstrate use of
119
+ the main client.
120
+
121
+ ### Why would I want to use a versioned client?
122
+
123
+ You can use a versioned client if you are content with a possibly lower-level
124
+ class interface, you explicitly want to avoid features provided by the main
125
+ client, or you want to access a specific service version not be covered by the
126
+ main client. You can identify versioned client gems because the service version
127
+ is part of the name, e.g. `google-cloud-tasks-v2`.
128
+
129
+ ### What about the google-apis-<name> clients?
130
+
131
+ Client library gems with names that begin with `google-apis-` are based on an
132
+ older code generation technology. They talk to a REST/JSON backend (whereas
133
+ most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may
134
+ not offer the same performance, features, and ease of use provided by more
135
+ modern clients.
136
+
137
+ The `google-apis-` clients have wide coverage across Google services, so you
138
+ might need to use one if there is no modern client available for the service.
139
+ However, if a modern client is available, we generally recommend it over the
140
+ older `google-apis-` clients.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2020 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,18 +14,6 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
15
18
 
16
- module Google
17
- module Protobuf
18
- # A generic empty message that you can re-use to avoid defining duplicated
19
- # empty messages in your APIs. A typical example is to use it as the request
20
- # or the response type of an API method. For instance:
21
- #
22
- # service Foo {
23
- # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
24
- # }
25
- #
26
- # The JSON representation for `Empty` is empty JSON object `{}`.
27
- class Empty; end
28
- end
29
- end
19
+ require "google/cloud/tasks" unless defined? Google::Cloud::Tasks::VERSION
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Copyright 2020 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,134 +14,103 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ # Require this file early so that the version constant gets defined before
20
+ # requiring "google/cloud". This is because google-cloud-core will load the
21
+ # entrypoint (gem name) file, which in turn re-requires this file (hence
22
+ # causing a require cycle) unless the version constant is already defined.
23
+ require "google/cloud/tasks/version"
24
+
25
+ require "googleauth"
26
+ gem "google-cloud-core"
27
+ require "google/cloud" unless defined? ::Google::Cloud.new
28
+ require "google/cloud/config"
15
29
 
16
- require "google/gax"
17
- require "pathname"
30
+ # Set the default configuration
31
+ ::Google::Cloud.configure.add_config! :tasks do |config|
32
+ config.add_field! :endpoint, "cloudtasks.googleapis.com", match: ::String
33
+ config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials]
34
+ config.add_field! :scope, nil, match: [::Array, ::String]
35
+ config.add_field! :lib_name, nil, match: ::String
36
+ config.add_field! :lib_version, nil, match: ::String
37
+ config.add_field! :interceptors, nil, match: ::Array
38
+ config.add_field! :timeout, nil, match: ::Numeric
39
+ config.add_field! :metadata, nil, match: ::Hash
40
+ config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
41
+ config.add_field! :quota_project, nil, match: ::String
42
+ end
18
43
 
19
44
  module Google
20
45
  module Cloud
21
- # rubocop:disable LineLength
22
-
23
- ##
24
- # # Ruby Client for Cloud Tasks API
25
- #
26
- # [Cloud Tasks API][Product Documentation]:
27
- # Manages the execution of large numbers of distributed requests.
28
- # - [Product Documentation][]
29
- #
30
- # ## Quick Start
31
- # In order to use this library, you first need to go through the following
32
- # steps:
33
- #
34
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
35
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
36
- # 3. [Enable the Cloud Tasks API.](https://console.cloud.google.com/apis/library/tasks.googleapis.com)
37
- # 4. [Setup Authentication.](https://googleapis.dev/ruby/google-cloud-tasks/latest/file.AUTHENTICATION.html)
38
- #
39
- # ### Installation
40
- # ```
41
- # $ gem install google-cloud-tasks
42
- # ```
43
- #
44
- # ### Next Steps
45
- # - Read the [Cloud Tasks API Product documentation][Product Documentation]
46
- # to learn more about the product and see How-to Guides.
47
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
48
- # to see the full list of Cloud APIs that we cover.
49
- #
50
- # [Product Documentation]: https://cloud.google.com/tasks
51
- #
52
- # ## Enabling Logging
53
- #
54
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
55
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
56
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
57
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
58
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
59
- #
60
- # Configuring a Ruby stdlib logger:
61
- #
62
- # ```ruby
63
- # require "logger"
64
- #
65
- # module MyLogger
66
- # LOGGER = Logger.new $stderr, level: Logger::WARN
67
- # def logger
68
- # LOGGER
69
- # end
70
- # end
71
- #
72
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
73
- # module GRPC
74
- # extend MyLogger
75
- # end
76
- # ```
77
- #
78
46
  module Tasks
79
- # rubocop:enable LineLength
80
-
81
- FILE_DIR = File.realdirpath(Pathname.new(__FILE__).join("..").join("tasks"))
82
-
83
- AVAILABLE_VERSIONS = Dir["#{FILE_DIR}/*"]
84
- .select { |file| File.directory?(file) }
85
- .select { |dir| Google::Gax::VERSION_MATCHER.match(File.basename(dir)) }
86
- .select { |dir| File.exist?(dir + ".rb") }
87
- .map { |dir| File.basename(dir) }
88
-
89
47
  ##
48
+ # Create a new client object for CloudTasks.
49
+ #
50
+ # By default, this returns an instance of
51
+ # [Google::Cloud::Tasks::V2::CloudTasks::Client](https://googleapis.dev/ruby/google-cloud-tasks-v2/latest/Google/Cloud/Tasks/V2/CloudTasks/Client.html)
52
+ # for version V2 of the API.
53
+ # However, you can specify specify a different API version by passing it in the
54
+ # `version` parameter. If the CloudTasks service is
55
+ # supported by that API version, and the corresponding gem is available, the
56
+ # appropriate versioned client will be returned.
57
+ #
58
+ # ## About CloudTasks
59
+ #
90
60
  # Cloud Tasks allows developers to manage the execution of background
91
61
  # work in their applications.
92
62
  #
93
- # @param version [Symbol, String]
94
- # The major version of the service to be used. By default :v2
95
- # is used.
96
- # @overload new(version:, credentials:, scopes:, client_config:, timeout:)
97
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
98
- # Provides the means for authenticating requests made by the client. This parameter can
99
- # be many types.
100
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
101
- # authenticating requests made by this client.
102
- # A `String` will be treated as the path to the keyfile to be used for the construction of
103
- # credentials for this client.
104
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
105
- # credentials for this client.
106
- # A `GRPC::Core::Channel` will be used to make calls through.
107
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
108
- # should already be composed with a `GRPC::Core::CallCredentials` object.
109
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
110
- # metadata for requests, generally, to give OAuth credentials.
111
- # @param scopes [Array<String>]
112
- # The OAuth scopes for this service. This parameter is ignored if
113
- # an updater_proc is supplied.
114
- # @param client_config [Hash]
115
- # A Hash for call options for each method. See
116
- # Google::Gax#construct_settings for the structure of
117
- # this data. Falls back to the default config if not specified
118
- # or the specified config is missing data points.
119
- # @param timeout [Numeric]
120
- # The default timeout, in seconds, for calls made through this client.
121
- # @param metadata [Hash]
122
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
123
- # @param service_address [String]
124
- # Override for the service hostname, or `nil` to leave as the default.
125
- # @param service_port [Integer]
126
- # Override for the service port, or `nil` to leave as the default.
127
- # @param exception_transformer [Proc]
128
- # An optional proc that intercepts any exceptions raised during an API call to inject
129
- # custom error handling.
130
- def self.new(*args, version: :v2, **kwargs)
131
- unless AVAILABLE_VERSIONS.include?(version.to_s.downcase)
132
- raise "The version: #{version} is not available. The available versions " \
133
- "are: [#{AVAILABLE_VERSIONS.join(", ")}]"
134
- end
63
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
64
+ # Defaults to `:v2`.
65
+ # @return [CloudTasks::Client] A client object for the specified version.
66
+ #
67
+ def self.cloud_tasks version: :v2, &block
68
+ require "google/cloud/tasks/#{version.to_s.downcase}"
69
+
70
+ package_name = Google::Cloud::Tasks
71
+ .constants
72
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
73
+ .first
74
+ package_module = Google::Cloud::Tasks.const_get package_name
75
+ package_module.const_get(:CloudTasks).const_get(:Client).new(&block)
76
+ end
77
+
78
+ ##
79
+ # Configure the google-cloud-tasks library.
80
+ #
81
+ # The following configuration parameters are supported:
82
+ #
83
+ # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
84
+ # The path to the keyfile as a String, the contents of the keyfile as a
85
+ # Hash, or a Google::Auth::Credentials object.
86
+ # * `lib_name` (*type:* `String`) -
87
+ # The library name as recorded in instrumentation and logging.
88
+ # * `lib_version` (*type:* `String`) -
89
+ # The library version as recorded in instrumentation and logging.
90
+ # * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
91
+ # An array of interceptors that are run before calls are executed.
92
+ # * `timeout` (*type:* `Numeric`) -
93
+ # Default timeout in seconds.
94
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) -
95
+ # Additional gRPC headers to be sent with the call.
96
+ # * `retry_policy` (*type:* `Hash`) -
97
+ # The retry policy. The value is a hash with the following keys:
98
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
99
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
100
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
101
+ # * `:retry_codes` (*type:* `Array<String>`) -
102
+ # The error codes that should trigger a retry.
103
+ #
104
+ # @return [::Google::Cloud::Config] The default configuration used by this library
105
+ #
106
+ def self.configure
107
+ yield ::Google::Cloud.configure.tasks if block_given?
135
108
 
136
- require "#{FILE_DIR}/#{version.to_s.downcase}"
137
- version_module = Google::Cloud::Tasks
138
- .constants
139
- .select {|sym| sym.to_s.downcase == version.to_s.downcase}
140
- .first
141
- Google::Cloud::Tasks.const_get(version_module).new(*args, **kwargs)
109
+ ::Google::Cloud.configure.tasks
142
110
  end
143
111
  end
144
112
  end
145
113
  end
114
+
115
+ helper_path = ::File.join __dir__, "tasks", "helpers.rb"
116
+ require "google/cloud/tasks/helpers" if ::File.file? helper_path
@@ -1,4 +1,6 @@
1
- # Copyright 2019 Google LLC
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
2
4
  #
3
5
  # Licensed under the Apache License, Version 2.0 (the "License");
4
6
  # you may not use this file except in compliance with the License.
@@ -12,11 +14,13 @@
12
14
  # See the License for the specific language governing permissions and
13
15
  # limitations under the License.
14
16
 
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
15
19
 
16
20
  module Google
17
21
  module Cloud
18
22
  module Tasks
19
- VERSION = "1.5.1".freeze
23
+ VERSION = "2.1.3"
20
24
  end
21
25
  end
22
26
  end
metadata CHANGED
@@ -1,125 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: google-gax
14
+ name: google-cloud-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
- name: googleapis-common-protos
28
+ name: google-cloud-tasks-v2
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.3.9
34
- - - "<"
31
+ - - "~>"
35
32
  - !ruby/object:Gem::Version
36
- version: '2.0'
33
+ version: '0.0'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.3.9
44
- - - "<"
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '2.0'
40
+ version: '0.0'
47
41
  - !ruby/object:Gem::Dependency
48
- name: googleapis-common-protos-types
42
+ name: google-cloud-tasks-v2beta2
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: 1.0.4
54
- - - "<"
45
+ - - "~>"
55
46
  - !ruby/object:Gem::Version
56
- version: '2.0'
47
+ version: '0.0'
57
48
  type: :runtime
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: 1.0.4
64
- - - "<"
52
+ - - "~>"
65
53
  - !ruby/object:Gem::Version
66
- version: '2.0'
54
+ version: '0.0'
67
55
  - !ruby/object:Gem::Dependency
68
- name: grpc-google-iam-v1
56
+ name: google-cloud-tasks-v2beta3
69
57
  requirement: !ruby/object:Gem::Requirement
70
58
  requirements:
71
59
  - - "~>"
72
60
  - !ruby/object:Gem::Version
73
- version: 0.6.9
61
+ version: '0.0'
74
62
  type: :runtime
75
63
  prerelease: false
76
64
  version_requirements: !ruby/object:Gem::Requirement
77
65
  requirements:
78
66
  - - "~>"
79
67
  - !ruby/object:Gem::Version
80
- version: 0.6.9
68
+ version: '0.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: google-style
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.24.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.24.0
81
83
  - !ruby/object:Gem::Dependency
82
84
  name: minitest
83
85
  requirement: !ruby/object:Gem::Requirement
84
86
  requirements:
85
87
  - - "~>"
86
88
  - !ruby/object:Gem::Version
87
- version: '5.10'
89
+ version: '5.14'
88
90
  type: :development
89
91
  prerelease: false
90
92
  version_requirements: !ruby/object:Gem::Requirement
91
93
  requirements:
92
94
  - - "~>"
93
95
  - !ruby/object:Gem::Version
94
- version: '5.10'
96
+ version: '5.14'
95
97
  - !ruby/object:Gem::Dependency
96
- name: redcarpet
98
+ name: minitest-focus
97
99
  requirement: !ruby/object:Gem::Requirement
98
100
  requirements:
99
101
  - - "~>"
100
102
  - !ruby/object:Gem::Version
101
- version: '3.0'
103
+ version: '1.1'
102
104
  type: :development
103
105
  prerelease: false
104
106
  version_requirements: !ruby/object:Gem::Requirement
105
107
  requirements:
106
108
  - - "~>"
107
109
  - !ruby/object:Gem::Version
108
- version: '3.0'
110
+ version: '1.1'
109
111
  - !ruby/object:Gem::Dependency
110
- name: google-style
112
+ name: minitest-rg
111
113
  requirement: !ruby/object:Gem::Requirement
112
114
  requirements:
113
115
  - - "~>"
114
116
  - !ruby/object:Gem::Version
115
- version: 1.24.0
117
+ version: '5.2'
116
118
  type: :development
117
119
  prerelease: false
118
120
  version_requirements: !ruby/object:Gem::Requirement
119
121
  requirements:
120
122
  - - "~>"
121
123
  - !ruby/object:Gem::Version
122
- version: 1.24.0
124
+ version: '5.2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rake
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '12.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '12.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: redcarpet
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.0'
123
153
  - !ruby/object:Gem::Dependency
124
154
  name: simplecov
125
155
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +178,10 @@ dependencies:
148
178
  - - "~>"
149
179
  - !ruby/object:Gem::Version
150
180
  version: '0.9'
151
- description: google-cloud-tasks is the official library for Cloud Tasks API.
181
+ description: Cloud Tasks is a fully managed service that allows you to manage the
182
+ execution, dispatch and delivery of a large number of distributed tasks. You can
183
+ asynchronously perform work outside of a user request. Your tasks can be executed
184
+ on App Engine or any arbitrary HTTP endpoint.
152
185
  email: googleapis-packages@google.com
153
186
  executables: []
154
187
  extensions: []
@@ -156,83 +189,13 @@ extra_rdoc_files: []
156
189
  files:
157
190
  - ".yardopts"
158
191
  - AUTHENTICATION.md
159
- - LICENSE
192
+ - LICENSE.md
193
+ - MIGRATING.md
160
194
  - README.md
195
+ - lib/google-cloud-tasks.rb
161
196
  - lib/google/cloud/tasks.rb
162
- - lib/google/cloud/tasks/v2.rb
163
- - lib/google/cloud/tasks/v2/cloud_tasks_client.rb
164
- - lib/google/cloud/tasks/v2/cloud_tasks_client_config.json
165
- - lib/google/cloud/tasks/v2/cloudtasks_pb.rb
166
- - lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb
167
- - lib/google/cloud/tasks/v2/credentials.rb
168
- - lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/cloudtasks.rb
169
- - lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/queue.rb
170
- - lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/target.rb
171
- - lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/task.rb
172
- - lib/google/cloud/tasks/v2/doc/google/iam/v1/iam_policy.rb
173
- - lib/google/cloud/tasks/v2/doc/google/iam/v1/options.rb
174
- - lib/google/cloud/tasks/v2/doc/google/iam/v1/policy.rb
175
- - lib/google/cloud/tasks/v2/doc/google/protobuf/any.rb
176
- - lib/google/cloud/tasks/v2/doc/google/protobuf/duration.rb
177
- - lib/google/cloud/tasks/v2/doc/google/protobuf/empty.rb
178
- - lib/google/cloud/tasks/v2/doc/google/protobuf/field_mask.rb
179
- - lib/google/cloud/tasks/v2/doc/google/protobuf/timestamp.rb
180
- - lib/google/cloud/tasks/v2/doc/google/rpc/status.rb
181
- - lib/google/cloud/tasks/v2/doc/google/type/expr.rb
182
- - lib/google/cloud/tasks/v2/helpers.rb
183
- - lib/google/cloud/tasks/v2/queue_pb.rb
184
- - lib/google/cloud/tasks/v2/target_pb.rb
185
- - lib/google/cloud/tasks/v2/task_pb.rb
186
- - lib/google/cloud/tasks/v2beta2.rb
187
- - lib/google/cloud/tasks/v2beta2/cloud_tasks_client.rb
188
- - lib/google/cloud/tasks/v2beta2/cloud_tasks_client_config.json
189
- - lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb
190
- - lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb
191
- - lib/google/cloud/tasks/v2beta2/credentials.rb
192
- - lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/cloudtasks.rb
193
- - lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/queue.rb
194
- - lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/target.rb
195
- - lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/task.rb
196
- - lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/iam_policy.rb
197
- - lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/options.rb
198
- - lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/policy.rb
199
- - lib/google/cloud/tasks/v2beta2/doc/google/protobuf/any.rb
200
- - lib/google/cloud/tasks/v2beta2/doc/google/protobuf/duration.rb
201
- - lib/google/cloud/tasks/v2beta2/doc/google/protobuf/empty.rb
202
- - lib/google/cloud/tasks/v2beta2/doc/google/protobuf/field_mask.rb
203
- - lib/google/cloud/tasks/v2beta2/doc/google/protobuf/timestamp.rb
204
- - lib/google/cloud/tasks/v2beta2/doc/google/rpc/status.rb
205
- - lib/google/cloud/tasks/v2beta2/doc/google/type/expr.rb
206
- - lib/google/cloud/tasks/v2beta2/helpers.rb
207
- - lib/google/cloud/tasks/v2beta2/queue_pb.rb
208
- - lib/google/cloud/tasks/v2beta2/target_pb.rb
209
- - lib/google/cloud/tasks/v2beta2/task_pb.rb
210
- - lib/google/cloud/tasks/v2beta3.rb
211
- - lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb
212
- - lib/google/cloud/tasks/v2beta3/cloud_tasks_client_config.json
213
- - lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb
214
- - lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb
215
- - lib/google/cloud/tasks/v2beta3/credentials.rb
216
- - lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/cloudtasks.rb
217
- - lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/queue.rb
218
- - lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/target.rb
219
- - lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/task.rb
220
- - lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/iam_policy.rb
221
- - lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/options.rb
222
- - lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/policy.rb
223
- - lib/google/cloud/tasks/v2beta3/doc/google/protobuf/any.rb
224
- - lib/google/cloud/tasks/v2beta3/doc/google/protobuf/duration.rb
225
- - lib/google/cloud/tasks/v2beta3/doc/google/protobuf/empty.rb
226
- - lib/google/cloud/tasks/v2beta3/doc/google/protobuf/field_mask.rb
227
- - lib/google/cloud/tasks/v2beta3/doc/google/protobuf/timestamp.rb
228
- - lib/google/cloud/tasks/v2beta3/doc/google/rpc/status.rb
229
- - lib/google/cloud/tasks/v2beta3/doc/google/type/expr.rb
230
- - lib/google/cloud/tasks/v2beta3/helpers.rb
231
- - lib/google/cloud/tasks/v2beta3/queue_pb.rb
232
- - lib/google/cloud/tasks/v2beta3/target_pb.rb
233
- - lib/google/cloud/tasks/v2beta3/task_pb.rb
234
197
  - lib/google/cloud/tasks/version.rb
235
- homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-tasks
198
+ homepage: https://github.com/googleapis/google-cloud-ruby
236
199
  licenses:
237
200
  - Apache-2.0
238
201
  metadata: {}
@@ -251,8 +214,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
214
  - !ruby/object:Gem::Version
252
215
  version: '0'
253
216
  requirements: []
254
- rubygems_version: 3.0.6
217
+ rubygems_version: 3.2.6
255
218
  signing_key:
256
219
  specification_version: 4
257
- summary: API Client library for Cloud Tasks API
220
+ summary: API Client library for the Cloud Tasks API
258
221
  test_files: []