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

import {
  array,
  lazy,
  number,
  object,
  optional,
  Schema,
  string,
} from '../schema';
import {
  AutoRenewCardRequestAutoRenewCardsItems,
  autoRenewCardRequestAutoRenewCardsItemsSchema,
} from './autoRenewCardRequestAutoRenewCardsItems';

export interface AutoRenewCardRequest {
  /**
   * Collecting Company Id of the selected payer.
   * Optional if ColCoCode is passed else Mandatory.
   * Example:
   * 1-Philippines
   * 5-UK
   */
  colCoId?: number;
  /**
   * Collecting Company Code (Shell Code) of the selected payer.
   * Mandatory for serviced OUs such as Romania, Latvia, Lithuania, Estonia, Ukraine etc. It is optional for other countries if ColCoID is provided.
   * Example:
   * 86-Philippines
   * 5-UK
   */
  colCoCode?: number;
  /**
   * Payer Number (Ex: GB000000123) of the selected payer.
   * Optional if PayerId is passed else Mandatory
   */
  payerNumber?: string;
  /**
   * Payer Id  of the selected payer.
   * Optional if PayerNumber is passed else Mandatory
   */
  payerId?: number;
  autoRenewCards?: AutoRenewCardRequestAutoRenewCardsItems[];
}

export const autoRenewCardRequestSchema: Schema<AutoRenewCardRequest> = object({
  colCoId: ['ColCoId', optional(number())],
  colCoCode: ['ColCoCode', optional(number())],
  payerNumber: ['PayerNumber', optional(string())],
  payerId: ['PayerId', optional(number())],
  autoRenewCards: [
    'AutoRenewCards',
    optional(array(lazy(() => autoRenewCardRequestAutoRenewCardsItemsSchema))),
  ],
});
