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

/**
 * International 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; International Labels API allows you to digitally create mailing labels for `FIRST-CLASS_PACKAGE_INTERNATIONAL_SERVICE`, `PRIORITY_MAIL_INTERNATIONAL`, and `PRIORITY_MAIL_EXPRESS_INTERNATIONAL`.  * Use the [Getting Started guide](https://developers.usps.com/getting-started) to get started with the Labels API. * The USPS&#174; International 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).  **References**: * [Publication 199](http://postalpro.usps.com/pub199) * [Publication 205](http://postalpro.usps.com/pub205)  **Manifest Scheduling**   The following table outlines the International Label manifesting schedule for specific conditions listed below.   | Condition                   | Scheduling | | ----------------------------| -------- | | **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 on the day after label creation. |
 *
 * OpenAPI spec version: 3.3.4
 * 
 * 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\InternationalLabels\Model;

use \ArrayAccess;
use \USPS\InternationalLabels\ObjectSerializer;

/**
 * IndiciaRequestDescriptionNonMachinableIndicators Class Doc Comment
 *
 * @category Class
 * @description Set of boolean indicators used to determine whether a letter qualifies as nonmachinable.
 * @package  USPS\InternationalLabels
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class IndiciaRequestDescriptionNonMachinableIndicators implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'is_polybagged' => 'bool',
        'has_closure_devices' => 'bool',
        'has_loose_items' => 'bool',
        'is_rigid' => 'bool',
        'is_self_mailer' => 'bool',
        'is_booklet' => 'bool'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'is_polybagged' => null,
        'has_closure_devices' => null,
        'has_loose_items' => null,
        'is_rigid' => null,
        'is_self_mailer' => null,
        'is_booklet' => 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 = [
        'is_polybagged' => 'isPolybagged',
        'has_closure_devices' => 'hasClosureDevices',
        'has_loose_items' => 'hasLooseItems',
        'is_rigid' => 'isRigid',
        'is_self_mailer' => 'isSelfMailer',
        'is_booklet' => 'isBooklet'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'is_polybagged' => 'setIsPolybagged',
        'has_closure_devices' => 'setHasClosureDevices',
        'has_loose_items' => 'setHasLooseItems',
        'is_rigid' => 'setIsRigid',
        'is_self_mailer' => 'setIsSelfMailer',
        'is_booklet' => 'setIsBooklet'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'is_polybagged' => 'getIsPolybagged',
        'has_closure_devices' => 'getHasClosureDevices',
        'has_loose_items' => 'getHasLooseItems',
        'is_rigid' => 'getIsRigid',
        'is_self_mailer' => 'getIsSelfMailer',
        'is_booklet' => 'getIsBooklet'
    ];

    /**
     * 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['is_polybagged'] = isset($data['is_polybagged']) ? $data['is_polybagged'] : false;
        $this->container['has_closure_devices'] = isset($data['has_closure_devices']) ? $data['has_closure_devices'] : false;
        $this->container['has_loose_items'] = isset($data['has_loose_items']) ? $data['has_loose_items'] : false;
        $this->container['is_rigid'] = isset($data['is_rigid']) ? $data['is_rigid'] : false;
        $this->container['is_self_mailer'] = isset($data['is_self_mailer']) ? $data['is_self_mailer'] : false;
        $this->container['is_booklet'] = isset($data['is_booklet']) ? $data['is_booklet'] : false;
    }

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

    /**
     * Sets is_polybagged
     *
     * @param bool $is_polybagged Is the letter/flat/card polybagged, polywrapped, enclosed in any plastic material, or has an exterior surface made of a material that is not paper. Windows in envelopes made of paper do not make mailpieces nonmachinable. Attachments allowable under applicable eligibility standards do not make mailpieces nonmachinable.
     *
     * @return $this
     */
    public function setIsPolybagged($is_polybagged)
    {
        $this->container['is_polybagged'] = $is_polybagged;

        return $this;
    }

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

    /**
     * Sets has_closure_devices
     *
     * @param bool $has_closure_devices Does the letter/flat/card have clasps, strings, buttons, or similar closure devices.
     *
     * @return $this
     */
    public function setHasClosureDevices($has_closure_devices)
    {
        $this->container['has_closure_devices'] = $has_closure_devices;

        return $this;
    }

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

    /**
     * Sets has_loose_items
     *
     * @param bool $has_loose_items Does the letter/flat/card contain items such as pens, pencils, keys, or coins that cause the thickness of the mailpiece to be uneven; or loose keys or coins or similar objects not affixed to the contents within the mailpiece. Loose items may cause a letter to be nonmailable when mailed in paper envelopes; (see [DMM 601.3.3](https://pe.usps.com/text/dmm300/601.htm#ep1196660)).
     *
     * @return $this
     */
    public function setHasLooseItems($has_loose_items)
    {
        $this->container['has_loose_items'] = $has_loose_items;

        return $this;
    }

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

    /**
     * Sets is_rigid
     *
     * @param bool $is_rigid Is the letter/flat/card too rigid (does not bend easily when subjected to a transport belt tension of 40 pounds around an 11-inch diameter turn).
     *
     * @return $this
     */
    public function setIsRigid($is_rigid)
    {
        $this->container['is_rigid'] = $is_rigid;

        return $this;
    }

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

    /**
     * Sets is_self_mailer
     *
     * @param bool $is_self_mailer Is the letter/flat/card a self-mailer that is not prepared according to [DMM 201.3.14](https://pe.usps.com/text/dmm300/201.htm#ep1079302).
     *
     * @return $this
     */
    public function setIsSelfMailer($is_self_mailer)
    {
        $this->container['is_self_mailer'] = $is_self_mailer;

        return $this;
    }

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

    /**
     * Sets is_booklet
     *
     * @param bool $is_booklet Is the letter/flat/card a booklet that is not prepared according to [DMM 201.3.16](https://pe.usps.com/text/dmm300/201.htm#ep1092751).
     *
     * @return $this
     */
    public function setIsBooklet($is_booklet)
    {
        $this->container['is_booklet'] = $is_booklet;

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