<?php
/**
 * 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 SquareConnect\Model;

use \ArrayAccess;
/**
 * LoyaltyEventFilter Class Doc Comment
 *
 * @category Class
 * @package  SquareConnect
 * @author   Square Inc.
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache License v2
 * @link     https://squareup.com/developers
 * Note: This endpoint is in beta.
 */
class LoyaltyEventFilter implements ArrayAccess
{
    /**
      * Array of property to type mappings. Used for (de)serialization 
      * @var string[]
      */
    static $swaggerTypes = array(
        'loyalty_account_filter' => '\SquareConnect\Model\LoyaltyEventLoyaltyAccountFilter',
        'type_filter' => '\SquareConnect\Model\LoyaltyEventTypeFilter',
        'date_time_filter' => '\SquareConnect\Model\LoyaltyEventDateTimeFilter',
        'location_filter' => '\SquareConnect\Model\LoyaltyEventLocationFilter',
        'order_filter' => '\SquareConnect\Model\LoyaltyEventOrderFilter'
    );
  
    /** 
      * Array of attributes where the key is the local name, and the value is the original name
      * @var string[] 
      */
    static $attributeMap = array(
        'loyalty_account_filter' => 'loyalty_account_filter',
        'type_filter' => 'type_filter',
        'date_time_filter' => 'date_time_filter',
        'location_filter' => 'location_filter',
        'order_filter' => 'order_filter'
    );
  
    /**
      * Array of attributes to setter functions (for deserialization of responses)
      * @var string[]
      */
    static $setters = array(
        'loyalty_account_filter' => 'setLoyaltyAccountFilter',
        'type_filter' => 'setTypeFilter',
        'date_time_filter' => 'setDateTimeFilter',
        'location_filter' => 'setLocationFilter',
        'order_filter' => 'setOrderFilter'
    );
  
    /**
      * Array of attributes to getter functions (for serialization of requests)
      * @var string[]
      */
    static $getters = array(
        'loyalty_account_filter' => 'getLoyaltyAccountFilter',
        'type_filter' => 'getTypeFilter',
        'date_time_filter' => 'getDateTimeFilter',
        'location_filter' => 'getLocationFilter',
        'order_filter' => 'getOrderFilter'
    );
  
    /**
      * $loyalty_account_filter Filter events by loyalty account.
      * @var \SquareConnect\Model\LoyaltyEventLoyaltyAccountFilter
      */
    protected $loyalty_account_filter;
    /**
      * $type_filter Filter events by event type.
      * @var \SquareConnect\Model\LoyaltyEventTypeFilter
      */
    protected $type_filter;
    /**
      * $date_time_filter Filter events by date time range.  For each range, the start time is inclusive and the end time  is exclusive.
      * @var \SquareConnect\Model\LoyaltyEventDateTimeFilter
      */
    protected $date_time_filter;
    /**
      * $location_filter Filter events by location.
      * @var \SquareConnect\Model\LoyaltyEventLocationFilter
      */
    protected $location_filter;
    /**
      * $order_filter Filter events by the order associated with the event.
      * @var \SquareConnect\Model\LoyaltyEventOrderFilter
      */
    protected $order_filter;

    /**
     * Constructor
     * @param mixed[] $data Associated array of property value initializing the model
     */
    public function __construct(array $data = null)
    {
        if ($data != null) {
            if (isset($data["loyalty_account_filter"])) {
              $this->loyalty_account_filter = $data["loyalty_account_filter"];
            } else {
              $this->loyalty_account_filter = null;
            }
            if (isset($data["type_filter"])) {
              $this->type_filter = $data["type_filter"];
            } else {
              $this->type_filter = null;
            }
            if (isset($data["date_time_filter"])) {
              $this->date_time_filter = $data["date_time_filter"];
            } else {
              $this->date_time_filter = null;
            }
            if (isset($data["location_filter"])) {
              $this->location_filter = $data["location_filter"];
            } else {
              $this->location_filter = null;
            }
            if (isset($data["order_filter"])) {
              $this->order_filter = $data["order_filter"];
            } else {
              $this->order_filter = null;
            }
        }
    }
    /**
     * Gets loyalty_account_filter
     * @return \SquareConnect\Model\LoyaltyEventLoyaltyAccountFilter
     */
    public function getLoyaltyAccountFilter()
    {
        return $this->loyalty_account_filter;
    }
  
    /**
     * Sets loyalty_account_filter
     * @param \SquareConnect\Model\LoyaltyEventLoyaltyAccountFilter $loyalty_account_filter Filter events by loyalty account.
     * @return $this
     */
    public function setLoyaltyAccountFilter($loyalty_account_filter)
    {
        $this->loyalty_account_filter = $loyalty_account_filter;
        return $this;
    }
    /**
     * Gets type_filter
     * @return \SquareConnect\Model\LoyaltyEventTypeFilter
     */
    public function getTypeFilter()
    {
        return $this->type_filter;
    }
  
    /**
     * Sets type_filter
     * @param \SquareConnect\Model\LoyaltyEventTypeFilter $type_filter Filter events by event type.
     * @return $this
     */
    public function setTypeFilter($type_filter)
    {
        $this->type_filter = $type_filter;
        return $this;
    }
    /**
     * Gets date_time_filter
     * @return \SquareConnect\Model\LoyaltyEventDateTimeFilter
     */
    public function getDateTimeFilter()
    {
        return $this->date_time_filter;
    }
  
    /**
     * Sets date_time_filter
     * @param \SquareConnect\Model\LoyaltyEventDateTimeFilter $date_time_filter Filter events by date time range.  For each range, the start time is inclusive and the end time  is exclusive.
     * @return $this
     */
    public function setDateTimeFilter($date_time_filter)
    {
        $this->date_time_filter = $date_time_filter;
        return $this;
    }
    /**
     * Gets location_filter
     * @return \SquareConnect\Model\LoyaltyEventLocationFilter
     */
    public function getLocationFilter()
    {
        return $this->location_filter;
    }
  
    /**
     * Sets location_filter
     * @param \SquareConnect\Model\LoyaltyEventLocationFilter $location_filter Filter events by location.
     * @return $this
     */
    public function setLocationFilter($location_filter)
    {
        $this->location_filter = $location_filter;
        return $this;
    }
    /**
     * Gets order_filter
     * @return \SquareConnect\Model\LoyaltyEventOrderFilter
     */
    public function getOrderFilter()
    {
        return $this->order_filter;
    }
  
    /**
     * Sets order_filter
     * @param \SquareConnect\Model\LoyaltyEventOrderFilter $order_filter Filter events by the order associated with the event.
     * @return $this
     */
    public function setOrderFilter($order_filter)
    {
        $this->order_filter = $order_filter;
        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset 
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->$offset);
    }
  
    /**
     * Gets offset.
     * @param  integer $offset Offset 
     * @return mixed 
     */
    public function offsetGet($offset)
    {
        return $this->$offset;
    }
  
    /**
     * Sets value based on offset.
     * @param  integer $offset Offset 
     * @param  mixed   $value  Value to be set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        $this->$offset = $value;
    }
  
    /**
     * Unsets offset.
     * @param  integer $offset Offset 
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->$offset);
    }
  
    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        } else {
            return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this));
        }
    }
}
