/**
 * 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 { ErrorStatus, errorStatusSchema } from './errorStatus';
import {
  RestrictioncardsRes,
  restrictioncardsResSchema,
} from './restrictioncardsRes';

export interface CardRestrictionResponse {
  /** Request Id of the API call */
  requestId?: string | null;
  /** Reference number for tracking the execution of the card restriction requests. */
  restrictionRequestReference?: number;
  cards?: RestrictioncardsRes[];
  error?: ErrorStatus;
}

export const cardRestrictionResponseSchema: Schema<CardRestrictionResponse> = object(
  {
    requestId: ['RequestId', optional(nullable(string()))],
    restrictionRequestReference: [
      'RestrictionRequestReference',
      optional(number()),
    ],
    cards: ['Cards', optional(array(lazy(() => restrictioncardsResSchema)))],
    error: ['Error', optional(lazy(() => errorStatusSchema))],
  }
);
