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

import {
  array,
  lazy,
  nullable,
  number,
  object,
  optional,
  Schema,
  string,
} from '../schema';
import {
  AccountVelocityLimit,
  accountVelocityLimitSchema,
} from './accountVelocityLimit';
import { ErrorStatus, errorStatusSchema } from './errorStatus';

export interface SearchAccountLimitResponse {
  /** Request Id of the API call */
  requestId?: string | null;
  /** Account ID of the customer. */
  accountId?: number;
  /**
   * Account Number
   * Example: GB99215176
   */
  accountNumber?: string;
  /**
   * 3 digit Shell global fuel product code, if already set up.
   * Example: 021
   */
  referenceProduct?: string;
  /**
   * The restriction condition code.
   * Example: DECLINE_ALERT
   */
  restrictionCondition?: string;
  velocityLimits?: AccountVelocityLimit[];
  error?: ErrorStatus;
}

export const searchAccountLimitResponseSchema: Schema<SearchAccountLimitResponse> = object(
  {
    requestId: ['RequestId', optional(nullable(string()))],
    accountId: ['AccountId', optional(number())],
    accountNumber: ['AccountNumber', optional(string())],
    referenceProduct: ['ReferenceProduct', optional(string())],
    restrictionCondition: ['RestrictionCondition', optional(string())],
    velocityLimits: [
      'VelocityLimits',
      optional(array(lazy(() => accountVelocityLimitSchema))),
    ],
    error: ['Error', optional(lazy(() => errorStatusSchema))],
  }
);
