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

/**
 * International Prices
 *
 * Contact Us: [USPS API Support](https://emailus.usps.com/s/usps-APIs) | [Terms of Service](https://about.usps.com/termsofuse.htm)  The International Prices API allows users to retrieve International postage rates for packages by: * Look up International Base Postage based on a set of given package characteristics * Look up International Base Postage based on a given SKU  The USPS&#174; has implemented Stock Keeping Units (SKUs) which provide unique identification for their products. These SKUs are available for download online for mailers.   For further details on package specifications, delivery information, and more, please consult the [International Mail Manual. (IMM)](https://pe.usps.com/text/imm/welcome.htm). For a list of published rates please refer to the [USPS Price List](https://pe.usps.com/text/dmm300/Notice123.htm) To discover the rate ingredients for this API, take a look at [Publication 205](http://postalpro.usps.com/pub205).    **Authentication, Authorization and Access Control**      Client applications are given authorized access to protected information resources. Authorization is accomplished via the USPS&#174; Customer Onboarding Platform, where Customer Registration users may grant applications access to their protected business information. All client applications must go through this onboarding process. Any Customer Registration user wishing to share their protected business information with client application(s) may also grant authorized access.  The OAuth2, version 3 (/v3), API is based on this authorization grant and must be used to get tokens for all V3 APIs. * The resulting OAuth2 access token is to be placed in the **Authorization** header, using the **Bearer** authentication scheme. * All version 3 APIs validate access to protected information resources and will respond with a *401* HTTP status, *Unauthorized* reason, when the client application has not been authorized to access the given information resource.  The following APIs may include payment account or permit identification used to get contract rates.
 *
 * OpenAPI spec version: 3.3.10
 * 
 * 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\InternationalPrices\Model;

use \ArrayAccess;
use \USPS\InternationalPrices\ObjectSerializer;

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

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $swaggerModelName = 'InternationalLetterRatesQuery_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 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 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 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 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 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 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));
    }
}
