google-apis-tasks_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module TasksV1
18
+ # Version of the google-apis-tasks_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20200905"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,121 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module TasksV1
24
+
25
+ class Task
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ class Link
29
+ class Representation < Google::Apis::Core::JsonRepresentation; end
30
+
31
+ include Google::Apis::Core::JsonObjectSupport
32
+ end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class TaskList
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class TaskLists
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class Tasks
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Task
56
+ # @private
57
+ class Representation < Google::Apis::Core::JsonRepresentation
58
+ property :completed, as: 'completed'
59
+ property :deleted, as: 'deleted'
60
+ property :due, as: 'due'
61
+ property :etag, as: 'etag'
62
+ property :hidden, as: 'hidden'
63
+ property :id, as: 'id'
64
+ property :kind, as: 'kind'
65
+ collection :links, as: 'links', class: Google::Apis::TasksV1::Task::Link, decorator: Google::Apis::TasksV1::Task::Link::Representation
66
+
67
+ property :notes, as: 'notes'
68
+ property :parent, as: 'parent'
69
+ property :position, as: 'position'
70
+ property :self_link, as: 'selfLink'
71
+ property :status, as: 'status'
72
+ property :title, as: 'title'
73
+ property :updated, as: 'updated'
74
+ end
75
+
76
+ class Link
77
+ # @private
78
+ class Representation < Google::Apis::Core::JsonRepresentation
79
+ property :description, as: 'description'
80
+ property :link, as: 'link'
81
+ property :type, as: 'type'
82
+ end
83
+ end
84
+ end
85
+
86
+ class TaskList
87
+ # @private
88
+ class Representation < Google::Apis::Core::JsonRepresentation
89
+ property :etag, as: 'etag'
90
+ property :id, as: 'id'
91
+ property :kind, as: 'kind'
92
+ property :self_link, as: 'selfLink'
93
+ property :title, as: 'title'
94
+ property :updated, as: 'updated'
95
+ end
96
+ end
97
+
98
+ class TaskLists
99
+ # @private
100
+ class Representation < Google::Apis::Core::JsonRepresentation
101
+ property :etag, as: 'etag'
102
+ collection :items, as: 'items', class: Google::Apis::TasksV1::TaskList, decorator: Google::Apis::TasksV1::TaskList::Representation
103
+
104
+ property :kind, as: 'kind'
105
+ property :next_page_token, as: 'nextPageToken'
106
+ end
107
+ end
108
+
109
+ class Tasks
110
+ # @private
111
+ class Representation < Google::Apis::Core::JsonRepresentation
112
+ property :etag, as: 'etag'
113
+ collection :items, as: 'items', class: Google::Apis::TasksV1::Task, decorator: Google::Apis::TasksV1::Task::Representation
114
+
115
+ property :kind, as: 'kind'
116
+ property :next_page_token, as: 'nextPageToken'
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,570 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module TasksV1
23
+ # Tasks API
24
+ #
25
+ # The Google Tasks API lets you manage your tasks and task lists.
26
+ #
27
+ # @example
28
+ # require 'google/apis/tasks_v1'
29
+ #
30
+ # Tasks = Google::Apis::TasksV1 # Alias the module
31
+ # service = Tasks::TasksService.new
32
+ #
33
+ # @see
34
+ class TasksService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://tasks.googleapis.com/', '',
47
+ client_name: 'google-apis-tasks_v1',
48
+ client_version: Google::Apis::TasksV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Deletes the authenticated user's specified task list.
53
+ # @param [String] tasklist
54
+ # Task list identifier.
55
+ # @param [String] fields
56
+ # Selector specifying which fields to include in a partial response.
57
+ # @param [String] quota_user
58
+ # Available to use for quota purposes for server-side applications. Can be any
59
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
60
+ # @param [Google::Apis::RequestOptions] options
61
+ # Request-specific options
62
+ #
63
+ # @yield [result, err] Result & error if block supplied
64
+ # @yieldparam result [NilClass] No result returned for this method
65
+ # @yieldparam err [StandardError] error object if request failed
66
+ #
67
+ # @return [void]
68
+ #
69
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
72
+ def delete_tasklist(tasklist, fields: nil, quota_user: nil, options: nil, &block)
73
+ command = make_simple_command(:delete, 'tasks/v1/users/@me/lists/{tasklist}', options)
74
+ command.params['tasklist'] = tasklist unless tasklist.nil?
75
+ command.query['fields'] = fields unless fields.nil?
76
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
77
+ execute_or_queue_command(command, &block)
78
+ end
79
+
80
+ # Returns the authenticated user's specified task list.
81
+ # @param [String] tasklist
82
+ # Task list identifier.
83
+ # @param [String] fields
84
+ # Selector specifying which fields to include in a partial response.
85
+ # @param [String] quota_user
86
+ # Available to use for quota purposes for server-side applications. Can be any
87
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
88
+ # @param [Google::Apis::RequestOptions] options
89
+ # Request-specific options
90
+ #
91
+ # @yield [result, err] Result & error if block supplied
92
+ # @yieldparam result [Google::Apis::TasksV1::TaskList] parsed result object
93
+ # @yieldparam err [StandardError] error object if request failed
94
+ #
95
+ # @return [Google::Apis::TasksV1::TaskList]
96
+ #
97
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
98
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
99
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
100
+ def get_tasklist(tasklist, fields: nil, quota_user: nil, options: nil, &block)
101
+ command = make_simple_command(:get, 'tasks/v1/users/@me/lists/{tasklist}', options)
102
+ command.response_representation = Google::Apis::TasksV1::TaskList::Representation
103
+ command.response_class = Google::Apis::TasksV1::TaskList
104
+ command.params['tasklist'] = tasklist unless tasklist.nil?
105
+ command.query['fields'] = fields unless fields.nil?
106
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
107
+ execute_or_queue_command(command, &block)
108
+ end
109
+
110
+ # Creates a new task list and adds it to the authenticated user's task lists.
111
+ # @param [Google::Apis::TasksV1::TaskList] task_list_object
112
+ # @param [String] fields
113
+ # Selector specifying which fields to include in a partial response.
114
+ # @param [String] quota_user
115
+ # Available to use for quota purposes for server-side applications. Can be any
116
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
117
+ # @param [Google::Apis::RequestOptions] options
118
+ # Request-specific options
119
+ #
120
+ # @yield [result, err] Result & error if block supplied
121
+ # @yieldparam result [Google::Apis::TasksV1::TaskList] parsed result object
122
+ # @yieldparam err [StandardError] error object if request failed
123
+ #
124
+ # @return [Google::Apis::TasksV1::TaskList]
125
+ #
126
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
127
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
128
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
129
+ def insert_tasklist(task_list_object = nil, fields: nil, quota_user: nil, options: nil, &block)
130
+ command = make_simple_command(:post, 'tasks/v1/users/@me/lists', options)
131
+ command.request_representation = Google::Apis::TasksV1::TaskList::Representation
132
+ command.request_object = task_list_object
133
+ command.response_representation = Google::Apis::TasksV1::TaskList::Representation
134
+ command.response_class = Google::Apis::TasksV1::TaskList
135
+ command.query['fields'] = fields unless fields.nil?
136
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
137
+ execute_or_queue_command(command, &block)
138
+ end
139
+
140
+ # Returns all the authenticated user's task lists.
141
+ # @param [Fixnum] max_results
142
+ # Maximum number of task lists returned on one page. Optional. The default is 20
143
+ # (max allowed: 100).
144
+ # @param [String] page_token
145
+ # Token specifying the result page to return. Optional.
146
+ # @param [String] fields
147
+ # Selector specifying which fields to include in a partial response.
148
+ # @param [String] quota_user
149
+ # Available to use for quota purposes for server-side applications. Can be any
150
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
151
+ # @param [Google::Apis::RequestOptions] options
152
+ # Request-specific options
153
+ #
154
+ # @yield [result, err] Result & error if block supplied
155
+ # @yieldparam result [Google::Apis::TasksV1::TaskLists] parsed result object
156
+ # @yieldparam err [StandardError] error object if request failed
157
+ #
158
+ # @return [Google::Apis::TasksV1::TaskLists]
159
+ #
160
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
161
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
162
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
163
+ def list_tasklists(max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
164
+ command = make_simple_command(:get, 'tasks/v1/users/@me/lists', options)
165
+ command.response_representation = Google::Apis::TasksV1::TaskLists::Representation
166
+ command.response_class = Google::Apis::TasksV1::TaskLists
167
+ command.query['maxResults'] = max_results unless max_results.nil?
168
+ command.query['pageToken'] = page_token unless page_token.nil?
169
+ command.query['fields'] = fields unless fields.nil?
170
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
171
+ execute_or_queue_command(command, &block)
172
+ end
173
+
174
+ # Updates the authenticated user's specified task list. This method supports
175
+ # patch semantics.
176
+ # @param [String] tasklist
177
+ # Task list identifier.
178
+ # @param [Google::Apis::TasksV1::TaskList] task_list_object
179
+ # @param [String] fields
180
+ # Selector specifying which fields to include in a partial response.
181
+ # @param [String] quota_user
182
+ # Available to use for quota purposes for server-side applications. Can be any
183
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
184
+ # @param [Google::Apis::RequestOptions] options
185
+ # Request-specific options
186
+ #
187
+ # @yield [result, err] Result & error if block supplied
188
+ # @yieldparam result [Google::Apis::TasksV1::TaskList] parsed result object
189
+ # @yieldparam err [StandardError] error object if request failed
190
+ #
191
+ # @return [Google::Apis::TasksV1::TaskList]
192
+ #
193
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
194
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
195
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
196
+ def patch_tasklist(tasklist, task_list_object = nil, fields: nil, quota_user: nil, options: nil, &block)
197
+ command = make_simple_command(:patch, 'tasks/v1/users/@me/lists/{tasklist}', options)
198
+ command.request_representation = Google::Apis::TasksV1::TaskList::Representation
199
+ command.request_object = task_list_object
200
+ command.response_representation = Google::Apis::TasksV1::TaskList::Representation
201
+ command.response_class = Google::Apis::TasksV1::TaskList
202
+ command.params['tasklist'] = tasklist unless tasklist.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Updates the authenticated user's specified task list.
209
+ # @param [String] tasklist
210
+ # Task list identifier.
211
+ # @param [Google::Apis::TasksV1::TaskList] task_list_object
212
+ # @param [String] fields
213
+ # Selector specifying which fields to include in a partial response.
214
+ # @param [String] quota_user
215
+ # Available to use for quota purposes for server-side applications. Can be any
216
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
217
+ # @param [Google::Apis::RequestOptions] options
218
+ # Request-specific options
219
+ #
220
+ # @yield [result, err] Result & error if block supplied
221
+ # @yieldparam result [Google::Apis::TasksV1::TaskList] parsed result object
222
+ # @yieldparam err [StandardError] error object if request failed
223
+ #
224
+ # @return [Google::Apis::TasksV1::TaskList]
225
+ #
226
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
227
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
228
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
229
+ def update_tasklist(tasklist, task_list_object = nil, fields: nil, quota_user: nil, options: nil, &block)
230
+ command = make_simple_command(:put, 'tasks/v1/users/@me/lists/{tasklist}', options)
231
+ command.request_representation = Google::Apis::TasksV1::TaskList::Representation
232
+ command.request_object = task_list_object
233
+ command.response_representation = Google::Apis::TasksV1::TaskList::Representation
234
+ command.response_class = Google::Apis::TasksV1::TaskList
235
+ command.params['tasklist'] = tasklist unless tasklist.nil?
236
+ command.query['fields'] = fields unless fields.nil?
237
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
238
+ execute_or_queue_command(command, &block)
239
+ end
240
+
241
+ # Clears all completed tasks from the specified task list. The affected tasks
242
+ # will be marked as 'hidden' and no longer be returned by default when
243
+ # retrieving all tasks for a task list.
244
+ # @param [String] tasklist
245
+ # Task list identifier.
246
+ # @param [String] fields
247
+ # Selector specifying which fields to include in a partial response.
248
+ # @param [String] quota_user
249
+ # Available to use for quota purposes for server-side applications. Can be any
250
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
251
+ # @param [Google::Apis::RequestOptions] options
252
+ # Request-specific options
253
+ #
254
+ # @yield [result, err] Result & error if block supplied
255
+ # @yieldparam result [NilClass] No result returned for this method
256
+ # @yieldparam err [StandardError] error object if request failed
257
+ #
258
+ # @return [void]
259
+ #
260
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
261
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
262
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
263
+ def clear_task(tasklist, fields: nil, quota_user: nil, options: nil, &block)
264
+ command = make_simple_command(:post, 'tasks/v1/lists/{tasklist}/clear', options)
265
+ command.params['tasklist'] = tasklist unless tasklist.nil?
266
+ command.query['fields'] = fields unless fields.nil?
267
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
268
+ execute_or_queue_command(command, &block)
269
+ end
270
+
271
+ # Deletes the specified task from the task list.
272
+ # @param [String] tasklist
273
+ # Task list identifier.
274
+ # @param [String] task
275
+ # Task identifier.
276
+ # @param [String] fields
277
+ # Selector specifying which fields to include in a partial response.
278
+ # @param [String] quota_user
279
+ # Available to use for quota purposes for server-side applications. Can be any
280
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
281
+ # @param [Google::Apis::RequestOptions] options
282
+ # Request-specific options
283
+ #
284
+ # @yield [result, err] Result & error if block supplied
285
+ # @yieldparam result [NilClass] No result returned for this method
286
+ # @yieldparam err [StandardError] error object if request failed
287
+ #
288
+ # @return [void]
289
+ #
290
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
291
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
292
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
293
+ def delete_task(tasklist, task, fields: nil, quota_user: nil, options: nil, &block)
294
+ command = make_simple_command(:delete, 'tasks/v1/lists/{tasklist}/tasks/{task}', options)
295
+ command.params['tasklist'] = tasklist unless tasklist.nil?
296
+ command.params['task'] = task unless task.nil?
297
+ command.query['fields'] = fields unless fields.nil?
298
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
299
+ execute_or_queue_command(command, &block)
300
+ end
301
+
302
+ # Returns the specified task.
303
+ # @param [String] tasklist
304
+ # Task list identifier.
305
+ # @param [String] task
306
+ # Task identifier.
307
+ # @param [String] fields
308
+ # Selector specifying which fields to include in a partial response.
309
+ # @param [String] quota_user
310
+ # Available to use for quota purposes for server-side applications. Can be any
311
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
312
+ # @param [Google::Apis::RequestOptions] options
313
+ # Request-specific options
314
+ #
315
+ # @yield [result, err] Result & error if block supplied
316
+ # @yieldparam result [Google::Apis::TasksV1::Task] parsed result object
317
+ # @yieldparam err [StandardError] error object if request failed
318
+ #
319
+ # @return [Google::Apis::TasksV1::Task]
320
+ #
321
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
322
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
323
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
324
+ def get_task(tasklist, task, fields: nil, quota_user: nil, options: nil, &block)
325
+ command = make_simple_command(:get, 'tasks/v1/lists/{tasklist}/tasks/{task}', options)
326
+ command.response_representation = Google::Apis::TasksV1::Task::Representation
327
+ command.response_class = Google::Apis::TasksV1::Task
328
+ command.params['tasklist'] = tasklist unless tasklist.nil?
329
+ command.params['task'] = task unless task.nil?
330
+ command.query['fields'] = fields unless fields.nil?
331
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
332
+ execute_or_queue_command(command, &block)
333
+ end
334
+
335
+ # Creates a new task on the specified task list.
336
+ # @param [String] tasklist
337
+ # Task list identifier.
338
+ # @param [Google::Apis::TasksV1::Task] task_object
339
+ # @param [String] parent
340
+ # Parent task identifier. If the task is created at the top level, this
341
+ # parameter is omitted. Optional.
342
+ # @param [String] previous
343
+ # Previous sibling task identifier. If the task is created at the first position
344
+ # among its siblings, this parameter is omitted. Optional.
345
+ # @param [String] fields
346
+ # Selector specifying which fields to include in a partial response.
347
+ # @param [String] quota_user
348
+ # Available to use for quota purposes for server-side applications. Can be any
349
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
350
+ # @param [Google::Apis::RequestOptions] options
351
+ # Request-specific options
352
+ #
353
+ # @yield [result, err] Result & error if block supplied
354
+ # @yieldparam result [Google::Apis::TasksV1::Task] parsed result object
355
+ # @yieldparam err [StandardError] error object if request failed
356
+ #
357
+ # @return [Google::Apis::TasksV1::Task]
358
+ #
359
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
360
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
361
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
362
+ def insert_task(tasklist, task_object = nil, parent: nil, previous: nil, fields: nil, quota_user: nil, options: nil, &block)
363
+ command = make_simple_command(:post, 'tasks/v1/lists/{tasklist}/tasks', options)
364
+ command.request_representation = Google::Apis::TasksV1::Task::Representation
365
+ command.request_object = task_object
366
+ command.response_representation = Google::Apis::TasksV1::Task::Representation
367
+ command.response_class = Google::Apis::TasksV1::Task
368
+ command.params['tasklist'] = tasklist unless tasklist.nil?
369
+ command.query['parent'] = parent unless parent.nil?
370
+ command.query['previous'] = previous unless previous.nil?
371
+ command.query['fields'] = fields unless fields.nil?
372
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
373
+ execute_or_queue_command(command, &block)
374
+ end
375
+
376
+ # Returns all tasks in the specified task list.
377
+ # @param [String] tasklist
378
+ # Task list identifier.
379
+ # @param [String] completed_max
380
+ # Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter
381
+ # by. Optional. The default is not to filter by completion date.
382
+ # @param [String] completed_min
383
+ # Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter
384
+ # by. Optional. The default is not to filter by completion date.
385
+ # @param [String] due_max
386
+ # Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by.
387
+ # Optional. The default is not to filter by due date.
388
+ # @param [String] due_min
389
+ # Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by.
390
+ # Optional. The default is not to filter by due date.
391
+ # @param [Fixnum] max_results
392
+ # Maximum number of task lists returned on one page. Optional. The default is 20
393
+ # (max allowed: 100).
394
+ # @param [String] page_token
395
+ # Token specifying the result page to return. Optional.
396
+ # @param [Boolean] show_completed
397
+ # Flag indicating whether completed tasks are returned in the result. Optional.
398
+ # The default is True. Note that showHidden must also be True to show tasks
399
+ # completed in first party clients, such as the web UI and Google's mobile apps.
400
+ # @param [Boolean] show_deleted
401
+ # Flag indicating whether deleted tasks are returned in the result. Optional.
402
+ # The default is False.
403
+ # @param [Boolean] show_hidden
404
+ # Flag indicating whether hidden tasks are returned in the result. Optional. The
405
+ # default is False.
406
+ # @param [String] updated_min
407
+ # Lower bound for a task's last modification time (as a RFC 3339 timestamp) to
408
+ # filter by. Optional. The default is not to filter by last modification time.
409
+ # @param [String] fields
410
+ # Selector specifying which fields to include in a partial response.
411
+ # @param [String] quota_user
412
+ # Available to use for quota purposes for server-side applications. Can be any
413
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
414
+ # @param [Google::Apis::RequestOptions] options
415
+ # Request-specific options
416
+ #
417
+ # @yield [result, err] Result & error if block supplied
418
+ # @yieldparam result [Google::Apis::TasksV1::Tasks] parsed result object
419
+ # @yieldparam err [StandardError] error object if request failed
420
+ #
421
+ # @return [Google::Apis::TasksV1::Tasks]
422
+ #
423
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
424
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
425
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
426
+ def list_tasks(tasklist, completed_max: nil, completed_min: nil, due_max: nil, due_min: nil, max_results: nil, page_token: nil, show_completed: nil, show_deleted: nil, show_hidden: nil, updated_min: nil, fields: nil, quota_user: nil, options: nil, &block)
427
+ command = make_simple_command(:get, 'tasks/v1/lists/{tasklist}/tasks', options)
428
+ command.response_representation = Google::Apis::TasksV1::Tasks::Representation
429
+ command.response_class = Google::Apis::TasksV1::Tasks
430
+ command.params['tasklist'] = tasklist unless tasklist.nil?
431
+ command.query['completedMax'] = completed_max unless completed_max.nil?
432
+ command.query['completedMin'] = completed_min unless completed_min.nil?
433
+ command.query['dueMax'] = due_max unless due_max.nil?
434
+ command.query['dueMin'] = due_min unless due_min.nil?
435
+ command.query['maxResults'] = max_results unless max_results.nil?
436
+ command.query['pageToken'] = page_token unless page_token.nil?
437
+ command.query['showCompleted'] = show_completed unless show_completed.nil?
438
+ command.query['showDeleted'] = show_deleted unless show_deleted.nil?
439
+ command.query['showHidden'] = show_hidden unless show_hidden.nil?
440
+ command.query['updatedMin'] = updated_min unless updated_min.nil?
441
+ command.query['fields'] = fields unless fields.nil?
442
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
443
+ execute_or_queue_command(command, &block)
444
+ end
445
+
446
+ # Moves the specified task to another position in the task list. This can
447
+ # include putting it as a child task under a new parent and/or move it to a
448
+ # different position among its sibling tasks.
449
+ # @param [String] tasklist
450
+ # Task list identifier.
451
+ # @param [String] task
452
+ # Task identifier.
453
+ # @param [String] parent
454
+ # New parent task identifier. If the task is moved to the top level, this
455
+ # parameter is omitted. Optional.
456
+ # @param [String] previous
457
+ # New previous sibling task identifier. If the task is moved to the first
458
+ # position among its siblings, this parameter is omitted. Optional.
459
+ # @param [String] fields
460
+ # Selector specifying which fields to include in a partial response.
461
+ # @param [String] quota_user
462
+ # Available to use for quota purposes for server-side applications. Can be any
463
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
464
+ # @param [Google::Apis::RequestOptions] options
465
+ # Request-specific options
466
+ #
467
+ # @yield [result, err] Result & error if block supplied
468
+ # @yieldparam result [Google::Apis::TasksV1::Task] parsed result object
469
+ # @yieldparam err [StandardError] error object if request failed
470
+ #
471
+ # @return [Google::Apis::TasksV1::Task]
472
+ #
473
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
474
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
475
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
476
+ def move_task(tasklist, task, parent: nil, previous: nil, fields: nil, quota_user: nil, options: nil, &block)
477
+ command = make_simple_command(:post, 'tasks/v1/lists/{tasklist}/tasks/{task}/move', options)
478
+ command.response_representation = Google::Apis::TasksV1::Task::Representation
479
+ command.response_class = Google::Apis::TasksV1::Task
480
+ command.params['tasklist'] = tasklist unless tasklist.nil?
481
+ command.params['task'] = task unless task.nil?
482
+ command.query['parent'] = parent unless parent.nil?
483
+ command.query['previous'] = previous unless previous.nil?
484
+ command.query['fields'] = fields unless fields.nil?
485
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
486
+ execute_or_queue_command(command, &block)
487
+ end
488
+
489
+ # Updates the specified task. This method supports patch semantics.
490
+ # @param [String] tasklist
491
+ # Task list identifier.
492
+ # @param [String] task
493
+ # Task identifier.
494
+ # @param [Google::Apis::TasksV1::Task] task_object
495
+ # @param [String] fields
496
+ # Selector specifying which fields to include in a partial response.
497
+ # @param [String] quota_user
498
+ # Available to use for quota purposes for server-side applications. Can be any
499
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
500
+ # @param [Google::Apis::RequestOptions] options
501
+ # Request-specific options
502
+ #
503
+ # @yield [result, err] Result & error if block supplied
504
+ # @yieldparam result [Google::Apis::TasksV1::Task] parsed result object
505
+ # @yieldparam err [StandardError] error object if request failed
506
+ #
507
+ # @return [Google::Apis::TasksV1::Task]
508
+ #
509
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
510
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
511
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
512
+ def patch_task(tasklist, task, task_object = nil, fields: nil, quota_user: nil, options: nil, &block)
513
+ command = make_simple_command(:patch, 'tasks/v1/lists/{tasklist}/tasks/{task}', options)
514
+ command.request_representation = Google::Apis::TasksV1::Task::Representation
515
+ command.request_object = task_object
516
+ command.response_representation = Google::Apis::TasksV1::Task::Representation
517
+ command.response_class = Google::Apis::TasksV1::Task
518
+ command.params['tasklist'] = tasklist unless tasklist.nil?
519
+ command.params['task'] = task unless task.nil?
520
+ command.query['fields'] = fields unless fields.nil?
521
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
522
+ execute_or_queue_command(command, &block)
523
+ end
524
+
525
+ # Updates the specified task.
526
+ # @param [String] tasklist
527
+ # Task list identifier.
528
+ # @param [String] task
529
+ # Task identifier.
530
+ # @param [Google::Apis::TasksV1::Task] task_object
531
+ # @param [String] fields
532
+ # Selector specifying which fields to include in a partial response.
533
+ # @param [String] quota_user
534
+ # Available to use for quota purposes for server-side applications. Can be any
535
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
536
+ # @param [Google::Apis::RequestOptions] options
537
+ # Request-specific options
538
+ #
539
+ # @yield [result, err] Result & error if block supplied
540
+ # @yieldparam result [Google::Apis::TasksV1::Task] parsed result object
541
+ # @yieldparam err [StandardError] error object if request failed
542
+ #
543
+ # @return [Google::Apis::TasksV1::Task]
544
+ #
545
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
546
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
547
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
548
+ def update_task(tasklist, task, task_object = nil, fields: nil, quota_user: nil, options: nil, &block)
549
+ command = make_simple_command(:put, 'tasks/v1/lists/{tasklist}/tasks/{task}', options)
550
+ command.request_representation = Google::Apis::TasksV1::Task::Representation
551
+ command.request_object = task_object
552
+ command.response_representation = Google::Apis::TasksV1::Task::Representation
553
+ command.response_class = Google::Apis::TasksV1::Task
554
+ command.params['tasklist'] = tasklist unless tasklist.nil?
555
+ command.params['task'] = task unless task.nil?
556
+ command.query['fields'] = fields unless fields.nil?
557
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
558
+ execute_or_queue_command(command, &block)
559
+ end
560
+
561
+ protected
562
+
563
+ def apply_command_defaults(command)
564
+ command.query['key'] = key unless key.nil?
565
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end