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

/**
 * Domestic Prices
 *
 * Contact Us: [USPS API Support](https://emailus.usps.com/s/usps-APIs) | [Terms of Service](https://about.usps.com/termsofuse.htm)  The prices API can be used to calculate postage rates for domestic packages:  * Base postage based on a set of given package characteristics * Base postage based on a given Stock Keeping Units (SKUs) * Extra service postage based on a given extra service code and mail class * A list of eligible products for a given set of package characteristics  For specifications such as package and letter dimensions, delivery information, etc., please refer to the [Domestic Mail Manual (DMM)](https://pe.usps.com/DMM300).  For a list of published prices please refer to the [USPS&#174; Price List](https://pe.usps.com/text/dmm300/Notice123.htm).  To discover the rate ingredients for this API, please visit [Publication 205](https://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.  If all mail classes are needed, please use the /total-rates/search endpoint.
 *
 * OpenAPI spec version: 3.4.27
 * 
 * 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\DomesticPrices\Model;

use \ArrayAccess;
use \USPS\DomesticPrices\ObjectSerializer;

/**
 * BaseRatesQuery Class Doc Comment
 *
 * @category Class
 * @description Package rate ingredients used to calculate base prices.
 * @package  USPS\DomesticPrices
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class BaseRatesQuery implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'origin_zip_code' => 'string',
        'destination_zip_code' => 'string',
        'weight' => '\USPS\DomesticPrices\Model\WeightPounds',
        'length' => '\USPS\DomesticPrices\Model\Length',
        'width' => '\USPS\DomesticPrices\Model\Width',
        'height' => '\USPS\DomesticPrices\Model\Height',
        'mail_class' => '\USPS\DomesticPrices\Model\MailClass',
        'processing_category' => 'string',
        'rate_indicator' => 'string',
        'destination_entry_facility_type' => 'string',
        'price_type' => '\USPS\DomesticPrices\Model\PriceType',
        'mailing_date' => '\USPS\DomesticPrices\Model\MailingDate',
        'account_type' => 'string',
        'account_number' => 'string',
        'has_nonstandard_characteristics' => 'bool'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'origin_zip_code' => null,
        'destination_zip_code' => null,
        'weight' => null,
        'length' => null,
        'width' => null,
        'height' => null,
        'mail_class' => null,
        'processing_category' => null,
        'rate_indicator' => null,
        'destination_entry_facility_type' => null,
        'price_type' => null,
        'mailing_date' => null,
        'account_type' => null,
        'account_number' => null,
        'has_nonstandard_characteristics' => 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 = [
        'origin_zip_code' => 'originZIPCode',
        'destination_zip_code' => 'destinationZIPCode',
        'weight' => 'weight',
        'length' => 'length',
        'width' => 'width',
        'height' => 'height',
        'mail_class' => 'mailClass',
        'processing_category' => 'processingCategory',
        'rate_indicator' => 'rateIndicator',
        'destination_entry_facility_type' => 'destinationEntryFacilityType',
        'price_type' => 'priceType',
        'mailing_date' => 'mailingDate',
        'account_type' => 'accountType',
        'account_number' => 'accountNumber',
        'has_nonstandard_characteristics' => 'hasNonstandardCharacteristics'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'origin_zip_code' => 'setOriginZipCode',
        'destination_zip_code' => 'setDestinationZipCode',
        'weight' => 'setWeight',
        'length' => 'setLength',
        'width' => 'setWidth',
        'height' => 'setHeight',
        'mail_class' => 'setMailClass',
        'processing_category' => 'setProcessingCategory',
        'rate_indicator' => 'setRateIndicator',
        'destination_entry_facility_type' => 'setDestinationEntryFacilityType',
        'price_type' => 'setPriceType',
        'mailing_date' => 'setMailingDate',
        'account_type' => 'setAccountType',
        'account_number' => 'setAccountNumber',
        'has_nonstandard_characteristics' => 'setHasNonstandardCharacteristics'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'origin_zip_code' => 'getOriginZipCode',
        'destination_zip_code' => 'getDestinationZipCode',
        'weight' => 'getWeight',
        'length' => 'getLength',
        'width' => 'getWidth',
        'height' => 'getHeight',
        'mail_class' => 'getMailClass',
        'processing_category' => 'getProcessingCategory',
        'rate_indicator' => 'getRateIndicator',
        'destination_entry_facility_type' => 'getDestinationEntryFacilityType',
        'price_type' => 'getPriceType',
        'mailing_date' => 'getMailingDate',
        'account_type' => 'getAccountType',
        'account_number' => 'getAccountNumber',
        'has_nonstandard_characteristics' => 'getHasNonstandardCharacteristics'
    ];

    /**
     * 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 PROCESSING_CATEGORY_LETTERS = 'LETTERS';
    const PROCESSING_CATEGORY_FLATS = 'FLATS';
    const PROCESSING_CATEGORY_MACHINABLE = 'MACHINABLE';
    const PROCESSING_CATEGORY_IRREGULAR = 'IRREGULAR';
    const PROCESSING_CATEGORY_NON_MACHINABLE = 'NON_MACHINABLE';
    const PROCESSING_CATEGORY_NONSTANDARD = 'NONSTANDARD';
    const RATE_INDICATOR__3_D = '3D';
    const RATE_INDICATOR__3_N = '3N';
    const RATE_INDICATOR__3_R = '3R';
    const RATE_INDICATOR__5_D = '5D';
    const RATE_INDICATOR_BA = 'BA';
    const RATE_INDICATOR_BB = 'BB';
    const RATE_INDICATOR_BM = 'BM';
    const RATE_INDICATOR_C1 = 'C1';
    const RATE_INDICATOR_C2 = 'C2';
    const RATE_INDICATOR_C3 = 'C3';
    const RATE_INDICATOR_C4 = 'C4';
    const RATE_INDICATOR_C5 = 'C5';
    const RATE_INDICATOR_CP = 'CP';
    const RATE_INDICATOR_CM = 'CM';
    const RATE_INDICATOR_DC = 'DC';
    const RATE_INDICATOR_DE = 'DE';
    const RATE_INDICATOR_DF = 'DF';
    const RATE_INDICATOR_DN = 'DN';
    const RATE_INDICATOR_DR = 'DR';
    const RATE_INDICATOR_E4 = 'E4';
    const RATE_INDICATOR_E6 = 'E6';
    const RATE_INDICATOR_E7 = 'E7';
    const RATE_INDICATOR_FA = 'FA';
    const RATE_INDICATOR_FB = 'FB';
    const RATE_INDICATOR_FE = 'FE';
    const RATE_INDICATOR_FP = 'FP';
    const RATE_INDICATOR_FS = 'FS';
    const RATE_INDICATOR_LC = 'LC';
    const RATE_INDICATOR_LF = 'LF';
    const RATE_INDICATOR_LL = 'LL';
    const RATE_INDICATOR_LO = 'LO';
    const RATE_INDICATOR_LS = 'LS';
    const RATE_INDICATOR_NP = 'NP';
    const RATE_INDICATOR_O1 = 'O1';
    const RATE_INDICATOR_O2 = 'O2';
    const RATE_INDICATOR_O3 = 'O3';
    const RATE_INDICATOR_O4 = 'O4';
    const RATE_INDICATOR_O5 = 'O5';
    const RATE_INDICATOR_O6 = 'O6';
    const RATE_INDICATOR_O7 = 'O7';
    const RATE_INDICATOR_OS = 'OS';
    const RATE_INDICATOR_P5 = 'P5';
    const RATE_INDICATOR_P6 = 'P6';
    const RATE_INDICATOR_P7 = 'P7';
    const RATE_INDICATOR_P8 = 'P8';
    const RATE_INDICATOR_P9 = 'P9';
    const RATE_INDICATOR_Q6 = 'Q6';
    const RATE_INDICATOR_Q7 = 'Q7';
    const RATE_INDICATOR_Q8 = 'Q8';
    const RATE_INDICATOR_Q9 = 'Q9';
    const RATE_INDICATOR_Q0 = 'Q0';
    const RATE_INDICATOR_PA = 'PA';
    const RATE_INDICATOR_PL = 'PL';
    const RATE_INDICATOR_PM = 'PM';
    const RATE_INDICATOR_PR = 'PR';
    const RATE_INDICATOR_SB = 'SB';
    const RATE_INDICATOR_SN = 'SN';
    const RATE_INDICATOR_SP = 'SP';
    const RATE_INDICATOR_SR = 'SR';
    const DESTINATION_ENTRY_FACILITY_TYPE_NONE = 'NONE';
    const DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_NETWORK_DISTRIBUTION_CENTER = 'DESTINATION_NETWORK_DISTRIBUTION_CENTER';
    const DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_SECTIONAL_CENTER_FACILITY = 'DESTINATION_SECTIONAL_CENTER_FACILITY';
    const DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_DELIVERY_UNIT = 'DESTINATION_DELIVERY_UNIT';
    const DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_SERVICE_HUB = 'DESTINATION_SERVICE_HUB';
    const DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER = 'DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER';
    const ACCOUNT_TYPE_EPS = 'EPS';
    const ACCOUNT_TYPE_PERMIT = 'PERMIT';
    const ACCOUNT_TYPE_METER = 'METER';
    const ACCOUNT_TYPE_MID = 'MID';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getProcessingCategoryAllowableValues()
    {
        return [
            self::PROCESSING_CATEGORY_LETTERS,
            self::PROCESSING_CATEGORY_FLATS,
            self::PROCESSING_CATEGORY_MACHINABLE,
            self::PROCESSING_CATEGORY_IRREGULAR,
            self::PROCESSING_CATEGORY_NON_MACHINABLE,
            self::PROCESSING_CATEGORY_NONSTANDARD,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getRateIndicatorAllowableValues()
    {
        return [
            self::RATE_INDICATOR__3_D,
            self::RATE_INDICATOR__3_N,
            self::RATE_INDICATOR__3_R,
            self::RATE_INDICATOR__5_D,
            self::RATE_INDICATOR_BA,
            self::RATE_INDICATOR_BB,
            self::RATE_INDICATOR_BM,
            self::RATE_INDICATOR_C1,
            self::RATE_INDICATOR_C2,
            self::RATE_INDICATOR_C3,
            self::RATE_INDICATOR_C4,
            self::RATE_INDICATOR_C5,
            self::RATE_INDICATOR_CP,
            self::RATE_INDICATOR_CM,
            self::RATE_INDICATOR_DC,
            self::RATE_INDICATOR_DE,
            self::RATE_INDICATOR_DF,
            self::RATE_INDICATOR_DN,
            self::RATE_INDICATOR_DR,
            self::RATE_INDICATOR_E4,
            self::RATE_INDICATOR_E6,
            self::RATE_INDICATOR_E7,
            self::RATE_INDICATOR_FA,
            self::RATE_INDICATOR_FB,
            self::RATE_INDICATOR_FE,
            self::RATE_INDICATOR_FP,
            self::RATE_INDICATOR_FS,
            self::RATE_INDICATOR_LC,
            self::RATE_INDICATOR_LF,
            self::RATE_INDICATOR_LL,
            self::RATE_INDICATOR_LO,
            self::RATE_INDICATOR_LS,
            self::RATE_INDICATOR_NP,
            self::RATE_INDICATOR_O1,
            self::RATE_INDICATOR_O2,
            self::RATE_INDICATOR_O3,
            self::RATE_INDICATOR_O4,
            self::RATE_INDICATOR_O5,
            self::RATE_INDICATOR_O6,
            self::RATE_INDICATOR_O7,
            self::RATE_INDICATOR_OS,
            self::RATE_INDICATOR_P5,
            self::RATE_INDICATOR_P6,
            self::RATE_INDICATOR_P7,
            self::RATE_INDICATOR_P8,
            self::RATE_INDICATOR_P9,
            self::RATE_INDICATOR_Q6,
            self::RATE_INDICATOR_Q7,
            self::RATE_INDICATOR_Q8,
            self::RATE_INDICATOR_Q9,
            self::RATE_INDICATOR_Q0,
            self::RATE_INDICATOR_PA,
            self::RATE_INDICATOR_PL,
            self::RATE_INDICATOR_PM,
            self::RATE_INDICATOR_PR,
            self::RATE_INDICATOR_SB,
            self::RATE_INDICATOR_SN,
            self::RATE_INDICATOR_SP,
            self::RATE_INDICATOR_SR,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getDestinationEntryFacilityTypeAllowableValues()
    {
        return [
            self::DESTINATION_ENTRY_FACILITY_TYPE_NONE,
            self::DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_NETWORK_DISTRIBUTION_CENTER,
            self::DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_SECTIONAL_CENTER_FACILITY,
            self::DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_DELIVERY_UNIT,
            self::DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_SERVICE_HUB,
            self::DESTINATION_ENTRY_FACILITY_TYPE_DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getAccountTypeAllowableValues()
    {
        return [
            self::ACCOUNT_TYPE_EPS,
            self::ACCOUNT_TYPE_PERMIT,
            self::ACCOUNT_TYPE_METER,
            self::ACCOUNT_TYPE_MID,
        ];
    }

    /**
     * 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['origin_zip_code'] = isset($data['origin_zip_code']) ? $data['origin_zip_code'] : null;
        $this->container['destination_zip_code'] = isset($data['destination_zip_code']) ? $data['destination_zip_code'] : null;
        $this->container['weight'] = isset($data['weight']) ? $data['weight'] : null;
        $this->container['length'] = isset($data['length']) ? $data['length'] : null;
        $this->container['width'] = isset($data['width']) ? $data['width'] : null;
        $this->container['height'] = isset($data['height']) ? $data['height'] : null;
        $this->container['mail_class'] = isset($data['mail_class']) ? $data['mail_class'] : null;
        $this->container['processing_category'] = isset($data['processing_category']) ? $data['processing_category'] : null;
        $this->container['rate_indicator'] = isset($data['rate_indicator']) ? $data['rate_indicator'] : null;
        $this->container['destination_entry_facility_type'] = isset($data['destination_entry_facility_type']) ? $data['destination_entry_facility_type'] : null;
        $this->container['price_type'] = isset($data['price_type']) ? $data['price_type'] : null;
        $this->container['mailing_date'] = isset($data['mailing_date']) ? $data['mailing_date'] : null;
        $this->container['account_type'] = isset($data['account_type']) ? $data['account_type'] : null;
        $this->container['account_number'] = isset($data['account_number']) ? $data['account_number'] : null;
        $this->container['has_nonstandard_characteristics'] = isset($data['has_nonstandard_characteristics']) ? $data['has_nonstandard_characteristics'] : false;
    }

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

        if ($this->container['origin_zip_code'] === null) {
            $invalidProperties[] = "'origin_zip_code' can't be null";
        }
        if ($this->container['destination_zip_code'] === null) {
            $invalidProperties[] = "'destination_zip_code' can't be null";
        }
        if ($this->container['weight'] === null) {
            $invalidProperties[] = "'weight' can't be null";
        }
        if ($this->container['length'] === null) {
            $invalidProperties[] = "'length' can't be null";
        }
        if ($this->container['width'] === null) {
            $invalidProperties[] = "'width' can't be null";
        }
        if ($this->container['height'] === null) {
            $invalidProperties[] = "'height' can't be null";
        }
        if ($this->container['mail_class'] === null) {
            $invalidProperties[] = "'mail_class' can't be null";
        }
        if ($this->container['processing_category'] === null) {
            $invalidProperties[] = "'processing_category' can't be null";
        }
        $allowedValues = $this->getProcessingCategoryAllowableValues();
        if (!is_null($this->container['processing_category']) && !in_array($this->container['processing_category'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'processing_category', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

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

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

        if ($this->container['price_type'] === null) {
            $invalidProperties[] = "'price_type' can't be null";
        }
        $allowedValues = $this->getAccountTypeAllowableValues();
        if (!is_null($this->container['account_type']) && !in_array($this->container['account_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'account_type', 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 origin_zip_code
     *
     * @return string
     */
    public function getOriginZipCode()
    {
        return $this->container['origin_zip_code'];
    }

    /**
     * Sets origin_zip_code
     *
     * @param string $origin_zip_code This is the originating ZIP Code&#8482; for the package.
     *
     * @return $this
     */
    public function setOriginZipCode($origin_zip_code)
    {
        $this->container['origin_zip_code'] = $origin_zip_code;

        return $this;
    }

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

    /**
     * Sets destination_zip_code
     *
     * @param string $destination_zip_code This is destination ZIP Code&#8482; for the package.
     *
     * @return $this
     */
    public function setDestinationZipCode($destination_zip_code)
    {
        $this->container['destination_zip_code'] = $destination_zip_code;

        return $this;
    }

    /**
     * Gets weight
     *
     * @return \USPS\DomesticPrices\Model\WeightPounds
     */
    public function getWeight()
    {
        return $this->container['weight'];
    }

    /**
     * Sets weight
     *
     * @param \USPS\DomesticPrices\Model\WeightPounds $weight weight
     *
     * @return $this
     */
    public function setWeight($weight)
    {
        $this->container['weight'] = $weight;

        return $this;
    }

    /**
     * Gets length
     *
     * @return \USPS\DomesticPrices\Model\Length
     */
    public function getLength()
    {
        return $this->container['length'];
    }

    /**
     * Sets length
     *
     * @param \USPS\DomesticPrices\Model\Length $length length
     *
     * @return $this
     */
    public function setLength($length)
    {
        $this->container['length'] = $length;

        return $this;
    }

    /**
     * Gets width
     *
     * @return \USPS\DomesticPrices\Model\Width
     */
    public function getWidth()
    {
        return $this->container['width'];
    }

    /**
     * Sets width
     *
     * @param \USPS\DomesticPrices\Model\Width $width width
     *
     * @return $this
     */
    public function setWidth($width)
    {
        $this->container['width'] = $width;

        return $this;
    }

    /**
     * Gets height
     *
     * @return \USPS\DomesticPrices\Model\Height
     */
    public function getHeight()
    {
        return $this->container['height'];
    }

    /**
     * Sets height
     *
     * @param \USPS\DomesticPrices\Model\Height $height height
     *
     * @return $this
     */
    public function setHeight($height)
    {
        $this->container['height'] = $height;

        return $this;
    }

    /**
     * Gets mail_class
     *
     * @return \USPS\DomesticPrices\Model\MailClass
     */
    public function getMailClass()
    {
        return $this->container['mail_class'];
    }

    /**
     * Sets mail_class
     *
     * @param \USPS\DomesticPrices\Model\MailClass $mail_class mail_class
     *
     * @return $this
     */
    public function setMailClass($mail_class)
    {
        $this->container['mail_class'] = $mail_class;

        return $this;
    }

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

    /**
     * Sets processing_category
     *
     * @param string $processing_category USPS categorizes parcels into one of two mail processing categories: MACHINABLE or NONSTANDARD.  These categories are based on the physical dimensions of the piece, regardless of the placement (orientation) of the delivery address on the piece. For more information see [Domestic Mail Manual (DMM)](https://pe.usps.com/DMM300/201.htm).  Machinable letter-size mail is:  * Not less than 5 inches long, 3-1/2 inches high, and 0.007-inch thick. For pieces more than 4-1/4 inches high or 6 inches long, or both, the minimum thickness is 0.009.(Pieces not meeting the 0.009 thickness are non-machinable letters under 2.1.) * Not more than 11-1/2 inches long, or more than 6-1/8 inches high, or greater than 1/4-inch thick. * Rectangular, with four square corners and parallel opposite sides. Letter-size, card-type mailpieces made of cardstock may have finished corners that do not exceed a radius of 0.125 inch (1/8 inch) unless prepared as Customized Market Mail under 243.9.0. See Exhibit 1.1.1. * Within an aspect ratio (length divided by height) of 1.3 to 2.5, inclusive. * Subject to additional dimensional restrictions in 3.0, depending on mailpiece design.  Flat-size mail must have the following characteristics:  * Be more than 11-1/2 inches long, or more than 6-1/8 inches high, or more than 1/4 inch thick, other than automation flats under 6.0 or as allowed for USPS&#174; Marketing Mail pieces with simplified addresses under 5.2.2. Mailpieces other than automation flats or USPS&#174; Marketing Mail pieces with simplified addresses that are 1/4 inch thick or less must be at least 3-1/2 inches high and at least 5 inches long and be at least 0.007 inch thick. * Be not more than 15 inches long or more than 12 inches high or more than 3/4 inch thick, except for: * Periodicals non-machinable flat-size pieces mailed as specified in 207.26.0. They must not be more than 1–1/4 inches thick. * Polywrapped flats, with selvage that extends beyond the contents, up to a maximum length of 15-3/4 inches or a maximum height of 12-1/2 inches. The enclosed contents must not be longer than 15 inches or higher than 12 inches. * Co-mailed polywrapped flats mailed as specified in Customer Support Ruling PS-346, with selvage that extends beyond the contents, up to a maximum height of 12-7/8 inches. The enclosed contents must not be higher than 12 inches. * Be rectangular with four square corners or with finished corners that do not exceed a radius of 0.125 inch (1/8 inch) unless prepared as Customized Market Mail under 9.0. * Be categorized as a catalog. * Other size or weight standards may apply to mail addressed to certain APOs and FPOs, and mail sent by the Department of State to U.S. government personnel abroad.  Note: * `IRREGULAR` is deprecated and will convert to `NONSTANDARD` as of 01/19/2025. * `NON_MACHINABLE` is deprecated and will convert to `NONSTANDARD` as of 01/19/2025.
     *
     * @return $this
     */
    public function setProcessingCategory($processing_category)
    {
        $allowedValues = $this->getProcessingCategoryAllowableValues();
        if (!in_array($processing_category, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'processing_category', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['processing_category'] = $processing_category;

        return $this;
    }

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

    /**
     * Sets rate_indicator
     *
     * @param string $rate_indicator Rate ingredient to determine pricing categorization for calculating the price  * 3D - 3-Digit  * 3N - 3-Digit Dimensional Rectangular  * 3R - 3-Digit Dimensional Nonrectangular  * 5D - 5-Digit  * BA - Basic  * BB - Mixed NDC  * BM - NDC  * C1 - Cubic Pricing Tier 1  * C2 - Cubic Pricing Tier 2  * C3 - Cubic Pricing Tier 3  * C4 - Cubic Pricing Tier 4  * C5 - Cubic Pricing Tier 5  * CP - Cubic Parcel  * CM - USPS Connect Local&#174; Mail  * DC - NDC  * DE - SCF  * DF - 5-Digit  * DN - Dimensional Nonrectangular   * DR - Dimensional Rectangular  * E4 - Priority Mail Express Flat Rate Envelope - Post Office To Addressee  * E6 - Priority Mail Express Legal Flat Rate Envelope  * E7 - Priority Mail Express Legal Flat Rate Envelope Sunday / Holiday  * FA - Legal Flat Rate Envelope  * FB - Medium Flat Rate Box/Large Flat Rate Bag  * FE - Flat Rate Envelope  * FP - Padded Flat Rate Envelope  * FS - Small Flat Rate Box  * LC - USPS Connect&#174; Local Single Piece  * LF - USPS Connect&#174; Local Flat Rate Box   * LL - USPS Connect&#174; Local Large Flat Rate Bag  * LO - USPS Connect&#174; Local Oversized  * LS - USPS Connect&#174; Local Small Flat Rate Bag  * NP - Non-Presorted  * O1 - Full Tray Box  * O2 - Half Tray Box   * O3 - EMM Tray Box   * O4 - Flat Tub Tray Box  * O5 - Surface Transported Pallet   * O6 - Full Pallet Box   * O7 - Half Pallet Box  * OS - Oversized  * P5 - Cubic Soft Pack Tier 1  * P6 - Cubic Soft Pack Tier 2  * P7 - Cubic Soft Pack Tier 3  * P8 - Cubic Soft Pack Tier 4  * P9 - Cubic Soft Pack Tier 5  * Q6 - Cubic Soft Pack Tier 6  * Q7 - Cubic Soft Pack Tier 7  * Q8 - Cubic Soft Pack Tier 8  * Q9 - Cubic Soft Pack Tier 9  * Q0 - Cubic Soft Pack Tier 10  * PA - Priority Mail Express Single Piece  * PL - Large Flat Rate Box  * PM - Large Flat Rate Box APO/FPO/DPO  * PR - Presorted  * SB - Small Flat Rate Bag  * SN - SCF Dimensional Nonrectangular  * SP - Single Piece  * SR - SCF Dimensional Rectangular
     *
     * @return $this
     */
    public function setRateIndicator($rate_indicator)
    {
        $allowedValues = $this->getRateIndicatorAllowableValues();
        if (!in_array($rate_indicator, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'rate_indicator', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['rate_indicator'] = $rate_indicator;

        return $this;
    }

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

    /**
     * Sets destination_entry_facility_type
     *
     * @param string $destination_entry_facility_type Types of Facilities: * `NONE` - Translate to Destination Rate Indicator N * `DESTINATION_NETWORK_DISTRIBUTION_CENTER` - Translate to Destination Rate Indicator B * `DESTINATION_SECTIONAL_CENTER_FACILITY` - Translate to Destination Rate Indicator S * `DESTINATION_DELIVERY_UNIT` - Translate to Destination Rate Indicator D * `DESTINATION_SERVICE_HUB` - Translate to Destination Rate Indicator H * `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` - Translate to Destination Rate Indicator B  Note: * Effective 01/18/2026: `DESTINATION_NETWORK_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is no longer eligible. * Effective 01/18/2026: (NSA Only) `DESTINATION_REGIONAL_PROCESSING_DISTRIBUTION_CENTER` with `PARCEL_SELECT` is available as an option.
     *
     * @return $this
     */
    public function setDestinationEntryFacilityType($destination_entry_facility_type)
    {
        $allowedValues = $this->getDestinationEntryFacilityTypeAllowableValues();
        if (!in_array($destination_entry_facility_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'destination_entry_facility_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['destination_entry_facility_type'] = $destination_entry_facility_type;

        return $this;
    }

    /**
     * Gets price_type
     *
     * @return \USPS\DomesticPrices\Model\PriceType
     */
    public function getPriceType()
    {
        return $this->container['price_type'];
    }

    /**
     * Sets price_type
     *
     * @param \USPS\DomesticPrices\Model\PriceType $price_type price_type
     *
     * @return $this
     */
    public function setPriceType($price_type)
    {
        $this->container['price_type'] = $price_type;

        return $this;
    }

    /**
     * Gets mailing_date
     *
     * @return \USPS\DomesticPrices\Model\MailingDate
     */
    public function getMailingDate()
    {
        return $this->container['mailing_date'];
    }

    /**
     * Sets mailing_date
     *
     * @param \USPS\DomesticPrices\Model\MailingDate $mailing_date mailing_date
     *
     * @return $this
     */
    public function setMailingDate($mailing_date)
    {
        $this->container['mailing_date'] = $mailing_date;

        return $this;
    }

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

    /**
     * Sets account_type
     *
     * @param string $account_type The type of payment account linked to a contract rate.  Note: - `METER` pricing is only available to PC Postage providers. - `MID` pricing is only available for return mail classes.
     *
     * @return $this
     */
    public function setAccountType($account_type)
    {
        $allowedValues = $this->getAccountTypeAllowableValues();
        if (!is_null($account_type) && !in_array($account_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'account_type', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['account_type'] = $account_type;

        return $this;
    }

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

    /**
     * Sets account_number
     *
     * @param string $account_number The Enterprise Payment Account, Permit number, PC Postage meter number, or Mailer ID associated with a contract.
     *
     * @return $this
     */
    public function setAccountNumber($account_number)
    {
        $this->container['account_number'] = $account_number;

        return $this;
    }

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

    /**
     * Sets has_nonstandard_characteristics
     *
     * @param bool $has_nonstandard_characteristics Package is nonstandard. Nonstandard packages include cylindrical tubes and rolls, certain high-density items, cartons containing more than 24 ounces of liquids in one or more glass containers, cartons containing 1 gallon or more of liquid in metal or plastic containers, and items in [201.7.6.2](https://pe.usps.com/text/dmm300/201.htm#7.6.2).
     *
     * @return $this
     */
    public function setHasNonstandardCharacteristics($has_nonstandard_characteristics)
    {
        $this->container['has_nonstandard_characteristics'] = $has_nonstandard_characteristics;

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