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 | const Category = require('./Category.js').Category;
|
23 | const Facet = require('./Facet.js').Facet;
|
24 |
|
25 | class PagedResponseCategory {
|
26 |
|
27 | /**
|
28 | * Constructs a PagedResponseCategory based on its enclosed builder.
|
29 | * @constructor
|
30 | * @param {Builder} builder the PagedResponseCategory builder
|
31 | */
|
32 | constructor(builder) {
|
33 | /**
|
34 | * The offset for this response, this is the number of elements skipped, not a page number.
|
35 | * @type {integer}
|
36 | */
|
37 | this.offset = builder.offset;
|
38 |
|
39 | /**
|
40 | * The actual number of results returned in results.
|
41 | * @type {integer}
|
42 | */
|
43 | this.count = builder.count;
|
44 |
|
45 | /**
|
46 | * The total number of results matching the query.
|
47 | * @type {integer}
|
48 | */
|
49 | this.total = builder.total;
|
50 |
|
51 | /**
|
52 | * The results for this response.
|
53 | * @type {Category[]}
|
54 | */
|
55 | this.results = builder.results;
|
56 |
|
57 | /**
|
58 | * The list of facets for this response.
|
59 | * @type {Facet[]}
|
60 | */
|
61 | this.facets = undefined;
|
62 |
|
63 | }
|
64 |
|
65 | /**
|
66 | * Builds a PagedResponseCategory based on API required properties.
|
67 | */
|
68 | static get Builder() {
|
69 | class Builder {
|
70 | withCount(count) {
|
71 | this.count = count;
|
72 | return this;
|
73 | }
|
74 |
|
75 | withOffset(offset) {
|
76 | this.offset = offset;
|
77 | return this;
|
78 | }
|
79 |
|
80 | withResults(results) {
|
81 | this.results = results;
|
82 | return this;
|
83 | }
|
84 |
|
85 | withTotal(total) {
|
86 | this.total = total;
|
87 | return this;
|
88 | }
|
89 |
|
90 | build() {
|
91 | return new PagedResponseCategory(this);
|
92 | }
|
93 | }
|
94 | return Builder;
|
95 | }
|
96 | }
|
97 | module.exports.PagedResponseCategory = PagedResponseCategory;
|