/*
 * The version of the OpenAPI document: v2
 * Contact: developer-experience@adyen.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit this class manually.
 */

import { Duration } from './duration';

export class TransactionRuleInterval {
    /**
    * The day of month, used when the `duration.unit` is **months**. If not provided, by default, this is set to **1**, the first day of the month.
    */
    'dayOfMonth'?: number;
    /**
    * The day of week, used when the `duration.unit` is **weeks**. If not provided, by default, this is set to **monday**.  Possible values: **sunday**, **monday**, **tuesday**, **wednesday**, **thursday**, **friday**.
    */
    'dayOfWeek'?: TransactionRuleInterval.DayOfWeekEnum;
    'duration'?: Duration;
    /**
    * The time of day, in **hh:mm:ss** format, used when the `duration.unit` is **hours**. If not provided, by default, this is set to **00:00:00**.
    */
    'timeOfDay'?: string;
    /**
    * The [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, **Europe/Amsterdam**. By default, this is set to **UTC**.
    */
    'timeZone'?: string;
    /**
    * The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during which the rule conditions and limits apply, and how often counters are reset.  Possible values:   * **perTransaction**: conditions are evaluated and the counters are reset for every transaction.  * **daily**: the counters are reset daily at 00:00:00 UTC.  * **weekly**: the counters are reset every Monday at 00:00:00 UTC.   * **monthly**: the counters reset every first day of the month at 00:00:00 UTC.   * **lifetime**: conditions are applied to the lifetime of the payment instrument.  * **rolling**: conditions are applied and the counters are reset based on a `duration`. If the reset date and time are not provided, Adyen applies the default reset time similar to fixed intervals. For example, if the duration is every two weeks, the counter resets every third Monday at 00:00:00 UTC.  * **sliding**: conditions are applied and the counters are reset based on the current time and a `duration` that you specify.
    */
    'type': TransactionRuleInterval.TypeEnum;

    static discriminator: string | undefined = undefined;

    static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
        {
            "name": "dayOfMonth",
            "baseName": "dayOfMonth",
            "type": "number"
        },
        {
            "name": "dayOfWeek",
            "baseName": "dayOfWeek",
            "type": "TransactionRuleInterval.DayOfWeekEnum"
        },
        {
            "name": "duration",
            "baseName": "duration",
            "type": "Duration"
        },
        {
            "name": "timeOfDay",
            "baseName": "timeOfDay",
            "type": "string"
        },
        {
            "name": "timeZone",
            "baseName": "timeZone",
            "type": "string"
        },
        {
            "name": "type",
            "baseName": "type",
            "type": "TransactionRuleInterval.TypeEnum"
        }    ];

    static getAttributeTypeMap() {
        return TransactionRuleInterval.attributeTypeMap;
    }
}

export namespace TransactionRuleInterval {
    export enum DayOfWeekEnum {
        Friday = <any> 'friday',
        Monday = <any> 'monday',
        Saturday = <any> 'saturday',
        Sunday = <any> 'sunday',
        Thursday = <any> 'thursday',
        Tuesday = <any> 'tuesday',
        Wednesday = <any> 'wednesday'
    }
    export enum TypeEnum {
        Daily = <any> 'daily',
        Lifetime = <any> 'lifetime',
        Monthly = <any> 'monthly',
        PerTransaction = <any> 'perTransaction',
        Rolling = <any> 'rolling',
        Sliding = <any> 'sliding',
        Weekly = <any> 'weekly'
    }
}
