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

/**
 * Locator
 *
 * 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\Locator\Locator;

use \ArrayAccess;
use \UPS\Locator\ObjectSerializer;

/**
 * LocatorResponseSearchResults Class Doc Comment
 *
 * @category Class
 * @description Container for search results.
 * @package  UPS\Locator
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class LocatorResponseSearchResults implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'geocode_candidate' => '\UPS\Locator\Locator\SearchResultsGeocodeCandidate[]',
        'disclaimer' => 'string',
        'drop_location' => '\UPS\Locator\Locator\SearchResultsDropLocation[]',
        'available_location_attributes' => '\UPS\Locator\Locator\SearchResultsAvailableLocationAttributes[]',
        'active_available_access_point_indicator' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'geocode_candidate' => null,
        'disclaimer' => null,
        'drop_location' => null,
        'available_location_attributes' => null,
        'active_available_access_point_indicator' => 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 = [
        'geocode_candidate' => 'GeocodeCandidate',
        'disclaimer' => 'Disclaimer',
        'drop_location' => 'DropLocation',
        'available_location_attributes' => 'AvailableLocationAttributes',
        'active_available_access_point_indicator' => 'ActiveAvailableAccessPointIndicator'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'geocode_candidate' => 'setGeocodeCandidate',
        'disclaimer' => 'setDisclaimer',
        'drop_location' => 'setDropLocation',
        'available_location_attributes' => 'setAvailableLocationAttributes',
        'active_available_access_point_indicator' => 'setActiveAvailableAccessPointIndicator'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'geocode_candidate' => 'getGeocodeCandidate',
        'disclaimer' => 'getDisclaimer',
        'drop_location' => 'getDropLocation',
        'available_location_attributes' => 'getAvailableLocationAttributes',
        'active_available_access_point_indicator' => 'getActiveAvailableAccessPointIndicator'
    ];

    /**
     * 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['geocode_candidate'] = isset($data['geocode_candidate']) ? $data['geocode_candidate'] : null;
        $this->container['disclaimer'] = isset($data['disclaimer']) ? $data['disclaimer'] : null;
        $this->container['drop_location'] = isset($data['drop_location']) ? $data['drop_location'] : null;
        $this->container['available_location_attributes'] = isset($data['available_location_attributes']) ? $data['available_location_attributes'] : null;
        $this->container['active_available_access_point_indicator'] = isset($data['active_available_access_point_indicator']) ? $data['active_available_access_point_indicator'] : 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 geocode_candidate
     *
     * @return \UPS\Locator\Locator\SearchResultsGeocodeCandidate[]
     */
    public function getGeocodeCandidate()
    {
        return $this->container['geocode_candidate'];
    }

    /**
     * Sets geocode_candidate
     *
     * @param \UPS\Locator\Locator\SearchResultsGeocodeCandidate[] $geocode_candidate If the origin address provided in the location request document does not have a match, a list of candidate addresses, geocodes and optionally a landmark will be returned.  **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 setGeocodeCandidate($geocode_candidate)
    {
        $this->container['geocode_candidate'] = $geocode_candidate;

        return $this;
    }

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

    /**
     * Sets disclaimer
     *
     * @param string $disclaimer Disclaimer. In the event the user requested Ground and Air service types and the maximum UPS locations list size has not been met, the list of locations will continue with locations that provide either ground or air within the search radius.   The disclaimer will note this deviation from the requested search criteria. The disclaimer is also the location where the user will receive information regarding a one-time pickup option if the first location is greater than 20 miles from the origin.
     *
     * @return $this
     */
    public function setDisclaimer($disclaimer)
    {
        $this->container['disclaimer'] = $disclaimer;

        return $this;
    }

    /**
     * Gets drop_location
     *
     * @return \UPS\Locator\Locator\SearchResultsDropLocation[]
     */
    public function getDropLocation()
    {
        return $this->container['drop_location'];
    }

    /**
     * Sets drop_location
     *
     * @param \UPS\Locator\Locator\SearchResultsDropLocation[] $drop_location When a location request is submitted with a valid origin address, UPS locations will be returned.  **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 setDropLocation($drop_location)
    {
        $this->container['drop_location'] = $drop_location;

        return $this;
    }

    /**
     * Gets available_location_attributes
     *
     * @return \UPS\Locator\Locator\SearchResultsAvailableLocationAttributes[]
     */
    public function getAvailableLocationAttributes()
    {
        return $this->container['available_location_attributes'];
    }

    /**
     * Sets available_location_attributes
     *
     * @param \UPS\Locator\Locator\SearchResultsAvailableLocationAttributes[] $available_location_attributes This container contains the information about the currently existing Retail Locations or Additional Services or Program types.  **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 setAvailableLocationAttributes($available_location_attributes)
    {
        $this->container['available_location_attributes'] = $available_location_attributes;

        return $this;
    }

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

    /**
     * Sets active_available_access_point_indicator
     *
     * @param string $active_available_access_point_indicator Indicates whether the country or territory has AccessPoints or not.   This tag is populated in the Response only if tag \"ExistIndicator\" was present in the Locator request.
     *
     * @return $this
     */
    public function setActiveAvailableAccessPointIndicator($active_available_access_point_indicator)
    {
        $this->container['active_available_access_point_indicator'] = $active_available_access_point_indicator;

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