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

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

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

    /**
      * 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_organisation_fifa_id' => 'string',
        'organisation_nature' => 'string',
        'national_identifier' => 'string',
        'official_address' => '\Fifa\ConnectId\Sdk\Api\Model\SearchAddressType',
        'modified_from_date_time' => '\DateTime',
        'modified_to_date_time' => '\DateTime',
        'number_of_results' => 'int'
    ];

    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_organisation_fifa_id' => 'parentOrganisationFIFAId',
        'organisation_nature' => 'organisationNature',
        'national_identifier' => 'nationalIdentifier',
        'official_address' => 'officialAddress',
        'modified_from_date_time' => 'modifiedFromDateTime',
        'modified_to_date_time' => 'modifiedToDateTime',
        'number_of_results' => 'numberOfResults'
    ];

    /**
     * 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_organisation_fifa_id' => 'setParentOrganisationFifaId',
        'organisation_nature' => 'setOrganisationNature',
        'national_identifier' => 'setNationalIdentifier',
        'official_address' => 'setOfficialAddress',
        'modified_from_date_time' => 'setModifiedFromDateTime',
        'modified_to_date_time' => 'setModifiedToDateTime',
        'number_of_results' => 'setNumberOfResults'
    ];

    /**
     * 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_organisation_fifa_id' => 'getParentOrganisationFifaId',
        'organisation_nature' => 'getOrganisationNature',
        'national_identifier' => 'getNationalIdentifier',
        'official_address' => 'getOfficialAddress',
        'modified_from_date_time' => 'getModifiedFromDateTime',
        'modified_to_date_time' => 'getModifiedToDateTime',
        'number_of_results' => 'getNumberOfResults'
    ];

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

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

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

    const ORGANISATION_NATURE_WORLD_FEDERATION = 'WorldFederation';
    const ORGANISATION_NATURE_CONFEDERATION = 'Confederation';
    const ORGANISATION_NATURE_NATIONAL_ASSOCIATION = 'NationalAssociation';
    const ORGANISATION_NATURE_REGIONAL_ASSOCIATION = 'RegionalAssociation';
    const ORGANISATION_NATURE_CLUB = 'Club';
    const ORGANISATION_NATURE_TEAM = 'Team';
    const ORGANISATION_NATURE_SCHOOL = 'School';
    const ORGANISATION_NATURE_MA_ACADEMY = 'MA Academy';
    const ORGANISATION_NATURE_GRASSROOT_PROGRAMME = 'Grassroot Programme';
    const ORGANISATION_NATURE_PRIVATE_ACADEMY = 'Private Academy';
    const ORGANISATION_NATURE_COLLEGE = 'College';
    const ORGANISATION_NATURE_UNIVERSITY = 'University';
    const ORGANISATION_NATURE_OTHER = 'Other';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getOrganisationNatureAllowableValues()
    {
        return [
            self::ORGANISATION_NATURE_WORLD_FEDERATION,
            self::ORGANISATION_NATURE_CONFEDERATION,
            self::ORGANISATION_NATURE_NATIONAL_ASSOCIATION,
            self::ORGANISATION_NATURE_REGIONAL_ASSOCIATION,
            self::ORGANISATION_NATURE_CLUB,
            self::ORGANISATION_NATURE_TEAM,
            self::ORGANISATION_NATURE_SCHOOL,
            self::ORGANISATION_NATURE_MA_ACADEMY,
            self::ORGANISATION_NATURE_GRASSROOT_PROGRAMME,
            self::ORGANISATION_NATURE_PRIVATE_ACADEMY,
            self::ORGANISATION_NATURE_COLLEGE,
            self::ORGANISATION_NATURE_UNIVERSITY,
            self::ORGANISATION_NATURE_OTHER,
        ];
    }

    /**
     * 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_organisation_fifa_id'] = isset($data['parent_organisation_fifa_id']) ? $data['parent_organisation_fifa_id'] : null;
        $this->container['organisation_nature'] = isset($data['organisation_nature']) ? $data['organisation_nature'] : null;
        $this->container['national_identifier'] = isset($data['national_identifier']) ? $data['national_identifier'] : null;
        $this->container['official_address'] = isset($data['official_address']) ? $data['official_address'] : 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;
        $this->container['number_of_results'] = isset($data['number_of_results']) ? $data['number_of_results'] : null;
    }

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

        $allowed_values = ["WorldFederation", "Confederation", "NationalAssociation", "RegionalAssociation", "Club", "Team", "School", "MA Academy", "Grassroot Programme", "Private Academy", "College", "University", "Other"];
        if (!in_array($this->container['organisation_nature'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'organisation_nature', must be one of 'WorldFederation', 'Confederation', 'NationalAssociation', 'RegionalAssociation', 'Club', 'Team', 'School', 'MA Academy', 'Grassroot Programme', 'Private Academy', 'College', 'University', 'Other'.";
        }

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

        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()
    {

        $allowed_values = ["WorldFederation", "Confederation", "NationalAssociation", "RegionalAssociation", "Club", "Team", "School", "MA Academy", "Grassroot Programme", "Private Academy", "College", "University", "Other"];
        if (!in_array($this->container['organisation_nature'], $allowed_values)) {
            return false;
        }

        if ($this->container['number_of_results'] > 5000) {
            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_organisation_fifa_id
     * @return string
     */
    public function getParentOrganisationFifaId()
    {
        return $this->container['parent_organisation_fifa_id'];
    }

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

        return $this;
    }

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

    /**
     * Sets organisation_nature
     * @param string $organisation_nature
     * @return $this
     */
    public function setOrganisationNature($organisation_nature)
    {
        $allowed_values = array('WorldFederation', 'Confederation', 'NationalAssociation', 'RegionalAssociation', 'Club', 'Team', 'School', 'MA Academy', 'Grassroot Programme', 'Private Academy', 'College', 'University', 'Other');
        if (!is_null($organisation_nature) && (!in_array($organisation_nature, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'organisation_nature', must be one of 'WorldFederation', 'Confederation', 'NationalAssociation', 'RegionalAssociation', 'Club', 'Team', 'School', 'MA Academy', 'Grassroot Programme', 'Private Academy', 'College', 'University', 'Other'");
        }
        $this->container['organisation_nature'] = $organisation_nature;

        return $this;
    }

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

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

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

    /**
     * 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 > 5000)) {
            throw new \InvalidArgumentException('invalid value for $number_of_results when calling FindOrganisationsRequestType., must be smaller than or equal to 5000.');
        }
        if (!is_null($number_of_results) && ($number_of_results < 1)) {
            throw new \InvalidArgumentException('invalid value for $number_of_results when calling FindOrganisationsRequestType., must be bigger than or equal to 1.');
        }

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

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


