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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'order_number' => 'int',
        'discipline' => 'string',
        'capacity' => 'int',
        'ground_nature' => 'string',
        'length' => 'float',
        'width' => 'float',
        'latitude' => 'float',
        'longitude' => 'float'
    ];

    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 = [
        'order_number' => 'orderNumber',
        'discipline' => 'discipline',
        'capacity' => 'capacity',
        'ground_nature' => 'groundNature',
        'length' => 'length',
        'width' => 'width',
        'latitude' => 'latitude',
        'longitude' => 'longitude'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'order_number' => 'setOrderNumber',
        'discipline' => 'setDiscipline',
        'capacity' => 'setCapacity',
        'ground_nature' => 'setGroundNature',
        'length' => 'setLength',
        'width' => 'setWidth',
        'latitude' => 'setLatitude',
        'longitude' => 'setLongitude'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'order_number' => 'getOrderNumber',
        'discipline' => 'getDiscipline',
        'capacity' => 'getCapacity',
        'ground_nature' => 'getGroundNature',
        'length' => 'getLength',
        'width' => 'getWidth',
        'latitude' => 'getLatitude',
        'longitude' => 'getLongitude'
    ];

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

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

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

    const DISCIPLINE_FOOTBALL = 'Football';
    const DISCIPLINE_FUTSAL = 'Futsal';
    const DISCIPLINE_BEACH_SOCCER = 'BeachSoccer';
    const GROUND_NATURE_GRASS = 'grass';
    const GROUND_NATURE_TURF2STAR = 'turf2star';
    const GROUND_NATURE_TURF1STAR = 'turf1star';
    const GROUND_NATURE_TURF = 'turf';
    const GROUND_NATURE_HARD_PITCH = 'hard pitch';
    const GROUND_NATURE_UNKNOWN = 'unknown';

    /**
     * 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 getGroundNatureAllowableValues()
    {
        return [
            self::GROUND_NATURE_GRASS,
            self::GROUND_NATURE_TURF2STAR,
            self::GROUND_NATURE_TURF1STAR,
            self::GROUND_NATURE_TURF,
            self::GROUND_NATURE_HARD_PITCH,
            self::GROUND_NATURE_UNKNOWN,
        ];
    }

    /**
     * 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['order_number'] = isset($data['order_number']) ? $data['order_number'] : null;
        $this->container['discipline'] = isset($data['discipline']) ? $data['discipline'] : null;
        $this->container['capacity'] = isset($data['capacity']) ? $data['capacity'] : null;
        $this->container['ground_nature'] = isset($data['ground_nature']) ? $data['ground_nature'] : null;
        $this->container['length'] = isset($data['length']) ? $data['length'] : null;
        $this->container['width'] = isset($data['width']) ? $data['width'] : null;
        $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null;
        $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null;
    }

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

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

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

        if (($this->container['order_number'] < 1)) {
            $invalid_properties[] = "invalid value for 'order_number', must be bigger than or equal to 1.";
        }

        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['capacity'] === null) {
            $invalid_properties[] = "'capacity' can't be null";
        }

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

        if (($this->container['capacity'] < 0)) {
            $invalid_properties[] = "invalid value for 'capacity', must be bigger than or equal to 0.";
        }

        if ($this->container['ground_nature'] === null) {
            $invalid_properties[] = "'ground_nature' can't be null";
        }
        $allowed_values = ["grass", "turf2star", "turf1star", "turf", "hard pitch", "unknown"];
        if (!in_array($this->container['ground_nature'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'ground_nature', must be one of 'grass', 'turf2star', 'turf1star', 'turf', 'hard pitch', 'unknown'.";
        }

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

        if ($this->container['order_number'] > 2147483647) {
            return false;
        }
        if ($this->container['order_number'] < 1) {
            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['capacity'] === null) {
            return false;
        }

        if ($this->container['capacity'] > 2147483647) {
            return false;
        }
        if ($this->container['capacity'] < 0) {
            return false;
        }

        if ($this->container['ground_nature'] === null) {
            return false;
        }
        $allowed_values = ["grass", "turf2star", "turf1star", "turf", "hard pitch", "unknown"];
        if (!in_array($this->container['ground_nature'], $allowed_values)) {
            return false;
        }
        return true;
    }

    /**
     * Gets order_number
     * @return int
     */
    public function getOrderNumber()
    {
        return $this->container['order_number'];
    }

    /**
     * Sets order_number
     * @param int $order_number
     * @return $this
     */
    public function setOrderNumber($order_number)
    {

        if (($order_number > 2147483647)) {
            throw new \InvalidArgumentException('invalid value for $order_number when calling FieldType., must be smaller than or equal to 2147483647.');
        }
        if (($order_number < 1)) {
            throw new \InvalidArgumentException('invalid value for $order_number when calling FieldType., must be bigger than or equal to 1.');
        }

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

        return $this;
    }

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

    /**
     * Sets discipline
     * @param string $discipline
     * @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 capacity
     * @return int
     */
    public function getCapacity()
    {
        return $this->container['capacity'];
    }

    /**
     * Sets capacity
     * @param int $capacity
     * @return $this
     */
    public function setCapacity($capacity)
    {

        if (($capacity > 2147483647)) {
            throw new \InvalidArgumentException('invalid value for $capacity when calling FieldType., must be smaller than or equal to 2147483647.');
        }
        if (($capacity < 0)) {
            throw new \InvalidArgumentException('invalid value for $capacity when calling FieldType., must be bigger than or equal to 0.');
        }

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

        return $this;
    }

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

    /**
     * Sets ground_nature
     * @param string $ground_nature
     * @return $this
     */
    public function setGroundNature($ground_nature)
    {
        $allowed_values = array('grass', 'turf2star', 'turf1star', 'turf', 'hard pitch', 'unknown');
        if ((!in_array($ground_nature, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'ground_nature', must be one of 'grass', 'turf2star', 'turf1star', 'turf', 'hard pitch', 'unknown'");
        }
        $this->container['ground_nature'] = $ground_nature;

        return $this;
    }

    /**
     * Gets length
     * @return float
     */
    public function getLength()
    {
        return $this->container['length'];
    }

    /**
     * Sets length
     * @param float $length
     * @return $this
     */
    public function setLength($length)
    {
        $this->container['length'] = $length;

        return $this;
    }

    /**
     * Gets width
     * @return float
     */
    public function getWidth()
    {
        return $this->container['width'];
    }

    /**
     * Sets width
     * @param float $width
     * @return $this
     */
    public function setWidth($width)
    {
        $this->container['width'] = $width;

        return $this;
    }

    /**
     * Gets latitude
     * @return float
     */
    public function getLatitude()
    {
        return $this->container['latitude'];
    }

    /**
     * Sets latitude
     * @param float $latitude
     * @return $this
     */
    public function setLatitude($latitude)
    {
        $this->container['latitude'] = $latitude;

        return $this;
    }

    /**
     * Gets longitude
     * @return float
     */
    public function getLongitude()
    {
        return $this->container['longitude'];
    }

    /**
     * Sets longitude
     * @param float $longitude
     * @return $this
     */
    public function setLongitude($longitude)
    {
        $this->container['longitude'] = $longitude;

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


