UNPKG

2.36 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.1.2
20 */
21const MoneyValue = require('./MoneyValue.js').MoneyValue;
22
23class ShippingMethod {
24
25 /**
26 * Constructs a ShippingMethod based on its enclosed builder.
27 * @constructor
28 * @param {Builder} builder the ShippingMethod builder
29 */
30 constructor(builder) {
31
32 /**
33 * The cost of shipping.
34 * @type {MoneyValue}
35 */
36 this.cost = builder.cost;
37
38 /**
39 * The description of the shipping method.
40 * @type {string}
41 */
42 this.description = undefined;
43
44 /**
45 * The id of the shipping method.
46 * @type {string}
47 */
48 this.id = builder.id;
49
50 /**
51 * The name of the shipping method.
52 * @type {string}
53 */
54 this.name = builder.name;
55 }
56
57 /**
58 * Builds a ShippingMethod based on API required properties.
59 */
60 static get Builder() {
61 class Builder {
62
63 withCost(cost) {
64 this.cost = cost;
65 return this;
66 }
67
68 withId(id) {
69 this.id = id;
70 return this;
71 }
72
73 withName(name) {
74 this.name = name;
75 return this;
76 }
77
78 build() {
79 return new ShippingMethod(this);
80 }
81 }
82 return Builder;
83 }
84}
85module.exports.ShippingMethod = ShippingMethod;