<?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;
/**
 * SearchOrdersFilter 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
 */
class SearchOrdersFilter implements ArrayAccess
{
    /**
      * Array of property to type mappings. Used for (de)serialization 
      * @var string[]
      */
    static $swaggerTypes = array(
        'state_filter' => '\SquareConnect\Model\SearchOrdersStateFilter',
        'date_time_filter' => '\SquareConnect\Model\SearchOrdersDateTimeFilter',
        'fulfillment_filter' => '\SquareConnect\Model\SearchOrdersFulfillmentFilter',
        'source_filter' => '\SquareConnect\Model\SearchOrdersSourceFilter',
        'customer_filter' => '\SquareConnect\Model\SearchOrdersCustomerFilter'
    );
  
    /** 
      * Array of attributes where the key is the local name, and the value is the original name
      * @var string[] 
      */
    static $attributeMap = array(
        'state_filter' => 'state_filter',
        'date_time_filter' => 'date_time_filter',
        'fulfillment_filter' => 'fulfillment_filter',
        'source_filter' => 'source_filter',
        'customer_filter' => 'customer_filter'
    );
  
    /**
      * Array of attributes to setter functions (for deserialization of responses)
      * @var string[]
      */
    static $setters = array(
        'state_filter' => 'setStateFilter',
        'date_time_filter' => 'setDateTimeFilter',
        'fulfillment_filter' => 'setFulfillmentFilter',
        'source_filter' => 'setSourceFilter',
        'customer_filter' => 'setCustomerFilter'
    );
  
    /**
      * Array of attributes to getter functions (for serialization of requests)
      * @var string[]
      */
    static $getters = array(
        'state_filter' => 'getStateFilter',
        'date_time_filter' => 'getDateTimeFilter',
        'fulfillment_filter' => 'getFulfillmentFilter',
        'source_filter' => 'getSourceFilter',
        'customer_filter' => 'getCustomerFilter'
    );
  
    /**
      * $state_filter Filter by [`OrderState`](#type-orderstate).
      * @var \SquareConnect\Model\SearchOrdersStateFilter
      */
    protected $state_filter;
    /**
      * $date_time_filter Filter for results within a time range.  __Important:__ If you filter for orders by time range, you must set SearchOrdersSort to sort by the same field. [Learn more about filtering orders by time range](/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range)
      * @var \SquareConnect\Model\SearchOrdersDateTimeFilter
      */
    protected $date_time_filter;
    /**
      * $fulfillment_filter Filter by fulfillment type or state.
      * @var \SquareConnect\Model\SearchOrdersFulfillmentFilter
      */
    protected $fulfillment_filter;
    /**
      * $source_filter Filter by source of order.
      * @var \SquareConnect\Model\SearchOrdersSourceFilter
      */
    protected $source_filter;
    /**
      * $customer_filter Filter by customers associated with the order.
      * @var \SquareConnect\Model\SearchOrdersCustomerFilter
      */
    protected $customer_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["state_filter"])) {
              $this->state_filter = $data["state_filter"];
            } else {
              $this->state_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["fulfillment_filter"])) {
              $this->fulfillment_filter = $data["fulfillment_filter"];
            } else {
              $this->fulfillment_filter = null;
            }
            if (isset($data["source_filter"])) {
              $this->source_filter = $data["source_filter"];
            } else {
              $this->source_filter = null;
            }
            if (isset($data["customer_filter"])) {
              $this->customer_filter = $data["customer_filter"];
            } else {
              $this->customer_filter = null;
            }
        }
    }
    /**
     * Gets state_filter
     * @return \SquareConnect\Model\SearchOrdersStateFilter
     */
    public function getStateFilter()
    {
        return $this->state_filter;
    }
  
    /**
     * Sets state_filter
     * @param \SquareConnect\Model\SearchOrdersStateFilter $state_filter Filter by [`OrderState`](#type-orderstate).
     * @return $this
     */
    public function setStateFilter($state_filter)
    {
        $this->state_filter = $state_filter;
        return $this;
    }
    /**
     * Gets date_time_filter
     * @return \SquareConnect\Model\SearchOrdersDateTimeFilter
     */
    public function getDateTimeFilter()
    {
        return $this->date_time_filter;
    }
  
    /**
     * Sets date_time_filter
     * @param \SquareConnect\Model\SearchOrdersDateTimeFilter $date_time_filter Filter for results within a time range.  __Important:__ If you filter for orders by time range, you must set SearchOrdersSort to sort by the same field. [Learn more about filtering orders by time range](/orders-api/manage-orders#important-note-on-filtering-orders-by-time-range)
     * @return $this
     */
    public function setDateTimeFilter($date_time_filter)
    {
        $this->date_time_filter = $date_time_filter;
        return $this;
    }
    /**
     * Gets fulfillment_filter
     * @return \SquareConnect\Model\SearchOrdersFulfillmentFilter
     */
    public function getFulfillmentFilter()
    {
        return $this->fulfillment_filter;
    }
  
    /**
     * Sets fulfillment_filter
     * @param \SquareConnect\Model\SearchOrdersFulfillmentFilter $fulfillment_filter Filter by fulfillment type or state.
     * @return $this
     */
    public function setFulfillmentFilter($fulfillment_filter)
    {
        $this->fulfillment_filter = $fulfillment_filter;
        return $this;
    }
    /**
     * Gets source_filter
     * @return \SquareConnect\Model\SearchOrdersSourceFilter
     */
    public function getSourceFilter()
    {
        return $this->source_filter;
    }
  
    /**
     * Sets source_filter
     * @param \SquareConnect\Model\SearchOrdersSourceFilter $source_filter Filter by source of order.
     * @return $this
     */
    public function setSourceFilter($source_filter)
    {
        $this->source_filter = $source_filter;
        return $this;
    }
    /**
     * Gets customer_filter
     * @return \SquareConnect\Model\SearchOrdersCustomerFilter
     */
    public function getCustomerFilter()
    {
        return $this->customer_filter;
    }
  
    /**
     * Sets customer_filter
     * @param \SquareConnect\Model\SearchOrdersCustomerFilter $customer_filter Filter by customers associated with the order.
     * @return $this
     */
    public function setCustomerFilter($customer_filter)
    {
        $this->customer_filter = $customer_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));
        }
    }
}
