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

/**
 * MatchOfficialRegistrationType Class Doc Comment
 *
 * @category    Class
 * @description This represents match official (e.g. Referee) registration and its attributes. A match official registration is assigned to a person. A match official registration marks a person as a match official for an organisation and the given validity period.
 * @package     Fifa\ConnectId\Sdk\Api
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class MatchOfficialRegistrationType implements ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'match_official_role' => 'string',
        'discipline' => 'string',
        'organisation_fifa_id' => 'string',
        'status' => 'string',
        'system_id' => '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 = [
        'match_official_role' => 'matchOfficialRole',
        'discipline' => 'discipline',
        'organisation_fifa_id' => 'organisationFIFAId',
        'status' => 'status',
        'system_id' => 'systemId'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'match_official_role' => 'setMatchOfficialRole',
        'discipline' => 'setDiscipline',
        'organisation_fifa_id' => 'setOrganisationFifaId',
        'status' => 'setStatus',
        'system_id' => 'setSystemId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'match_official_role' => 'getMatchOfficialRole',
        'discipline' => 'getDiscipline',
        'organisation_fifa_id' => 'getOrganisationFifaId',
        'status' => 'getStatus',
        'system_id' => 'getSystemId'
    ];

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

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

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

    const MATCH_OFFICIAL_ROLE_REFEREE = 'Referee';
    const MATCH_OFFICIAL_ROLE_REFEREE_ASSISTANT = 'RefereeAssistant';
    const MATCH_OFFICIAL_ROLE_OBSERVER = 'Observer';
    const MATCH_OFFICIAL_ROLE_DELEGATE = 'Delegate';
    const MATCH_OFFICIAL_ROLE_OTHER = 'Other';
    const MATCH_OFFICIAL_ROLE_VAR = 'VAR';
    const MATCH_OFFICIAL_ROLE_AVAR = 'AVAR';
    const DISCIPLINE_FOOTBALL = 'Football';
    const DISCIPLINE_FUTSAL = 'Futsal';
    const DISCIPLINE_BEACH_SOCCER = 'BeachSoccer';
    const STATUS_ACTIVE = 'active';
    const STATUS_INACTIVE = 'inactive';
    const STATUS_PENDING = 'pending';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getMatchOfficialRoleAllowableValues()
    {
        return [
            self::MATCH_OFFICIAL_ROLE_REFEREE,
            self::MATCH_OFFICIAL_ROLE_REFEREE_ASSISTANT,
            self::MATCH_OFFICIAL_ROLE_OBSERVER,
            self::MATCH_OFFICIAL_ROLE_DELEGATE,
            self::MATCH_OFFICIAL_ROLE_OTHER,
            self::MATCH_OFFICIAL_ROLE_VAR,
            self::MATCH_OFFICIAL_ROLE_AVAR,
        ];
    }

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getDisciplineAllowableValues()
    {
        return [
            self::DISCIPLINE_FOOTBALL,
            self::DISCIPLINE_FUTSAL,
            self::DISCIPLINE_BEACH_SOCCER,
        ];
    }

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getStatusAllowableValues()
    {
        return [
            self::STATUS_ACTIVE,
            self::STATUS_INACTIVE,
            self::STATUS_PENDING,
        ];
    }

    /**
     * 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['match_official_role'] = isset($data['match_official_role']) ? $data['match_official_role'] : null;
        $this->container['discipline'] = isset($data['discipline']) ? $data['discipline'] : null;
        $this->container['organisation_fifa_id'] = isset($data['organisation_fifa_id']) ? $data['organisation_fifa_id'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : null;
        $this->container['system_id'] = isset($data['system_id']) ? $data['system_id'] : null;
    }

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

        if ($this->container['match_official_role'] === null) {
            $invalid_properties[] = "'match_official_role' can't be null";
        }
        $allowed_values = ["Referee", "RefereeAssistant", "Observer", "Delegate", "Other", "VAR", "AVAR"];
        if (!in_array($this->container['match_official_role'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'match_official_role', must be one of 'Referee', 'RefereeAssistant', 'Observer', 'Delegate', 'Other', 'VAR', 'AVAR'.";
        }

        if ($this->container['discipline'] === null) {
            $invalid_properties[] = "'discipline' can't be null";
        }
        $allowed_values = ["Football", "Futsal", "BeachSoccer"];
        if (!in_array($this->container['discipline'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'discipline', must be one of 'Football', 'Futsal', 'BeachSoccer'.";
        }

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

        if ($this->container['status'] === null) {
            $invalid_properties[] = "'status' can't be null";
        }
        $allowed_values = ["active", "inactive", "pending"];
        if (!in_array($this->container['status'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'status', must be one of 'active', 'inactive', 'pending'.";
        }

        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['match_official_role'] === null) {
            return false;
        }
        $allowed_values = ["Referee", "RefereeAssistant", "Observer", "Delegate", "Other", "VAR", "AVAR"];
        if (!in_array($this->container['match_official_role'], $allowed_values)) {
            return false;
        }
        if ($this->container['discipline'] === null) {
            return false;
        }
        $allowed_values = ["Football", "Futsal", "BeachSoccer"];
        if (!in_array($this->container['discipline'], $allowed_values)) {
            return false;
        }
        if ($this->container['organisation_fifa_id'] === null) {
            return false;
        }

        if ($this->container['status'] === null) {
            return false;
        }
        $allowed_values = ["active", "inactive", "pending"];
        if (!in_array($this->container['status'], $allowed_values)) {
            return false;
        }
        return true;
    }

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

    /**
     * Sets match_official_role
     * @param string $match_official_role The match official role type, e.g. Referee or Observer.
     * @return $this
     */
    public function setMatchOfficialRole($match_official_role)
    {
        $allowed_values = array('Referee', 'RefereeAssistant', 'Observer', 'Delegate', 'Other', 'VAR', 'AVAR');
        if ((!in_array($match_official_role, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'match_official_role', must be one of 'Referee', 'RefereeAssistant', 'Observer', 'Delegate', 'Other', 'VAR', 'AVAR'");
        }
        $this->container['match_official_role'] = $match_official_role;

        return $this;
    }

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

    /**
     * Sets discipline
     * @param string $discipline The sport/discipline this registration is for. E.g. a futsal referee is distinct from a football referee.
     * @return $this
     */
    public function setDiscipline($discipline)
    {
        $allowed_values = array('Football', 'Futsal', 'BeachSoccer');
        if ((!in_array($discipline, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'discipline', must be one of 'Football', 'Futsal', 'BeachSoccer'");
        }
        $this->container['discipline'] = $discipline;

        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 The worldwide unique FIFA id of the club or organisation the person is registered for.
     * @return $this
     */
    public function setOrganisationFifaId($organisation_fifa_id)
    {

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

        return $this;
    }

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

    /**
     * Sets status
     * @param string $status The status of the registration.
     * @return $this
     */
    public function setStatus($status)
    {
        $allowed_values = array('active', 'inactive', 'pending');
        if ((!in_array($status, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'active', 'inactive', 'pending'");
        }
        $this->container['status'] = $status;

        return $this;
    }

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

    /**
     * Sets system_id
     * @param string $system_id The identifier of the system to which the registration belongs
     * @return $this
     */
    public function setSystemId($system_id)
    {
        $this->container['system_id'] = $system_id;

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


