google-cloud-tasks 0.7.0 → 0.7.1
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 +4 -4
- data/.yardopts +2 -0
- data/AUTHENTICATION.md +199 -0
- data/lib/google/cloud/tasks/v2/cloud_tasks_client.rb +15 -15
- data/lib/google/cloud/tasks/v2/doc/google/protobuf/any.rb +2 -1
- data/lib/google/cloud/tasks/v2/doc/google/protobuf/field_mask.rb +18 -26
- data/lib/google/cloud/tasks/v2/doc/google/protobuf/timestamp.rb +15 -13
- data/lib/google/cloud/tasks/v2beta2/cloud_tasks_client.rb +15 -15
- data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/any.rb +2 -1
- data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/field_mask.rb +18 -26
- data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/timestamp.rb +15 -13
- data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb +15 -15
- data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/any.rb +2 -1
- data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/field_mask.rb +18 -26
- data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/timestamp.rb +15 -13
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7e42c029deb06246e3db6fad541287255f1a8aee3e204b0770069d513425b9
|
4
|
+
data.tar.gz: cb4ac480bcb37ce8cf4a50303be16be5b55609c93414566c9cac274e0bdd4f91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e511bc420bced872e0404e69bdf289ee275094622352e33247f343159f707c574ce7c630cf94edaf01706ea45f0980401e6b36349e7df9f332f02e2fea96a04b
|
7
|
+
data.tar.gz: 7f014699dd95d6d5c003f2b370c9e504bcbd54580f59118520114e783014693919507d61e53bd2b99d5be7596a38664dabd9c9f56284f07274e64ba2a0802122
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
# Authentication
|
2
|
+
|
3
|
+
In general, the google-cloud-tasks library uses [Service
|
4
|
+
Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
|
5
|
+
credentials to connect to Google Cloud services. When running within [Google
|
6
|
+
Cloud Platform environments](#google-cloud-platform-environments)
|
7
|
+
the credentials will be discovered automatically. When running on other
|
8
|
+
environments, the Service Account credentials can be specified by providing the
|
9
|
+
path to the [JSON
|
10
|
+
keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for
|
11
|
+
the account (or the JSON itself) in [environment
|
12
|
+
variables](#environment-variables). Additionally, Cloud SDK credentials can also
|
13
|
+
be discovered automatically, but this is only recommended during development.
|
14
|
+
|
15
|
+
## Quickstart
|
16
|
+
|
17
|
+
1. [Create a service account and credentials](#creating-a-service-account).
|
18
|
+
2. Set the [environment variable](#environment-variables).
|
19
|
+
|
20
|
+
```sh
|
21
|
+
export TASKS_CREDENTIALS=/path/to/json`
|
22
|
+
```
|
23
|
+
|
24
|
+
3. Initialize the client.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
require "google/cloud/tasks"
|
28
|
+
|
29
|
+
client = Google::Cloud::Tasks.new
|
30
|
+
```
|
31
|
+
|
32
|
+
## Project and Credential Lookup
|
33
|
+
|
34
|
+
The google-cloud-tasks library aims to make authentication
|
35
|
+
as simple as possible, and provides several mechanisms to configure your system
|
36
|
+
without providing **Project ID** and **Service Account Credentials** directly in
|
37
|
+
code.
|
38
|
+
|
39
|
+
**Project ID** is discovered in the following order:
|
40
|
+
|
41
|
+
1. Specify project ID in method arguments
|
42
|
+
2. Specify project ID in configuration
|
43
|
+
3. Discover project ID in environment variables
|
44
|
+
4. Discover GCE project ID
|
45
|
+
5. Discover project ID in credentials JSON
|
46
|
+
|
47
|
+
**Credentials** are discovered in the following order:
|
48
|
+
|
49
|
+
1. Specify credentials in method arguments
|
50
|
+
2. Specify credentials in configuration
|
51
|
+
3. Discover credentials path in environment variables
|
52
|
+
4. Discover credentials JSON in environment variables
|
53
|
+
5. Discover credentials file in the Cloud SDK's path
|
54
|
+
6. Discover GCE credentials
|
55
|
+
|
56
|
+
### Google Cloud Platform environments
|
57
|
+
|
58
|
+
While running on Google Cloud Platform environments such as Google Compute
|
59
|
+
Engine, Google App Engine and Google Kubernetes Engine, no extra work is needed.
|
60
|
+
The **Project ID** and **Credentials** and are discovered automatically. Code
|
61
|
+
should be written as if already authenticated. Just be sure when you [set up the
|
62
|
+
GCE instance][gce-how-to], you add the correct scopes for the APIs you want to
|
63
|
+
access. For example:
|
64
|
+
|
65
|
+
* **All APIs**
|
66
|
+
* `https://www.googleapis.com/auth/cloud-platform`
|
67
|
+
* `https://www.googleapis.com/auth/cloud-platform.read-only`
|
68
|
+
* **BigQuery**
|
69
|
+
* `https://www.googleapis.com/auth/bigquery`
|
70
|
+
* `https://www.googleapis.com/auth/bigquery.insertdata`
|
71
|
+
* **Compute Engine**
|
72
|
+
* `https://www.googleapis.com/auth/compute`
|
73
|
+
* **Datastore**
|
74
|
+
* `https://www.googleapis.com/auth/datastore`
|
75
|
+
* `https://www.googleapis.com/auth/userinfo.email`
|
76
|
+
* **DNS**
|
77
|
+
* `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
|
78
|
+
* **Pub/Sub**
|
79
|
+
* `https://www.googleapis.com/auth/pubsub`
|
80
|
+
* **Storage**
|
81
|
+
* `https://www.googleapis.com/auth/devstorage.full_control`
|
82
|
+
* `https://www.googleapis.com/auth/devstorage.read_only`
|
83
|
+
* `https://www.googleapis.com/auth/devstorage.read_write`
|
84
|
+
|
85
|
+
### Environment Variables
|
86
|
+
|
87
|
+
The **Project ID** and **Credentials JSON** can be placed in environment
|
88
|
+
variables instead of declaring them directly in code. Each service has its own
|
89
|
+
environment variable, allowing for different service accounts to be used for
|
90
|
+
different services. (See the READMEs for the individual service gems for
|
91
|
+
details.) The path to the **Credentials JSON** file can be stored in the
|
92
|
+
environment variable, or the **Credentials JSON** itself can be stored for
|
93
|
+
environments such as Docker containers where writing files is difficult or not
|
94
|
+
encouraged.
|
95
|
+
|
96
|
+
The environment variables that google-cloud-tasks checks for project ID are:
|
97
|
+
|
98
|
+
1. `TASKS_PROJECT`
|
99
|
+
2. `GOOGLE_CLOUD_PROJECT`
|
100
|
+
|
101
|
+
The environment variables that google-cloud-tasks checks for credentials are configured on {Google::Cloud::Tasks::V2::Credentials}:
|
102
|
+
|
103
|
+
1. `TASKS_CREDENTIALS` - Path to JSON file, or JSON contents
|
104
|
+
2. `TASKS_KEYFILE` - Path to JSON file, or JSON contents
|
105
|
+
3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
106
|
+
4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
107
|
+
5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
108
|
+
|
109
|
+
```ruby
|
110
|
+
require "google/cloud/tasks"
|
111
|
+
|
112
|
+
ENV["TASKS_PROJECT"] = "my-project-id"
|
113
|
+
ENV["TASKS_CREDENTIALS"] = "path/to/keyfile.json"
|
114
|
+
|
115
|
+
client = Google::Cloud::Tasks.new
|
116
|
+
```
|
117
|
+
|
118
|
+
### Configuration
|
119
|
+
|
120
|
+
The **Project ID** and **Credentials JSON** can be configured instead of placing them in environment variables or providing them as arguments.
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
require "google/cloud/tasks"
|
124
|
+
|
125
|
+
Google::Cloud::Tasks.configure do |config|
|
126
|
+
config.project_id = "my-project-id"
|
127
|
+
config.credentials = "path/to/keyfile.json"
|
128
|
+
end
|
129
|
+
|
130
|
+
client = Google::Cloud::Tasks.new
|
131
|
+
```
|
132
|
+
|
133
|
+
### Cloud SDK
|
134
|
+
|
135
|
+
This option allows for an easy way to authenticate during development. If
|
136
|
+
credentials are not provided in code or in environment variables, then Cloud SDK
|
137
|
+
credentials are discovered.
|
138
|
+
|
139
|
+
To configure your system for this, simply:
|
140
|
+
|
141
|
+
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
142
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
143
|
+
3. Write code as if already authenticated.
|
144
|
+
|
145
|
+
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
146
|
+
*should* only be used during development.
|
147
|
+
|
148
|
+
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
149
|
+
[dev-console]: https://console.cloud.google.com/project
|
150
|
+
|
151
|
+
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
152
|
+
|
153
|
+
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
154
|
+
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
155
|
+
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
156
|
+
|
157
|
+
## Creating a Service Account
|
158
|
+
|
159
|
+
Google Cloud requires a **Project ID** and **Service Account Credentials** to
|
160
|
+
connect to the APIs. You will use the **Project ID** and **JSON key file** to
|
161
|
+
connect to most services with google-cloud-tasks.
|
162
|
+
|
163
|
+
If you are not running this client within [Google Cloud Platform
|
164
|
+
environments](#google-cloud-platform-environments), you need a Google
|
165
|
+
Developers service account.
|
166
|
+
|
167
|
+
1. Visit the [Google Developers Console][dev-console].
|
168
|
+
1. Create a new project or click on an existing project.
|
169
|
+
1. Activate the slide-out navigation tray and select **API Manager**. From
|
170
|
+
here, you will enable the APIs that your application requires.
|
171
|
+
|
172
|
+
![Enable the APIs that your application requires][enable-apis]
|
173
|
+
|
174
|
+
*Note: You may need to enable billing in order to use these services.*
|
175
|
+
|
176
|
+
1. Select **Credentials** from the side navigation.
|
177
|
+
|
178
|
+
You should see a screen like one of the following.
|
179
|
+
|
180
|
+
![Create a new service account][create-new-service-account]
|
181
|
+
|
182
|
+
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
183
|
+
|
184
|
+
Find the "Add credentials" drop down and select "Service account" to be
|
185
|
+
guided through downloading a new JSON key file.
|
186
|
+
|
187
|
+
If you want to re-use an existing service account, you can easily generate a
|
188
|
+
new key file. Just select the account you wish to re-use, and click "Generate
|
189
|
+
new JSON key":
|
190
|
+
|
191
|
+
![Re-use an existing service account][reuse-service-account]
|
192
|
+
|
193
|
+
The key file you download will be used by this library to authenticate API
|
194
|
+
requests and should be stored in a secure location.
|
195
|
+
|
196
|
+
## Troubleshooting
|
197
|
+
|
198
|
+
If you're having trouble authenticating you can ask for help by following the
|
199
|
+
{file:TROUBLESHOOTING.md Troubleshooting Guide}.
|
@@ -72,18 +72,18 @@ module Google
|
|
72
72
|
].freeze
|
73
73
|
|
74
74
|
|
75
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
76
|
-
"projects/{project}"
|
77
|
-
)
|
78
|
-
|
79
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
80
|
-
|
81
75
|
LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
76
|
"projects/{project}/locations/{location}"
|
83
77
|
)
|
84
78
|
|
85
79
|
private_constant :LOCATION_PATH_TEMPLATE
|
86
80
|
|
81
|
+
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
|
+
"projects/{project}"
|
83
|
+
)
|
84
|
+
|
85
|
+
private_constant :PROJECT_PATH_TEMPLATE
|
86
|
+
|
87
87
|
QUEUE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
88
88
|
"projects/{project}/locations/{location}/queues/{queue}"
|
89
89
|
)
|
@@ -96,15 +96,6 @@ module Google
|
|
96
96
|
|
97
97
|
private_constant :TASK_PATH_TEMPLATE
|
98
98
|
|
99
|
-
# Returns a fully-qualified project resource name string.
|
100
|
-
# @param project [String]
|
101
|
-
# @return [String]
|
102
|
-
def self.project_path project
|
103
|
-
PROJECT_PATH_TEMPLATE.render(
|
104
|
-
:"project" => project
|
105
|
-
)
|
106
|
-
end
|
107
|
-
|
108
99
|
# Returns a fully-qualified location resource name string.
|
109
100
|
# @param project [String]
|
110
101
|
# @param location [String]
|
@@ -116,6 +107,15 @@ module Google
|
|
116
107
|
)
|
117
108
|
end
|
118
109
|
|
110
|
+
# Returns a fully-qualified project resource name string.
|
111
|
+
# @param project [String]
|
112
|
+
# @return [String]
|
113
|
+
def self.project_path project
|
114
|
+
PROJECT_PATH_TEMPLATE.render(
|
115
|
+
:"project" => project
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
119
|
# Returns a fully-qualified queue resource name string.
|
120
120
|
# @param project [String]
|
121
121
|
# @param location [String]
|
@@ -97,7 +97,8 @@ module Google
|
|
97
97
|
# @!attribute [rw] type_url
|
98
98
|
# @return [String]
|
99
99
|
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
-
# protocol buffer message.
|
100
|
+
# protocol buffer message. This string must contain at least
|
101
|
+
# one "/" character. The last segment of the URL's path must represent
|
101
102
|
# the fully qualified name of the type (as in
|
102
103
|
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
103
104
|
# (e.g., leading "." is not accepted).
|
@@ -83,57 +83,49 @@ module Google
|
|
83
83
|
# describe the updated values, the API ignores the values of all
|
84
84
|
# fields not covered by the mask.
|
85
85
|
#
|
86
|
-
# If a repeated field is specified for an update operation,
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# string.
|
86
|
+
# If a repeated field is specified for an update operation, new values will
|
87
|
+
# be appended to the existing repeated field in the target resource. Note that
|
88
|
+
# a repeated field is only allowed in the last position of a `paths` string.
|
90
89
|
#
|
91
90
|
# If a sub-message is specified in the last position of the field mask for an
|
92
|
-
# update operation, then the existing sub-message
|
93
|
-
#
|
91
|
+
# update operation, then new value will be merged into the existing sub-message
|
92
|
+
# in the target resource.
|
93
|
+
#
|
94
|
+
# For example, given the target message:
|
94
95
|
#
|
95
96
|
# f {
|
96
97
|
# b {
|
97
|
-
# d
|
98
|
-
# x
|
98
|
+
# d: 1
|
99
|
+
# x: 2
|
99
100
|
# }
|
100
|
-
# c
|
101
|
+
# c: [1]
|
101
102
|
# }
|
102
103
|
#
|
103
104
|
# And an update message:
|
104
105
|
#
|
105
106
|
# f {
|
106
107
|
# b {
|
107
|
-
# d
|
108
|
+
# d: 10
|
108
109
|
# }
|
110
|
+
# c: [2]
|
109
111
|
# }
|
110
112
|
#
|
111
113
|
# then if the field mask is:
|
112
114
|
#
|
113
|
-
# paths: "f.b"
|
115
|
+
# paths: ["f.b", "f.c"]
|
114
116
|
#
|
115
117
|
# then the result will be:
|
116
118
|
#
|
117
119
|
# f {
|
118
120
|
# b {
|
119
|
-
# d
|
121
|
+
# d: 10
|
122
|
+
# x: 2
|
120
123
|
# }
|
121
|
-
# c
|
124
|
+
# c: [1, 2]
|
122
125
|
# }
|
123
126
|
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# paths: "f.b.d"
|
127
|
-
#
|
128
|
-
# then the result would be:
|
129
|
-
#
|
130
|
-
# f {
|
131
|
-
# b {
|
132
|
-
# d : 10
|
133
|
-
# x : 2
|
134
|
-
# }
|
135
|
-
# c : 1
|
136
|
-
# }
|
127
|
+
# An implementation may provide options to override this default behavior for
|
128
|
+
# repeated and message fields.
|
137
129
|
#
|
138
130
|
# In order to reset a field's value to the default, the field must
|
139
131
|
# be in the mask and set to the default value in the provided resource.
|
@@ -15,17 +15,19 @@
|
|
15
15
|
|
16
16
|
module Google
|
17
17
|
module Protobuf
|
18
|
-
# A Timestamp represents a point in time independent of any time zone
|
19
|
-
#
|
20
|
-
# nanosecond resolution
|
21
|
-
#
|
22
|
-
# backwards to year one.
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
18
|
+
# A Timestamp represents a point in time independent of any time zone or local
|
19
|
+
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
+
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
+
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
+
# Gregorian calendar backwards to year one.
|
23
|
+
#
|
24
|
+
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
+
# second table is needed for interpretation, using a [24-hour linear
|
26
|
+
# smear](https://developers.google.com/time/smear).
|
27
|
+
#
|
28
|
+
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
+
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
+
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
29
31
|
#
|
30
32
|
# = Examples
|
31
33
|
#
|
@@ -86,12 +88,12 @@ module Google
|
|
86
88
|
# 01:30 UTC on January 15, 2017.
|
87
89
|
#
|
88
90
|
# In JavaScript, one can convert a Date object to this format using the
|
89
|
-
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
91
|
+
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
90
92
|
# method. In Python, a standard `datetime.datetime` object can be converted
|
91
93
|
# to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
92
94
|
# with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
93
95
|
# can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
94
|
-
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime
|
96
|
+
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
95
97
|
# ) to obtain a formatter capable of generating timestamps in this format.
|
96
98
|
# @!attribute [rw] seconds
|
97
99
|
# @return [Integer]
|
@@ -72,18 +72,18 @@ module Google
|
|
72
72
|
].freeze
|
73
73
|
|
74
74
|
|
75
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
76
|
-
"projects/{project}"
|
77
|
-
)
|
78
|
-
|
79
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
80
|
-
|
81
75
|
LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
76
|
"projects/{project}/locations/{location}"
|
83
77
|
)
|
84
78
|
|
85
79
|
private_constant :LOCATION_PATH_TEMPLATE
|
86
80
|
|
81
|
+
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
|
+
"projects/{project}"
|
83
|
+
)
|
84
|
+
|
85
|
+
private_constant :PROJECT_PATH_TEMPLATE
|
86
|
+
|
87
87
|
QUEUE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
88
88
|
"projects/{project}/locations/{location}/queues/{queue}"
|
89
89
|
)
|
@@ -96,15 +96,6 @@ module Google
|
|
96
96
|
|
97
97
|
private_constant :TASK_PATH_TEMPLATE
|
98
98
|
|
99
|
-
# Returns a fully-qualified project resource name string.
|
100
|
-
# @param project [String]
|
101
|
-
# @return [String]
|
102
|
-
def self.project_path project
|
103
|
-
PROJECT_PATH_TEMPLATE.render(
|
104
|
-
:"project" => project
|
105
|
-
)
|
106
|
-
end
|
107
|
-
|
108
99
|
# Returns a fully-qualified location resource name string.
|
109
100
|
# @param project [String]
|
110
101
|
# @param location [String]
|
@@ -116,6 +107,15 @@ module Google
|
|
116
107
|
)
|
117
108
|
end
|
118
109
|
|
110
|
+
# Returns a fully-qualified project resource name string.
|
111
|
+
# @param project [String]
|
112
|
+
# @return [String]
|
113
|
+
def self.project_path project
|
114
|
+
PROJECT_PATH_TEMPLATE.render(
|
115
|
+
:"project" => project
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
119
|
# Returns a fully-qualified queue resource name string.
|
120
120
|
# @param project [String]
|
121
121
|
# @param location [String]
|
@@ -97,7 +97,8 @@ module Google
|
|
97
97
|
# @!attribute [rw] type_url
|
98
98
|
# @return [String]
|
99
99
|
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
-
# protocol buffer message.
|
100
|
+
# protocol buffer message. This string must contain at least
|
101
|
+
# one "/" character. The last segment of the URL's path must represent
|
101
102
|
# the fully qualified name of the type (as in
|
102
103
|
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
103
104
|
# (e.g., leading "." is not accepted).
|
@@ -83,57 +83,49 @@ module Google
|
|
83
83
|
# describe the updated values, the API ignores the values of all
|
84
84
|
# fields not covered by the mask.
|
85
85
|
#
|
86
|
-
# If a repeated field is specified for an update operation,
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# string.
|
86
|
+
# If a repeated field is specified for an update operation, new values will
|
87
|
+
# be appended to the existing repeated field in the target resource. Note that
|
88
|
+
# a repeated field is only allowed in the last position of a `paths` string.
|
90
89
|
#
|
91
90
|
# If a sub-message is specified in the last position of the field mask for an
|
92
|
-
# update operation, then the existing sub-message
|
93
|
-
#
|
91
|
+
# update operation, then new value will be merged into the existing sub-message
|
92
|
+
# in the target resource.
|
93
|
+
#
|
94
|
+
# For example, given the target message:
|
94
95
|
#
|
95
96
|
# f {
|
96
97
|
# b {
|
97
|
-
# d
|
98
|
-
# x
|
98
|
+
# d: 1
|
99
|
+
# x: 2
|
99
100
|
# }
|
100
|
-
# c
|
101
|
+
# c: [1]
|
101
102
|
# }
|
102
103
|
#
|
103
104
|
# And an update message:
|
104
105
|
#
|
105
106
|
# f {
|
106
107
|
# b {
|
107
|
-
# d
|
108
|
+
# d: 10
|
108
109
|
# }
|
110
|
+
# c: [2]
|
109
111
|
# }
|
110
112
|
#
|
111
113
|
# then if the field mask is:
|
112
114
|
#
|
113
|
-
# paths: "f.b"
|
115
|
+
# paths: ["f.b", "f.c"]
|
114
116
|
#
|
115
117
|
# then the result will be:
|
116
118
|
#
|
117
119
|
# f {
|
118
120
|
# b {
|
119
|
-
# d
|
121
|
+
# d: 10
|
122
|
+
# x: 2
|
120
123
|
# }
|
121
|
-
# c
|
124
|
+
# c: [1, 2]
|
122
125
|
# }
|
123
126
|
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# paths: "f.b.d"
|
127
|
-
#
|
128
|
-
# then the result would be:
|
129
|
-
#
|
130
|
-
# f {
|
131
|
-
# b {
|
132
|
-
# d : 10
|
133
|
-
# x : 2
|
134
|
-
# }
|
135
|
-
# c : 1
|
136
|
-
# }
|
127
|
+
# An implementation may provide options to override this default behavior for
|
128
|
+
# repeated and message fields.
|
137
129
|
#
|
138
130
|
# In order to reset a field's value to the default, the field must
|
139
131
|
# be in the mask and set to the default value in the provided resource.
|
@@ -15,17 +15,19 @@
|
|
15
15
|
|
16
16
|
module Google
|
17
17
|
module Protobuf
|
18
|
-
# A Timestamp represents a point in time independent of any time zone
|
19
|
-
#
|
20
|
-
# nanosecond resolution
|
21
|
-
#
|
22
|
-
# backwards to year one.
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
18
|
+
# A Timestamp represents a point in time independent of any time zone or local
|
19
|
+
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
+
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
+
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
+
# Gregorian calendar backwards to year one.
|
23
|
+
#
|
24
|
+
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
+
# second table is needed for interpretation, using a [24-hour linear
|
26
|
+
# smear](https://developers.google.com/time/smear).
|
27
|
+
#
|
28
|
+
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
+
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
+
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
29
31
|
#
|
30
32
|
# = Examples
|
31
33
|
#
|
@@ -86,12 +88,12 @@ module Google
|
|
86
88
|
# 01:30 UTC on January 15, 2017.
|
87
89
|
#
|
88
90
|
# In JavaScript, one can convert a Date object to this format using the
|
89
|
-
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
91
|
+
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
90
92
|
# method. In Python, a standard `datetime.datetime` object can be converted
|
91
93
|
# to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
92
94
|
# with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
93
95
|
# can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
94
|
-
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime
|
96
|
+
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
95
97
|
# ) to obtain a formatter capable of generating timestamps in this format.
|
96
98
|
# @!attribute [rw] seconds
|
97
99
|
# @return [Integer]
|
@@ -72,18 +72,18 @@ module Google
|
|
72
72
|
].freeze
|
73
73
|
|
74
74
|
|
75
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
76
|
-
"projects/{project}"
|
77
|
-
)
|
78
|
-
|
79
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
80
|
-
|
81
75
|
LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
76
|
"projects/{project}/locations/{location}"
|
83
77
|
)
|
84
78
|
|
85
79
|
private_constant :LOCATION_PATH_TEMPLATE
|
86
80
|
|
81
|
+
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
82
|
+
"projects/{project}"
|
83
|
+
)
|
84
|
+
|
85
|
+
private_constant :PROJECT_PATH_TEMPLATE
|
86
|
+
|
87
87
|
QUEUE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
88
88
|
"projects/{project}/locations/{location}/queues/{queue}"
|
89
89
|
)
|
@@ -96,15 +96,6 @@ module Google
|
|
96
96
|
|
97
97
|
private_constant :TASK_PATH_TEMPLATE
|
98
98
|
|
99
|
-
# Returns a fully-qualified project resource name string.
|
100
|
-
# @param project [String]
|
101
|
-
# @return [String]
|
102
|
-
def self.project_path project
|
103
|
-
PROJECT_PATH_TEMPLATE.render(
|
104
|
-
:"project" => project
|
105
|
-
)
|
106
|
-
end
|
107
|
-
|
108
99
|
# Returns a fully-qualified location resource name string.
|
109
100
|
# @param project [String]
|
110
101
|
# @param location [String]
|
@@ -116,6 +107,15 @@ module Google
|
|
116
107
|
)
|
117
108
|
end
|
118
109
|
|
110
|
+
# Returns a fully-qualified project resource name string.
|
111
|
+
# @param project [String]
|
112
|
+
# @return [String]
|
113
|
+
def self.project_path project
|
114
|
+
PROJECT_PATH_TEMPLATE.render(
|
115
|
+
:"project" => project
|
116
|
+
)
|
117
|
+
end
|
118
|
+
|
119
119
|
# Returns a fully-qualified queue resource name string.
|
120
120
|
# @param project [String]
|
121
121
|
# @param location [String]
|
@@ -97,7 +97,8 @@ module Google
|
|
97
97
|
# @!attribute [rw] type_url
|
98
98
|
# @return [String]
|
99
99
|
# A URL/resource name that uniquely identifies the type of the serialized
|
100
|
-
# protocol buffer message.
|
100
|
+
# protocol buffer message. This string must contain at least
|
101
|
+
# one "/" character. The last segment of the URL's path must represent
|
101
102
|
# the fully qualified name of the type (as in
|
102
103
|
# `path/google.protobuf.Duration`). The name should be in a canonical form
|
103
104
|
# (e.g., leading "." is not accepted).
|
@@ -83,57 +83,49 @@ module Google
|
|
83
83
|
# describe the updated values, the API ignores the values of all
|
84
84
|
# fields not covered by the mask.
|
85
85
|
#
|
86
|
-
# If a repeated field is specified for an update operation,
|
87
|
-
#
|
88
|
-
#
|
89
|
-
# string.
|
86
|
+
# If a repeated field is specified for an update operation, new values will
|
87
|
+
# be appended to the existing repeated field in the target resource. Note that
|
88
|
+
# a repeated field is only allowed in the last position of a `paths` string.
|
90
89
|
#
|
91
90
|
# If a sub-message is specified in the last position of the field mask for an
|
92
|
-
# update operation, then the existing sub-message
|
93
|
-
#
|
91
|
+
# update operation, then new value will be merged into the existing sub-message
|
92
|
+
# in the target resource.
|
93
|
+
#
|
94
|
+
# For example, given the target message:
|
94
95
|
#
|
95
96
|
# f {
|
96
97
|
# b {
|
97
|
-
# d
|
98
|
-
# x
|
98
|
+
# d: 1
|
99
|
+
# x: 2
|
99
100
|
# }
|
100
|
-
# c
|
101
|
+
# c: [1]
|
101
102
|
# }
|
102
103
|
#
|
103
104
|
# And an update message:
|
104
105
|
#
|
105
106
|
# f {
|
106
107
|
# b {
|
107
|
-
# d
|
108
|
+
# d: 10
|
108
109
|
# }
|
110
|
+
# c: [2]
|
109
111
|
# }
|
110
112
|
#
|
111
113
|
# then if the field mask is:
|
112
114
|
#
|
113
|
-
# paths: "f.b"
|
115
|
+
# paths: ["f.b", "f.c"]
|
114
116
|
#
|
115
117
|
# then the result will be:
|
116
118
|
#
|
117
119
|
# f {
|
118
120
|
# b {
|
119
|
-
# d
|
121
|
+
# d: 10
|
122
|
+
# x: 2
|
120
123
|
# }
|
121
|
-
# c
|
124
|
+
# c: [1, 2]
|
122
125
|
# }
|
123
126
|
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
# paths: "f.b.d"
|
127
|
-
#
|
128
|
-
# then the result would be:
|
129
|
-
#
|
130
|
-
# f {
|
131
|
-
# b {
|
132
|
-
# d : 10
|
133
|
-
# x : 2
|
134
|
-
# }
|
135
|
-
# c : 1
|
136
|
-
# }
|
127
|
+
# An implementation may provide options to override this default behavior for
|
128
|
+
# repeated and message fields.
|
137
129
|
#
|
138
130
|
# In order to reset a field's value to the default, the field must
|
139
131
|
# be in the mask and set to the default value in the provided resource.
|
@@ -15,17 +15,19 @@
|
|
15
15
|
|
16
16
|
module Google
|
17
17
|
module Protobuf
|
18
|
-
# A Timestamp represents a point in time independent of any time zone
|
19
|
-
#
|
20
|
-
# nanosecond resolution
|
21
|
-
#
|
22
|
-
# backwards to year one.
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
18
|
+
# A Timestamp represents a point in time independent of any time zone or local
|
19
|
+
# calendar, encoded as a count of seconds and fractions of seconds at
|
20
|
+
# nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
21
|
+
# January 1, 1970, in the proleptic Gregorian calendar which extends the
|
22
|
+
# Gregorian calendar backwards to year one.
|
23
|
+
#
|
24
|
+
# All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
25
|
+
# second table is needed for interpretation, using a [24-hour linear
|
26
|
+
# smear](https://developers.google.com/time/smear).
|
27
|
+
#
|
28
|
+
# The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
29
|
+
# restricting to that range, we ensure that we can convert to and from [RFC
|
30
|
+
# 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
29
31
|
#
|
30
32
|
# = Examples
|
31
33
|
#
|
@@ -86,12 +88,12 @@ module Google
|
|
86
88
|
# 01:30 UTC on January 15, 2017.
|
87
89
|
#
|
88
90
|
# In JavaScript, one can convert a Date object to this format using the
|
89
|
-
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
|
91
|
+
# standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
90
92
|
# method. In Python, a standard `datetime.datetime` object can be converted
|
91
93
|
# to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
92
94
|
# with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
93
95
|
# can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
94
|
-
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime
|
96
|
+
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
95
97
|
# ) to obtain a formatter capable of generating timestamps in this format.
|
96
98
|
# @!attribute [rw] seconds
|
97
99
|
# @return [Integer]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -135,6 +135,7 @@ extensions: []
|
|
135
135
|
extra_rdoc_files: []
|
136
136
|
files:
|
137
137
|
- ".yardopts"
|
138
|
+
- AUTHENTICATION.md
|
138
139
|
- LICENSE
|
139
140
|
- README.md
|
140
141
|
- lib/google/cloud/tasks.rb
|