<?php
/**
 * UpdatingADraftCampaignRequest
 *
 * PHP version 5
 *
 * @category Class
 * @package  Swagger\Client
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Moosend API
 *
 * TODO: Add a description
 *
 * OpenAPI spec version: 1.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace Swagger\Client\Model;

use \ArrayAccess;

/**
 * UpdatingADraftCampaignRequest Class Doc Comment
 *
 * @category    Class
 * @package     Swagger\Client
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class UpdatingADraftCampaignRequest implements ArrayAccess
{
    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'UpdatingADraftCampaignRequest';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'name' => 'string',
        'subject' => 'string',
        'sender_email' => 'string',
        'reply_to_email' => 'string',
        'is_ab' => 'string',
        'confirmation_to_email' => 'string',
        'web_location' => 'string',
        'mailing_lists' => '\Swagger\Client\Model\MailingLists[]',
        'segment_id' => 'string',
        'ab_campaign_type' => 'string',
        'track_in_google_analytics' => 'string',
        'dont_track_link_clicks' => 'string',
        'subject_b' => 'string',
        'web_location_b' => 'string',
        'sender_email_b' => 'string',
        'hours_to_test' => 'string',
        'list_percentage' => 'string',
        'ab_winner_selection_type' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerFormats = [
        'name' => null,
        'subject' => null,
        'sender_email' => null,
        'reply_to_email' => null,
        'is_ab' => null,
        'confirmation_to_email' => null,
        'web_location' => null,
        'mailing_lists' => null,
        'segment_id' => null,
        'ab_campaign_type' => null,
        'track_in_google_analytics' => null,
        'dont_track_link_clicks' => null,
        'subject_b' => null,
        'web_location_b' => null,
        'sender_email_b' => null,
        'hours_to_test' => null,
        'list_percentage' => null,
        'ab_winner_selection_type' => null
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'name' => 'Name',
        'subject' => 'Subject',
        'sender_email' => 'SenderEmail',
        'reply_to_email' => 'ReplyToEmail',
        'is_ab' => 'IsAB',
        'confirmation_to_email' => 'ConfirmationToEmail',
        'web_location' => 'WebLocation',
        'mailing_lists' => 'MailingLists',
        'segment_id' => 'SegmentID',
        'ab_campaign_type' => 'ABCampaignType',
        'track_in_google_analytics' => 'TrackInGoogleAnalytics',
        'dont_track_link_clicks' => 'DontTrackLinkClicks',
        'subject_b' => 'SubjectB',
        'web_location_b' => 'WebLocationB',
        'sender_email_b' => 'SenderEmailB',
        'hours_to_test' => 'HoursToTest',
        'list_percentage' => 'ListPercentage',
        'ab_winner_selection_type' => 'ABWinnerSelectionType'
    ];


    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'name' => 'setName',
        'subject' => 'setSubject',
        'sender_email' => 'setSenderEmail',
        'reply_to_email' => 'setReplyToEmail',
        'is_ab' => 'setIsAb',
        'confirmation_to_email' => 'setConfirmationToEmail',
        'web_location' => 'setWebLocation',
        'mailing_lists' => 'setMailingLists',
        'segment_id' => 'setSegmentId',
        'ab_campaign_type' => 'setAbCampaignType',
        'track_in_google_analytics' => 'setTrackInGoogleAnalytics',
        'dont_track_link_clicks' => 'setDontTrackLinkClicks',
        'subject_b' => 'setSubjectB',
        'web_location_b' => 'setWebLocationB',
        'sender_email_b' => 'setSenderEmailB',
        'hours_to_test' => 'setHoursToTest',
        'list_percentage' => 'setListPercentage',
        'ab_winner_selection_type' => 'setAbWinnerSelectionType'
    ];


    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'name' => 'getName',
        'subject' => 'getSubject',
        'sender_email' => 'getSenderEmail',
        'reply_to_email' => 'getReplyToEmail',
        'is_ab' => 'getIsAb',
        'confirmation_to_email' => 'getConfirmationToEmail',
        'web_location' => 'getWebLocation',
        'mailing_lists' => 'getMailingLists',
        'segment_id' => 'getSegmentId',
        'ab_campaign_type' => 'getAbCampaignType',
        'track_in_google_analytics' => 'getTrackInGoogleAnalytics',
        'dont_track_link_clicks' => 'getDontTrackLinkClicks',
        'subject_b' => 'getSubjectB',
        'web_location_b' => 'getWebLocationB',
        'sender_email_b' => 'getSenderEmailB',
        'hours_to_test' => 'getHoursToTest',
        'list_percentage' => 'getListPercentage',
        'ab_winner_selection_type' => 'getAbWinnerSelectionType'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    

    

    /**
     * Associative array for storing property values
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     * @param mixed[] $data Associated array of property values initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['subject'] = isset($data['subject']) ? $data['subject'] : null;
        $this->container['sender_email'] = isset($data['sender_email']) ? $data['sender_email'] : null;
        $this->container['reply_to_email'] = isset($data['reply_to_email']) ? $data['reply_to_email'] : null;
        $this->container['is_ab'] = isset($data['is_ab']) ? $data['is_ab'] : null;
        $this->container['confirmation_to_email'] = isset($data['confirmation_to_email']) ? $data['confirmation_to_email'] : null;
        $this->container['web_location'] = isset($data['web_location']) ? $data['web_location'] : null;
        $this->container['mailing_lists'] = isset($data['mailing_lists']) ? $data['mailing_lists'] : null;
        $this->container['segment_id'] = isset($data['segment_id']) ? $data['segment_id'] : null;
        $this->container['ab_campaign_type'] = isset($data['ab_campaign_type']) ? $data['ab_campaign_type'] : null;
        $this->container['track_in_google_analytics'] = isset($data['track_in_google_analytics']) ? $data['track_in_google_analytics'] : null;
        $this->container['dont_track_link_clicks'] = isset($data['dont_track_link_clicks']) ? $data['dont_track_link_clicks'] : null;
        $this->container['subject_b'] = isset($data['subject_b']) ? $data['subject_b'] : null;
        $this->container['web_location_b'] = isset($data['web_location_b']) ? $data['web_location_b'] : null;
        $this->container['sender_email_b'] = isset($data['sender_email_b']) ? $data['sender_email_b'] : null;
        $this->container['hours_to_test'] = isset($data['hours_to_test']) ? $data['hours_to_test'] : null;
        $this->container['list_percentage'] = isset($data['list_percentage']) ? $data['list_percentage'] : null;
        $this->container['ab_winner_selection_type'] = isset($data['ab_winner_selection_type']) ? $data['ab_winner_selection_type'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = [];

        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        return true;
    }


    /**
     * Gets name
     * @return string
     */
    public function getName()
    {
        return $this->container['name'];
    }

    /**
     * Sets name
     * @param string $name The name of the campaign.
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets subject
     * @return string
     */
    public function getSubject()
    {
        return $this->container['subject'];
    }

    /**
     * Sets subject
     * @param string $subject The subject line of the new campaign.
     * @return $this
     */
    public function setSubject($subject)
    {
        $this->container['subject'] = $subject;

        return $this;
    }

    /**
     * Gets sender_email
     * @return string
     */
    public function getSenderEmail()
    {
        return $this->container['sender_email'];
    }

    /**
     * Sets sender_email
     * @param string $sender_email The sender email of the campaign.
     * @return $this
     */
    public function setSenderEmail($sender_email)
    {
        $this->container['sender_email'] = $sender_email;

        return $this;
    }

    /**
     * Gets reply_to_email
     * @return string
     */
    public function getReplyToEmail()
    {
        return $this->container['reply_to_email'];
    }

    /**
     * Sets reply_to_email
     * @param string $reply_to_email The email address to which recipients replies will arrive. It must be one of your sender accounts. If not specified, the sender's email will be assumed.
     * @return $this
     */
    public function setReplyToEmail($reply_to_email)
    {
        $this->container['reply_to_email'] = $reply_to_email;

        return $this;
    }

    /**
     * Gets is_ab
     * @return string
     */
    public function getIsAb()
    {
        return $this->container['is_ab'];
    }

    /**
     * Sets is_ab
     * @param string $is_ab A flag that defines if a campaign is an AB campaign.
     * @return $this
     */
    public function setIsAb($is_ab)
    {
        $this->container['is_ab'] = $is_ab;

        return $this;
    }

    /**
     * Gets confirmation_to_email
     * @return string
     */
    public function getConfirmationToEmail()
    {
        return $this->container['confirmation_to_email'];
    }

    /**
     * Sets confirmation_to_email
     * @param string $confirmation_to_email The email address to which a confirmation message will be,  sent when the campaign has been successfully sent.
     * @return $this
     */
    public function setConfirmationToEmail($confirmation_to_email)
    {
        $this->container['confirmation_to_email'] = $confirmation_to_email;

        return $this;
    }

    /**
     * Gets web_location
     * @return string
     */
    public function getWebLocation()
    {
        return $this->container['web_location'];
    }

    /**
     * Sets web_location
     * @param string $web_location A url to retrieve the html content for the campaign. We'll automatically move all CSS inline.
     * @return $this
     */
    public function setWebLocation($web_location)
    {
        $this->container['web_location'] = $web_location;

        return $this;
    }

    /**
     * Gets mailing_lists
     * @return \Swagger\Client\Model\MailingLists[]
     */
    public function getMailingLists()
    {
        return $this->container['mailing_lists'];
    }

    /**
     * Sets mailing_lists
     * @param \Swagger\Client\Model\MailingLists[] $mailing_lists A list of mailing lists in your account to which the campaign will be sent to.
     * @return $this
     */
    public function setMailingLists($mailing_lists)
    {
        $this->container['mailing_lists'] = $mailing_lists;

        return $this;
    }

    /**
     * Gets segment_id
     * @return string
     */
    public function getSegmentId()
    {
        return $this->container['segment_id'];
    }

    /**
     * Sets segment_id
     * @param string $segment_id The ID of a segment in the specified mailing list to filter the recipients with. If not specified, the campaign will be sent to all active subscribers of the mailing list.
     * @return $this
     */
    public function setSegmentId($segment_id)
    {
        $this->container['segment_id'] = $segment_id;

        return $this;
    }

    /**
     * Gets ab_campaign_type
     * @return string
     */
    public function getAbCampaignType()
    {
        return $this->container['ab_campaign_type'];
    }

    /**
     * Sets ab_campaign_type
     * @param string $ab_campaign_type If you want to send an AB split campaign you should specify this parameter to one of the following values.  * `Subject` * `Sender` * `Content`
     * @return $this
     */
    public function setAbCampaignType($ab_campaign_type)
    {
        $this->container['ab_campaign_type'] = $ab_campaign_type;

        return $this;
    }

    /**
     * Gets track_in_google_analytics
     * @return string
     */
    public function getTrackInGoogleAnalytics()
    {
        return $this->container['track_in_google_analytics'];
    }

    /**
     * Sets track_in_google_analytics
     * @param string $track_in_google_analytics Tracks traffic from your campaign to your site. Note: You need to have Google Analytics configured on your site to use this feature.
     * @return $this
     */
    public function setTrackInGoogleAnalytics($track_in_google_analytics)
    {
        $this->container['track_in_google_analytics'] = $track_in_google_analytics;

        return $this;
    }

    /**
     * Gets dont_track_link_clicks
     * @return string
     */
    public function getDontTrackLinkClicks()
    {
        return $this->container['dont_track_link_clicks'];
    }

    /**
     * Sets dont_track_link_clicks
     * @param string $dont_track_link_clicks Moosend wraps your own links with its own to enable link click tracking. Check this box if you don't wish to track link click traffic through Moosend.
     * @return $this
     */
    public function setDontTrackLinkClicks($dont_track_link_clicks)
    {
        $this->container['dont_track_link_clicks'] = $dont_track_link_clicks;

        return $this;
    }

    /**
     * Gets subject_b
     * @return string
     */
    public function getSubjectB()
    {
        return $this->container['subject_b'];
    }

    /**
     * Sets subject_b
     * @param string $subject_b If you wish to send an AB split campaign with two different versions of the subject line , you must specify the second subject using this parameter. If specified in any other campaign type, it will be ignored.
     * @return $this
     */
    public function setSubjectB($subject_b)
    {
        $this->container['subject_b'] = $subject_b;

        return $this;
    }

    /**
     * Gets web_location_b
     * @return string
     */
    public function getWebLocationB()
    {
        return $this->container['web_location_b'];
    }

    /**
     * Sets web_location_b
     * @param string $web_location_b If you wish to send an AB split campaign with two different versions of the html content, you must specify where the second html content will be retrieved from using this parameter. If specified in any other campaign type, it will be ignored.
     * @return $this
     */
    public function setWebLocationB($web_location_b)
    {
        $this->container['web_location_b'] = $web_location_b;

        return $this;
    }

    /**
     * Gets sender_email_b
     * @return string
     */
    public function getSenderEmailB()
    {
        return $this->container['sender_email_b'];
    }

    /**
     * Sets sender_email_b
     * @param string $sender_email_b If you wish to send an AB split campaign with two different versions of the sender , you must specify the second sender email address using this parameter. This must be one of your sender signatures defined in your account. If specified in any other campaign type, it will be ignored.
     * @return $this
     */
    public function setSenderEmailB($sender_email_b)
    {
        $this->container['sender_email_b'] = $sender_email_b;

        return $this;
    }

    /**
     * Gets hours_to_test
     * @return string
     */
    public function getHoursToTest()
    {
        return $this->container['hours_to_test'];
    }

    /**
     * Sets hours_to_test
     * @param string $hours_to_test If you choose to send an AB campaign type, you must set this parameter to specify how long the test will run, before determining which will be the winning version to be sent to the rest of the recipients. This should be an integer value between 1 and 24. If specified in a regular campaign, it will be ignored.
     * @return $this
     */
    public function setHoursToTest($hours_to_test)
    {
        $this->container['hours_to_test'] = $hours_to_test;

        return $this;
    }

    /**
     * Gets list_percentage
     * @return string
     */
    public function getListPercentage()
    {
        return $this->container['list_percentage'];
    }

    /**
     * Sets list_percentage
     * @param string $list_percentage If you choose to send an AB campaign type, you must set this parameter to specify a portion of the target recipients that will receive the test versions. For example, if you specify 10, then 10% of your recipients will receive the A version and another 10% will receive the B version. The specified value should be an integer between 5 and 40. If specified in a regular campaign, it will be ignored. (optional, string)
     * @return $this
     */
    public function setListPercentage($list_percentage)
    {
        $this->container['list_percentage'] = $list_percentage;

        return $this;
    }

    /**
     * Gets ab_winner_selection_type
     * @return string
     */
    public function getAbWinnerSelectionType()
    {
        return $this->container['ab_winner_selection_type'];
    }

    /**
     * Sets ab_winner_selection_type
     * @param string $ab_winner_selection_type If you choose to send an AB campaign type, you may set this parameter to one of the following values to specify the method to determine the winning version for the test.   If not set, OpenRate will be assumed. If specified in a regular campaign, it will be ignored. * `OpenRate` * `TotalUniqueClicks`
     * @return $this
     */
    public function setAbWinnerSelectionType($ab_winner_selection_type)
    {
        $this->container['ab_winner_selection_type'] = $ab_winner_selection_type;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     * @param  integer $offset Offset
     * @param  mixed   $value  Value to be set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     * @param  integer $offset Offset
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this));
    }
}


