/**
 * 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 {
  BundledRestrictionsList,
  bundledRestrictionsListSchema,
} from './bundledRestrictionsList';
import { ErrorStatus, errorStatusSchema } from './errorStatus';

export interface BundleDetailsResponse {
  /**
   * Payer Id of the bundles and cards.
   * Example: 123456
   */
  payerId?: number;
  /**
   * Payer Number of the bundles and cards.
   * Example: GB000000123
   */
  payerNumber?: string;
  /**
   * Account ID of the bundle.
   * Example: 123456
   */
  accountId?: number;
  /**
   * Account Number of the bundle.
   * Example: GB000000123
   */
  accountNumber?: string;
  /** unique identifier for the Card Bundle */
  bundleId?: string;
  /** External system allocated Card Bundle identifier for Card Bundle. */
  externalBundleId?: string;
  /** Card Bundle Description. */
  description?: string;
  /** List of Card Pans added to the card bundle. */
  pans?: string[];
  /**
   * ISO currency code of the country.
   * Example: GBP
   */
  restrictionCurrencyCode?: string;
  /**
   * Currency symbol of the country.
   * Example: £, $
   */
  restrictionCurrencySymbol?: string;
  restrictions?: BundledRestrictionsList;
  error?: ErrorStatus;
  /** API Request Id */
  requestId?: string;
}

export const bundleDetailsResponseSchema: Schema<BundleDetailsResponse> = object(
  {
    payerId: ['PayerId', optional(number())],
    payerNumber: ['PayerNumber', optional(string())],
    accountId: ['AccountId', optional(number())],
    accountNumber: ['AccountNumber', optional(string())],
    bundleId: ['BundleId', optional(string())],
    externalBundleId: ['ExternalBundleId', optional(string())],
    description: ['Description', optional(string())],
    pans: ['Pans', optional(array(string()))],
    restrictionCurrencyCode: ['RestrictionCurrencyCode', optional(string())],
    restrictionCurrencySymbol: [
      'RestrictionCurrencySymbol',
      optional(string()),
    ],
    restrictions: [
      'Restrictions',
      optional(lazy(() => bundledRestrictionsListSchema)),
    ],
    error: ['Error', optional(lazy(() => errorStatusSchema))],
    requestId: ['RequestId', optional(string())],
  }
);
