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

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

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

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