/**
 * 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.js';
import {
  AccountVelocityLimit,
  accountVelocityLimitSchema,
} from './accountVelocityLimit.js';

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[];
}

export const searchAccountLimitResponseSchema: Schema<SearchAccountLimitResponse> = lazy(
  () =>
    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(accountVelocityLimitSchema)),
      ],
    })
);
