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

import {
  array,
  boolean,
  lazy,
  nullable,
  number,
  object,
  optional,
  Schema,
  string,
  unknown,
} from '../schema';
import {
  CardDeliveryAddress,
  cardDeliveryAddressSchema,
} from './cardDeliveryAddress';
import {
  CardDetailsResponseCardBlockSchedulesItemsAllOf0,
  cardDetailsResponseCardBlockSchedulesItemsAllOf0Schema,
} from './cardDetailsResponseCardBlockSchedulesItemsAllOf0';
import {
  CardDetailsResponseFuelSetsItems,
  cardDetailsResponseFuelSetsItemsSchema,
} from './cardDetailsResponseFuelSetsItems';
import {
  CardDetailsResponseInternationalPOSLanguageCodeEnum,
  cardDetailsResponseInternationalPOSLanguageCodeEnumSchema,
} from './cardDetailsResponseInternationalPOSLanguageCodeEnum';
import {
  CardDetailsResponseInternationalPOSLanguageIDEnum,
  cardDetailsResponseInternationalPOSLanguageIDEnumSchema,
} from './cardDetailsResponseInternationalPOSLanguageIDEnum';
import {
  CardDetailsResponseNonFuelSetsItems,
  cardDetailsResponseNonFuelSetsItemsSchema,
} from './cardDetailsResponseNonFuelSetsItems';
import {
  CardDetailsResponsePINTypeEnum,
  cardDetailsResponsePINTypeEnumSchema,
} from './cardDetailsResponsePINTypeEnum';
import {
  CardDetailsResponseRenewedCardReissueSettingEnum,
  cardDetailsResponseRenewedCardReissueSettingEnumSchema,
} from './cardDetailsResponseRenewedCardReissueSettingEnum';
import {
  CardDetailsResponseStatusIdEnum,
  cardDetailsResponseStatusIdEnumSchema,
} from './cardDetailsResponseStatusIdEnum';
import { ErrorStatus, errorStatusSchema } from './errorStatus';
import {
  PINDeliveryAddress,
  pINDeliveryAddressSchema,
} from './pINDeliveryAddress';

export interface CardDetailsResponse {
  /** Payer Id (i.e. Customer Id of the Payment Customer in the Shell Card Platform) of the selected payer. */
  payerId?: number | null;
  /** Payer Number of the selected payer. */
  payerNumber?: string | null;
  /** Account Id (i.e. Customer Id of the Customer in the Shell Card Platform) of the customer. */
  accountId?: number | null;
  /** Account Number of the customer. */
  accountNumber?: string | null;
  /** Account short name. */
  accountShortName?: string | null;
  /** ISO 3166 Alpha-2 Country Code for the customer and card owning country. */
  colCoCountryCode?: string | null;
  /** ISO 4217 Curreny Code of the local currency. */
  localCurrencyCode?: string | null;
  /** Currency symbol of local currency. */
  localCurrencySymbol?: string | null;
  /** Unique Card Id in Cards platform. */
  cardId?: number;
  /** Card PAN. In the response body the PAN will be masked if the option is enabled in the Shell Card Platform. */
  pAN?: string | null;
  /**
   * Possible Id’s and description:
   * * 1  Active
   * * 7  Blocked Card
   * * 8  Expired
   * * 9  Cancelled
   * * 10  New
   * * 23  Pending Renewal
   * * 31  Replaced
   * * 41  Temporary Block (Customer)
   * * 42  Temporary Block (Shell)
   * * 43  Fraud
   * * 101 Active (Block in progress) *
   * * 102 Blocked Card (Unblock in progress) *
   * * 103 Active (Cancel in progress) *
   * * 104 Active (Marked as damaged) *
   * * 105 New (Cancel as damaged) *
   * * 106 Active(Scheduled for block) ”#
   * * 107 Blocked Card(Scheduled for unblock)*#
   * * 108 Blocked Card (Cancel in progress) *
   * > Note:
   * •  Items marked with * are intermediate statuses  to indicate that there are pending requests in progress. , The response can contain these intermediate statuses only if the IncludeIntermediateStatus flag is true.
   * •  The placeholder “<Shell Card Platform Status>” in the items marked with # will be replaced with the Shell Card Platform status description. E.g., “Active (Scheduled for block)”
   */
  statusId?: CardDetailsResponseStatusIdEnum;
  /**
   * Possible Id’s and description:
   * * 1  Active
   * * 7  Blocked Card
   * * 8  Expired
   * * 9  Cancelled
   * * 10  New
   * * 23  Pending Renewal
   * * 31  Replaced
   * * 41  Temporary Block (Customer)
   * * 42  Temporary Block (Shell)
   * * 43  Fraud
   * * 101 Active (Block in progress) *
   * * 102 Blocked Card (Unblock in progress) *
   * * 103 Active (Cancel in progress) *
   * * 104 Active (Marked as damaged) *
   * * 105 New (Cancel as damaged) *
   * * 106 Active(Scheduled for block) ”#
   * * 107 Blocked Card(Scheduled for unblock) *#
   * * 108 Blocked Card (Cancel in progress) *
   * > Note:
   * •  Items marked with * are intermediate statuses  to indicate that there are pending requests in progress. , The response can contain these intermediate statuses only if the IncludeIntermediateStatus flag is true.
   * •  The placeholder “<Shell Card Platform Status>” in the items marked with # will be replaced with the Shell Card Platform status description. E.g., “Active (Scheduled for block)”
   */
  status?: string;
  /** True if odometer input is enabled on the card, else false */
  odometerPrompt?: boolean;
  /** True if fleet id input is enabled, else false */
  fleetIdPrompt?: boolean;
  /**
   * PIN type:
   *   * `Card` - Card PIN
   *   * `Fleet` - Fleet PIN
   */
  pINType?: CardDetailsResponsePINTypeEnum;
  /** True if card has PIN, else false */
  hasPIN?: boolean;
  /** True if card has Self Selected PIN, else false */
  isSelfSelectedPIN?: boolean;
  /** True if card can be blocked temporarily, else false */
  temporaryBlockAllowed?: boolean;
  /** True/False True if card can be Unblocked, else false */
  unblockAllowed?: boolean;
  /** True if card can be blocked permanently, else false */
  permanentBlockAllowed?: boolean;
  /** Issue number of the card */
  issueNumber?: number;
  reissueSetting?: unknown;
  /**
   * POS language identifier. Language Id:
   *   * `1` - German
   *   * `2` - French
   *   * `3` - Bulgarian
   *   * `4` - Croatian
   *   * `5` - Czech
   *   * `6` - Danish
   *   * `7` - Finnish
   *   * `8` - English
   *   * `9` - Greek
   *   * `10` - Chinese
   *   * `11` - Hungarian
   *   * `12` - Italian
   *   * `13` - Luxembourgish
   *   * `14` - Malay
   *   * `15` - Dutch
   *   * `16` - Norwegian, Bokmal
   *   * `17` - Urdu
   *   * `18` - Polish
   *   * `19` - Portuguese
   *   * `20` - Romanian
   *   * `21` - Russian
   *   * `22` - Slovak
   *   * `23` - Slovenian
   *   * `24` - Spanish
   *   * `25` - Swedish
   *   * `26` - Turkish
   *   * `27` - Thai
   *   * `28` - Filipino
   *   * `29` - Estonian
   *   * `30` - Latvian
   *   * `31` - Lithuanian
   */
  internationalPOSLanguageID?: CardDetailsResponseInternationalPOSLanguageIDEnum;
  /**
   * POS language code. Language code:
   *   * `deu` - German
   *   * `fra` - French
   *   * `bul` - Bulgarian
   *   * `hrv` - Croatian
   *   * `ces` - Czech
   *   * `dan` - Danish
   *   * `fin` - Finnish
   *   * `eng` - English
   *   * `ell` - Greek
   *   * `zho` - Chinese
   *   * `hun` - Hungarian
   *   * `ita` - Italian
   *   * `ltz` - Luxembourgish
   *   * `msa` - Malay
   *   * `nld` - Dutch
   *   * `nob` - Norwegian, Bokmal
   *   * `urd` - Urdu
   *   * `pol` - Polish
   *   * `por` - Portuguese
   *   * `ron` - Romanian
   *   * `rus` - Russian
   *   * `slk` - Slovak
   *   * `slv` - Slovenian
   *   * `spa` - Spanish
   *   * `swe` - Swedish
   *   * `tur` - Turkish
   *   * `tha` - Thai
   *   * `fil` - Filipino
   *   * `est` - Estonian
   *   * `lav` - Latvian
   *   * `lit` - Lithuanian
   */
  internationalPOSLanguageCode?: CardDetailsResponseInternationalPOSLanguageCodeEnum;
  /**
   * POS language identifier. Language Id:
   *   * `1` - German
   *   * `2` - French
   *   * `3` - Bulgarian
   *   * `4` - Croatian
   *   * `5` - Czech
   *   * `6` - Danish
   *   * `7` - Finnish
   *   * `8` - English
   *   * `9` - Greek
   *   * `10` - Chinese
   *   * `11` - Hungarian
   *   * `12` - Italian
   *   * `13` - Luxembourgish
   *   * `14` - Malay
   *   * `15` - Dutch
   *   * `16` - Norwegian, Bokmal
   *   * `17` - Urdu
   *   * `18` - Polish
   *   * `19` - Portuguese
   *   * `20` - Romanian
   *   * `21` - Russian
   *   * `22` - Slovak
   *   * `23` - Slovenian
   *   * `24` - Spanish
   *   * `25` - Swedish
   *   * `26` - Turkish
   *   * `27` - Thai
   *   * `28` - Filipino
   *   * `29` - Estonian
   *   * `30` - Latvian
   *   * `31` - Lithuanian
   */
  localPOSLanguageID?: CardDetailsResponseInternationalPOSLanguageIDEnum;
  /**
   * POS language code. Language code:
   *   * `deu` - German
   *   * `fra` - French
   *   * `bul` - Bulgarian
   *   * `hrv` - Croatian
   *   * `ces` - Czech
   *   * `dan` - Danish
   *   * `fin` - Finnish
   *   * `eng` - English
   *   * `ell` - Greek
   *   * `zho` - Chinese
   *   * `hun` - Hungarian
   *   * `ita` - Italian
   *   * `ltz` - Luxembourgish
   *   * `msa` - Malay
   *   * `nld` - Dutch
   *   * `nob` - Norwegian, Bokmal
   *   * `urd` - Urdu
   *   * `pol` - Polish
   *   * `por` - Portuguese
   *   * `ron` - Romanian
   *   * `rus` - Russian
   *   * `slk` - Slovak
   *   * `slv` - Slovenian
   *   * `spa` - Spanish
   *   * `swe` - Swedish
   *   * `tur` - Turkish
   *   * `tha` - Thai
   *   * `fil` - Filipino
   *   * `est` - Estonian
   *   * `lav` - Latvian
   *   * `lit` - Lithuanian
   */
  localPOSLanguageCode?: CardDetailsResponseInternationalPOSLanguageCodeEnum;
  /** ISO code of the card i.e. first 7 digits of the PAN. */
  cardTypeCode?: string | null;
  /** Card Type ID */
  cardTypeId?: number | null;
  /** Card Type Name */
  cardTypeName?: string | null;
  /** Token Type ID configured for the Card */
  tokenTypeId?: number | null;
  /** Token Type Name configured for the Card */
  tokenTypeName?: string | null;
  /** True if a chip card, else false */
  isChipCard?: boolean;
  /** True if it is a magnetic stripe card, else false */
  isMagStripCard?: boolean;
  /** True if it is a virtual card, else false */
  isVirtualCard?: boolean;
  /** Purchase category code of the card. */
  purchaseCategoryCode?: string | null;
  /** Purchase category identifier in the Shell Card Platform. */
  purchaseCategoryId?: number;
  /** Purchase category name */
  purchaseCategoryName?: string | null;
  /** True if it is a Commercial Road Transport (CRT) card, else false */
  isCRT?: boolean;
  /** True if it is a Fleet card, else false */
  isFleet?: boolean;
  /** True if it is an international card, else false */
  isInternational?: boolean;
  /** True if it is a national card, else false */
  isNational?: boolean;
  /** True if it is allowed at all partner sites, else false */
  isPartnerSitesIncluded?: boolean;
  /** True if it is only allowed at Shell sites, else false */
  isShellSitesOnly?: boolean;
  /** List of active fuel type product restrictions applied on the card. */
  fuelSets?: CardDetailsResponseFuelSetsItems[];
  /** List of active non-fuel type product restrictions applied on the card. */
  nonFuelSets?: CardDetailsResponseNonFuelSetsItems[];
  /** Card issue date. */
  issuedDate?: string | null;
  /** Expiry date of the card. */
  expiryDate?: string;
  /** Card last used date. */
  lastUsedDate?: string | null;
  /** Last misused date of the card. */
  misuseDate?: string | null;
  /** Hot-list status */
  temperature?: string | null;
  /** Driver name of the card. Note- While ordering card, optional when VRN is passed else mandatory. */
  driverName?: string;
  /** Vehicle registration number of the card. Note- While ordering card, optional when DriverName is passed else mandatory. */
  vRN?: string;
  /** Text printed on the card as account name. */
  embossText?: string;
  /**
   * Existing Card Group ID, under which the replacement card is to be created.
   * Pass “-1” if the replacement card should not be assigned to any card group.
   * Optional.
   * If not provided, the replacement card will be created under the same card group as the current card.
   * Example- 156
   */
  cardGroupId?: number | null;
  /** Card group name. Note- 1. While ordering card this field is mandatory when IsNewCardGroup is true. */
  cardGroupName?: string | null;
  /** Renewal date of the card. Applicable if ReissueSetting is set to True. */
  renewalDate?: string | null;
  /** Renewed card id. */
  renewedCardId?: number | null;
  /** Renewed card status id. */
  renewedCardStatusId?: number | null;
  /** Renewed card status description. */
  renewedCardStatus?: string;
  /** Renewed card expiry date. */
  renewedCardExpiryDate?: string;
  /** Renewed card issue number. */
  renewedCardIssueNumber?: number | null;
  /**
   * Reissue setting of the renewed new card. Reissue Setting:
   *   * `True` - Card will be sent to production
   *   * `False` - Parent Card is Dormant or the Card is not to be produced
   */
  renewedCardReissueSetting?: CardDetailsResponseRenewedCardReissueSettingEnum;
  /** Card Creation Date time */
  creationDate?: string | null;
  /** Effective date for the Card */
  effectiveDate?: string | null;
  /** Card last modified date */
  lastModifiedDate?: string | null;
  /** Bundle Id associated with card in the Gateway. This field will have a null value if the card is not associated with any bundle in Gateway or the value of IncludeBundleDetails in request is false. */
  bundleId?: string | null;
  cardDeliveryAddress?: CardDeliveryAddress;
  pINDeliveryAddress?: PINDeliveryAddress;
  cardBlockSchedules?:
    | CardDetailsResponseCardBlockSchedulesItemsAllOf0[]
    | null;
  error?: ErrorStatus;
  /** API Request */
  requestId?: string;
}

export const cardDetailsResponseSchema: Schema<CardDetailsResponse> = object({
  payerId: ['PayerId', optional(nullable(number()))],
  payerNumber: ['PayerNumber', optional(nullable(string()))],
  accountId: ['AccountId', optional(nullable(number()))],
  accountNumber: ['AccountNumber', optional(nullable(string()))],
  accountShortName: ['AccountShortName', optional(nullable(string()))],
  colCoCountryCode: ['ColCoCountryCode', optional(nullable(string()))],
  localCurrencyCode: ['LocalCurrencyCode', optional(nullable(string()))],
  localCurrencySymbol: ['LocalCurrencySymbol', optional(nullable(string()))],
  cardId: ['CardId', optional(number())],
  pAN: ['PAN', optional(nullable(string()))],
  statusId: ['StatusId', optional(cardDetailsResponseStatusIdEnumSchema)],
  status: ['Status', optional(string())],
  odometerPrompt: ['OdometerPrompt', optional(boolean())],
  fleetIdPrompt: ['FleetIdPrompt', optional(boolean())],
  pINType: ['PINType', optional(cardDetailsResponsePINTypeEnumSchema)],
  hasPIN: ['HasPIN', optional(boolean())],
  isSelfSelectedPIN: ['IsSelfSelectedPIN', optional(boolean())],
  temporaryBlockAllowed: ['TemporaryBlockAllowed', optional(boolean())],
  unblockAllowed: ['UnblockAllowed', optional(boolean())],
  permanentBlockAllowed: ['PermanentBlockAllowed', optional(boolean())],
  issueNumber: ['IssueNumber', optional(number())],
  reissueSetting: ['ReissueSetting', optional(unknown())],
  internationalPOSLanguageID: [
    'InternationalPOSLanguageID',
    optional(cardDetailsResponseInternationalPOSLanguageIDEnumSchema),
  ],
  internationalPOSLanguageCode: [
    'InternationalPOSLanguageCode',
    optional(cardDetailsResponseInternationalPOSLanguageCodeEnumSchema),
  ],
  localPOSLanguageID: [
    'LocalPOSLanguageID',
    optional(cardDetailsResponseInternationalPOSLanguageIDEnumSchema),
  ],
  localPOSLanguageCode: [
    'LocalPOSLanguageCode',
    optional(cardDetailsResponseInternationalPOSLanguageCodeEnumSchema),
  ],
  cardTypeCode: ['CardTypeCode', optional(nullable(string()))],
  cardTypeId: ['CardTypeId', optional(nullable(number()))],
  cardTypeName: ['CardTypeName', optional(nullable(string()))],
  tokenTypeId: ['TokenTypeId', optional(nullable(number()))],
  tokenTypeName: ['TokenTypeName', optional(nullable(string()))],
  isChipCard: ['IsChipCard', optional(boolean())],
  isMagStripCard: ['IsMagStripCard', optional(boolean())],
  isVirtualCard: ['IsVirtualCard', optional(boolean())],
  purchaseCategoryCode: ['PurchaseCategoryCode', optional(nullable(string()))],
  purchaseCategoryId: ['PurchaseCategoryId', optional(number())],
  purchaseCategoryName: ['PurchaseCategoryName', optional(nullable(string()))],
  isCRT: ['IsCRT', optional(boolean())],
  isFleet: ['IsFleet', optional(boolean())],
  isInternational: ['IsInternational', optional(boolean())],
  isNational: ['IsNational', optional(boolean())],
  isPartnerSitesIncluded: ['IsPartnerSitesIncluded', optional(boolean())],
  isShellSitesOnly: ['IsShellSitesOnly', optional(boolean())],
  fuelSets: [
    'FuelSets',
    optional(array(lazy(() => cardDetailsResponseFuelSetsItemsSchema))),
  ],
  nonFuelSets: [
    'NonFuelSets',
    optional(array(lazy(() => cardDetailsResponseNonFuelSetsItemsSchema))),
  ],
  issuedDate: ['IssuedDate', optional(nullable(string()))],
  expiryDate: ['ExpiryDate', optional(string())],
  lastUsedDate: ['LastUsedDate', optional(nullable(string()))],
  misuseDate: ['MisuseDate', optional(nullable(string()))],
  temperature: ['Temperature', optional(nullable(string()))],
  driverName: ['DriverName', optional(string())],
  vRN: ['VRN', optional(string())],
  embossText: ['EmbossText', optional(string())],
  cardGroupId: ['CardGroupId', optional(nullable(number()))],
  cardGroupName: ['CardGroupName', optional(nullable(string()))],
  renewalDate: ['RenewalDate', optional(nullable(string()))],
  renewedCardId: ['RenewedCardId', optional(nullable(number()))],
  renewedCardStatusId: ['RenewedCardStatusId', optional(nullable(number()))],
  renewedCardStatus: ['RenewedCardStatus', optional(string())],
  renewedCardExpiryDate: ['RenewedCardExpiryDate', optional(string())],
  renewedCardIssueNumber: [
    'RenewedCardIssueNumber',
    optional(nullable(number())),
  ],
  renewedCardReissueSetting: [
    'RenewedCardReissueSetting',
    optional(cardDetailsResponseRenewedCardReissueSettingEnumSchema),
  ],
  creationDate: ['CreationDate', optional(nullable(string()))],
  effectiveDate: ['EffectiveDate', optional(nullable(string()))],
  lastModifiedDate: ['LastModifiedDate', optional(nullable(string()))],
  bundleId: ['BundleId', optional(nullable(string()))],
  cardDeliveryAddress: [
    'CardDeliveryAddress',
    optional(lazy(() => cardDeliveryAddressSchema)),
  ],
  pINDeliveryAddress: [
    'PINDeliveryAddress',
    optional(lazy(() => pINDeliveryAddressSchema)),
  ],
  cardBlockSchedules: [
    'CardBlockSchedules',
    optional(
      nullable(
        array(
          lazy(() => cardDetailsResponseCardBlockSchedulesItemsAllOf0Schema)
        )
      )
    ),
  ],
  error: ['Error', optional(lazy(() => errorStatusSchema))],
  requestId: ['RequestId', optional(string())],
});
