/**
 * 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 { Location, locationSchema } from './location';

export interface PickupOption {
  /** Date from which the parcel can be picked up at the PostNL location */
  pickupDate?: string;
  /** The date when you need to deliver the shipment to PostNL to ensure the expected delivery date is achieved. Will be returned as 'null' if not calculated */
  shippingDate?: string;
  /** The pickup option */
  option?: string;
  /** Array of pickup locations */
  locations?: Location[];
}

export const pickupOptionSchema: Schema<PickupOption> = object({
  pickupDate: ['PickupDate', optional(string())],
  shippingDate: ['ShippingDate', optional(string())],
  option: ['Option', optional(string())],
  locations: ['Locations', optional(array(lazy(() => locationSchema)))],
});
