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

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

use \ArrayAccess;
use \UPS\Shipping\ObjectSerializer;

/**
 * LabelRecoveryResponse Class Doc Comment
 *
 * @category Class
 * @description Response for the Label recovery request  Validates the date range and label being present. Also if the shipment is return or not
 * @package  UPS\Shipping
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class LabelRecoveryResponse implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'response' => '\UPS\Shipping\Shipping\LabelRecoveryResponseResponse',
        'shipment_identification_number' => 'string',
        'label_results' => 'OneOfLabelRecoveryResponseLabelResults',
        'cod_turn_in_page' => '\UPS\Shipping\Shipping\LabelRecoveryResponseCODTurnInPage',
        'form' => '\UPS\Shipping\Shipping\LabelRecoveryResponseForm',
        'high_value_report' => '\UPS\Shipping\Shipping\LabelRecoveryResponseHighValueReport',
        'tracking_candidate' => 'OneOfLabelRecoveryResponseTrackingCandidate'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'response' => null,
        'shipment_identification_number' => null,
        'label_results' => null,
        'cod_turn_in_page' => null,
        'form' => null,
        'high_value_report' => null,
        'tracking_candidate' => 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 = [
        'response' => 'Response',
        'shipment_identification_number' => 'ShipmentIdentificationNumber',
        'label_results' => 'LabelResults',
        'cod_turn_in_page' => 'CODTurnInPage',
        'form' => 'Form',
        'high_value_report' => 'HighValueReport',
        'tracking_candidate' => 'TrackingCandidate'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'response' => 'setResponse',
        'shipment_identification_number' => 'setShipmentIdentificationNumber',
        'label_results' => 'setLabelResults',
        'cod_turn_in_page' => 'setCodTurnInPage',
        'form' => 'setForm',
        'high_value_report' => 'setHighValueReport',
        'tracking_candidate' => 'setTrackingCandidate'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'response' => 'getResponse',
        'shipment_identification_number' => 'getShipmentIdentificationNumber',
        'label_results' => 'getLabelResults',
        'cod_turn_in_page' => 'getCodTurnInPage',
        'form' => 'getForm',
        'high_value_report' => 'getHighValueReport',
        'tracking_candidate' => 'getTrackingCandidate'
    ];

    /**
     * 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['response'] = isset($data['response']) ? $data['response'] : null;
        $this->container['shipment_identification_number'] = isset($data['shipment_identification_number']) ? $data['shipment_identification_number'] : null;
        $this->container['label_results'] = isset($data['label_results']) ? $data['label_results'] : null;
        $this->container['cod_turn_in_page'] = isset($data['cod_turn_in_page']) ? $data['cod_turn_in_page'] : null;
        $this->container['form'] = isset($data['form']) ? $data['form'] : null;
        $this->container['high_value_report'] = isset($data['high_value_report']) ? $data['high_value_report'] : null;
        $this->container['tracking_candidate'] = isset($data['tracking_candidate']) ? $data['tracking_candidate'] : null;
    }

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

        if ($this->container['response'] === null) {
            $invalidProperties[] = "'response' can't be null";
        }
        if ($this->container['label_results'] === null) {
            $invalidProperties[] = "'label_results' 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 response
     *
     * @return \UPS\Shipping\Shipping\LabelRecoveryResponseResponse
     */
    public function getResponse()
    {
        return $this->container['response'];
    }

    /**
     * Sets response
     *
     * @param \UPS\Shipping\Shipping\LabelRecoveryResponseResponse $response response
     *
     * @return $this
     */
    public function setResponse($response)
    {
        $this->container['response'] = $response;

        return $this;
    }

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

    /**
     * Sets shipment_identification_number
     *
     * @param string $shipment_identification_number Tracking number of the leading package in the shipment
     *
     * @return $this
     */
    public function setShipmentIdentificationNumber($shipment_identification_number)
    {
        $this->container['shipment_identification_number'] = $shipment_identification_number;

        return $this;
    }

    /**
     * Gets label_results
     *
     * @return OneOfLabelRecoveryResponseLabelResults
     */
    public function getLabelResults()
    {
        return $this->container['label_results'];
    }

    /**
     * Sets label_results
     *
     * @param OneOfLabelRecoveryResponseLabelResults $label_results label_results
     *
     * @return $this
     */
    public function setLabelResults($label_results)
    {
        $this->container['label_results'] = $label_results;

        return $this;
    }

    /**
     * Gets cod_turn_in_page
     *
     * @return \UPS\Shipping\Shipping\LabelRecoveryResponseCODTurnInPage
     */
    public function getCodTurnInPage()
    {
        return $this->container['cod_turn_in_page'];
    }

    /**
     * Sets cod_turn_in_page
     *
     * @param \UPS\Shipping\Shipping\LabelRecoveryResponseCODTurnInPage $cod_turn_in_page cod_turn_in_page
     *
     * @return $this
     */
    public function setCodTurnInPage($cod_turn_in_page)
    {
        $this->container['cod_turn_in_page'] = $cod_turn_in_page;

        return $this;
    }

    /**
     * Gets form
     *
     * @return \UPS\Shipping\Shipping\LabelRecoveryResponseForm
     */
    public function getForm()
    {
        return $this->container['form'];
    }

    /**
     * Sets form
     *
     * @param \UPS\Shipping\Shipping\LabelRecoveryResponseForm $form form
     *
     * @return $this
     */
    public function setForm($form)
    {
        $this->container['form'] = $form;

        return $this;
    }

    /**
     * Gets high_value_report
     *
     * @return \UPS\Shipping\Shipping\LabelRecoveryResponseHighValueReport
     */
    public function getHighValueReport()
    {
        return $this->container['high_value_report'];
    }

    /**
     * Sets high_value_report
     *
     * @param \UPS\Shipping\Shipping\LabelRecoveryResponseHighValueReport $high_value_report high_value_report
     *
     * @return $this
     */
    public function setHighValueReport($high_value_report)
    {
        $this->container['high_value_report'] = $high_value_report;

        return $this;
    }

    /**
     * Gets tracking_candidate
     *
     * @return OneOfLabelRecoveryResponseTrackingCandidate
     */
    public function getTrackingCandidate()
    {
        return $this->container['tracking_candidate'];
    }

    /**
     * Sets tracking_candidate
     *
     * @param OneOfLabelRecoveryResponseTrackingCandidate $tracking_candidate tracking_candidate
     *
     * @return $this
     */
    public function setTrackingCandidate($tracking_candidate)
    {
        $this->container['tracking_candidate'] = $tracking_candidate;

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