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

/**
 * ExtraServices Class Doc Comment
 *
 * @category Class
 * @description Extra Service Codes requested. * 415 - USPS Label Delivery * 480 - Tracking Plus 6 Months * 481 - Tracking Plus 1 Year * 482 - Tracking Plus 3 Years * 483 - Tracking Plus 5 Years * 484 - Tracking Plus 7 Years * 485 - Tracking Plus 10 Years * 486 - Tracking Plus Signature 3 Years * 487 - Tracking Plus Signature 5 Years * 488 - Tracking Plus Signature 7 Years * 489 - Tracking Plus Signature 10 Years * 498 - PO Box Locker – Stocking Fee (NSA Only) * 500 - PO Box Locker – Self-Service Pickup Fee (NSA Only) * 501 - PO Box Locker – Clerk-Assisted Pickup Fee (NSA Only) * 502 - PO Box Locker – Local Delivery Fee (NSA Only) * 810 - HAZMAT Air Eligible Ethanol Package * 811 - HAZMAT Class 1 - Toy Propellant/Safety Fuse Package * 812 - HAZMAT Class 3 – Flammable Liquid Package * 813 - HAZMAT Class 7 - Radioactive Materials Package * 814 - HAZMAT Class 8 - Corrosive Materials Package * 815 - HAZMAT Class 8 - Nonspillable Wet Battery Package * 816 - HAZMAT Class 9 - Lithium Battery Marked - Ground Only Package * 817 - HAZMAT Class 9 - Lithium Battery - Returns Package * 818 - HAZMAT Class 9 - Lithium batteries, marked package * 819 - HAZMAT Class 9 - Dry Ice Package * 820 - HAZMAT Class 9 - Lithium batteries, unmarked package * 821 - HAZMAT Class 9 - Magnetized Materials Package * 822 - HAZMAT Division 4.1 – Flammable Solids or Safety Matches Package * 823 - HAZMAT Division 5.1 - Oxidizers Package * 824 - HAZMAT Division 5.2 - Organic Peroxides Package * 825 - HAZMAT Division 6.1 – Toxic Materials Package * 826 - HAZMAT Division 6.2 – Infectious Substances Package * 827 - HAZMAT Excepted Quantity Provision Package * 828 - HAZMAT Ground Only * 829 - HAZMAT ID8000 Consumer Commodity Package * 830 - HAZMAT Lighters Package * 831 - HAZMAT LTD QTY Ground Package * 832 - HAZMAT Small Quantity Provision Package * 853 - Perishable Material * 856 - Live Animals Transportation Fee * 857 - Hazardous Material * 858 - Cremated Remains * 910 - Certified Mail * 911 - Certified Mail Restricted Delivery * 912 - Certified Mail Adult Signature Required * 913 - Certified Mail Adult Signature Restricted Delivery * 915 - Collect on Delivery (COD) * 917 - COD Restricted Delivery * 920 - USPS Tracking * 921 - Signature Confirmation * 922 - Adult Signature Required 21 or Over * 923 - Adult Signature Restricted Delivery 21 or Over * 924 - Signature Confirmation Restricted Delivery * 925 - Priority Mail Express Merchandise Insurance * 930 - Insurance &lt;&#x3D; $500 * 931 - Insurance &gt; $500 * 934 - Insurance Restricted Delivery * 940 - Registered Mail * 941 - Registered Mail Restricted Delivery * 955 - Return Receipt * 957 - Return Receipt Electronic * 972 - Live Animal and Perishable Handling Fee * 981 - Signature Requested (PRIORITY_MAIL_EXPRESS only) * 984 - Parcel Locker Delivery * 986 - PO to Addressee (PRIORITY_MAIL_EXPRESS only) * 991 - Sunday Delivery  &lt;b&gt;Note:&lt;/b&gt; Entering a single extra service will be removed in the next major revision.
 * @package  USPS\DomesticPrices
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class ExtraServices implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
    ];

    /**
     * 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 = [
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
    ];

    /**
     * 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)
    {
    }

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

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