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

/**
 * OrganisationOfficialRegistrationType Class Doc Comment
 *
 * @category    Class
 * @description This represents an organisation official  (e.g. President, Secretary, Press Officer) registration and its attributes. An organisation organisation registration is assigned to a person. An organisation official registration marks a person as an organisation 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 OrganisationOfficialRegistrationType implements ArrayAccess
{
    const DISCRIMINATOR = null;

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

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

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

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'organisation_official_role' => 'getOrganisationOfficialRole',
        '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 ORGANISATION_OFFICIAL_ROLE_PRESIDENT = 'President';
    const ORGANISATION_OFFICIAL_ROLE_VICE_PRESIDENT = 'VicePresident';
    const ORGANISATION_OFFICIAL_ROLE_GENERAL_SECRETARY = 'GeneralSecretary';
    const ORGANISATION_OFFICIAL_ROLE_BOARD_MEMBER = 'BoardMember';
    const ORGANISATION_OFFICIAL_ROLE_BOARD_CHAIRMAN = 'BoardChairman';
    const ORGANISATION_OFFICIAL_ROLE_MEDIA_OFFICER = 'MediaOfficer';
    const ORGANISATION_OFFICIAL_ROLE_SPORTS_DIRECTOR = 'SportsDirector';
    const ORGANISATION_OFFICIAL_ROLE_TECHNICAL_DIRECTOR = 'TechnicalDirector';
    const ORGANISATION_OFFICIAL_ROLE_OWNER = 'Owner';
    const ORGANISATION_OFFICIAL_ROLE_OTHER = 'Other';
    const STATUS_ACTIVE = 'active';
    const STATUS_INACTIVE = 'inactive';
    const STATUS_PENDING = 'pending';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getOrganisationOfficialRoleAllowableValues()
    {
        return [
            self::ORGANISATION_OFFICIAL_ROLE_PRESIDENT,
            self::ORGANISATION_OFFICIAL_ROLE_VICE_PRESIDENT,
            self::ORGANISATION_OFFICIAL_ROLE_GENERAL_SECRETARY,
            self::ORGANISATION_OFFICIAL_ROLE_BOARD_MEMBER,
            self::ORGANISATION_OFFICIAL_ROLE_BOARD_CHAIRMAN,
            self::ORGANISATION_OFFICIAL_ROLE_MEDIA_OFFICER,
            self::ORGANISATION_OFFICIAL_ROLE_SPORTS_DIRECTOR,
            self::ORGANISATION_OFFICIAL_ROLE_TECHNICAL_DIRECTOR,
            self::ORGANISATION_OFFICIAL_ROLE_OWNER,
            self::ORGANISATION_OFFICIAL_ROLE_OTHER,
        ];
    }

    /**
     * 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['organisation_official_role'] = isset($data['organisation_official_role']) ? $data['organisation_official_role'] : 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['organisation_official_role'] === null) {
            $invalid_properties[] = "'organisation_official_role' can't be null";
        }
        $allowed_values = ["President", "VicePresident", "GeneralSecretary", "BoardMember", "BoardChairman", "MediaOfficer", "SportsDirector", "TechnicalDirector", "Owner", "Other"];
        if (!in_array($this->container['organisation_official_role'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'organisation_official_role', must be one of 'President', 'VicePresident', 'GeneralSecretary', 'BoardMember', 'BoardChairman', 'MediaOfficer', 'SportsDirector', 'TechnicalDirector', 'Owner', 'Other'.";
        }

        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['organisation_official_role'] === null) {
            return false;
        }
        $allowed_values = ["President", "VicePresident", "GeneralSecretary", "BoardMember", "BoardChairman", "MediaOfficer", "SportsDirector", "TechnicalDirector", "Owner", "Other"];
        if (!in_array($this->container['organisation_official_role'], $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 organisation_official_role
     * @return string
     */
    public function getOrganisationOfficialRole()
    {
        return $this->container['organisation_official_role'];
    }

    /**
     * Sets organisation_official_role
     * @param string $organisation_official_role The organisation official's role type, e.g. President or Press Officer.
     * @return $this
     */
    public function setOrganisationOfficialRole($organisation_official_role)
    {
        $allowed_values = array('President', 'VicePresident', 'GeneralSecretary', 'BoardMember', 'BoardChairman', 'MediaOfficer', 'SportsDirector', 'TechnicalDirector', 'Owner', 'Other');
        if ((!in_array($organisation_official_role, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'organisation_official_role', must be one of 'President', 'VicePresident', 'GeneralSecretary', 'BoardMember', 'BoardChairman', 'MediaOfficer', 'SportsDirector', 'TechnicalDirector', 'Owner', 'Other'");
        }
        $this->container['organisation_official_role'] = $organisation_official_role;

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


