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

/**
 * Dangerous Goods Utility
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * 
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.50
 */
/**
 * 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\DangerousGoods\DangerousGoods;

use \ArrayAccess;
use \UPS\DangerousGoods\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'package_identifier' => 'string',
        'accessible_indicator' => 'string',
        'europe_bu_indicator' => 'string',
        'chemical_record_results' => '\UPS\DangerousGoods\DangerousGoods\PackageResultsChemicalRecordResults[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'package_identifier' => null,
        'accessible_indicator' => null,
        'europe_bu_indicator' => null,
        'chemical_record_results' => 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 = [
        'package_identifier' => 'PackageIdentifier',
        'accessible_indicator' => 'AccessibleIndicator',
        'europe_bu_indicator' => 'EuropeBUIndicator',
        'chemical_record_results' => 'ChemicalRecordResults'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'package_identifier' => 'setPackageIdentifier',
        'accessible_indicator' => 'setAccessibleIndicator',
        'europe_bu_indicator' => 'setEuropeBuIndicator',
        'chemical_record_results' => 'setChemicalRecordResults'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'package_identifier' => 'getPackageIdentifier',
        'accessible_indicator' => 'getAccessibleIndicator',
        'europe_bu_indicator' => 'getEuropeBuIndicator',
        'chemical_record_results' => 'getChemicalRecordResults'
    ];

    /**
     * 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['package_identifier'] = isset($data['package_identifier']) ? $data['package_identifier'] : null;
        $this->container['accessible_indicator'] = isset($data['accessible_indicator']) ? $data['accessible_indicator'] : null;
        $this->container['europe_bu_indicator'] = isset($data['europe_bu_indicator']) ? $data['europe_bu_indicator'] : null;
        $this->container['chemical_record_results'] = isset($data['chemical_record_results']) ? $data['chemical_record_results'] : null;
    }

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

        if ($this->container['package_identifier'] === null) {
            $invalidProperties[] = "'package_identifier' can't be null";
        }
        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 package_identifier
     *
     * @return string
     */
    public function getPackageIdentifier()
    {
        return $this->container['package_identifier'];
    }

    /**
     * Sets package_identifier
     *
     * @param string $package_identifier Identifies the package containing Dangerous Goods.
     *
     * @return $this
     */
    public function setPackageIdentifier($package_identifier)
    {
        $this->container['package_identifier'] = $package_identifier;

        return $this;
    }

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

    /**
     * Sets accessible_indicator
     *
     * @param string $accessible_indicator Indicates if a package is crew accessible or not.  Y = Package is crew accessible. N = Package is not crew accessible.
     *
     * @return $this
     */
    public function setAccessibleIndicator($accessible_indicator)
    {
        $this->container['accessible_indicator'] = $accessible_indicator;

        return $this;
    }

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

    /**
     * Sets europe_bu_indicator
     *
     * @param string $europe_bu_indicator Indicates if origin country or territory is in the Europe Business Unit.    Y = Origin country or territory is in the Europe Business Unit. N = Origin country or territory is not in the Europe Business Unit.
     *
     * @return $this
     */
    public function setEuropeBuIndicator($europe_bu_indicator)
    {
        $this->container['europe_bu_indicator'] = $europe_bu_indicator;

        return $this;
    }

    /**
     * Gets chemical_record_results
     *
     * @return \UPS\DangerousGoods\DangerousGoods\PackageResultsChemicalRecordResults[]
     */
    public function getChemicalRecordResults()
    {
        return $this->container['chemical_record_results'];
    }

    /**
     * Sets chemical_record_results
     *
     * @param \UPS\DangerousGoods\DangerousGoods\PackageResultsChemicalRecordResults[] $chemical_record_results Chemical Records Results container.  **NOTE:** For versions >= v2, this element will always be returned as an array. For requests using version = v1, this element will be returned as an array if there is more than one object and a single object if there is only 1.
     *
     * @return $this
     */
    public function setChemicalRecordResults($chemical_record_results)
    {
        $this->container['chemical_record_results'] = $chemical_record_results;

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