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

import { array, lazy, object, optional, Schema } from '../schema';
import { DeliveryOption, deliveryOptionSchema } from './deliveryOption';
import { PickupOption, pickupOptionSchema } from './pickupOption';
import { Warning, warningSchema } from './warning';

export interface CheckoutResponse {
  /** Array of delivery options */
  deliveryOptions?: DeliveryOption[];
  /** Array of possible pickup options */
  pickupOptions?: PickupOption[];
  /** An array of warnings */
  warnings?: Warning[];
}

export const checkoutResponseSchema: Schema<CheckoutResponse> = object({
  deliveryOptions: [
    'DeliveryOptions',
    optional(array(lazy(() => deliveryOptionSchema))),
  ],
  pickupOptions: [
    'PickupOptions',
    optional(array(lazy(() => pickupOptionSchema))),
  ],
  warnings: ['Warnings', optional(array(lazy(() => warningSchema)))],
});
