@teemill/product-catalog 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +22 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +45 -0
- package/dist/apis/ProductsApi.d.ts +49 -0
- package/dist/apis/ProductsApi.js +199 -0
- package/dist/apis/VariantsApi.d.ts +49 -0
- package/dist/apis/VariantsApi.js +199 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/ApiError.d.ts +37 -0
- package/dist/models/ApiError.js +53 -0
- package/dist/models/Attribute.d.ts +37 -0
- package/dist/models/Attribute.js +52 -0
- package/dist/models/Image.d.ts +67 -0
- package/dist/models/Image.js +62 -0
- package/dist/models/Price.d.ts +37 -0
- package/dist/models/Price.js +52 -0
- package/dist/models/Product.d.ts +93 -0
- package/dist/models/Product.js +73 -0
- package/dist/models/ProductsResponse.d.ts +38 -0
- package/dist/models/ProductsResponse.js +53 -0
- package/dist/models/Stock.d.ts +31 -0
- package/dist/models/Stock.js +50 -0
- package/dist/models/Variant.d.ts +114 -0
- package/dist/models/Variant.js +81 -0
- package/dist/models/VariantProduct.d.ts +37 -0
- package/dist/models/VariantProduct.js +52 -0
- package/dist/models/VariantsResponse.d.ts +38 -0
- package/dist/models/VariantsResponse.js +53 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +28 -0
- package/dist/runtime.d.ts +182 -0
- package/dist/runtime.js +562 -0
- package/package.json +19 -0
- package/src/apis/ProductsApi.ts +149 -0
- package/src/apis/VariantsApi.ts +149 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/ApiError.ts +74 -0
- package/src/models/Attribute.ts +73 -0
- package/src/models/Image.ts +113 -0
- package/src/models/Price.ts +73 -0
- package/src/models/Product.ts +159 -0
- package/src/models/ProductsResponse.ts +80 -0
- package/src/models/Stock.ts +65 -0
- package/src/models/Variant.ts +200 -0
- package/src/models/VariantProduct.ts +73 -0
- package/src/models/VariantsResponse.ts +80 -0
- package/src/models/index.ts +12 -0
- package/src/runtime.ts +431 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ApiError,
|
|
19
|
+
Product,
|
|
20
|
+
ProductsResponse,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
ApiErrorFromJSON,
|
|
24
|
+
ApiErrorToJSON,
|
|
25
|
+
ProductFromJSON,
|
|
26
|
+
ProductToJSON,
|
|
27
|
+
ProductsResponseFromJSON,
|
|
28
|
+
ProductsResponseToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface GetProductRequest {
|
|
32
|
+
project: string;
|
|
33
|
+
productId: string;
|
|
34
|
+
fields?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GetProductsRequest {
|
|
38
|
+
project: string;
|
|
39
|
+
pageToken?: number;
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
fields?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export class ProductsApi extends runtime.BaseAPI {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets a product by the given id
|
|
51
|
+
* Get product
|
|
52
|
+
*/
|
|
53
|
+
async getProductRaw(requestParameters: GetProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Product>> {
|
|
54
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
55
|
+
throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getProduct.');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (requestParameters.productId === null || requestParameters.productId === undefined) {
|
|
59
|
+
throw new runtime.RequiredError('productId','Required parameter requestParameters.productId was null or undefined when calling getProduct.');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const queryParameters: any = {};
|
|
63
|
+
|
|
64
|
+
if (requestParameters.project !== undefined) {
|
|
65
|
+
queryParameters['project'] = requestParameters.project;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (requestParameters.fields !== undefined) {
|
|
69
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
73
|
+
|
|
74
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
75
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const response = await this.request({
|
|
79
|
+
path: `/v1/catalog/products/{productId}`.replace(`{${"productId"}}`, encodeURIComponent(String(requestParameters.productId))),
|
|
80
|
+
method: 'GET',
|
|
81
|
+
headers: headerParameters,
|
|
82
|
+
query: queryParameters,
|
|
83
|
+
}, initOverrides);
|
|
84
|
+
|
|
85
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ProductFromJSON(jsonValue));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Gets a product by the given id
|
|
90
|
+
* Get product
|
|
91
|
+
*/
|
|
92
|
+
async getProduct(requestParameters: GetProductRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Product> {
|
|
93
|
+
const response = await this.getProductRaw(requestParameters, initOverrides);
|
|
94
|
+
return await response.value();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Lists all products
|
|
99
|
+
* List products
|
|
100
|
+
*/
|
|
101
|
+
async getProductsRaw(requestParameters: GetProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProductsResponse>> {
|
|
102
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
103
|
+
throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getProducts.');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const queryParameters: any = {};
|
|
107
|
+
|
|
108
|
+
if (requestParameters.project !== undefined) {
|
|
109
|
+
queryParameters['project'] = requestParameters.project;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (requestParameters.pageToken !== undefined) {
|
|
113
|
+
queryParameters['pageToken'] = requestParameters.pageToken;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (requestParameters.pageSize !== undefined) {
|
|
117
|
+
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (requestParameters.fields !== undefined) {
|
|
121
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
125
|
+
|
|
126
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
127
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const response = await this.request({
|
|
131
|
+
path: `/v1/catalog/products`,
|
|
132
|
+
method: 'GET',
|
|
133
|
+
headers: headerParameters,
|
|
134
|
+
query: queryParameters,
|
|
135
|
+
}, initOverrides);
|
|
136
|
+
|
|
137
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ProductsResponseFromJSON(jsonValue));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Lists all products
|
|
142
|
+
* List products
|
|
143
|
+
*/
|
|
144
|
+
async getProducts(requestParameters: GetProductsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProductsResponse> {
|
|
145
|
+
const response = await this.getProductsRaw(requestParameters, initOverrides);
|
|
146
|
+
return await response.value();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ApiError,
|
|
19
|
+
Variant,
|
|
20
|
+
VariantsResponse,
|
|
21
|
+
} from '../models/index';
|
|
22
|
+
import {
|
|
23
|
+
ApiErrorFromJSON,
|
|
24
|
+
ApiErrorToJSON,
|
|
25
|
+
VariantFromJSON,
|
|
26
|
+
VariantToJSON,
|
|
27
|
+
VariantsResponseFromJSON,
|
|
28
|
+
VariantsResponseToJSON,
|
|
29
|
+
} from '../models/index';
|
|
30
|
+
|
|
31
|
+
export interface GetVariantRequest {
|
|
32
|
+
project: string;
|
|
33
|
+
variantId: string;
|
|
34
|
+
fields?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ListVariantsRequest {
|
|
38
|
+
project: string;
|
|
39
|
+
pageToken?: number;
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
fields?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export class VariantsApi extends runtime.BaseAPI {
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets a variant by the given id
|
|
51
|
+
* Get variant
|
|
52
|
+
*/
|
|
53
|
+
async getVariantRaw(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Variant>> {
|
|
54
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
55
|
+
throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getVariant.');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (requestParameters.variantId === null || requestParameters.variantId === undefined) {
|
|
59
|
+
throw new runtime.RequiredError('variantId','Required parameter requestParameters.variantId was null or undefined when calling getVariant.');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const queryParameters: any = {};
|
|
63
|
+
|
|
64
|
+
if (requestParameters.project !== undefined) {
|
|
65
|
+
queryParameters['project'] = requestParameters.project;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (requestParameters.fields !== undefined) {
|
|
69
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
73
|
+
|
|
74
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
75
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const response = await this.request({
|
|
79
|
+
path: `/v1/catalog/variants/{variantId}`.replace(`{${"variantId"}}`, encodeURIComponent(String(requestParameters.variantId))),
|
|
80
|
+
method: 'GET',
|
|
81
|
+
headers: headerParameters,
|
|
82
|
+
query: queryParameters,
|
|
83
|
+
}, initOverrides);
|
|
84
|
+
|
|
85
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VariantFromJSON(jsonValue));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Gets a variant by the given id
|
|
90
|
+
* Get variant
|
|
91
|
+
*/
|
|
92
|
+
async getVariant(requestParameters: GetVariantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Variant> {
|
|
93
|
+
const response = await this.getVariantRaw(requestParameters, initOverrides);
|
|
94
|
+
return await response.value();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Lists all variants
|
|
99
|
+
* List variants
|
|
100
|
+
*/
|
|
101
|
+
async listVariantsRaw(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VariantsResponse>> {
|
|
102
|
+
if (requestParameters.project === null || requestParameters.project === undefined) {
|
|
103
|
+
throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listVariants.');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const queryParameters: any = {};
|
|
107
|
+
|
|
108
|
+
if (requestParameters.project !== undefined) {
|
|
109
|
+
queryParameters['project'] = requestParameters.project;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (requestParameters.pageToken !== undefined) {
|
|
113
|
+
queryParameters['pageToken'] = requestParameters.pageToken;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (requestParameters.pageSize !== undefined) {
|
|
117
|
+
queryParameters['pageSize'] = requestParameters.pageSize;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (requestParameters.fields !== undefined) {
|
|
121
|
+
queryParameters['fields'] = requestParameters.fields;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
125
|
+
|
|
126
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
127
|
+
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // api-key authentication
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const response = await this.request({
|
|
131
|
+
path: `/v1/catalog/variants`,
|
|
132
|
+
method: 'GET',
|
|
133
|
+
headers: headerParameters,
|
|
134
|
+
query: queryParameters,
|
|
135
|
+
}, initOverrides);
|
|
136
|
+
|
|
137
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VariantsResponseFromJSON(jsonValue));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Lists all variants
|
|
142
|
+
* List variants
|
|
143
|
+
*/
|
|
144
|
+
async listVariants(requestParameters: ListVariantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VariantsResponse> {
|
|
145
|
+
const response = await this.listVariantsRaw(requestParameters, initOverrides);
|
|
146
|
+
return await response.value();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ApiError
|
|
20
|
+
*/
|
|
21
|
+
export interface ApiError {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ApiError
|
|
26
|
+
*/
|
|
27
|
+
code?: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ApiError
|
|
32
|
+
*/
|
|
33
|
+
message: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the ApiError interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfApiError(value: object): boolean {
|
|
40
|
+
let isInstance = true;
|
|
41
|
+
isInstance = isInstance && "message" in value;
|
|
42
|
+
|
|
43
|
+
return isInstance;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function ApiErrorFromJSON(json: any): ApiError {
|
|
47
|
+
return ApiErrorFromJSONTyped(json, false);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function ApiErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiError {
|
|
51
|
+
if ((json === undefined) || (json === null)) {
|
|
52
|
+
return json;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
|
|
56
|
+
'code': !exists(json, 'code') ? undefined : json['code'],
|
|
57
|
+
'message': json['message'],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function ApiErrorToJSON(value?: ApiError | null): any {
|
|
62
|
+
if (value === undefined) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (value === null) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'code': value.code,
|
|
71
|
+
'message': value.message,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Attribute
|
|
20
|
+
*/
|
|
21
|
+
export interface Attribute {
|
|
22
|
+
/**
|
|
23
|
+
* Attribute name
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof Attribute
|
|
26
|
+
*/
|
|
27
|
+
name?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Attribute value
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Attribute
|
|
32
|
+
*/
|
|
33
|
+
value?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the Attribute interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfAttribute(value: object): boolean {
|
|
40
|
+
let isInstance = true;
|
|
41
|
+
|
|
42
|
+
return isInstance;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function AttributeFromJSON(json: any): Attribute {
|
|
46
|
+
return AttributeFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function AttributeFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attribute {
|
|
50
|
+
if ((json === undefined) || (json === null)) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'name': !exists(json, 'name') ? undefined : json['name'],
|
|
56
|
+
'value': !exists(json, 'value') ? undefined : json['value'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function AttributeToJSON(value?: Attribute | null): any {
|
|
61
|
+
if (value === undefined) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (value === null) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'name': value.name,
|
|
70
|
+
'value': value.value,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Image description
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Image
|
|
20
|
+
*/
|
|
21
|
+
export interface Image {
|
|
22
|
+
/**
|
|
23
|
+
* Unique object identifier
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof Image
|
|
26
|
+
*/
|
|
27
|
+
id?: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Image
|
|
32
|
+
*/
|
|
33
|
+
src?: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof Image
|
|
38
|
+
*/
|
|
39
|
+
alt?: string;
|
|
40
|
+
/**
|
|
41
|
+
* List of variant Ids
|
|
42
|
+
* @type {Array<string>}
|
|
43
|
+
* @memberof Image
|
|
44
|
+
*/
|
|
45
|
+
variantIds?: Array<string>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof Image
|
|
50
|
+
*/
|
|
51
|
+
sortOrder?: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof Image
|
|
56
|
+
*/
|
|
57
|
+
createdAt?: string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof Image
|
|
62
|
+
*/
|
|
63
|
+
updatedAt?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Check if a given object implements the Image interface.
|
|
68
|
+
*/
|
|
69
|
+
export function instanceOfImage(value: object): boolean {
|
|
70
|
+
let isInstance = true;
|
|
71
|
+
|
|
72
|
+
return isInstance;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ImageFromJSON(json: any): Image {
|
|
76
|
+
return ImageFromJSONTyped(json, false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function ImageFromJSONTyped(json: any, ignoreDiscriminator: boolean): Image {
|
|
80
|
+
if ((json === undefined) || (json === null)) {
|
|
81
|
+
return json;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
|
|
85
|
+
'id': !exists(json, 'id') ? undefined : json['id'],
|
|
86
|
+
'src': !exists(json, 'src') ? undefined : json['src'],
|
|
87
|
+
'alt': !exists(json, 'alt') ? undefined : json['alt'],
|
|
88
|
+
'variantIds': !exists(json, 'variantIds') ? undefined : json['variantIds'],
|
|
89
|
+
'sortOrder': !exists(json, 'sortOrder') ? undefined : json['sortOrder'],
|
|
90
|
+
'createdAt': !exists(json, 'createdAt') ? undefined : json['createdAt'],
|
|
91
|
+
'updatedAt': !exists(json, 'updatedAt') ? undefined : json['updatedAt'],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function ImageToJSON(value?: Image | null): any {
|
|
96
|
+
if (value === undefined) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
if (value === null) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
|
|
104
|
+
'id': value.id,
|
|
105
|
+
'src': value.src,
|
|
106
|
+
'alt': value.alt,
|
|
107
|
+
'variantIds': value.variantIds,
|
|
108
|
+
'sortOrder': value.sortOrder,
|
|
109
|
+
'createdAt': value.createdAt,
|
|
110
|
+
'updatedAt': value.updatedAt,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Product Catalog API
|
|
5
|
+
* Manage Teemill Product Catalog For full documentation on functionality and account settings go to [teemill.com](https://teemill.com)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.2
|
|
8
|
+
* Contact: hello@teemill.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { exists, mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Standard price definition that defines the amount, tax rate and currency.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface Price
|
|
20
|
+
*/
|
|
21
|
+
export interface Price {
|
|
22
|
+
/**
|
|
23
|
+
* Price including tax in the specified currency.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof Price
|
|
26
|
+
*/
|
|
27
|
+
amount?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Currency code for the currency the price is valued in.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof Price
|
|
32
|
+
*/
|
|
33
|
+
currencyCode?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the Price interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfPrice(value: object): boolean {
|
|
40
|
+
let isInstance = true;
|
|
41
|
+
|
|
42
|
+
return isInstance;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function PriceFromJSON(json: any): Price {
|
|
46
|
+
return PriceFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function PriceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Price {
|
|
50
|
+
if ((json === undefined) || (json === null)) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'amount': !exists(json, 'amount') ? undefined : json['amount'],
|
|
56
|
+
'currencyCode': !exists(json, 'currencyCode') ? undefined : json['currencyCode'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function PriceToJSON(value?: Price | null): any {
|
|
61
|
+
if (value === undefined) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (value === null) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'amount': value.amount,
|
|
70
|
+
'currencyCode': value.currencyCode,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|