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

import { lazy, object, optional, Schema, unknown } from '../schema';
import {
  DayTimeRestrictions,
  dayTimeRestrictionsSchema,
} from './dayTimeRestrictions';
import {
  LocationRestriction,
  locationRestrictionSchema,
} from './locationRestriction';
import {
  SearchProductRestriction,
  searchProductRestrictionSchema,
} from './searchProductRestriction';

export interface Restriction {
  usageRestrictions?: unknown;
  dayTimeRestrictions?: DayTimeRestrictions;
  productRestrictions?: SearchProductRestriction;
  locationRestrictions?: LocationRestriction;
}

export const restrictionSchema: Schema<Restriction> = object({
  usageRestrictions: ['UsageRestrictions', optional(unknown())],
  dayTimeRestrictions: [
    'DayTimeRestrictions',
    optional(lazy(() => dayTimeRestrictionsSchema)),
  ],
  productRestrictions: [
    'ProductRestrictions',
    optional(lazy(() => searchProductRestrictionSchema)),
  ],
  locationRestrictions: [
    'LocationRestrictions',
    optional(lazy(() => locationRestrictionSchema)),
  ],
});
