UNPKG

2.43 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 */
21
22class Attribute {
23
24 /**
25 * Constructs a Attribute based on its enclosed builder.
26 * @constructor
27 * @param {Builder} builder the Attribute builder
28 */
29 constructor(builder) {
30
31 /**
32 * The unique id for this text attribute, for example 'width'.
33 * @type {string}
34 */
35 this.id = builder.id;
36
37 /**
38 * If true, this attribute is a variant attribute. If not set or false, the attribute is a normal/simple attribute.
39 * @type {boolean}
40 */
41 this.isVariantAxis = undefined;
42
43 /**
44 * The name for this text attribute.
45 * @type {string}
46 */
47 this.name = builder.name;
48
49 /**
50 * The value of the attribute. This can be any arbitrary valid JSON value.
51 * @type {object}
52 */
53 this.value = builder.value;
54 }
55
56 /**
57 * Builds a Attribute based on API required properties.
58 */
59 static get Builder() {
60 class Builder {
61
62 withId(id) {
63 this.id = id;
64 return this;
65 }
66
67 withName(name) {
68 this.name = name;
69 return this;
70 }
71
72 withValue(value) {
73 this.value = value;
74 return this;
75 }
76
77 build() {
78 return new Attribute(this);
79 }
80 }
81 return Builder;
82 }
83}
84module.exports.Attribute = Attribute;