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

/**
 * Rate
 *
 * The Rating API is used when rating or shopping a shipment. # Reference - <a href=\"https://developer.ups.com/api/reference/rating/business-rules\" target=\"_blank\" rel=\"noopener\">Business Rules</a> - <a href=\"https://developer.ups.com/api/reference/rating/appendix\" target=\"_blank\" rel=\"noopener\">Appendix</a> - <a href=\"https://developer.ups.com/api/reference/rating/error-codes\" target=\"_blank\" rel=\"noopener\">Errors</a> - <a href=\"https://developer.ups.com/api/reference/rating/faq\" target=\"_blank\" rel=\"noopener\">FAQ</a> - <a href=\"https://developer.ups.com/api/reference/rating/best-practices\" target=\"_blank\" rel=\"noopener noreferrer\"> Best Practices</a>  <br/><p>Try out UPS APIs with example requests using Postman. Explore API documentation and sample applications through GitHub.</p>  <a href=\"https://god.gw.postman.com/run-collection/29542085-ac21ef26-eecf-4841-b0b2-737d615b6809?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D29542085-ac21ef26-eecf-4841-b0b2-737d615b6809%26entityType%3Dcollection%26workspaceId%3D7e7595f0-4829-4f9a-aee1-75c126b9d417\" target=\"_blank\" rel=\"noopener noreferrer\">   <img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\"></a> <a href=\"https://github.com/UPS-API\" target=\"_blank\" rel=\"noopener noreferrer\">   <img src=\"https://www.ups.com/assets/resources/webcontent/images/gitHubButton.svg\" alt=\"Open in GitHub\" style=\"width: 128px; height: 32px;\"> </a>
 *
 * 
 * 
 * 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 UPS\Rating\Rating;

use \ArrayAccess;
use \UPS\Rating\ObjectSerializer;

/**
 * PackagePackageServiceOptions Class Doc Comment
 *
 * @category Class
 * @description PackageServiceOptions container.
 * @package  UPS\Rating
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class PackagePackageServiceOptions implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'delivery_confirmation' => '\UPS\Rating\Rating\PackageServiceOptionsDeliveryConfirmation',
        'access_point_cod' => '\UPS\Rating\Rating\PackageServiceOptionsAccessPointCOD',
        'cod' => '\UPS\Rating\Rating\PackageServiceOptionsCOD',
        'declared_value' => '\UPS\Rating\Rating\PackageServiceOptionsDeclaredValue',
        'shipper_declared_value' => '\UPS\Rating\Rating\PackageServiceOptionsShipperDeclaredValue',
        'shipper_release_indicator' => 'string',
        'proactive_indicator' => 'string',
        'refrigeration_indicator' => 'string',
        'insurance' => '\UPS\Rating\Rating\PackageServiceOptionsInsurance',
        'ups_premium_care_indicator' => 'string',
        'haz_mat' => '\UPS\Rating\Rating\PackageServiceOptionsHazMat',
        'dry_ice' => '\UPS\Rating\Rating\PackageServiceOptionsDryIce'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'delivery_confirmation' => null,
        'access_point_cod' => null,
        'cod' => null,
        'declared_value' => null,
        'shipper_declared_value' => null,
        'shipper_release_indicator' => null,
        'proactive_indicator' => null,
        'refrigeration_indicator' => null,
        'insurance' => null,
        'ups_premium_care_indicator' => null,
        'haz_mat' => null,
        'dry_ice' => 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 = [
        'delivery_confirmation' => 'DeliveryConfirmation',
        'access_point_cod' => 'AccessPointCOD',
        'cod' => 'COD',
        'declared_value' => 'DeclaredValue',
        'shipper_declared_value' => 'ShipperDeclaredValue',
        'shipper_release_indicator' => 'ShipperReleaseIndicator',
        'proactive_indicator' => 'ProactiveIndicator',
        'refrigeration_indicator' => 'RefrigerationIndicator',
        'insurance' => 'Insurance',
        'ups_premium_care_indicator' => 'UPSPremiumCareIndicator',
        'haz_mat' => 'HazMat',
        'dry_ice' => 'DryIce'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'delivery_confirmation' => 'setDeliveryConfirmation',
        'access_point_cod' => 'setAccessPointCod',
        'cod' => 'setCod',
        'declared_value' => 'setDeclaredValue',
        'shipper_declared_value' => 'setShipperDeclaredValue',
        'shipper_release_indicator' => 'setShipperReleaseIndicator',
        'proactive_indicator' => 'setProactiveIndicator',
        'refrigeration_indicator' => 'setRefrigerationIndicator',
        'insurance' => 'setInsurance',
        'ups_premium_care_indicator' => 'setUpsPremiumCareIndicator',
        'haz_mat' => 'setHazMat',
        'dry_ice' => 'setDryIce'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'delivery_confirmation' => 'getDeliveryConfirmation',
        'access_point_cod' => 'getAccessPointCod',
        'cod' => 'getCod',
        'declared_value' => 'getDeclaredValue',
        'shipper_declared_value' => 'getShipperDeclaredValue',
        'shipper_release_indicator' => 'getShipperReleaseIndicator',
        'proactive_indicator' => 'getProactiveIndicator',
        'refrigeration_indicator' => 'getRefrigerationIndicator',
        'insurance' => 'getInsurance',
        'ups_premium_care_indicator' => 'getUpsPremiumCareIndicator',
        'haz_mat' => 'getHazMat',
        'dry_ice' => 'getDryIce'
    ];

    /**
     * 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['delivery_confirmation'] = isset($data['delivery_confirmation']) ? $data['delivery_confirmation'] : null;
        $this->container['access_point_cod'] = isset($data['access_point_cod']) ? $data['access_point_cod'] : null;
        $this->container['cod'] = isset($data['cod']) ? $data['cod'] : null;
        $this->container['declared_value'] = isset($data['declared_value']) ? $data['declared_value'] : null;
        $this->container['shipper_declared_value'] = isset($data['shipper_declared_value']) ? $data['shipper_declared_value'] : null;
        $this->container['shipper_release_indicator'] = isset($data['shipper_release_indicator']) ? $data['shipper_release_indicator'] : null;
        $this->container['proactive_indicator'] = isset($data['proactive_indicator']) ? $data['proactive_indicator'] : null;
        $this->container['refrigeration_indicator'] = isset($data['refrigeration_indicator']) ? $data['refrigeration_indicator'] : null;
        $this->container['insurance'] = isset($data['insurance']) ? $data['insurance'] : null;
        $this->container['ups_premium_care_indicator'] = isset($data['ups_premium_care_indicator']) ? $data['ups_premium_care_indicator'] : null;
        $this->container['haz_mat'] = isset($data['haz_mat']) ? $data['haz_mat'] : null;
        $this->container['dry_ice'] = isset($data['dry_ice']) ? $data['dry_ice'] : 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;
    }


    /**
     * Gets delivery_confirmation
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsDeliveryConfirmation
     */
    public function getDeliveryConfirmation()
    {
        return $this->container['delivery_confirmation'];
    }

    /**
     * Sets delivery_confirmation
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsDeliveryConfirmation $delivery_confirmation delivery_confirmation
     *
     * @return $this
     */
    public function setDeliveryConfirmation($delivery_confirmation)
    {
        $this->container['delivery_confirmation'] = $delivery_confirmation;

        return $this;
    }

    /**
     * Gets access_point_cod
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsAccessPointCOD
     */
    public function getAccessPointCod()
    {
        return $this->container['access_point_cod'];
    }

    /**
     * Sets access_point_cod
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsAccessPointCOD $access_point_cod access_point_cod
     *
     * @return $this
     */
    public function setAccessPointCod($access_point_cod)
    {
        $this->container['access_point_cod'] = $access_point_cod;

        return $this;
    }

    /**
     * Gets cod
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsCOD
     */
    public function getCod()
    {
        return $this->container['cod'];
    }

    /**
     * Sets cod
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsCOD $cod cod
     *
     * @return $this
     */
    public function setCod($cod)
    {
        $this->container['cod'] = $cod;

        return $this;
    }

    /**
     * Gets declared_value
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsDeclaredValue
     */
    public function getDeclaredValue()
    {
        return $this->container['declared_value'];
    }

    /**
     * Sets declared_value
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsDeclaredValue $declared_value declared_value
     *
     * @return $this
     */
    public function setDeclaredValue($declared_value)
    {
        $this->container['declared_value'] = $declared_value;

        return $this;
    }

    /**
     * Gets shipper_declared_value
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsShipperDeclaredValue
     */
    public function getShipperDeclaredValue()
    {
        return $this->container['shipper_declared_value'];
    }

    /**
     * Sets shipper_declared_value
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsShipperDeclaredValue $shipper_declared_value shipper_declared_value
     *
     * @return $this
     */
    public function setShipperDeclaredValue($shipper_declared_value)
    {
        $this->container['shipper_declared_value'] = $shipper_declared_value;

        return $this;
    }

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

    /**
     * Sets shipper_release_indicator
     *
     * @param string $shipper_release_indicator The presence indicates that the package may be released by driver without a signature from the consignee.  Empty Tag. Only available for US50/PR to US50/PR packages without return service.
     *
     * @return $this
     */
    public function setShipperReleaseIndicator($shipper_release_indicator)
    {
        $this->container['shipper_release_indicator'] = $shipper_release_indicator;

        return $this;
    }

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

    /**
     * Sets proactive_indicator
     *
     * @param string $proactive_indicator Any value associated with this element will be ignored. If present, the package is rated for UPS Proactive Response and proactive package tracking.Contractual accessorial for health care companies to allow package monitoring throughout the UPS system.  Shippers account needs to have valid contract for UPS Proactive Response.
     *
     * @return $this
     */
    public function setProactiveIndicator($proactive_indicator)
    {
        $this->container['proactive_indicator'] = $proactive_indicator;

        return $this;
    }

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

    /**
     * Sets refrigeration_indicator
     *
     * @param string $refrigeration_indicator Presence/Absence Indicator. Any value is ignored. If present, indicates that the package contains an item that needs refrigeration.  Shippers account needs to have a valid contract for Refrigeration.
     *
     * @return $this
     */
    public function setRefrigerationIndicator($refrigeration_indicator)
    {
        $this->container['refrigeration_indicator'] = $refrigeration_indicator;

        return $this;
    }

    /**
     * Gets insurance
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsInsurance
     */
    public function getInsurance()
    {
        return $this->container['insurance'];
    }

    /**
     * Sets insurance
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsInsurance $insurance insurance
     *
     * @return $this
     */
    public function setInsurance($insurance)
    {
        $this->container['insurance'] = $insurance;

        return $this;
    }

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

    /**
     * Sets ups_premium_care_indicator
     *
     * @param string $ups_premium_care_indicator The UPSPremiumCareIndicator indicates special handling is required for shipment having controlled substances.  Empty Tag means indicator is present.  Valid only for Canada to Canada movements.  Available for the following Return Services: - Returns Exchange (available with a contract) - Print Return Label - Print and Mail - Electronic Return Label - Return Service Three Attempt  May be requested with following UPS services: - UPS Express® Early - UPS Express - UPS Express Saver - UPS Standard.  Not available for packages with the following: - Delivery Confirmation - Signature Required - Delivery Confirmation - Adult Signature Required.
     *
     * @return $this
     */
    public function setUpsPremiumCareIndicator($ups_premium_care_indicator)
    {
        $this->container['ups_premium_care_indicator'] = $ups_premium_care_indicator;

        return $this;
    }

    /**
     * Gets haz_mat
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsHazMat
     */
    public function getHazMat()
    {
        return $this->container['haz_mat'];
    }

    /**
     * Sets haz_mat
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsHazMat $haz_mat haz_mat
     *
     * @return $this
     */
    public function setHazMat($haz_mat)
    {
        $this->container['haz_mat'] = $haz_mat;

        return $this;
    }

    /**
     * Gets dry_ice
     *
     * @return \UPS\Rating\Rating\PackageServiceOptionsDryIce
     */
    public function getDryIce()
    {
        return $this->container['dry_ice'];
    }

    /**
     * Sets dry_ice
     *
     * @param \UPS\Rating\Rating\PackageServiceOptionsDryIce $dry_ice dry_ice
     *
     * @return $this
     */
    public function setDryIce($dry_ice)
    {
        $this->container['dry_ice'] = $dry_ice;

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