tuix-marketplace-api
Version:
This package facilitates the client request to tuix marketplace api
176 lines (165 loc) • 4.26 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Tuix Services
* Tuix Services API
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface ProductDTO
*/
export interface ProductDTO {
/**
*
* @type {string}
* @memberof ProductDTO
*/
color?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
createdAt?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
description: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
id?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
mainProductId?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
material?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
name: string;
/**
*
* @type {number}
* @memberof ProductDTO
*/
price: number;
/**
*
* @type {string}
* @memberof ProductDTO
*/
size?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
sku: string;
/**
*
* @type {number}
* @memberof ProductDTO
*/
stock: number;
/**
*
* @type {string}
* @memberof ProductDTO
*/
style?: string;
/**
*
* @type {string}
* @memberof ProductDTO
*/
updatedAt?: string;
/**
*
* @type {number}
* @memberof ProductDTO
*/
weight: number;
}
/**
* Check if a given object implements the ProductDTO interface.
*/
export function instanceOfProductDTO(value: object): value is ProductDTO {
if (!('description' in value) || value['description'] === undefined) return false;
if (!('name' in value) || value['name'] === undefined) return false;
if (!('price' in value) || value['price'] === undefined) return false;
if (!('sku' in value) || value['sku'] === undefined) return false;
if (!('stock' in value) || value['stock'] === undefined) return false;
if (!('weight' in value) || value['weight'] === undefined) return false;
return true;
}
export function ProductDTOFromJSON(json: any): ProductDTO {
return ProductDTOFromJSONTyped(json, false);
}
export function ProductDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductDTO {
if (json == null) {
return json;
}
return {
'color': json['color'] == null ? undefined : json['color'],
'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
'description': json['description'],
'id': json['id'] == null ? undefined : json['id'],
'mainProductId': json['mainProductId'] == null ? undefined : json['mainProductId'],
'material': json['material'] == null ? undefined : json['material'],
'name': json['name'],
'price': json['price'],
'size': json['size'] == null ? undefined : json['size'],
'sku': json['sku'],
'stock': json['stock'],
'style': json['style'] == null ? undefined : json['style'],
'updatedAt': json['updatedAt'] == null ? undefined : json['updatedAt'],
'weight': json['weight'],
};
}
export function ProductDTOToJSON(json: any): ProductDTO {
return ProductDTOToJSONTyped(json, false);
}
export function ProductDTOToJSONTyped(value?: ProductDTO | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'color': value['color'],
'createdAt': value['createdAt'],
'description': value['description'],
'id': value['id'],
'mainProductId': value['mainProductId'],
'material': value['material'],
'name': value['name'],
'price': value['price'],
'size': value['size'],
'sku': value['sku'],
'stock': value['stock'],
'style': value['style'],
'updatedAt': value['updatedAt'],
'weight': value['weight'],
};
}