/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * 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'; import type { ProductRegistrationAssetResource } from './ProductRegistrationAssetResource'; import { ProductRegistrationAssetResourceFromJSON, ProductRegistrationAssetResourceFromJSONTyped, ProductRegistrationAssetResourceToJSON, ProductRegistrationAssetResourceToJSONTyped, } from './ProductRegistrationAssetResource'; import type { ProductRegistrationProductChildResource } from './ProductRegistrationProductChildResource'; import { ProductRegistrationProductChildResourceFromJSON, ProductRegistrationProductChildResourceFromJSONTyped, ProductRegistrationProductChildResourceToJSON, ProductRegistrationProductChildResourceToJSONTyped, } from './ProductRegistrationProductChildResource'; import type { AddressResource } from './AddressResource'; import { AddressResourceFromJSON, AddressResourceFromJSONTyped, AddressResourceToJSON, AddressResourceToJSONTyped, } from './AddressResource'; import type { ProductRegistrationCustomerResource } from './ProductRegistrationCustomerResource'; import { ProductRegistrationCustomerResourceFromJSON, ProductRegistrationCustomerResourceFromJSONTyped, ProductRegistrationCustomerResourceToJSON, ProductRegistrationCustomerResourceToJSONTyped, } from './ProductRegistrationCustomerResource'; /** * * @export * @interface ProductRegistrationResource */ export interface ProductRegistrationResource { /** * * @type {number} * @memberof ProductRegistrationResource */ id?: number | null; /** * * @type {Date} * @memberof ProductRegistrationResource */ purchasedDate: Date; /** * * @type {ProductRegistrationCustomerResource} * @memberof ProductRegistrationResource */ customer: ProductRegistrationCustomerResource | null; /** * * @type {AddressResource} * @memberof ProductRegistrationResource */ address: AddressResource | null; /** * * @type {Array} * @memberof ProductRegistrationResource */ productChildren: Array | null; /** * * @type {Array} * @memberof ProductRegistrationResource */ assets: Array | null; /** * * @type {string} * @memberof ProductRegistrationResource */ omnisendId?: string | null; /** * * @type {string} * @memberof ProductRegistrationResource */ omnisendSyncStatus?: string | null; /** * * @type {Date} * @memberof ProductRegistrationResource */ createdAt?: Date | null; /** * * @type {Date} * @memberof ProductRegistrationResource */ updatedAt?: Date | null; } /** * Check if a given object implements the ProductRegistrationResource interface. */ export function instanceOfProductRegistrationResource(value: object): value is ProductRegistrationResource { if (!('purchasedDate' in value) || value['purchasedDate'] === undefined) return false; if (!('customer' in value) || value['customer'] === undefined) return false; if (!('address' in value) || value['address'] === undefined) return false; if (!('productChildren' in value) || value['productChildren'] === undefined) return false; if (!('assets' in value) || value['assets'] === undefined) return false; return true; } export function ProductRegistrationResourceFromJSON(json: any): ProductRegistrationResource { return ProductRegistrationResourceFromJSONTyped(json, false); } export function ProductRegistrationResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProductRegistrationResource { if (json == null) { return json; } return { 'id': json['id'] == null ? undefined : json['id'], 'purchasedDate': (new Date(json['purchasedDate'])), 'customer': ProductRegistrationCustomerResourceFromJSON(json['customer']), 'address': AddressResourceFromJSON(json['address']), 'productChildren': (json['productChildren'] == null ? null : (json['productChildren'] as Array).map(ProductRegistrationProductChildResourceFromJSON)), 'assets': (json['assets'] == null ? null : (json['assets'] as Array).map(ProductRegistrationAssetResourceFromJSON)), 'omnisendId': json['omnisendId'] == null ? undefined : json['omnisendId'], 'omnisendSyncStatus': json['omnisendSyncStatus'] == null ? undefined : json['omnisendSyncStatus'], 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), }; } export function ProductRegistrationResourceToJSON(json: any): ProductRegistrationResource { return ProductRegistrationResourceToJSONTyped(json, false); } export function ProductRegistrationResourceToJSONTyped(value?: ProductRegistrationResource | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'purchasedDate': ((value['purchasedDate']).toISOString()), 'customer': ProductRegistrationCustomerResourceToJSON(value['customer']), 'address': AddressResourceToJSON(value['address']), 'productChildren': (value['productChildren'] == null ? null : (value['productChildren'] as Array).map(ProductRegistrationProductChildResourceToJSON)), 'assets': (value['assets'] == null ? null : (value['assets'] as Array).map(ProductRegistrationAssetResourceToJSON)), 'omnisendId': value['omnisendId'], 'omnisendSyncStatus': value['omnisendSyncStatus'], 'createdAt': value['createdAt'] === null ? null : ((value['createdAt'] as any)?.toISOString()), 'updatedAt': value['updatedAt'] === null ? null : ((value['updatedAt'] as any)?.toISOString()), }; }