package ru.yandex.autotests.directapi.model.api5.campaigns;

import com.yandex.direct.api.v5.campaigns.TimeTargeting;
import com.yandex.direct.api.v5.campaigns.TimeTargetingAdd;
import com.yandex.direct.api.v5.campaigns.TimeTargetingOnPublicHolidays;

/**
 * Created by pavryabov on 15.08.15.
 */
public class TimeTargetingAddMap extends TimeTargetingBaseMap<TimeTargetingAddMap> {

    public static final String HOLIDAYS_SCHEDULE = "holidaysSchedule";

    public TimeTargetingAddMap() {
        super();
        setBean(new TimeTargetingAdd());
    }

    public TimeTargetingAddMap(TimeTargeting timeTargeting) {
        super();
        setBean(timeTargeting);
    }

    public TimeTargetingAddMap put(String fieldName, Object value) {
        super.put(fieldName, value);
        return this;
    }

    public TimeTargetingAddMap withHolidaysSchedule(TimeTargetingOnPublicHolidaysMap timeTargetingOnPublicHolidaysMap) {
        TimeTargetingOnPublicHolidays timeTargetingOnPublicHolidays =
                (TimeTargetingOnPublicHolidays) ((timeTargetingOnPublicHolidaysMap == null)
                        ? null : timeTargetingOnPublicHolidaysMap.getBean());
        this.put(HOLIDAYS_SCHEDULE, timeTargetingOnPublicHolidays);
        return this;
    }
}
