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

import {
  boolean,
  lazy,
  nullable,
  object,
  optional,
  Schema,
  string,
  unknown,
} from '../schema';
import {
  CardDayTimeRestrictions,
  cardDayTimeRestrictionsSchema,
} from './cardDayTimeRestrictions';
import {
  LocationRestriction,
  locationRestrictionSchema,
} from './locationRestriction';

export interface BundleRestrictionUpdate {
  /**
   * True/False
   * A value indicates if the day/time restriction is to be reset for card bundle.
   * Optional
   * Default value is False.
   */
  resetDayTimeRestriction?: boolean | null;
  /**
   * True/False
   * A value indicates if the location restriction is to be reset for card bundle.
   * Optional
   * Default value is False.
   */
  resetLocationRestriction?: boolean | null;
  /**
   * True/False
   * A value indicates if the product restriction is to be reset for card bundle.
   * Optional
   * Default value is False.
   */
  resetProductRestriction?: boolean | null;
  usageRestrictions?: unknown;
  /**
   * Identifier of the day/time restriction profile to be updated for the bundle in Gateway.
   * Optional
   */
  dayTimeRestrictionProfileId?: string | null;
  dayTimeRestrictions?: CardDayTimeRestrictions;
  productRestrictions?: unknown;
  /**
   * Identifier of the location restriction profile to be updated for the bundle in Gateway.
   * Optional
   */
  locationRestrictionProfileId?: string;
  locationRestrictions?: LocationRestriction;
}

export const bundleRestrictionUpdateSchema: Schema<BundleRestrictionUpdate> = object(
  {
    resetDayTimeRestriction: [
      'ResetDayTimeRestriction',
      optional(nullable(boolean())),
    ],
    resetLocationRestriction: [
      'ResetLocationRestriction',
      optional(nullable(boolean())),
    ],
    resetProductRestriction: [
      'ResetProductRestriction',
      optional(nullable(boolean())),
    ],
    usageRestrictions: ['UsageRestrictions', optional(unknown())],
    dayTimeRestrictionProfileId: [
      'DayTimeRestrictionProfileId',
      optional(nullable(string())),
    ],
    dayTimeRestrictions: [
      'DayTimeRestrictions',
      optional(lazy(() => cardDayTimeRestrictionsSchema)),
    ],
    productRestrictions: ['ProductRestrictions', optional(unknown())],
    locationRestrictionProfileId: [
      'LocationRestrictionProfileId',
      optional(string()),
    ],
    locationRestrictions: [
      'LocationRestrictions',
      optional(lazy(() => locationRestrictionSchema)),
    ],
  }
);
