/**
 * PostNL Ecommerce APIsLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { array, lazy, object, optional, Schema, string } from '../schema';
import { Address5, address5Schema } from './address5';
import { Customer1, customer1Schema } from './customer1';
import { Dimension1, dimension1Schema } from './dimension1';
import { ProductOptions, productOptionsSchema } from './productOptions';
import { Status, statusSchema } from './status';

export interface Shipment2 {
  /** The main barcode of the shipment */
  mainBarcode?: string;
  /** The barcode of the shipment */
  barcode?: string;
  /** The amount of parcels in the multi-collo shipment */
  shipmentAmount?: string;
  /** The sequence of this parcel in the multi-collo shipment */
  shipmentCounter?: string;
  customer?: Customer1;
  /** The product code of the shipment */
  productCode?: string;
  /** The description of the product code */
  productDescription?: string;
  /** The customer reference belonging to the shipment */
  reference?: string;
  /** The expected delivery date of the shipment */
  deliveryDate?: string;
  dimension?: Dimension1;
  /** A list of addresses belonging to the shipment */
  address?: Address5[];
  /** A list of product options. */
  productOptions?: ProductOptions;
  /** The current status of the shipment (see the [Status codes](#tag/TandT-status-codes/Status-codes) for possible values. */
  status?: Status;
}

export const shipment2Schema: Schema<Shipment2> = object({
  mainBarcode: ['MainBarcode', optional(string())],
  barcode: ['Barcode', optional(string())],
  shipmentAmount: ['ShipmentAmount', optional(string())],
  shipmentCounter: ['ShipmentCounter', optional(string())],
  customer: ['Customer', optional(lazy(() => customer1Schema))],
  productCode: ['ProductCode', optional(string())],
  productDescription: ['ProductDescription', optional(string())],
  reference: ['Reference', optional(string())],
  deliveryDate: ['DeliveryDate', optional(string())],
  dimension: ['Dimension', optional(lazy(() => dimension1Schema))],
  address: ['Address', optional(array(lazy(() => address5Schema)))],
  productOptions: [
    'ProductOptions',
    optional(lazy(() => productOptionsSchema)),
  ],
  status: ['Status', optional(lazy(() => statusSchema))],
});
