UNPKG

2.96 kBJavaScriptView Raw
1/*******************************************************************************
2 *
3 * Copyright 2018 Adobe. All rights reserved.
4 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License. You may obtain a copy
6 * of the License at http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software distributed under
9 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10 * OF ANY KIND, either express or implied. See the License for the specific language
11 * governing permissions and limitations under the License.
12 *
13 ******************************************************************************/
14
15/**
16 * Auto generated code based on Swagger definition.
17 * Dot not edit manually. Manual changes will be overridden.
18 *
19 * @version 1.0.0
20 */
21
22const ShoppingListEntry = require('./ShoppingListEntry.js').ShoppingListEntry;
23
24class ShoppingList {
25
26 /**
27 * Constructs a ShoppingList based on its enclosed builder.
28 * @constructor
29 * @param {Builder} builder the ShoppingList builder
30 */
31 constructor(builder) {
32 /**
33 * The date-time when this object was created. The JSON representation must be in RFC339 / ISO8601 format
34 * @type {string}
35 */
36 this.createdAt = undefined;
37
38 /**
39 * The date-time when this object was last modified. The JSON representation must be in RFC339 / ISO8601 format
40 * @type {string}
41 */
42 this.lastModifiedAt = undefined;
43
44 /**
45 * The id of the shopping list.
46 * @type {string}
47 */
48 this.id = builder.id;
49
50 /**
51 * The name of the shopping list.
52 * @type {string}
53 */
54 this.name = builder.name;
55
56 /**
57 * The description of the shopping list.
58 * @type {string}
59 */
60 this.description = undefined;
61
62 /**
63 * The entries of the shopping list.
64 * @type {ShoppingListEntry[]}
65 */
66 this.entries = builder.entries;
67
68 /**
69 * The customer id that owns this shopping list.
70 * @type {string}
71 */
72 this.customerId = undefined;
73
74 }
75
76 /**
77 * Builds a ShoppingList based on API required properties.
78 */
79 static get Builder() {
80 class Builder {
81 withEntries(entries) {
82 this.entries = entries;
83 return this;
84 }
85
86 withId(id) {
87 this.id = id;
88 return this;
89 }
90
91 withName(name) {
92 this.name = name;
93 return this;
94 }
95
96 build() {
97 return new ShoppingList(this);
98 }
99 }
100 return Builder;
101 }
102}
103module.exports.ShoppingList = ShoppingList;