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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'image_type' => 'string',
        'label_type' => 'string',
        'suppress_postage' => 'bool',
        'suppress_mail_date' => 'bool',
        'branding_image_format' => 'string',
        'branding_image_uuids' => 'string[]',
        'package_number' => 'int',
        'total_packages' => 'int'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'image_type' => null,
        'label_type' => null,
        'suppress_postage' => null,
        'suppress_mail_date' => null,
        'branding_image_format' => null,
        'branding_image_uuids' => null,
        'package_number' => null,
        'total_packages' => 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 = [
        'image_type' => 'imageType',
        'label_type' => 'labelType',
        'suppress_postage' => 'suppressPostage',
        'suppress_mail_date' => 'suppressMailDate',
        'branding_image_format' => 'brandingImageFormat',
        'branding_image_uuids' => 'brandingImageUUIDs',
        'package_number' => 'packageNumber',
        'total_packages' => 'totalPackages'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'image_type' => 'setImageType',
        'label_type' => 'setLabelType',
        'suppress_postage' => 'setSuppressPostage',
        'suppress_mail_date' => 'setSuppressMailDate',
        'branding_image_format' => 'setBrandingImageFormat',
        'branding_image_uuids' => 'setBrandingImageUuids',
        'package_number' => 'setPackageNumber',
        'total_packages' => 'setTotalPackages'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'image_type' => 'getImageType',
        'label_type' => 'getLabelType',
        'suppress_postage' => 'getSuppressPostage',
        'suppress_mail_date' => 'getSuppressMailDate',
        'branding_image_format' => 'getBrandingImageFormat',
        'branding_image_uuids' => 'getBrandingImageUuids',
        'package_number' => 'getPackageNumber',
        'total_packages' => 'getTotalPackages'
    ];

    /**
     * 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;
    }

    const IMAGE_TYPE_PDF = 'PDF';
    const IMAGE_TYPE_TIFF = 'TIFF';
    const IMAGE_TYPE_JPG = 'JPG';
    const IMAGE_TYPE_PNG = 'PNG';
    const IMAGE_TYPE_GIF = 'GIF';
    const IMAGE_TYPE_SVG = 'SVG';
    const IMAGE_TYPE_ZPL203_DPI = 'ZPL203DPI';
    const IMAGE_TYPE_ZPL300_DPI = 'ZPL300DPI';
    const LABEL_TYPE__4_X4_LABEL = '4X4LABEL';
    const LABEL_TYPE__4_X5_LABEL = '4X5LABEL';
    const LABEL_TYPE__4_X6_LABEL = '4X6LABEL';
    const LABEL_TYPE__6_X4_LABEL = '6X4LABEL';
    const LABEL_TYPE__2_X7_LABEL = '2X7LABEL';
    const BRANDING_IMAGE_FORMAT_ONE_SQUARE = 'ONE_SQUARE';
    const BRANDING_IMAGE_FORMAT_TWO_SQUARES = 'TWO_SQUARES';
    const BRANDING_IMAGE_FORMAT_RECTANGLE = 'RECTANGLE';
    const BRANDING_IMAGE_FORMAT_NONE = 'NONE';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getImageTypeAllowableValues()
    {
        return [
            self::IMAGE_TYPE_PDF,
            self::IMAGE_TYPE_TIFF,
            self::IMAGE_TYPE_JPG,
            self::IMAGE_TYPE_PNG,
            self::IMAGE_TYPE_GIF,
            self::IMAGE_TYPE_SVG,
            self::IMAGE_TYPE_ZPL203_DPI,
            self::IMAGE_TYPE_ZPL300_DPI,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getLabelTypeAllowableValues()
    {
        return [
            self::LABEL_TYPE__4_X4_LABEL,
            self::LABEL_TYPE__4_X5_LABEL,
            self::LABEL_TYPE__4_X6_LABEL,
            self::LABEL_TYPE__6_X4_LABEL,
            self::LABEL_TYPE__2_X7_LABEL,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getBrandingImageFormatAllowableValues()
    {
        return [
            self::BRANDING_IMAGE_FORMAT_ONE_SQUARE,
            self::BRANDING_IMAGE_FORMAT_TWO_SQUARES,
            self::BRANDING_IMAGE_FORMAT_RECTANGLE,
            self::BRANDING_IMAGE_FORMAT_NONE,
        ];
    }

    /**
     * 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['image_type'] = isset($data['image_type']) ? $data['image_type'] : 'PDF';
        $this->container['label_type'] = isset($data['label_type']) ? $data['label_type'] : '4X6LABEL';
        $this->container['suppress_postage'] = isset($data['suppress_postage']) ? $data['suppress_postage'] : true;
        $this->container['suppress_mail_date'] = isset($data['suppress_mail_date']) ? $data['suppress_mail_date'] : true;
        $this->container['branding_image_format'] = isset($data['branding_image_format']) ? $data['branding_image_format'] : 'NONE';
        $this->container['branding_image_uuids'] = isset($data['branding_image_uuids']) ? $data['branding_image_uuids'] : null;
        $this->container['package_number'] = isset($data['package_number']) ? $data['package_number'] : null;
        $this->container['total_packages'] = isset($data['total_packages']) ? $data['total_packages'] : null;
    }

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

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

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

        $allowedValues = $this->getBrandingImageFormatAllowableValues();
        if (!is_null($this->container['branding_image_format']) && !in_array($this->container['branding_image_format'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'branding_image_format', 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 image_type
     *
     * @return string
     */
    public function getImageType()
    {
        return $this->container['image_type'];
    }

    /**
     * Sets image_type
     *
     * @param string $image_type The type of label image requested. If omitted then the default image type is PDF.  Note: - Labels with customs forms only support formats of `PDF`, `TIFF`, `ZPL203DPI`, and `ZPL300DPI`.
     *
     * @return $this
     */
    public function setImageType($image_type)
    {
        $allowedValues = $this->getImageTypeAllowableValues();
        if (!is_null($image_type) && !in_array($image_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'image_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['image_type'] = $image_type;

        return $this;
    }

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

    /**
     * Sets label_type
     *
     * @param string $label_type Ability to select the label image size. If omitted then the default label size is `4X6LABEL`.  Note:   * Currently, customs forms only support `4X6LABEL`.   * The `labelType` of `2X7LABEL` is not supported with the `imageType` of `ZPL203DPI` or `ZPL300DPI`.
     *
     * @return $this
     */
    public function setLabelType($label_type)
    {
        $allowedValues = $this->getLabelTypeAllowableValues();
        if (!is_null($label_type) && !in_array($label_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'label_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['label_type'] = $label_type;

        return $this;
    }

    /**
     * Gets suppress_postage
     *
     * @return bool
     */
    public function getSuppressPostage()
    {
        return $this->container['suppress_postage'];
    }

    /**
     * Sets suppress_postage
     *
     * @param bool $suppress_postage Indicates if postage is printed on the label. If omitted then the request will be defaulted to true.
     *
     * @return $this
     */
    public function setSuppressPostage($suppress_postage)
    {
        $this->container['suppress_postage'] = $suppress_postage;

        return $this;
    }

    /**
     * Gets suppress_mail_date
     *
     * @return bool
     */
    public function getSuppressMailDate()
    {
        return $this->container['suppress_mail_date'];
    }

    /**
     * Sets suppress_mail_date
     *
     * @param bool $suppress_mail_date Indicates if the `mailingDate` is printed on the label.  If omitted then the value will default to true.  Note:  * Mail Date cannot be suppressed on Domestic Customs Forms. The customs form will always display the Date of Mailing.  * The date the label was created cannot be suppressed and will always print on the label.
     *
     * @return $this
     */
    public function setSuppressMailDate($suppress_mail_date)
    {
        $this->container['suppress_mail_date'] = $suppress_mail_date;

        return $this;
    }

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

    /**
     * Sets branding_image_format
     *
     * @param string $branding_image_format The format of label branding images to be shown on the generated label image.  Note: * Label branding images will not be shown on labels with customs forms. * Label branding images are not currently supported with an `imageType` of `ZPL203DPI` or `ZPL300DPI`. * Label branding images are not currently supported with a `labelType` of `4X4LABEL`. * When a `brandingImageFormat` is provided with a Destination Entry Facility, the Drop-Off Location will not be displayed on the label. * When a `brandingImageFormat` of `RECTANGLE` is provided, Customer Reference #3-#4 cannot be provided since they will not be shown. * When a `brandingImageFormat` of `ONE_SQUARE` or `TWO_SQUARES` is provided, Customer Reference numbers will be shifted to the right to accommodate the image. * When a `brandingImageFormat` of `RECTANGLE` is provided, Customer Reference numbers, package number, and total packages will not be displayed on the label. * A `brandingImageFormat` of `ONE_SQUARE` is currently only supported with `labelType` of `4X6LABEL`, `4X5LABEL`, `6X4LABEL`, and `2X7LABEL` for both outbound and return labels. * A `brandingImageFormat` of `TWO_SQUARES` is currently only supported with `labelType` of `4X6LABEL`, `4X5LABEL`, and `6X4LABEL` for both outbound and return labels. * A `brandingImageFormat` of `RECTANGLE` is currently only supported with `labelType` of `4X6LABEL`, `4X5LABEL`, and `6X4LABEL` for outbound labels and `4X5LABEL` and `6X4LABEL` for return labels.
     *
     * @return $this
     */
    public function setBrandingImageFormat($branding_image_format)
    {
        $allowedValues = $this->getBrandingImageFormatAllowableValues();
        if (!is_null($branding_image_format) && !in_array($branding_image_format, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'branding_image_format', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['branding_image_format'] = $branding_image_format;

        return $this;
    }

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

    /**
     * Sets branding_image_uuids
     *
     * @param string[] $branding_image_uuids The UUIDs associated with custom images uploaded in the Logo Branding endpoint: /branding  Note: * These UUIDs must have been created with the same Payment Authorization Label Owner CRID in use when creating the label * When using `ONE_SQUARE` or `RECTANGLE` the brandingImageUUIDs list should include only one imageUUID string. * When using `TWO_SQUARES` the brandingImageUUIDs list should include only two imageUUID strings.
     *
     * @return $this
     */
    public function setBrandingImageUuids($branding_image_uuids)
    {
        $this->container['branding_image_uuids'] = $branding_image_uuids;

        return $this;
    }

    /**
     * Gets package_number
     *
     * @return int
     */
    public function getPackageNumber()
    {
        return $this->container['package_number'];
    }

    /**
     * Sets package_number
     *
     * @param int $package_number The package number in a series such as 1 of 3, 2 of 3, etc.  If `totalPackages` is populated then `packageNumber` is required.  `packageNumber` must be less than or equal to `totalPackages`.  This feature is not supported on the 2x7 or 4x4 label format.  Note: * When `packageNumber` is provided with a Destination Entry Facility, the Drop-Off Location will not be displayed on the label.
     *
     * @return $this
     */
    public function setPackageNumber($package_number)
    {
        $this->container['package_number'] = $package_number;

        return $this;
    }

    /**
     * Gets total_packages
     *
     * @return int
     */
    public function getTotalPackages()
    {
        return $this->container['total_packages'];
    }

    /**
     * Sets total_packages
     *
     * @param int $total_packages The total number of packages in a series such as 999.  If packageNumber is populated then totalPackages is required.  totalPackages must be greater than or equal to packageNumber.  This feature is not supported by the 2x7 or 4x4 label format.
     *
     * @return $this
     */
    public function setTotalPackages($total_packages)
    {
        $this->container['total_packages'] = $total_packages;

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