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

import {
  array,
  lazy,
  number,
  object,
  optional,
  Schema,
  string,
} from '../schema';
import {
  ScheduleCardBlockResponseDataItems,
  scheduleCardBlockResponseDataItemsSchema,
} from './scheduleCardBlockResponseDataItems';

export interface ScheduleCardBlockResponse {
  /**
   * Reference number for tracking the execution of the request.
   * Note: Reference will be empty for status 9006 and 9012 i.e., request for all the cards failed.
   */
  mainReference?: number;
  /** API Request ID */
  requestId?: string;
  /** Overall Status of the API call */
  status?: string;
  /** List of SubmittedScheduleCardBlockCard entity. */
  data?: ScheduleCardBlockResponseDataItems[];
}

export const scheduleCardBlockResponseSchema: Schema<ScheduleCardBlockResponse> = object(
  {
    mainReference: ['MainReference', optional(number())],
    requestId: ['RequestId', optional(string())],
    status: ['Status', optional(string())],
    data: [
      'Data',
      optional(array(lazy(() => scheduleCardBlockResponseDataItemsSchema))),
    ],
  }
);
