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

/**
 * Labels
 *
 * Contact Us: [USPS API Support](https://emailus.usps.com/s/usps-APIs) | [Terms of Service](https://about.usps.com/termsofuse.htm)  The USPS&#174; Labels API allows you to digitally create mailing labels for the following mail classes: USPS Ground Advantage&#8482;, Parcel Select&#174; Destination Entry, Parcel Select Lightweight&#174;, USPS Connect&#174; Local, USPS Connect&#174; Regional, Priority  Mail&#174;, Priority Mail Express&#174;, Bound Printed Matter, Library Mail, and Media Mail&#174;.  * Use the [Getting Started guide](https://developers.usps.com/getting-started) to get started with the Labels API. * The USPS&#174; Labels API uses a token to authorize the use of an [Enterprise Payment](https://postalpro.usps.com/EPS) or Permit account. The specification to generate the token is in the [Payments 3.0 - Set Payment Account Information](https://developers.usps.com/paymentsv3#tag/Resources/operation/post-payments-payment-authorization).  **Manifest Scheduling**   The following table outlines the Domestic Label manifesting schedule for specific conditions listed below.   | Condition                   | Scheduling | | ----------------------------| -------- | | **Customs Forms labels**    | 12:30am CT on the day after label creation. | | **Return labels**    | 12:30am CT on the day after label creation. | | **Smart Locker labels**     | Electronic data is sent to Postal systems within 15 minutes of label creation. | | **Value of `true` provided for `immediateManifest` field**| Electronic data is sent to Postal systems within 15 minutes of label creation.  | | **Label is added to a [SCAN Form](https://developers.usps.com/scanv3#tag/Resources/operation/post-scan-form)**| Electronic data is sent to Postal systems within 15 minutes of SCAN Form creation.  | | **All other conditions**    | 12:30am CT after the `mailingDate` value provided by the user |
 *
 * OpenAPI spec version: 3.9.9
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.71
 */
/**
 * 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 USPS\Labels\Model;

use \ArrayAccess;
use \USPS\Labels\ObjectSerializer;

/**
 * ReturnLabelMetadata Class Doc Comment
 *
 * @category Class
 * @description Return Label Metadata
 * @package  USPS\Labels
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class ReturnLabelMetadata implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'label_address' => '\USPS\Labels\Model\DomesticLabelAddress',
        'routing_information' => 'string',
        'tracking_number' => 'string',
        'sku' => 'string',
        'sku' => 'string',
        'postage' => 'float',
        'extra_services' => '\USPS\Labels\Model\ExtraServiceResponse',
        'service_type_code' => 'string',
        'zone' => 'string',
        'mailing_date' => '\DateTime',
        'weight_uom' => 'string',
        'weight' => 'float',
        'dimensional_weight' => 'float',
        'fees' => '\USPS\Labels\Model\ReturnLabelMetadataFees[]',
        'label_broker_id' => 'string',
        'banner_text' => 'string',
        'retail_distribution_code' => 'string',
        'links' => '\USPS\Labels\Model\Links'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'label_address' => null,
        'routing_information' => null,
        'tracking_number' => null,
        'sku' => null,
        'sku' => null,
        'postage' => null,
        'extra_services' => null,
        'service_type_code' => null,
        'zone' => null,
        'mailing_date' => 'date-time',
        'weight_uom' => null,
        'weight' => null,
        'dimensional_weight' => null,
        'fees' => null,
        'label_broker_id' => null,
        'banner_text' => null,
        'retail_distribution_code' => null,
        'links' => 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 = [
        'label_address' => 'labelAddress',
        'routing_information' => 'routingInformation',
        'tracking_number' => 'trackingNumber',
        'sku' => 'SKU',
        'sku' => 'sku',
        'postage' => 'postage',
        'extra_services' => 'extraServices',
        'service_type_code' => 'serviceTypeCode',
        'zone' => 'zone',
        'mailing_date' => 'mailingDate',
        'weight_uom' => 'weightUOM',
        'weight' => 'weight',
        'dimensional_weight' => 'dimensionalWeight',
        'fees' => 'fees',
        'label_broker_id' => 'labelBrokerID',
        'banner_text' => 'bannerText',
        'retail_distribution_code' => 'retailDistributionCode',
        'links' => 'links'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'label_address' => 'setLabelAddress',
        'routing_information' => 'setRoutingInformation',
        'tracking_number' => 'setTrackingNumber',
        'sku' => 'setSku',
        'sku' => 'setSku',
        'postage' => 'setPostage',
        'extra_services' => 'setExtraServices',
        'service_type_code' => 'setServiceTypeCode',
        'zone' => 'setZone',
        'mailing_date' => 'setMailingDate',
        'weight_uom' => 'setWeightUom',
        'weight' => 'setWeight',
        'dimensional_weight' => 'setDimensionalWeight',
        'fees' => 'setFees',
        'label_broker_id' => 'setLabelBrokerId',
        'banner_text' => 'setBannerText',
        'retail_distribution_code' => 'setRetailDistributionCode',
        'links' => 'setLinks'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'label_address' => 'getLabelAddress',
        'routing_information' => 'getRoutingInformation',
        'tracking_number' => 'getTrackingNumber',
        'sku' => 'getSku',
        'sku' => 'getSku',
        'postage' => 'getPostage',
        'extra_services' => 'getExtraServices',
        'service_type_code' => 'getServiceTypeCode',
        'zone' => 'getZone',
        'mailing_date' => 'getMailingDate',
        'weight_uom' => 'getWeightUom',
        'weight' => 'getWeight',
        'dimensional_weight' => 'getDimensionalWeight',
        'fees' => 'getFees',
        'label_broker_id' => 'getLabelBrokerId',
        'banner_text' => 'getBannerText',
        'retail_distribution_code' => 'getRetailDistributionCode',
        'links' => 'getLinks'
    ];

    /**
     * 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['label_address'] = isset($data['label_address']) ? $data['label_address'] : null;
        $this->container['routing_information'] = isset($data['routing_information']) ? $data['routing_information'] : null;
        $this->container['tracking_number'] = isset($data['tracking_number']) ? $data['tracking_number'] : null;
        $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
        $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
        $this->container['postage'] = isset($data['postage']) ? $data['postage'] : null;
        $this->container['extra_services'] = isset($data['extra_services']) ? $data['extra_services'] : null;
        $this->container['service_type_code'] = isset($data['service_type_code']) ? $data['service_type_code'] : null;
        $this->container['zone'] = isset($data['zone']) ? $data['zone'] : null;
        $this->container['mailing_date'] = isset($data['mailing_date']) ? $data['mailing_date'] : null;
        $this->container['weight_uom'] = isset($data['weight_uom']) ? $data['weight_uom'] : null;
        $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
        $this->container['dimensional_weight'] = isset($data['dimensional_weight']) ? $data['dimensional_weight'] : null;
        $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null;
        $this->container['label_broker_id'] = isset($data['label_broker_id']) ? $data['label_broker_id'] : null;
        $this->container['banner_text'] = isset($data['banner_text']) ? $data['banner_text'] : null;
        $this->container['retail_distribution_code'] = isset($data['retail_distribution_code']) ? $data['retail_distribution_code'] : null;
        $this->container['links'] = isset($data['links']) ? $data['links'] : 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 label_address
     *
     * @return \USPS\Labels\Model\DomesticLabelAddress
     */
    public function getLabelAddress()
    {
        return $this->container['label_address'];
    }

    /**
     * Sets label_address
     *
     * @param \USPS\Labels\Model\DomesticLabelAddress $label_address label_address
     *
     * @return $this
     */
    public function setLabelAddress($label_address)
    {
        $this->container['label_address'] = $label_address;

        return $this;
    }

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

    /**
     * Sets routing_information
     *
     * @param string $routing_information The \"420\" 3-digit GS1 Application Identifier and the 5 or 9 digit Destination ZIP Code&#8482;
     *
     * @return $this
     */
    public function setRoutingInformation($routing_information)
    {
        $this->container['routing_information'] = $routing_information;

        return $this;
    }

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

    /**
     * Sets tracking_number
     *
     * @param string $tracking_number The human readable version of the package tracking number
     *
     * @return $this
     */
    public function setTrackingNumber($tracking_number)
    {
        $this->container['tracking_number'] = $tracking_number;

        return $this;
    }

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

    /**
     * Sets sku
     *
     * @param string $sku Pricing SKU
     *
     * @return $this
     */
    public function setSku($sku)
    {
        $this->container['sku'] = $sku;

        return $this;
    }

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

    /**
     * Sets sku
     *
     * @param string $sku Pricing SKU
     *
     * @return $this
     */
    public function setSku($sku)
    {
        $this->container['sku'] = $sku;

        return $this;
    }

    /**
     * Gets postage
     *
     * @return float
     */
    public function getPostage()
    {
        return $this->container['postage'];
    }

    /**
     * Sets postage
     *
     * @param float $postage Amount of Postage Required, does not include insurance or other extra service fees.
     *
     * @return $this
     */
    public function setPostage($postage)
    {
        $this->container['postage'] = $postage;

        return $this;
    }

    /**
     * Gets extra_services
     *
     * @return \USPS\Labels\Model\ExtraServiceResponse
     */
    public function getExtraServices()
    {
        return $this->container['extra_services'];
    }

    /**
     * Sets extra_services
     *
     * @param \USPS\Labels\Model\ExtraServiceResponse $extra_services extra_services
     *
     * @return $this
     */
    public function setExtraServices($extra_services)
    {
        $this->container['extra_services'] = $extra_services;

        return $this;
    }

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

    /**
     * Sets service_type_code
     *
     * @param string $service_type_code The Service Type Code associated with the package. A list of Service Type Codes can be found at: [https://postalpro.usps.com/IMPB_Service_Type_Codes](https://postalpro.usps.com/IMPB_Service_Type_Codes)
     *
     * @return $this
     */
    public function setServiceTypeCode($service_type_code)
    {
        $this->container['service_type_code'] = $service_type_code;

        return $this;
    }

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

    /**
     * Sets zone
     *
     * @param string $zone Indicates the calculated zone used for pricing between the provided `originZIPCode` and `destinationZIPCode` for a given `mailClass`, `mailingDate`, `rateIndicator`, and `weight`.
     *
     * @return $this
     */
    public function setZone($zone)
    {
        $this->container['zone'] = $zone;

        return $this;
    }

    /**
     * Gets mailing_date
     *
     * @return \DateTime
     */
    public function getMailingDate()
    {
        return $this->container['mailing_date'];
    }

    /**
     * Sets mailing_date
     *
     * @param \DateTime $mailing_date The date and time when the request was processed, with a two-hour offset applied.
     *
     * @return $this
     */
    public function setMailingDate($mailing_date)
    {
        $this->container['mailing_date'] = $mailing_date;

        return $this;
    }

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

    /**
     * Sets weight_uom
     *
     * @param string $weight_uom Weight Unit of Measurement    * lb - Pounds
     *
     * @return $this
     */
    public function setWeightUom($weight_uom)
    {
        $this->container['weight_uom'] = $weight_uom;

        return $this;
    }

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

    /**
     * Sets weight
     *
     * @param float $weight The package weight, in weightUOM. Items must weigh 70 pounds (1120 ounces) or less.
     *
     * @return $this
     */
    public function setWeight($weight)
    {
        $this->container['weight'] = $weight;

        return $this;
    }

    /**
     * Gets dimensional_weight
     *
     * @return float
     */
    public function getDimensionalWeight()
    {
        return $this->container['dimensional_weight'];
    }

    /**
     * Sets dimensional_weight
     *
     * @param float $dimensional_weight The dimensional weight of package, if greater than specified in weight, in ounces.
     *
     * @return $this
     */
    public function setDimensionalWeight($dimensional_weight)
    {
        $this->container['dimensional_weight'] = $dimensional_weight;

        return $this;
    }

    /**
     * Gets fees
     *
     * @return \USPS\Labels\Model\ReturnLabelMetadataFees[]
     */
    public function getFees()
    {
        return $this->container['fees'];
    }

    /**
     * Sets fees
     *
     * @param \USPS\Labels\Model\ReturnLabelMetadataFees[] $fees Fees associated to the package.
     *
     * @return $this
     */
    public function setFees($fees)
    {
        $this->container['fees'] = $fees;

        return $this;
    }

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

    /**
     * Sets label_broker_id
     *
     * @param string $label_broker_id Unique Label Broker ID that can be used as an alternative to the Label Broker QR Code to retrieve the label at a Post Office. Will only be provided when an imageType of LABEL_BROKER is requested.
     *
     * @return $this
     */
    public function setLabelBrokerId($label_broker_id)
    {
        $this->container['label_broker_id'] = $label_broker_id;

        return $this;
    }

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

    /**
     * Sets banner_text
     *
     * @param string $banner_text Banner text printed on the label
     *
     * @return $this
     */
    public function setBannerText($banner_text)
    {
        $this->container['banner_text'] = $banner_text;

        return $this;
    }

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

    /**
     * Sets retail_distribution_code
     *
     * @param string $retail_distribution_code Retail Description Code associated with the label
     *
     * @return $this
     */
    public function setRetailDistributionCode($retail_distribution_code)
    {
        $this->container['retail_distribution_code'] = $retail_distribution_code;

        return $this;
    }

    /**
     * Gets links
     *
     * @return \USPS\Labels\Model\Links
     */
    public function getLinks()
    {
        return $this->container['links'];
    }

    /**
     * Sets links
     *
     * @param \USPS\Labels\Model\Links $links links
     *
     * @return $this
     */
    public function setLinks($links)
    {
        $this->container['links'] = $links;

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