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

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'organisation_id' => 'string',
        'modified_from_date_time' => '\DateTime',
        'modified_to_date_time' => '\DateTime',
        'next_batch_token' => 'string',
        'batch_size' => 'int',
        'include_merged_and_deleted' => 'bool'
    ];

    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_id' => 'organisationId',
        'modified_from_date_time' => 'modifiedFromDateTime',
        'modified_to_date_time' => 'modifiedToDateTime',
        'next_batch_token' => 'nextBatchToken',
        'batch_size' => 'batchSize',
        'include_merged_and_deleted' => 'includeMergedAndDeleted'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'organisation_id' => 'setOrganisationId',
        'modified_from_date_time' => 'setModifiedFromDateTime',
        'modified_to_date_time' => 'setModifiedToDateTime',
        'next_batch_token' => 'setNextBatchToken',
        'batch_size' => 'setBatchSize',
        'include_merged_and_deleted' => 'setIncludeMergedAndDeleted'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'organisation_id' => 'getOrganisationId',
        'modified_from_date_time' => 'getModifiedFromDateTime',
        'modified_to_date_time' => 'getModifiedToDateTime',
        'next_batch_token' => 'getNextBatchToken',
        'batch_size' => 'getBatchSize',
        'include_merged_and_deleted' => 'getIncludeMergedAndDeleted'
    ];

    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['organisation_id'] = isset($data['organisation_id']) ? $data['organisation_id'] : null;
        $this->container['modified_from_date_time'] = isset($data['modified_from_date_time']) ? $data['modified_from_date_time'] : null;
        $this->container['modified_to_date_time'] = isset($data['modified_to_date_time']) ? $data['modified_to_date_time'] : null;
        $this->container['next_batch_token'] = isset($data['next_batch_token']) ? $data['next_batch_token'] : null;
        $this->container['batch_size'] = isset($data['batch_size']) ? $data['batch_size'] : null;
        $this->container['include_merged_and_deleted'] = isset($data['include_merged_and_deleted']) ? $data['include_merged_and_deleted'] : null;
    }

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

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

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

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

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

        if ($this->container['batch_size'] > 10000) {
            return false;
        }
        if ($this->container['batch_size'] < 1000) {
            return false;
        }

        return true;
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets next_batch_token
     * @param string $next_batch_token A next batch continuation token
     * @return $this
     */
    public function setNextBatchToken($next_batch_token)
    {
        $this->container['next_batch_token'] = $next_batch_token;

        return $this;
    }

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

    /**
     * Sets batch_size
     * @param int $batch_size If not set a default value of 10k is taken
     * @return $this
     */
    public function setBatchSize($batch_size)
    {

        if (!is_null($batch_size) && ($batch_size > 10000)) {
            throw new \InvalidArgumentException('invalid value for $batch_size when calling GetAllOrganisationsRequestType., must be smaller than or equal to 10000.');
        }
        if (!is_null($batch_size) && ($batch_size < 1000)) {
            throw new \InvalidArgumentException('invalid value for $batch_size when calling GetAllOrganisationsRequestType., must be bigger than or equal to 1000.');
        }

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

        return $this;
    }

    /**
     * Gets include_merged_and_deleted
     * @return bool
     */
    public function getIncludeMergedAndDeleted()
    {
        return $this->container['include_merged_and_deleted'];
    }

    /**
     * Sets include_merged_and_deleted
     * @param bool $include_merged_and_deleted Set to true if the response should contain organisations deleted or merged as secondary
     * @return $this
     */
    public function setIncludeMergedAndDeleted($include_merged_and_deleted)
    {
        $this->container['include_merged_and_deleted'] = $include_merged_and_deleted;

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


