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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'identifier' => 'string',
        'national_identifier_nature' => 'string',
        'country' => 'string',
        'date_from' => '\DateTime',
        'date_to' => '\DateTime',
        'description' => 'string'
    ];

    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 = [
        'identifier' => 'identifier',
        'national_identifier_nature' => 'nationalIdentifierNature',
        'country' => 'country',
        'date_from' => 'dateFrom',
        'date_to' => 'dateTo',
        'description' => 'description'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'identifier' => 'setIdentifier',
        'national_identifier_nature' => 'setNationalIdentifierNature',
        'country' => 'setCountry',
        'date_from' => 'setDateFrom',
        'date_to' => 'setDateTo',
        'description' => 'setDescription'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'identifier' => 'getIdentifier',
        'national_identifier_nature' => 'getNationalIdentifierNature',
        'country' => 'getCountry',
        'date_from' => 'getDateFrom',
        'date_to' => 'getDateTo',
        'description' => 'getDescription'
    ];

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

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

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

    const NATIONAL_IDENTIFIER_NATURE_PASSPORT_NUMBER = 'PassportNumber';
    const NATIONAL_IDENTIFIER_NATURE_SOCIAL_SECURITY_NUMBER = 'SocialSecurityNumber';
    const NATIONAL_IDENTIFIER_NATURE_BIRTH_CERTIFICATE = 'BirthCertificate';
    const NATIONAL_IDENTIFIER_NATURE_TAX_ID = 'TaxID';
    const NATIONAL_IDENTIFIER_NATURE_PERSONAL_ID = 'PersonalID';
    const NATIONAL_IDENTIFIER_NATURE_NATIONAL_SYSTEM_ID = 'NationalSystemID';
    const NATIONAL_IDENTIFIER_NATURE_CONTINENTAL_SYSTEM_ID = 'ContinentalSystemID';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getNationalIdentifierNatureAllowableValues()
    {
        return [
            self::NATIONAL_IDENTIFIER_NATURE_PASSPORT_NUMBER,
            self::NATIONAL_IDENTIFIER_NATURE_SOCIAL_SECURITY_NUMBER,
            self::NATIONAL_IDENTIFIER_NATURE_BIRTH_CERTIFICATE,
            self::NATIONAL_IDENTIFIER_NATURE_TAX_ID,
            self::NATIONAL_IDENTIFIER_NATURE_PERSONAL_ID,
            self::NATIONAL_IDENTIFIER_NATURE_NATIONAL_SYSTEM_ID,
            self::NATIONAL_IDENTIFIER_NATURE_CONTINENTAL_SYSTEM_ID,
        ];
    }

    /**
     * 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['identifier'] = isset($data['identifier']) ? $data['identifier'] : null;
        $this->container['national_identifier_nature'] = isset($data['national_identifier_nature']) ? $data['national_identifier_nature'] : null;
        $this->container['country'] = isset($data['country']) ? $data['country'] : null;
        $this->container['date_from'] = isset($data['date_from']) ? $data['date_from'] : null;
        $this->container['date_to'] = isset($data['date_to']) ? $data['date_to'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
    }

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

        if ($this->container['identifier'] === null) {
            $invalid_properties[] = "'identifier' can't be null";
        }

        if ($this->container['national_identifier_nature'] === null) {
            $invalid_properties[] = "'national_identifier_nature' can't be null";
        }
        $allowed_values = ["PassportNumber", "SocialSecurityNumber", "BirthCertificate", "TaxID", "PersonalID", "NationalSystemID", "ContinentalSystemID"];
        if (!in_array($this->container['national_identifier_nature'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'national_identifier_nature', must be one of 'PassportNumber', 'SocialSecurityNumber', 'BirthCertificate', 'TaxID', 'PersonalID', 'NationalSystemID', 'ContinentalSystemID'.";
        }

        if ($this->container['country'] === null) {
            $invalid_properties[] = "'country' can't be null";
        }

        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['identifier'] === null) {
            return false;
        }

        if ($this->container['national_identifier_nature'] === null) {
            return false;
        }
        $allowed_values = ["PassportNumber", "SocialSecurityNumber", "BirthCertificate", "TaxID", "PersonalID", "NationalSystemID", "ContinentalSystemID"];
        if (!in_array($this->container['national_identifier_nature'], $allowed_values)) {
            return false;
        }
        if ($this->container['country'] === null) {
            return false;
        }

        return true;
    }

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

    /**
     * Sets identifier
     * @param string $identifier
     * @return $this
     */
    public function setIdentifier($identifier)
    {

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

        return $this;
    }

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

    /**
     * Sets national_identifier_nature
     * @param string $national_identifier_nature
     * @return $this
     */
    public function setNationalIdentifierNature($national_identifier_nature)
    {
        $allowed_values = array('PassportNumber', 'SocialSecurityNumber', 'BirthCertificate', 'TaxID', 'PersonalID', 'NationalSystemID', 'ContinentalSystemID');
        if ((!in_array($national_identifier_nature, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'national_identifier_nature', must be one of 'PassportNumber', 'SocialSecurityNumber', 'BirthCertificate', 'TaxID', 'PersonalID', 'NationalSystemID', 'ContinentalSystemID'");
        }
        $this->container['national_identifier_nature'] = $national_identifier_nature;

        return $this;
    }

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

    /**
     * Sets country
     * @param string $country
     * @return $this
     */
    public function setCountry($country)
    {

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


