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

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

export interface AccountRestrictionResponse {
  /** Request Id of the API call */
  requestId?: string | null;
  /**
   * Account Id on which restriction is applied.
   * Example: 123456
   */
  accountId?: number;
  /**
   * Account Number on which restriction is applied.
   * Example: GB000000123
   */
  accountNumber?: string;
  /** Status of the card usage restriction submitted to Gateway. Based on the response from Gateway value will be set as either “Success” or “Failed”. */
  usageRestrictionStatus?: string;
  /** Response for the usage restriction in case of an error. This field will have a value only when “UsageRestrictionStatus” is “Failed”. */
  usageRestrictionDescription?: string;
  error?: ErrorStatus;
}

export const accountRestrictionResponseSchema: Schema<AccountRestrictionResponse> = object(
  {
    requestId: ['RequestId', optional(nullable(string()))],
    accountId: ['AccountId', optional(number())],
    accountNumber: ['AccountNumber', optional(string())],
    usageRestrictionStatus: ['UsageRestrictionStatus', optional(string())],
    usageRestrictionDescription: [
      'UsageRestrictionDescription',
      optional(string()),
    ],
    error: ['Error', optional(lazy(() => errorStatusSchema))],
  }
);
