<?php
/**
 * FindFacilitiesRequestType
 *
 * PHP version 5
 *
 * @category Class
 * @package  Fifa\ConnectId\Sdk\Api
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * FIFA Connect ID - ID Directory V6
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: v6
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */

/**
 * 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 Fifa\ConnectId\Sdk\Api\Model;

use \ArrayAccess;

/**
 * FindFacilitiesRequestType Class Doc Comment
 *
 * @category    Class
 * @package     Fifa\ConnectId\Sdk\Api
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class FindFacilitiesRequestType implements ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'international_name' => 'string',
        'international_short_name' => 'string',
        'local_name' => 'string',
        'local_short_name' => 'string',
        'parent_facility_fifa_id' => 'string',
        'organisation_fifa_id' => 'string',
        'official_address' => '\Fifa\ConnectId\Sdk\Api\Model\SearchAddressType',
        'number_of_results' => 'int',
        'modified_from_date_time' => '\DateTime',
        'modified_to_date_time' => '\DateTime'
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'international_name' => 'internationalName',
        'international_short_name' => 'internationalShortName',
        'local_name' => 'localName',
        'local_short_name' => 'localShortName',
        'parent_facility_fifa_id' => 'parentFacilityFIFAId',
        'organisation_fifa_id' => 'organisationFIFAId',
        'official_address' => 'officialAddress',
        'number_of_results' => 'numberOfResults',
        'modified_from_date_time' => 'modifiedFromDateTime',
        'modified_to_date_time' => 'modifiedToDateTime'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'international_name' => 'setInternationalName',
        'international_short_name' => 'setInternationalShortName',
        'local_name' => 'setLocalName',
        'local_short_name' => 'setLocalShortName',
        'parent_facility_fifa_id' => 'setParentFacilityFifaId',
        'organisation_fifa_id' => 'setOrganisationFifaId',
        'official_address' => 'setOfficialAddress',
        'number_of_results' => 'setNumberOfResults',
        'modified_from_date_time' => 'setModifiedFromDateTime',
        'modified_to_date_time' => 'setModifiedToDateTime'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'international_name' => 'getInternationalName',
        'international_short_name' => 'getInternationalShortName',
        'local_name' => 'getLocalName',
        'local_short_name' => 'getLocalShortName',
        'parent_facility_fifa_id' => 'getParentFacilityFifaId',
        'organisation_fifa_id' => 'getOrganisationFifaId',
        'official_address' => 'getOfficialAddress',
        'number_of_results' => 'getNumberOfResults',
        'modified_from_date_time' => 'getModifiedFromDateTime',
        'modified_to_date_time' => 'getModifiedToDateTime'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    /**
     * 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['international_name'] = isset($data['international_name']) ? $data['international_name'] : null;
        $this->container['international_short_name'] = isset($data['international_short_name']) ? $data['international_short_name'] : null;
        $this->container['local_name'] = isset($data['local_name']) ? $data['local_name'] : null;
        $this->container['local_short_name'] = isset($data['local_short_name']) ? $data['local_short_name'] : null;
        $this->container['parent_facility_fifa_id'] = isset($data['parent_facility_fifa_id']) ? $data['parent_facility_fifa_id'] : null;
        $this->container['organisation_fifa_id'] = isset($data['organisation_fifa_id']) ? $data['organisation_fifa_id'] : null;
        $this->container['official_address'] = isset($data['official_address']) ? $data['official_address'] : null;
        $this->container['number_of_results'] = isset($data['number_of_results']) ? $data['number_of_results'] : null;
        $this->container['modified_from_date_time'] = isset($data['modified_from_date_time']) ? $data['modified_from_date_time'] : null;
        $this->container['modified_to_date_time'] = isset($data['modified_to_date_time']) ? $data['modified_to_date_time'] : null;
    }

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

        if (!is_null($this->container['number_of_results']) && ($this->container['number_of_results'] > 50)) {
            $invalid_properties[] = "invalid value for 'number_of_results', must be smaller than or equal to 50.";
        }

        if (!is_null($this->container['number_of_results']) && ($this->container['number_of_results'] < 1)) {
            $invalid_properties[] = "invalid value for 'number_of_results', must be bigger than or equal to 1.";
        }

        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        if ($this->container['number_of_results'] > 50) {
            return false;
        }
        if ($this->container['number_of_results'] < 1) {
            return false;
        }

        return true;
    }

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

    /**
     * Sets international_name
     * @param string $international_name
     * @return $this
     */
    public function setInternationalName($international_name)
    {
        $this->container['international_name'] = $international_name;

        return $this;
    }

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

    /**
     * Sets international_short_name
     * @param string $international_short_name
     * @return $this
     */
    public function setInternationalShortName($international_short_name)
    {
        $this->container['international_short_name'] = $international_short_name;

        return $this;
    }

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

    /**
     * Sets local_name
     * @param string $local_name
     * @return $this
     */
    public function setLocalName($local_name)
    {
        $this->container['local_name'] = $local_name;

        return $this;
    }

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

    /**
     * Sets local_short_name
     * @param string $local_short_name
     * @return $this
     */
    public function setLocalShortName($local_short_name)
    {
        $this->container['local_short_name'] = $local_short_name;

        return $this;
    }

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

    /**
     * Sets parent_facility_fifa_id
     * @param string $parent_facility_fifa_id
     * @return $this
     */
    public function setParentFacilityFifaId($parent_facility_fifa_id)
    {
        $this->container['parent_facility_fifa_id'] = $parent_facility_fifa_id;

        return $this;
    }

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

    /**
     * Sets organisation_fifa_id
     * @param string $organisation_fifa_id
     * @return $this
     */
    public function setOrganisationFifaId($organisation_fifa_id)
    {
        $this->container['organisation_fifa_id'] = $organisation_fifa_id;

        return $this;
    }

    /**
     * Gets official_address
     * @return \Fifa\ConnectId\Sdk\Api\Model\SearchAddressType
     */
    public function getOfficialAddress()
    {
        return $this->container['official_address'];
    }

    /**
     * Sets official_address
     * @param \Fifa\ConnectId\Sdk\Api\Model\SearchAddressType $official_address
     * @return $this
     */
    public function setOfficialAddress($official_address)
    {
        $this->container['official_address'] = $official_address;

        return $this;
    }

    /**
     * Gets number_of_results
     * @return int
     */
    public function getNumberOfResults()
    {
        return $this->container['number_of_results'];
    }

    /**
     * Sets number_of_results
     * @param int $number_of_results
     * @return $this
     */
    public function setNumberOfResults($number_of_results)
    {

        if (!is_null($number_of_results) && ($number_of_results > 50)) {
            throw new \InvalidArgumentException('invalid value for $number_of_results when calling FindFacilitiesRequestType., must be smaller than or equal to 50.');
        }
        if (!is_null($number_of_results) && ($number_of_results < 1)) {
            throw new \InvalidArgumentException('invalid value for $number_of_results when calling FindFacilitiesRequestType., must be bigger than or equal to 1.');
        }

        $this->container['number_of_results'] = $number_of_results;

        return $this;
    }

    /**
     * Gets modified_from_date_time
     * @return \DateTime
     */
    public function getModifiedFromDateTime()
    {
        return $this->container['modified_from_date_time'];
    }

    /**
     * Sets modified_from_date_time
     * @param \DateTime $modified_from_date_time
     * @return $this
     */
    public function setModifiedFromDateTime($modified_from_date_time)
    {
        $this->container['modified_from_date_time'] = $modified_from_date_time;

        return $this;
    }

    /**
     * Gets modified_to_date_time
     * @return \DateTime
     */
    public function getModifiedToDateTime()
    {
        return $this->container['modified_to_date_time'];
    }

    /**
     * Sets modified_to_date_time
     * @param \DateTime $modified_to_date_time
     * @return $this
     */
    public function setModifiedToDateTime($modified_to_date_time)
    {
        $this->container['modified_to_date_time'] = $modified_to_date_time;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    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
     */
    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
     */
    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(\Fifa\ConnectId\Sdk\Api\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\Fifa\ConnectId\Sdk\Api\ObjectSerializer::sanitizeForSerialization($this));
    }
}


