<?php
/**
 * Package
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'access_point_information' => '\UPS\Tracking\Tracking\AccessPointInformation',
        'activity' => '\UPS\Tracking\Tracking\Activity[]',
        'additional_attributes' => 'string[]',
        'additional_services' => 'string[]',
        'alternate_tracking_number' => '\UPS\Tracking\Tracking\AlternateTrackingNumber[]',
        'current_status' => '\UPS\Tracking\Tracking\Status',
        'delivery_date' => '\UPS\Tracking\Tracking\DeliveryDate[]',
        'delivery_information' => '\UPS\Tracking\Tracking\DeliveryInformation',
        'delivery_time' => '\UPS\Tracking\Tracking\DeliveryTime',
        'milestones' => '\UPS\Tracking\Tracking\Milestones[]',
        'package_address' => '\UPS\Tracking\Tracking\PackageAddress[]',
        'package_count' => 'int',
        'payment_information' => '\UPS\Tracking\Tracking\PaymentInformation[]',
        'reference_number' => '\UPS\Tracking\Tracking\ReferenceNumber[]',
        'service' => '\UPS\Tracking\Tracking\Service',
        'status_code' => 'string',
        'status_description' => 'string',
        'suppression_indicators' => 'string[]',
        'tracking_number' => 'string',
        'weight' => '\UPS\Tracking\Tracking\Weight'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'access_point_information' => null,
        'activity' => null,
        'additional_attributes' => null,
        'additional_services' => null,
        'alternate_tracking_number' => null,
        'current_status' => null,
        'delivery_date' => null,
        'delivery_information' => null,
        'delivery_time' => null,
        'milestones' => null,
        'package_address' => null,
        'package_count' => 'int32',
        'payment_information' => null,
        'reference_number' => null,
        'service' => null,
        'status_code' => null,
        'status_description' => null,
        'suppression_indicators' => null,
        'tracking_number' => null,
        'weight' => 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 = [
        'access_point_information' => 'accessPointInformation',
        'activity' => 'activity',
        'additional_attributes' => 'additionalAttributes',
        'additional_services' => 'additionalServices',
        'alternate_tracking_number' => 'alternateTrackingNumber',
        'current_status' => 'currentStatus',
        'delivery_date' => 'deliveryDate',
        'delivery_information' => 'deliveryInformation',
        'delivery_time' => 'deliveryTime',
        'milestones' => 'milestones',
        'package_address' => 'packageAddress',
        'package_count' => 'packageCount',
        'payment_information' => 'paymentInformation',
        'reference_number' => 'referenceNumber',
        'service' => 'service',
        'status_code' => 'statusCode',
        'status_description' => 'statusDescription',
        'suppression_indicators' => 'suppressionIndicators',
        'tracking_number' => 'trackingNumber',
        'weight' => 'weight'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'access_point_information' => 'setAccessPointInformation',
        'activity' => 'setActivity',
        'additional_attributes' => 'setAdditionalAttributes',
        'additional_services' => 'setAdditionalServices',
        'alternate_tracking_number' => 'setAlternateTrackingNumber',
        'current_status' => 'setCurrentStatus',
        'delivery_date' => 'setDeliveryDate',
        'delivery_information' => 'setDeliveryInformation',
        'delivery_time' => 'setDeliveryTime',
        'milestones' => 'setMilestones',
        'package_address' => 'setPackageAddress',
        'package_count' => 'setPackageCount',
        'payment_information' => 'setPaymentInformation',
        'reference_number' => 'setReferenceNumber',
        'service' => 'setService',
        'status_code' => 'setStatusCode',
        'status_description' => 'setStatusDescription',
        'suppression_indicators' => 'setSuppressionIndicators',
        'tracking_number' => 'setTrackingNumber',
        'weight' => 'setWeight'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'access_point_information' => 'getAccessPointInformation',
        'activity' => 'getActivity',
        'additional_attributes' => 'getAdditionalAttributes',
        'additional_services' => 'getAdditionalServices',
        'alternate_tracking_number' => 'getAlternateTrackingNumber',
        'current_status' => 'getCurrentStatus',
        'delivery_date' => 'getDeliveryDate',
        'delivery_information' => 'getDeliveryInformation',
        'delivery_time' => 'getDeliveryTime',
        'milestones' => 'getMilestones',
        'package_address' => 'getPackageAddress',
        'package_count' => 'getPackageCount',
        'payment_information' => 'getPaymentInformation',
        'reference_number' => 'getReferenceNumber',
        'service' => 'getService',
        'status_code' => 'getStatusCode',
        'status_description' => 'getStatusDescription',
        'suppression_indicators' => 'getSuppressionIndicators',
        'tracking_number' => 'getTrackingNumber',
        'weight' => 'getWeight'
    ];

    /**
     * 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['access_point_information'] = isset($data['access_point_information']) ? $data['access_point_information'] : null;
        $this->container['activity'] = isset($data['activity']) ? $data['activity'] : null;
        $this->container['additional_attributes'] = isset($data['additional_attributes']) ? $data['additional_attributes'] : null;
        $this->container['additional_services'] = isset($data['additional_services']) ? $data['additional_services'] : null;
        $this->container['alternate_tracking_number'] = isset($data['alternate_tracking_number']) ? $data['alternate_tracking_number'] : null;
        $this->container['current_status'] = isset($data['current_status']) ? $data['current_status'] : null;
        $this->container['delivery_date'] = isset($data['delivery_date']) ? $data['delivery_date'] : null;
        $this->container['delivery_information'] = isset($data['delivery_information']) ? $data['delivery_information'] : null;
        $this->container['delivery_time'] = isset($data['delivery_time']) ? $data['delivery_time'] : null;
        $this->container['milestones'] = isset($data['milestones']) ? $data['milestones'] : null;
        $this->container['package_address'] = isset($data['package_address']) ? $data['package_address'] : null;
        $this->container['package_count'] = isset($data['package_count']) ? $data['package_count'] : null;
        $this->container['payment_information'] = isset($data['payment_information']) ? $data['payment_information'] : null;
        $this->container['reference_number'] = isset($data['reference_number']) ? $data['reference_number'] : null;
        $this->container['service'] = isset($data['service']) ? $data['service'] : null;
        $this->container['status_code'] = isset($data['status_code']) ? $data['status_code'] : null;
        $this->container['status_description'] = isset($data['status_description']) ? $data['status_description'] : null;
        $this->container['suppression_indicators'] = isset($data['suppression_indicators']) ? $data['suppression_indicators'] : null;
        $this->container['tracking_number'] = isset($data['tracking_number']) ? $data['tracking_number'] : null;
        $this->container['weight'] = isset($data['weight']) ? $data['weight'] : 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 access_point_information
     *
     * @return \UPS\Tracking\Tracking\AccessPointInformation
     */
    public function getAccessPointInformation()
    {
        return $this->container['access_point_information'];
    }

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

        return $this;
    }

    /**
     * Gets activity
     *
     * @return \UPS\Tracking\Tracking\Activity[]
     */
    public function getActivity()
    {
        return $this->container['activity'];
    }

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

        return $this;
    }

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

    /**
     * Sets additional_attributes
     *
     * @param string[] $additional_attributes The list of additional attributes that may be associated with the package. Presence of any element indicates the package has that attribute.
     *
     * @return $this
     */
    public function setAdditionalAttributes($additional_attributes)
    {
        $this->container['additional_attributes'] = $additional_attributes;

        return $this;
    }

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

    /**
     * Sets additional_services
     *
     * @param string[] $additional_services The list of additional services that may be associated with the package. Presence of any element indicates that the package has that service.
     *
     * @return $this
     */
    public function setAdditionalServices($additional_services)
    {
        $this->container['additional_services'] = $additional_services;

        return $this;
    }

    /**
     * Gets alternate_tracking_number
     *
     * @return \UPS\Tracking\Tracking\AlternateTrackingNumber[]
     */
    public function getAlternateTrackingNumber()
    {
        return $this->container['alternate_tracking_number'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets delivery_date
     *
     * @return \UPS\Tracking\Tracking\DeliveryDate[]
     */
    public function getDeliveryDate()
    {
        return $this->container['delivery_date'];
    }

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

        return $this;
    }

    /**
     * Gets delivery_information
     *
     * @return \UPS\Tracking\Tracking\DeliveryInformation
     */
    public function getDeliveryInformation()
    {
        return $this->container['delivery_information'];
    }

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

        return $this;
    }

    /**
     * Gets delivery_time
     *
     * @return \UPS\Tracking\Tracking\DeliveryTime
     */
    public function getDeliveryTime()
    {
        return $this->container['delivery_time'];
    }

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

        return $this;
    }

    /**
     * Gets milestones
     *
     * @return \UPS\Tracking\Tracking\Milestones[]
     */
    public function getMilestones()
    {
        return $this->container['milestones'];
    }

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

        return $this;
    }

    /**
     * Gets package_address
     *
     * @return \UPS\Tracking\Tracking\PackageAddress[]
     */
    public function getPackageAddress()
    {
        return $this->container['package_address'];
    }

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

        return $this;
    }

    /**
     * Gets package_count
     *
     * @return int
     */
    public function getPackageCount()
    {
        return $this->container['package_count'];
    }

    /**
     * Sets package_count
     *
     * @param int $package_count The total number of packages in the shipment. Note that this number may be greater than the number of returned packages in the response. In such cases subsequent calls are needed to get additional packages.
     *
     * @return $this
     */
    public function setPackageCount($package_count)
    {
        $this->container['package_count'] = $package_count;

        return $this;
    }

    /**
     * Gets payment_information
     *
     * @return \UPS\Tracking\Tracking\PaymentInformation[]
     */
    public function getPaymentInformation()
    {
        return $this->container['payment_information'];
    }

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

        return $this;
    }

    /**
     * Gets reference_number
     *
     * @return \UPS\Tracking\Tracking\ReferenceNumber[]
     */
    public function getReferenceNumber()
    {
        return $this->container['reference_number'];
    }

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

        return $this;
    }

    /**
     * Gets service
     *
     * @return \UPS\Tracking\Tracking\Service
     */
    public function getService()
    {
        return $this->container['service'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets status_description
     *
     * @param string $status_description The activity status description. Note: this field will be translated based on the locale provided in the request.
     *
     * @return $this
     */
    public function setStatusDescription($status_description)
    {
        $this->container['status_description'] = $status_description;

        return $this;
    }

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

    /**
     * Sets suppression_indicators
     *
     * @param string[] $suppression_indicators Contains values which signify that certain data should be suppressed or hidden. Valid values: Tracking activity details should be hidden. Note: this is mainly intended for use by UPS.com applications.
     *
     * @return $this
     */
    public function setSuppressionIndicators($suppression_indicators)
    {
        $this->container['suppression_indicators'] = $suppression_indicators;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets weight
     *
     * @return \UPS\Tracking\Tracking\Weight
     */
    public function getWeight()
    {
        return $this->container['weight'];
    }

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

        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));
    }
}
