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

/**
 * Pickup
 *
 * 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\Pickup\Pickup;

use \ArrayAccess;
use \UPS\Pickup\ObjectSerializer;

/**
 * PickupPendingStatusResponsePendingStatus Class Doc Comment
 *
 * @category Class
 * @description The result of retrieving pending pickups.
 * @package  UPS\Pickup
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class PickupPendingStatusResponsePendingStatus implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'pickup_type' => 'string',
        'service_date' => 'string',
        'prn' => 'string',
        'gwn_status_code' => 'string',
        'on_call_status_code' => 'string',
        'pickup_status_message' => 'string',
        'billing_code' => 'string',
        'contact_name' => 'string',
        'reference_number' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'pickup_type' => null,
        'service_date' => null,
        'prn' => null,
        'gwn_status_code' => null,
        'on_call_status_code' => null,
        'pickup_status_message' => null,
        'billing_code' => null,
        'contact_name' => null,
        'reference_number' => 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 = [
        'pickup_type' => 'PickupType',
        'service_date' => 'ServiceDate',
        'prn' => 'PRN',
        'gwn_status_code' => 'GWNStatusCode',
        'on_call_status_code' => 'OnCallStatusCode',
        'pickup_status_message' => 'PickupStatusMessage',
        'billing_code' => 'BillingCode',
        'contact_name' => 'ContactName',
        'reference_number' => 'ReferenceNumber'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'pickup_type' => 'setPickupType',
        'service_date' => 'setServiceDate',
        'prn' => 'setPrn',
        'gwn_status_code' => 'setGwnStatusCode',
        'on_call_status_code' => 'setOnCallStatusCode',
        'pickup_status_message' => 'setPickupStatusMessage',
        'billing_code' => 'setBillingCode',
        'contact_name' => 'setContactName',
        'reference_number' => 'setReferenceNumber'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'pickup_type' => 'getPickupType',
        'service_date' => 'getServiceDate',
        'prn' => 'getPrn',
        'gwn_status_code' => 'getGwnStatusCode',
        'on_call_status_code' => 'getOnCallStatusCode',
        'pickup_status_message' => 'getPickupStatusMessage',
        'billing_code' => 'getBillingCode',
        'contact_name' => 'getContactName',
        'reference_number' => 'getReferenceNumber'
    ];

    /**
     * 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['pickup_type'] = isset($data['pickup_type']) ? $data['pickup_type'] : null;
        $this->container['service_date'] = isset($data['service_date']) ? $data['service_date'] : null;
        $this->container['prn'] = isset($data['prn']) ? $data['prn'] : null;
        $this->container['gwn_status_code'] = isset($data['gwn_status_code']) ? $data['gwn_status_code'] : null;
        $this->container['on_call_status_code'] = isset($data['on_call_status_code']) ? $data['on_call_status_code'] : null;
        $this->container['pickup_status_message'] = isset($data['pickup_status_message']) ? $data['pickup_status_message'] : null;
        $this->container['billing_code'] = isset($data['billing_code']) ? $data['billing_code'] : null;
        $this->container['contact_name'] = isset($data['contact_name']) ? $data['contact_name'] : null;
        $this->container['reference_number'] = isset($data['reference_number']) ? $data['reference_number'] : null;
    }

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

        if ($this->container['pickup_type'] === null) {
            $invalidProperties[] = "'pickup_type' can't be null";
        }
        if ($this->container['service_date'] === null) {
            $invalidProperties[] = "'service_date' can't be null";
        }
        if ($this->container['prn'] === null) {
            $invalidProperties[] = "'prn' can't be null";
        }
        if ($this->container['pickup_status_message'] === null) {
            $invalidProperties[] = "'pickup_status_message' can't be null";
        }
        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 pickup_type
     *
     * @return string
     */
    public function getPickupType()
    {
        return $this->container['pickup_type'];
    }

    /**
     * Sets pickup_type
     *
     * @param string $pickup_type Specify the type of pending pickup. - 01 = on-callPickup
     *
     * @return $this
     */
    public function setPickupType($pickup_type)
    {
        $this->container['pickup_type'] = $pickup_type;

        return $this;
    }

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

    /**
     * Sets service_date
     *
     * @param string $service_date Local service date. Format: yyyyMMdd - yyyy = Year applicable - MM = 01-12 - dd = 01-31
     *
     * @return $this
     */
    public function setServiceDate($service_date)
    {
        $this->container['service_date'] = $service_date;

        return $this;
    }

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

    /**
     * Sets prn
     *
     * @param string $prn Returned PRN
     *
     * @return $this
     */
    public function setPrn($prn)
    {
        $this->container['prn'] = $prn;

        return $this;
    }

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

    /**
     * Sets gwn_status_code
     *
     * @param string $gwn_status_code Status code for Smart Pickup.
     *
     * @return $this
     */
    public function setGwnStatusCode($gwn_status_code)
    {
        $this->container['gwn_status_code'] = $gwn_status_code;

        return $this;
    }

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

    /**
     * Sets on_call_status_code
     *
     * @param string $on_call_status_code A unique string identifier to identify a success pre-notification processing. Only available if end result is success.
     *
     * @return $this
     */
    public function setOnCallStatusCode($on_call_status_code)
    {
        $this->container['on_call_status_code'] = $on_call_status_code;

        return $this;
    }

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

    /**
     * Sets pickup_status_message
     *
     * @param string $pickup_status_message The status for on-callpickup.  PickupPendingStatusResponse will only display incomplete status for today and tomorrow only. - 002 and 012 are the most common responses. - 001 = Received at dispatch - 002 = Dispatched to driver - 003 = Order successfully completed - 004 = Order unsuccessfully completed - 005 = Missed commit – Updated ETA supplied by driver - 007 = Cancelled - 008 = Order has invalid order status - 012 = Your pickup request is being processed
     *
     * @return $this
     */
    public function setPickupStatusMessage($pickup_status_message)
    {
        $this->container['pickup_status_message'] = $pickup_status_message;

        return $this;
    }

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

    /**
     * Sets billing_code
     *
     * @param string $billing_code Pickup billing classification for on call - 01 = Regular - 02 = Return - 03 = Alternate Address (Not supported for now)
     *
     * @return $this
     */
    public function setBillingCode($billing_code)
    {
        $this->container['billing_code'] = $billing_code;

        return $this;
    }

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

    /**
     * Sets contact_name
     *
     * @param string $contact_name on-callpickup contact name
     *
     * @return $this
     */
    public function setContactName($contact_name)
    {
        $this->container['contact_name'] = $contact_name;

        return $this;
    }

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

    /**
     * Sets reference_number
     *
     * @param string $reference_number Customer provided reference number for on-call pickup
     *
     * @return $this
     */
    public function setReferenceNumber($reference_number)
    {
        $this->container['reference_number'] = $reference_number;

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