/**
 * 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 { Customer3, customer3Schema } from './customer3';
import { Message1, message1Schema } from './message1';
import { Shipment3, shipment3Schema } from './shipment3';

export interface LabellingRequest {
  customer: Customer3;
  /** GIF image of the signature (as a base64 encoded string) max size: 280x60 mm (1058x226 pixels). This can be used to automatically sign the customs forms. The value of this element can have a maximum size of 65536 characters. Note that the total request can have a maximum size of 200KB. Larger requests will not be accepted by the server for performance reasons. Requests that exceed this limit will not return a validation error,but a HTTP 404 error. */
  labelSignature?: string;
  message: Message1;
  /** List of 1 or more Shipments. At least 1 shipment is required. */
  shipments: Shipment3[];
}

export const labellingRequestSchema: Schema<LabellingRequest> = object({
  customer: ['Customer', lazy(() => customer3Schema)],
  labelSignature: ['LabelSignature', optional(string())],
  message: ['Message', lazy(() => message1Schema)],
  shipments: ['Shipments', array(lazy(() => shipment3Schema))],
});
