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

import { object, optional, Schema, string } from '../schema';

export interface Contact {
  /** Type of the contact. This is a code. Please refer to the available [Contact types](#tag/Reference-codes/Contact-types) for the possible values. */
  contactType: string;
  /** Email address of the contact. Mandatory in some cases. Either the Email or Telnr needs to be filled in for Non EU destinations. Please see [Guidelines](https://developer.postnl.nl/browse-apis/send-and-track/labelling-webservice/). */
  email?: string;
  /** Mobile phone number of the contact. Mandatory in some cases. Please see [Guidelines](https://developer.postnl.nl/browse-apis/send-and-track/labelling-webservice/). */
  sMSNr?: string;
  /** Phone number of the contact. Either the Email or Telnr needs to be filled in for Non EU destinations. Preferably prefixed with “+” and the international dialling code. */
  telNr?: string;
}

export const contactSchema: Schema<Contact> = object({
  contactType: ['ContactType', string()],
  email: ['Email', optional(string())],
  sMSNr: ['SMSNr', optional(string())],
  telNr: ['TelNr', optional(string())],
});
