<?php
/**
 * DomesticReturnsCustomsForm
 *
 * 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 \USPS\Labels\ObjectSerializer;

/**
 * DomesticReturnsCustomsForm Class Doc Comment
 *
 * @category Class
 * @description Domestic Returns Custom Form
 * @package  USPS\Labels
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class DomesticReturnsCustomsForm extends CustomsForm 
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'customs_content_type' => 'string',
        'importers_reference' => 'string',
        'importers_contact' => 'string',
        'exporters_reference' => 'string',
        'exporters_contact' => 'string',
        'contents' => '\USPS\Labels\Model\ShippingContents[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'customs_content_type' => null,
        'importers_reference' => null,
        'importers_contact' => null,
        'exporters_reference' => null,
        'exporters_contact' => null,
        'contents' => null
    ];

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

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

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'customs_content_type' => 'customsContentType',
        'importers_reference' => 'importersReference',
        'importers_contact' => 'importersContact',
        'exporters_reference' => 'exportersReference',
        'exporters_contact' => 'exportersContact',
        'contents' => 'contents'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'customs_content_type' => 'setCustomsContentType',
        'importers_reference' => 'setImportersReference',
        'importers_contact' => 'setImportersContact',
        'exporters_reference' => 'setExportersReference',
        'exporters_contact' => 'setExportersContact',
        'contents' => 'setContents'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'customs_content_type' => 'getCustomsContentType',
        'importers_reference' => 'getImportersReference',
        'importers_contact' => 'getImportersContact',
        'exporters_reference' => 'getExportersReference',
        'exporters_contact' => 'getExportersContact',
        'contents' => 'getContents'
    ];

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

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

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

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

    const CUSTOMS_CONTENT_TYPE_MERCHANDISE = 'MERCHANDISE';
    const CUSTOMS_CONTENT_TYPE_GIFT = 'GIFT';
    const CUSTOMS_CONTENT_TYPE_DOCUMENT = 'DOCUMENT';
    const CUSTOMS_CONTENT_TYPE_COMMERCIAL_SAMPLE = 'COMMERCIAL_SAMPLE';
    const CUSTOMS_CONTENT_TYPE_RETURNED_GOODS = 'RETURNED_GOODS';
    const CUSTOMS_CONTENT_TYPE_OTHER = 'OTHER';
    const CUSTOMS_CONTENT_TYPE_HUMANITARIAN_DONATIONS = 'HUMANITARIAN_DONATIONS';
    const CUSTOMS_CONTENT_TYPE_DANGEROUS_GOODS = 'DANGEROUS_GOODS';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getCustomsContentTypeAllowableValues()
    {
        return [
            self::CUSTOMS_CONTENT_TYPE_MERCHANDISE,
            self::CUSTOMS_CONTENT_TYPE_GIFT,
            self::CUSTOMS_CONTENT_TYPE_DOCUMENT,
            self::CUSTOMS_CONTENT_TYPE_COMMERCIAL_SAMPLE,
            self::CUSTOMS_CONTENT_TYPE_RETURNED_GOODS,
            self::CUSTOMS_CONTENT_TYPE_OTHER,
            self::CUSTOMS_CONTENT_TYPE_HUMANITARIAN_DONATIONS,
            self::CUSTOMS_CONTENT_TYPE_DANGEROUS_GOODS,
        ];
    }


    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        parent::__construct($data);

        $this->container['customs_content_type'] = isset($data['customs_content_type']) ? $data['customs_content_type'] : null;
        $this->container['importers_reference'] = isset($data['importers_reference']) ? $data['importers_reference'] : null;
        $this->container['importers_contact'] = isset($data['importers_contact']) ? $data['importers_contact'] : null;
        $this->container['exporters_reference'] = isset($data['exporters_reference']) ? $data['exporters_reference'] : null;
        $this->container['exporters_contact'] = isset($data['exporters_contact']) ? $data['exporters_contact'] : null;
        $this->container['contents'] = isset($data['contents']) ? $data['contents'] : null;
    }

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

        $allowedValues = $this->getCustomsContentTypeAllowableValues();
        if (!is_null($this->container['customs_content_type']) && !in_array($this->container['customs_content_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'customs_content_type', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        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 customs_content_type
     *
     * @return string
     */
    public function getCustomsContentType()
    {
        return $this->container['customs_content_type'];
    }

    /**
     * Sets customs_content_type
     *
     * @param string $customs_content_type Specifies the content of the package or envelope.  * MERCHANDISE  * GIFT  * DOCUMENT  * COMMERCIAL_SAMPLE  * RETURNED_GOODS  * OTHER  * HUMANITARIAN_DONATIONS  * DANGEROUS_GOODS
     *
     * @return $this
     */
    public function setCustomsContentType($customs_content_type)
    {
        $allowedValues = $this->getCustomsContentTypeAllowableValues();
        if (!is_null($customs_content_type) && !in_array($customs_content_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'customs_content_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['customs_content_type'] = $customs_content_type;

        return $this;
    }

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

    /**
     * Sets importers_reference
     *
     * @param string $importers_reference Importers Reference. The Importer’s Reference might be a tax code, importer code, or VAT number used for sales tax.
     *
     * @return $this
     */
    public function setImportersReference($importers_reference)
    {
        $this->container['importers_reference'] = $importers_reference;

        return $this;
    }

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

    /**
     * Sets importers_contact
     *
     * @param string $importers_contact Importers Contact. Enter, if known, the Importer’s telephone number, fax number, or email address, as such information might facilitate customs clearance or delivery.
     *
     * @return $this
     */
    public function setImportersContact($importers_contact)
    {
        $this->container['importers_contact'] = $importers_contact;

        return $this;
    }

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

    /**
     * Sets exporters_reference
     *
     * @param string $exporters_reference Exporters Reference. The Exporter’s Reference might be a tax code, importer code, or VAT number used for sales tax.
     *
     * @return $this
     */
    public function setExportersReference($exporters_reference)
    {
        $this->container['exporters_reference'] = $exporters_reference;

        return $this;
    }

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

    /**
     * Sets exporters_contact
     *
     * @param string $exporters_contact Exporters Contact. Enter, if known, the Exporter’s telephone number, fax number, or email address, as such information might facilitate customs clearance or delivery.
     *
     * @return $this
     */
    public function setExportersContact($exporters_contact)
    {
        $this->container['exporters_contact'] = $exporters_contact;

        return $this;
    }

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

    /**
     * Sets contents
     *
     * @param \USPS\Labels\Model\ShippingContents[] $contents Details of the contents of the package. The first five items will print on the label of the customs form, and the rest will print on a separate continuation page.
     *
     * @return $this
     */
    public function setContents($contents)
    {
        $this->container['contents'] = $contents;

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