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

/**
 * UPS TrackService API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * 
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.50
 */
/**
 * 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 UPS\Tracking\Tracking;

use \ArrayAccess;
use \UPS\Tracking\ObjectSerializer;

/**
 * Activity Class Doc Comment
 *
 * @category Class
 * @description Container with all activities associated with the package. Activities are returned in chronological order, with the most recent activity first.
 * @package  UPS\Tracking
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class Activity implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'date' => 'string',
        'gmt_date' => 'string',
        'gmt_offset' => 'string',
        'gmt_time' => 'string',
        'location' => '\UPS\Tracking\Tracking\Location',
        'status' => '\UPS\Tracking\Tracking\Status',
        'time' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'date' => null,
        'gmt_date' => null,
        'gmt_offset' => null,
        'gmt_time' => null,
        'location' => null,
        'status' => null,
        'time' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    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 = [
        'date' => 'date',
        'gmt_date' => 'gmtDate',
        'gmt_offset' => 'gmtOffset',
        'gmt_time' => 'gmtTime',
        'location' => 'location',
        'status' => 'status',
        'time' => 'time'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'date' => 'setDate',
        'gmt_date' => 'setGmtDate',
        'gmt_offset' => 'setGmtOffset',
        'gmt_time' => 'setGmtTime',
        'location' => 'setLocation',
        'status' => 'setStatus',
        'time' => 'setTime'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'date' => 'getDate',
        'gmt_date' => 'getGmtDate',
        'gmt_offset' => 'getGmtOffset',
        'gmt_time' => 'getGmtTime',
        'location' => 'getLocation',
        'status' => 'getStatus',
        'time' => 'getTime'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }



    /**
     * 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['date'] = isset($data['date']) ? $data['date'] : null;
        $this->container['gmt_date'] = isset($data['gmt_date']) ? $data['gmt_date'] : null;
        $this->container['gmt_offset'] = isset($data['gmt_offset']) ? $data['gmt_offset'] : null;
        $this->container['gmt_time'] = isset($data['gmt_time']) ? $data['gmt_time'] : null;
        $this->container['location'] = isset($data['location']) ? $data['location'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : null;
        $this->container['time'] = isset($data['time']) ? $data['time'] : null;
    }

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

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets date
     *
     * @param string $date The date of the activity. Format: YYYYMMDD
     *
     * @return $this
     */
    public function setDate($date)
    {
        $this->container['date'] = $date;

        return $this;
    }

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

    /**
     * Sets gmt_date
     *
     * @param string $gmt_date gmtDate
     *
     * @return $this
     */
    public function setGmtDate($gmt_date)
    {
        $this->container['gmt_date'] = $gmt_date;

        return $this;
    }

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

    /**
     * Sets gmt_offset
     *
     * @param string $gmt_offset gmtOffset
     *
     * @return $this
     */
    public function setGmtOffset($gmt_offset)
    {
        $this->container['gmt_offset'] = $gmt_offset;

        return $this;
    }

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

    /**
     * Sets gmt_time
     *
     * @param string $gmt_time gmtTime
     *
     * @return $this
     */
    public function setGmtTime($gmt_time)
    {
        $this->container['gmt_time'] = $gmt_time;

        return $this;
    }

    /**
     * Gets location
     *
     * @return \UPS\Tracking\Tracking\Location
     */
    public function getLocation()
    {
        return $this->container['location'];
    }

    /**
     * Sets location
     *
     * @param \UPS\Tracking\Tracking\Location $location location
     *
     * @return $this
     */
    public function setLocation($location)
    {
        $this->container['location'] = $location;

        return $this;
    }

    /**
     * Gets status
     *
     * @return \UPS\Tracking\Tracking\Status
     */
    public function getStatus()
    {
        return $this->container['status'];
    }

    /**
     * Sets status
     *
     * @param \UPS\Tracking\Tracking\Status $status status
     *
     * @return $this
     */
    public function setStatus($status)
    {
        $this->container['status'] = $status;

        return $this;
    }

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

    /**
     * Sets time
     *
     * @param string $time The time of the activity. Format: HHMMSS (24 hr)
     *
     * @return $this
     */
    public function setTime($time)
    {
        $this->container['time'] = $time;

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

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    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
     */
    #[\ReturnTypeWillChange]
    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
     */
    #[\ReturnTypeWillChange]
    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(
                ObjectSerializer::sanitizeForSerialization($this),
                JSON_PRETTY_PRINT
            );
        }

        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}
