This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
/
TaskBase.js
588 lines (526 loc) · 22 KB
/
TaskBase.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
/**
* Asana
* This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml).
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import AsanaResource from './AsanaResource';
import Like from './Like';
import TaskBaseAllOf from './TaskBaseAllOf';
import TaskBaseAllOfExternal from './TaskBaseAllOfExternal';
import TaskBaseAllOfMemberships from './TaskBaseAllOfMemberships';
import TaskCompact from './TaskCompact';
import UserCompact from './UserCompact';
/**
* The TaskBase model module.
* @module model/TaskBase
* @version 1.0.0
*/
class TaskBase {
/**
* Constructs a new <code>TaskBase</code>.
* @alias module:model/TaskBase
* @implements module:model/TaskCompact
* @implements module:model/TaskBaseAllOf
*/
constructor() {
TaskCompact.initialize(this);TaskBaseAllOf.initialize(this);
TaskBase.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>TaskBase</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/TaskBase} obj Optional instance to populate.
* @return {module:model/TaskBase} The populated <code>TaskBase</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new TaskBase();
TaskCompact.constructFromObject(data, obj);
TaskBaseAllOf.constructFromObject(data, obj);
if (data.hasOwnProperty('gid')) {
obj['gid'] = ApiClient.convertToType(data['gid'], 'String');
}
if (data.hasOwnProperty('resource_type')) {
obj['resource_type'] = ApiClient.convertToType(data['resource_type'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('resource_subtype')) {
obj['resource_subtype'] = ApiClient.convertToType(data['resource_subtype'], 'String');
}
if (data.hasOwnProperty('approval_status')) {
obj['approval_status'] = ApiClient.convertToType(data['approval_status'], 'String');
}
if (data.hasOwnProperty('assignee_status')) {
obj['assignee_status'] = ApiClient.convertToType(data['assignee_status'], 'String');
}
if (data.hasOwnProperty('completed')) {
obj['completed'] = ApiClient.convertToType(data['completed'], 'Boolean');
}
if (data.hasOwnProperty('completed_at')) {
obj['completed_at'] = ApiClient.convertToType(data['completed_at'], 'Date');
}
if (data.hasOwnProperty('completed_by')) {
obj['completed_by'] = UserCompact.constructFromObject(data['completed_by']);
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'Date');
}
if (data.hasOwnProperty('dependencies')) {
obj['dependencies'] = ApiClient.convertToType(data['dependencies'], [AsanaResource]);
}
if (data.hasOwnProperty('dependents')) {
obj['dependents'] = ApiClient.convertToType(data['dependents'], [AsanaResource]);
}
if (data.hasOwnProperty('due_at')) {
obj['due_at'] = ApiClient.convertToType(data['due_at'], 'Date');
}
if (data.hasOwnProperty('due_on')) {
obj['due_on'] = ApiClient.convertToType(data['due_on'], 'Date');
}
if (data.hasOwnProperty('external')) {
obj['external'] = TaskBaseAllOfExternal.constructFromObject(data['external']);
}
if (data.hasOwnProperty('html_notes')) {
obj['html_notes'] = ApiClient.convertToType(data['html_notes'], 'String');
}
if (data.hasOwnProperty('hearted')) {
obj['hearted'] = ApiClient.convertToType(data['hearted'], 'Boolean');
}
if (data.hasOwnProperty('hearts')) {
obj['hearts'] = ApiClient.convertToType(data['hearts'], [Like]);
}
if (data.hasOwnProperty('is_rendered_as_separator')) {
obj['is_rendered_as_separator'] = ApiClient.convertToType(data['is_rendered_as_separator'], 'Boolean');
}
if (data.hasOwnProperty('liked')) {
obj['liked'] = ApiClient.convertToType(data['liked'], 'Boolean');
}
if (data.hasOwnProperty('likes')) {
obj['likes'] = ApiClient.convertToType(data['likes'], [Like]);
}
if (data.hasOwnProperty('memberships')) {
obj['memberships'] = ApiClient.convertToType(data['memberships'], [TaskBaseAllOfMemberships]);
}
if (data.hasOwnProperty('modified_at')) {
obj['modified_at'] = ApiClient.convertToType(data['modified_at'], 'Date');
}
if (data.hasOwnProperty('notes')) {
obj['notes'] = ApiClient.convertToType(data['notes'], 'String');
}
if (data.hasOwnProperty('num_hearts')) {
obj['num_hearts'] = ApiClient.convertToType(data['num_hearts'], 'Number');
}
if (data.hasOwnProperty('num_likes')) {
obj['num_likes'] = ApiClient.convertToType(data['num_likes'], 'Number');
}
if (data.hasOwnProperty('num_subtasks')) {
obj['num_subtasks'] = ApiClient.convertToType(data['num_subtasks'], 'Number');
}
if (data.hasOwnProperty('start_at')) {
obj['start_at'] = ApiClient.convertToType(data['start_at'], 'Date');
}
if (data.hasOwnProperty('start_on')) {
obj['start_on'] = ApiClient.convertToType(data['start_on'], 'Date');
}
}
return obj;
}
}
/**
* Globally unique identifier of the resource, as a string.
* @member {String} gid
*/
TaskBase.prototype['gid'] = undefined;
/**
* The base type of this resource.
* @member {String} resource_type
*/
TaskBase.prototype['resource_type'] = undefined;
/**
* Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
* @member {String} name
*/
TaskBase.prototype['name'] = undefined;
/**
* The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. The resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date.
* @member {module:model/TaskBase.ResourceSubtypeEnum} resource_subtype
*/
TaskBase.prototype['resource_subtype'] = undefined;
/**
* *Conditional* Reflects the approval status of this task. This field is kept in sync with `completed`, meaning `pending` translates to false while `approved`, `rejected`, and `changes_requested` translate to true. If you set completed to true, this field will be set to `approved`.
* @member {module:model/TaskBase.ApprovalStatusEnum} approval_status
*/
TaskBase.prototype['approval_status'] = undefined;
/**
* *Deprecated* Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. Setting this field to \"inbox\" or \"upcoming\" inserts it at the top of the section, while the other options will insert at the bottom.
* @member {module:model/TaskBase.AssigneeStatusEnum} assignee_status
*/
TaskBase.prototype['assignee_status'] = undefined;
/**
* True if the task is currently marked complete, false if not.
* @member {Boolean} completed
*/
TaskBase.prototype['completed'] = undefined;
/**
* The time at which this task was completed, or null if the task is incomplete.
* @member {Date} completed_at
*/
TaskBase.prototype['completed_at'] = undefined;
/**
* @member {module:model/UserCompact} completed_by
*/
TaskBase.prototype['completed_by'] = undefined;
/**
* The time at which this resource was created.
* @member {Date} created_at
*/
TaskBase.prototype['created_at'] = undefined;
/**
* [Opt In](/docs/input-output-options). Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.
* @member {Array.<module:model/AsanaResource>} dependencies
*/
TaskBase.prototype['dependencies'] = undefined;
/**
* [Opt In](/docs/input-output-options). Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.
* @member {Array.<module:model/AsanaResource>} dependents
*/
TaskBase.prototype['dependents'] = undefined;
/**
* The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with `due_on`.
* @member {Date} due_at
*/
TaskBase.prototype['due_at'] = undefined;
/**
* The localized date on which this task is due, or null if the task has no due date. This takes a date with `YYYY-MM-DD` format and should not be used together with `due_at`.
* @member {Date} due_on
*/
TaskBase.prototype['due_on'] = undefined;
/**
* @member {module:model/TaskBaseAllOfExternal} external
*/
TaskBase.prototype['external'] = undefined;
/**
* [Opt In](/docs/input-output-options). The notes of the text with formatting as HTML.
* @member {String} html_notes
*/
TaskBase.prototype['html_notes'] = undefined;
/**
* *Deprecated - please use liked instead* True if the task is hearted by the authorized user, false if not.
* @member {Boolean} hearted
*/
TaskBase.prototype['hearted'] = undefined;
/**
* *Deprecated - please use likes instead* Array of likes for users who have hearted this task.
* @member {Array.<module:model/Like>} hearts
*/
TaskBase.prototype['hearts'] = undefined;
/**
* [Opt In](/docs/input-output-options). In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to [sections](/docs/asana-sections) without being true `section` objects. If a `task` object is rendered this way in any context it will have the property `is_rendered_as_separator` set to `true`.
* @member {Boolean} is_rendered_as_separator
*/
TaskBase.prototype['is_rendered_as_separator'] = undefined;
/**
* True if the task is liked by the authorized user, false if not.
* @member {Boolean} liked
*/
TaskBase.prototype['liked'] = undefined;
/**
* Array of likes for users who have liked this task.
* @member {Array.<module:model/Like>} likes
*/
TaskBase.prototype['likes'] = undefined;
/**
* *Create-only*. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the `addProject` and `removeProject` endpoints. Note that over time, more types of memberships may be added to this property.
* @member {Array.<module:model/TaskBaseAllOfMemberships>} memberships
*/
TaskBase.prototype['memberships'] = undefined;
/**
* The time at which this task was last modified. *Note: This does not currently reflect any changes in associations such as projects or comments that may have been added or removed from the task.*
* @member {Date} modified_at
*/
TaskBase.prototype['modified_at'] = undefined;
/**
* Free-form textual information associated with the task (i.e. its description).
* @member {String} notes
*/
TaskBase.prototype['notes'] = undefined;
/**
* *Deprecated - please use likes instead* The number of users who have hearted this task.
* @member {Number} num_hearts
*/
TaskBase.prototype['num_hearts'] = undefined;
/**
* The number of users who have liked this task.
* @member {Number} num_likes
*/
TaskBase.prototype['num_likes'] = undefined;
/**
* [Opt In](/docs/input-output-options). The number of subtasks on this task.
* @member {Number} num_subtasks
*/
TaskBase.prototype['num_subtasks'] = undefined;
/**
* Date and time on which work begins for the task, or null if the task has no start time. This takes an ISO 8601 date string in UTC and should not be used together with `start_on`. *Note: `due_at` must be present in the request when setting or unsetting the `start_at` parameter.*
* @member {Date} start_at
*/
TaskBase.prototype['start_at'] = undefined;
/**
* The day on which work begins for the task , or null if the task has no start date. This takes a date with `YYYY-MM-DD` format and should not be used together with `start_at`. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter.*
* @member {Date} start_on
*/
TaskBase.prototype['start_on'] = undefined;
// Implement TaskCompact interface:
/**
* Globally unique identifier of the resource, as a string.
* @member {String} gid
*/
TaskCompact.prototype['gid'] = undefined;
/**
* The base type of this resource.
* @member {String} resource_type
*/
TaskCompact.prototype['resource_type'] = undefined;
/**
* The name of the task.
* @member {String} name
*/
TaskCompact.prototype['name'] = undefined;
/**
* The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. The resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date.
* @member {module:model/TaskCompact.ResourceSubtypeEnum} resource_subtype
*/
TaskCompact.prototype['resource_subtype'] = undefined;
// Implement TaskBaseAllOf interface:
/**
* *Conditional* Reflects the approval status of this task. This field is kept in sync with `completed`, meaning `pending` translates to false while `approved`, `rejected`, and `changes_requested` translate to true. If you set completed to true, this field will be set to `approved`.
* @member {module:model/TaskBaseAllOf.ApprovalStatusEnum} approval_status
*/
TaskBaseAllOf.prototype['approval_status'] = undefined;
/**
* *Deprecated* Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. Setting this field to \"inbox\" or \"upcoming\" inserts it at the top of the section, while the other options will insert at the bottom.
* @member {module:model/TaskBaseAllOf.AssigneeStatusEnum} assignee_status
*/
TaskBaseAllOf.prototype['assignee_status'] = undefined;
/**
* True if the task is currently marked complete, false if not.
* @member {Boolean} completed
*/
TaskBaseAllOf.prototype['completed'] = undefined;
/**
* The time at which this task was completed, or null if the task is incomplete.
* @member {Date} completed_at
*/
TaskBaseAllOf.prototype['completed_at'] = undefined;
/**
* @member {module:model/UserCompact} completed_by
*/
TaskBaseAllOf.prototype['completed_by'] = undefined;
/**
* The time at which this resource was created.
* @member {Date} created_at
*/
TaskBaseAllOf.prototype['created_at'] = undefined;
/**
* [Opt In](/docs/input-output-options). Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency.
* @member {Array.<module:model/AsanaResource>} dependencies
*/
TaskBaseAllOf.prototype['dependencies'] = undefined;
/**
* [Opt In](/docs/input-output-options). Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent.
* @member {Array.<module:model/AsanaResource>} dependents
*/
TaskBaseAllOf.prototype['dependents'] = undefined;
/**
* The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with `due_on`.
* @member {Date} due_at
*/
TaskBaseAllOf.prototype['due_at'] = undefined;
/**
* The localized date on which this task is due, or null if the task has no due date. This takes a date with `YYYY-MM-DD` format and should not be used together with `due_at`.
* @member {Date} due_on
*/
TaskBaseAllOf.prototype['due_on'] = undefined;
/**
* @member {module:model/TaskBaseAllOfExternal} external
*/
TaskBaseAllOf.prototype['external'] = undefined;
/**
* [Opt In](/docs/input-output-options). The notes of the text with formatting as HTML.
* @member {String} html_notes
*/
TaskBaseAllOf.prototype['html_notes'] = undefined;
/**
* *Deprecated - please use liked instead* True if the task is hearted by the authorized user, false if not.
* @member {Boolean} hearted
*/
TaskBaseAllOf.prototype['hearted'] = undefined;
/**
* *Deprecated - please use likes instead* Array of likes for users who have hearted this task.
* @member {Array.<module:model/Like>} hearts
*/
TaskBaseAllOf.prototype['hearts'] = undefined;
/**
* [Opt In](/docs/input-output-options). In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to [sections](/docs/asana-sections) without being true `section` objects. If a `task` object is rendered this way in any context it will have the property `is_rendered_as_separator` set to `true`.
* @member {Boolean} is_rendered_as_separator
*/
TaskBaseAllOf.prototype['is_rendered_as_separator'] = undefined;
/**
* True if the task is liked by the authorized user, false if not.
* @member {Boolean} liked
*/
TaskBaseAllOf.prototype['liked'] = undefined;
/**
* Array of likes for users who have liked this task.
* @member {Array.<module:model/Like>} likes
*/
TaskBaseAllOf.prototype['likes'] = undefined;
/**
* *Create-only*. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the `addProject` and `removeProject` endpoints. Note that over time, more types of memberships may be added to this property.
* @member {Array.<module:model/TaskBaseAllOfMemberships>} memberships
*/
TaskBaseAllOf.prototype['memberships'] = undefined;
/**
* The time at which this task was last modified. *Note: This does not currently reflect any changes in associations such as projects or comments that may have been added or removed from the task.*
* @member {Date} modified_at
*/
TaskBaseAllOf.prototype['modified_at'] = undefined;
/**
* Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer.
* @member {String} name
*/
TaskBaseAllOf.prototype['name'] = undefined;
/**
* Free-form textual information associated with the task (i.e. its description).
* @member {String} notes
*/
TaskBaseAllOf.prototype['notes'] = undefined;
/**
* *Deprecated - please use likes instead* The number of users who have hearted this task.
* @member {Number} num_hearts
*/
TaskBaseAllOf.prototype['num_hearts'] = undefined;
/**
* The number of users who have liked this task.
* @member {Number} num_likes
*/
TaskBaseAllOf.prototype['num_likes'] = undefined;
/**
* [Opt In](/docs/input-output-options). The number of subtasks on this task.
* @member {Number} num_subtasks
*/
TaskBaseAllOf.prototype['num_subtasks'] = undefined;
/**
* Date and time on which work begins for the task, or null if the task has no start time. This takes an ISO 8601 date string in UTC and should not be used together with `start_on`. *Note: `due_at` must be present in the request when setting or unsetting the `start_at` parameter.*
* @member {Date} start_at
*/
TaskBaseAllOf.prototype['start_at'] = undefined;
/**
* The day on which work begins for the task , or null if the task has no start date. This takes a date with `YYYY-MM-DD` format and should not be used together with `start_at`. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter.*
* @member {Date} start_on
*/
TaskBaseAllOf.prototype['start_on'] = undefined;
/**
* Allowed values for the <code>resource_subtype</code> property.
* @enum {String}
* @readonly
*/
TaskBase['ResourceSubtypeEnum'] = {
/**
* value: "default_task"
* @const
*/
"default_task": "default_task",
/**
* value: "milestone"
* @const
*/
"milestone": "milestone",
/**
* value: "section"
* @const
*/
"section": "section",
/**
* value: "approval"
* @const
*/
"approval": "approval"
};
/**
* Allowed values for the <code>approval_status</code> property.
* @enum {String}
* @readonly
*/
TaskBase['ApprovalStatusEnum'] = {
/**
* value: "pending"
* @const
*/
"pending": "pending",
/**
* value: "approved"
* @const
*/
"approved": "approved",
/**
* value: "rejected"
* @const
*/
"rejected": "rejected",
/**
* value: "changes_requested"
* @const
*/
"changes_requested": "changes_requested"
};
/**
* Allowed values for the <code>assignee_status</code> property.
* @enum {String}
* @readonly
*/
TaskBase['AssigneeStatusEnum'] = {
/**
* value: "today"
* @const
*/
"today": "today",
/**
* value: "upcoming"
* @const
*/
"upcoming": "upcoming",
/**
* value: "later"
* @const
*/
"later": "later",
/**
* value: "new"
* @const
*/
"new": "new",
/**
* value: "inbox"
* @const
*/
"inbox": "inbox"
};
export default TaskBase;