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 |
|
22 | class MoneyValue {
|
23 |
|
24 | /**
|
25 | * Constructs a MoneyValue based on its enclosed builder.
|
26 | * @constructor
|
27 | * @param {Builder} builder the MoneyValue builder
|
28 | */
|
29 | constructor(builder) {
|
30 | /**
|
31 | * The currency code for this money value.
|
32 | * @type {string}
|
33 | */
|
34 | this.currency = builder.currency;
|
35 |
|
36 | /**
|
37 | * The amount in cents of this money value.
|
38 | * @type {number}
|
39 | */
|
40 | this.amount = builder.amount;
|
41 |
|
42 | /**
|
43 | * The country code for this money value.
|
44 | * @type {string}
|
45 | */
|
46 | this.country = undefined;
|
47 |
|
48 | }
|
49 |
|
50 | /**
|
51 | * Builds a MoneyValue based on API required properties.
|
52 | */
|
53 | static get Builder() {
|
54 | class Builder {
|
55 | withAmount(amount) {
|
56 | this.amount = amount;
|
57 | return this;
|
58 | }
|
59 |
|
60 | withCurrency(currency) {
|
61 | this.currency = currency;
|
62 | return this;
|
63 | }
|
64 |
|
65 | build() {
|
66 | return new MoneyValue(this);
|
67 | }
|
68 | }
|
69 | return Builder;
|
70 | }
|
71 | }
|
72 | module.exports.MoneyValue = MoneyValue;
|