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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'imb' => 'string',
        'construct_code' => 'string',
        'tracking_number' => 'string',
        'sku' => 'string',
        'total_price' => 'float',
        'postage' => 'float',
        'fees' => '\USPS\Labels\Model\IndiciaResponseIndiciaMetadataFees[]',
        'weight' => 'float',
        'extra_services' => '\USPS\Labels\Model\ExtraServiceResponse',
        'service_type_code' => 'string',
        'banner_text' => 'string',
        'mail_class' => 'string',
        'to_address' => 'AllOfIndiciaImbResponseIndiciaMetadataToAddress',
        'return_address' => 'AllOfIndiciaImbResponseIndiciaMetadataReturnAddress',
        'indicia_imi' => '\USPS\Labels\Model\IndiciaIMI'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'imb' => null,
        'construct_code' => null,
        'tracking_number' => null,
        'sku' => null,
        'total_price' => 'float',
        'postage' => null,
        'fees' => null,
        'weight' => null,
        'extra_services' => null,
        'service_type_code' => null,
        'banner_text' => null,
        'mail_class' => null,
        'to_address' => null,
        'return_address' => null,
        'indicia_imi' => 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 = [
        'imb' => 'imb',
        'construct_code' => 'constructCode',
        'tracking_number' => 'trackingNumber',
        'sku' => 'SKU',
        'total_price' => 'totalPrice',
        'postage' => 'postage',
        'fees' => 'fees',
        'weight' => 'weight',
        'extra_services' => 'extraServices',
        'service_type_code' => 'serviceTypeCode',
        'banner_text' => 'bannerText',
        'mail_class' => 'mailClass',
        'to_address' => 'toAddress',
        'return_address' => 'returnAddress',
        'indicia_imi' => 'indiciaIMI'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'imb' => 'setImb',
        'construct_code' => 'setConstructCode',
        'tracking_number' => 'setTrackingNumber',
        'sku' => 'setSku',
        'total_price' => 'setTotalPrice',
        'postage' => 'setPostage',
        'fees' => 'setFees',
        'weight' => 'setWeight',
        'extra_services' => 'setExtraServices',
        'service_type_code' => 'setServiceTypeCode',
        'banner_text' => 'setBannerText',
        'mail_class' => 'setMailClass',
        'to_address' => 'setToAddress',
        'return_address' => 'setReturnAddress',
        'indicia_imi' => 'setIndiciaImi'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'imb' => 'getImb',
        'construct_code' => 'getConstructCode',
        'tracking_number' => 'getTrackingNumber',
        'sku' => 'getSku',
        'total_price' => 'getTotalPrice',
        'postage' => 'getPostage',
        'fees' => 'getFees',
        'weight' => 'getWeight',
        'extra_services' => 'getExtraServices',
        'service_type_code' => 'getServiceTypeCode',
        'banner_text' => 'getBannerText',
        'mail_class' => 'getMailClass',
        'to_address' => 'getToAddress',
        'return_address' => 'getReturnAddress',
        'indicia_imi' => 'getIndiciaImi'
    ];

    /**
     * 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['imb'] = isset($data['imb']) ? $data['imb'] : null;
        $this->container['construct_code'] = isset($data['construct_code']) ? $data['construct_code'] : null;
        $this->container['tracking_number'] = isset($data['tracking_number']) ? $data['tracking_number'] : null;
        $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null;
        $this->container['total_price'] = isset($data['total_price']) ? $data['total_price'] : null;
        $this->container['postage'] = isset($data['postage']) ? $data['postage'] : null;
        $this->container['fees'] = isset($data['fees']) ? $data['fees'] : null;
        $this->container['weight'] = isset($data['weight']) ? $data['weight'] : 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['banner_text'] = isset($data['banner_text']) ? $data['banner_text'] : null;
        $this->container['mail_class'] = isset($data['mail_class']) ? $data['mail_class'] : null;
        $this->container['to_address'] = isset($data['to_address']) ? $data['to_address'] : null;
        $this->container['return_address'] = isset($data['return_address']) ? $data['return_address'] : null;
        $this->container['indicia_imi'] = isset($data['indicia_imi']) ? $data['indicia_imi'] : 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 imb
     *
     * @return string
     */
    public function getImb()
    {
        return $this->container['imb'];
    }

    /**
     * Sets imb
     *
     * @param string $imb Human-readable form of the intelligent mail barcode (IMB) value.
     *
     * @return $this
     */
    public function setImb($imb)
    {
        $this->container['imb'] = $imb;

        return $this;
    }

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

    /**
     * Sets construct_code
     *
     * @param string $construct_code The barcode construct code associated with the tracking number.  Notes:   - This field will be absent from the response if the request does not include extra services.
     *
     * @return $this
     */
    public function setConstructCode($construct_code)
    {
        $this->container['construct_code'] = $construct_code;

        return $this;
    }

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

    /**
     * Sets tracking_number
     *
     * @param string $tracking_number Human-readable form of the intelligent mail package barcode (IMPB) value.  Notes:   - This field will be absent from the response if the request does not include extra services.
     *
     * @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 total_price
     *
     * @return float
     */
    public function getTotalPrice()
    {
        return $this->container['total_price'];
    }

    /**
     * Sets total_price
     *
     * @param float $total_price Total price of the indicia, including postage and any fees.
     *
     * @return $this
     */
    public function setTotalPrice($total_price)
    {
        $this->container['total_price'] = $total_price;

        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 fees
     *
     * @return \USPS\Labels\Model\IndiciaResponseIndiciaMetadataFees[]
     */
    public function getFees()
    {
        return $this->container['fees'];
    }

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

        return $this;
    }

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

    /**
     * Sets weight
     *
     * @param float $weight The mailpiece weight, in ounces.
     *
     * @return $this
     */
    public function setWeight($weight)
    {
        $this->container['weight'] = $weight;

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

    /**
     * Sets mail_class
     *
     * @param string $mail_class The mail class of the indicia.
     *
     * @return $this
     */
    public function setMailClass($mail_class)
    {
        $this->container['mail_class'] = $mail_class;

        return $this;
    }

    /**
     * Gets to_address
     *
     * @return AllOfIndiciaImbResponseIndiciaMetadataToAddress
     */
    public function getToAddress()
    {
        return $this->container['to_address'];
    }

    /**
     * Sets to_address
     *
     * @param AllOfIndiciaImbResponseIndiciaMetadataToAddress $to_address The `toAddress` from the request that will be printed on the letter, flat, or card.
     *
     * @return $this
     */
    public function setToAddress($to_address)
    {
        $this->container['to_address'] = $to_address;

        return $this;
    }

    /**
     * Gets return_address
     *
     * @return AllOfIndiciaImbResponseIndiciaMetadataReturnAddress
     */
    public function getReturnAddress()
    {
        return $this->container['return_address'];
    }

    /**
     * Sets return_address
     *
     * @param AllOfIndiciaImbResponseIndiciaMetadataReturnAddress $return_address The `returnAddress` from the request that will be printed on the letter, flat, or card.
     *
     * @return $this
     */
    public function setReturnAddress($return_address)
    {
        $this->container['return_address'] = $return_address;

        return $this;
    }

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

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

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