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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'return_label_metadata' => '\USPS\Labels\Model\ReturnLabelMetadata',
        'return_label_image' => 'string',
        'return_receipt_image' => 'string',
        'label_broker_qr' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'return_label_metadata' => null,
        'return_label_image' => 'byte',
        'return_receipt_image' => 'byte',
        'label_broker_qr' => 'byte'
    ];

    /**
     * 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 = [
        'return_label_metadata' => 'returnLabelMetadata',
        'return_label_image' => 'returnLabelImage',
        'return_receipt_image' => 'returnReceiptImage',
        'label_broker_qr' => 'labelBrokerQR'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'return_label_metadata' => 'setReturnLabelMetadata',
        'return_label_image' => 'setReturnLabelImage',
        'return_receipt_image' => 'setReturnReceiptImage',
        'label_broker_qr' => 'setLabelBrokerQr'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'return_label_metadata' => 'getReturnLabelMetadata',
        'return_label_image' => 'getReturnLabelImage',
        'return_receipt_image' => 'getReturnReceiptImage',
        'label_broker_qr' => 'getLabelBrokerQr'
    ];

    /**
     * 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['return_label_metadata'] = isset($data['return_label_metadata']) ? $data['return_label_metadata'] : null;
        $this->container['return_label_image'] = isset($data['return_label_image']) ? $data['return_label_image'] : null;
        $this->container['return_receipt_image'] = isset($data['return_receipt_image']) ? $data['return_receipt_image'] : null;
        $this->container['label_broker_qr'] = isset($data['label_broker_qr']) ? $data['label_broker_qr'] : 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 return_label_metadata
     *
     * @return \USPS\Labels\Model\ReturnLabelMetadata
     */
    public function getReturnLabelMetadata()
    {
        return $this->container['return_label_metadata'];
    }

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

        return $this;
    }

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

    /**
     * Sets return_label_image
     *
     * @param string $return_label_image Contains the Base64-encoded file contents of the return label image. Provided only when `imageInfo.imageType` is not `NONE`.  Note: - Not provided when Extra Service Code `415 - USPS Label Delivery` is requested, as no images are returned for this service.
     *
     * @return $this
     */
    public function setReturnLabelImage($return_label_image)
    {
        $this->container['return_label_image'] = $return_label_image;

        return $this;
    }

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

    /**
     * Sets return_receipt_image
     *
     * @param string $return_receipt_image Contains the Base64-encoded file contents of the return receipt image. Provided only when `imageInfo.receiptOption` is `SEPARATE_PAGE`.  Note: - When `imageInfo.imageType` is `ZPL203DPI` or `ZPL300DPI` and `imageInfo.receiptOption` is `SEPARATE_PAGE`, the receipt will be returned as an additional label segment within the single ZPL payload in `labelImage`. In this case, `receiptImage` will not be populated. - Not provided when Extra Service Code `415 - USPS Label Delivery` is requested, as no images are returned for this service.
     *
     * @return $this
     */
    public function setReturnReceiptImage($return_receipt_image)
    {
        $this->container['return_receipt_image'] = $return_receipt_image;

        return $this;
    }

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

    /**
     * Sets label_broker_qr
     *
     * @param string $label_broker_qr The Label Broker QR Code image, Base64 encoded file contents. Only provided if `imageType` in the `imageInfo` is set to `LABEL_BROKER`.
     *
     * @return $this
     */
    public function setLabelBrokerQr($label_broker_qr)
    {
        $this->container['label_broker_qr'] = $label_broker_qr;

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