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

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

/**
 * Delivery address of card. This address will be used for card reissue and PIN reminders in future.
 * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
 */
export interface UpdateCardRenewalAddress {
  /**
   * Contact name
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   * Max Length: 50
   */
  contactName: string;
  /**
   * Title
   * Max Length: 50
   */
  contactTitle?: string;
  /**
   * Company name.
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   * Max Length: 50
   */
  companyName: string;
  /**
   * Address line 1,2 and 3
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   * Max Length: 128
   * Note: -Each address line should be separated by “\r\n”.
   */
  addressLine: string;
  /**
   * ZipCode
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   * Max Length: 10
   */
  zipCode: string;
  /**
   * City
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   * Max Length: 40
   */
  city?: string;
  /** Region id of card. */
  regionID?: number;
  /**
   * Country ID
   * Note: Mandatory when ‘UseCustomerDefaultAddress’ is set to ‘false’. The field is ignored otherwise.
   */
  countryID: number;
  /**
   * Email Address
   * Max Length: 90
   * Note: -
   * Based on the international standard that there can be
   * •    Max Length 64 before the @ (the 'Local part’) =64(minimum of 1)
   * •    Max Lenth after the (the domain) = 88 (Minimum of 2)
   */
  emailAddress?: string;
  /**
   * Phone number
   * Optional
   * Max Length: 16
   */
  phoneNumber?: string;
}

export const updateCardRenewalAddressSchema: Schema<UpdateCardRenewalAddress> = object(
  {
    contactName: ['ContactName', string()],
    contactTitle: ['ContactTitle', optional(string())],
    companyName: ['CompanyName', string()],
    addressLine: ['AddressLine', string()],
    zipCode: ['ZipCode', string()],
    city: ['City', optional(string())],
    regionID: ['RegionID', optional(number())],
    countryID: ['CountryID', number()],
    emailAddress: ['EmailAddress', optional(string())],
    phoneNumber: ['PhoneNumber', optional(string())],
  }
);
