/**
 * Paypal Server SDKLib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

import { lazy, object, optional, Schema } from '../schema';
import { PhoneNumber, phoneNumberSchema } from './phoneNumber';
import { PhoneType, phoneTypeSchema } from './phoneType';

/** The phone information. */
export interface PhoneWithType {
  /** The phone type. */
  phoneType?: PhoneType;
  /** The phone number in its canonical international [E.164 numbering plan format](https://www.itu.int/rec/T-REC-E.164/en). */
  phoneNumber: PhoneNumber;
}

export const phoneWithTypeSchema: Schema<PhoneWithType> = object({
  phoneType: ['phone_type', optional(phoneTypeSchema)],
  phoneNumber: ['phone_number', lazy(() => phoneNumberSchema)],
});
