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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'person_fifa_id' => 'string',
        'proximity_score' => 'double',
        'duplicate_match_type' => '\Fifa\ConnectId\Sdk\Api\Model\PersonDuplicateMatchType',
        'person' => '\Fifa\ConnectId\Sdk\Api\Model\PersonType',
        'primary_data_provider_registration_type' => '\Fifa\ConnectId\Sdk\Api\Model\RegistrationType',
        'person_registration_context' => '\Fifa\ConnectId\Sdk\Api\Model\PersonRegistrationContextType'
    ];

    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 = [
        'person_fifa_id' => 'personFifaId',
        'proximity_score' => 'proximityScore',
        'duplicate_match_type' => 'duplicateMatchType',
        'person' => 'person',
        'primary_data_provider_registration_type' => 'primaryDataProviderRegistrationType',
        'person_registration_context' => 'personRegistrationContext'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'person_fifa_id' => 'setPersonFifaId',
        'proximity_score' => 'setProximityScore',
        'duplicate_match_type' => 'setDuplicateMatchType',
        'person' => 'setPerson',
        'primary_data_provider_registration_type' => 'setPrimaryDataProviderRegistrationType',
        'person_registration_context' => 'setPersonRegistrationContext'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'person_fifa_id' => 'getPersonFifaId',
        'proximity_score' => 'getProximityScore',
        'duplicate_match_type' => 'getDuplicateMatchType',
        'person' => 'getPerson',
        'primary_data_provider_registration_type' => 'getPrimaryDataProviderRegistrationType',
        'person_registration_context' => 'getPersonRegistrationContext'
    ];

    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['person_fifa_id'] = isset($data['person_fifa_id']) ? $data['person_fifa_id'] : null;
        $this->container['proximity_score'] = isset($data['proximity_score']) ? $data['proximity_score'] : null;
        $this->container['duplicate_match_type'] = isset($data['duplicate_match_type']) ? $data['duplicate_match_type'] : null;
        $this->container['person'] = isset($data['person']) ? $data['person'] : null;
        $this->container['primary_data_provider_registration_type'] = isset($data['primary_data_provider_registration_type']) ? $data['primary_data_provider_registration_type'] : null;
        $this->container['person_registration_context'] = isset($data['person_registration_context']) ? $data['person_registration_context'] : null;
    }

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

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

        if ($this->container['proximity_score'] === null) {
            $invalid_properties[] = "'proximity_score' can't be null";
        }
        if ($this->container['duplicate_match_type'] === null) {
            $invalid_properties[] = "'duplicate_match_type' can't be null";
        }
        if ($this->container['person'] === null) {
            $invalid_properties[] = "'person' can't be null";
        }
        if ($this->container['person_registration_context'] === null) {
            $invalid_properties[] = "'person_registration_context' 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['person_fifa_id'] === null) {
            return false;
        }

        if ($this->container['proximity_score'] === null) {
            return false;
        }
        if ($this->container['duplicate_match_type'] === null) {
            return false;
        }
        if ($this->container['person'] === null) {
            return false;
        }
        if ($this->container['person_registration_context'] === null) {
            return false;
        }
        return true;
    }

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

    /**
     * Sets person_fifa_id
     * @param string $person_fifa_id FIFA Unique Identifier
     * @return $this
     */
    public function setPersonFifaId($person_fifa_id)
    {

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

        return $this;
    }

    /**
     * Gets proximity_score
     * @return double
     */
    public function getProximityScore()
    {
        return $this->container['proximity_score'];
    }

    /**
     * Sets proximity_score
     * @param double $proximity_score An approximation of how likely this person is a duplicate
     * @return $this
     */
    public function setProximityScore($proximity_score)
    {
        $this->container['proximity_score'] = $proximity_score;

        return $this;
    }

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

    /**
     * Sets duplicate_match_type
     * @param \Fifa\ConnectId\Sdk\Api\Model\PersonDuplicateMatchType $duplicate_match_type An explanation of what type of matching led to finding the duplicate
     * @return $this
     */
    public function setDuplicateMatchType($duplicate_match_type)
    {
        $this->container['duplicate_match_type'] = $duplicate_match_type;

        return $this;
    }

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

    /**
     * Sets person
     * @param \Fifa\ConnectId\Sdk\Api\Model\PersonType $person Data of matching person
     * @return $this
     */
    public function setPerson($person)
    {
        $this->container['person'] = $person;

        return $this;
    }

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

    /**
     * Sets primary_data_provider_registration_type
     * @param \Fifa\ConnectId\Sdk\Api\Model\RegistrationType $primary_data_provider_registration_type Registration belonging to the primary data provider
     * @return $this
     */
    public function setPrimaryDataProviderRegistrationType($primary_data_provider_registration_type)
    {
        $this->container['primary_data_provider_registration_type'] = $primary_data_provider_registration_type;

        return $this;
    }

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

    /**
     * Sets person_registration_context
     * @param \Fifa\ConnectId\Sdk\Api\Model\PersonRegistrationContextType $person_registration_context The context of the registration in Connect ID
     * @return $this
     */
    public function setPersonRegistrationContext($person_registration_context)
    {
        $this->container['person_registration_context'] = $person_registration_context;

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


