<?php
/**
 * User
 *
 * PHP version 5
 *
 * @category Class
 * @package  OSDN
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * OSDN REST API v0 beta
 *
 * OSDN REST API. Currently this API is experimental release. Pelase refer documentation on https://osdn.net/projects/osdn-codes/wiki/APIGuide and you can get client libraries from https://osdn.net/projects/osdn-codes/releases/p14859 .
 *
 * OpenAPI spec version: 0.0.20171120
 * Contact: admin@osdn.net
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * 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 OSDN\Model;

use \ArrayAccess;

/**
 * User Class Doc Comment
 *
 * @category    Class */
/** 
 * @package     OSDN
 * @author      http://github.com/swagger-api/swagger-codegen
 * @license     http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class User implements ArrayAccess
{
    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'User';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'id' => 'int',
        'name' => 'string',
        'display_name' => 'string',
        'authorized_keys' => 'string[]',
        'email' => 'string',
        'ranking' => 'int',
        'blog' => 'string',
        'timezone' => 'string',
        'last_update' => '\DateTime',
        'add_date' => '\DateTime',
        'language' => 'string',
        'images' => '\OSDN\Model\UserImages',
        'groups' => '\OSDN\Model\SimpleGroup[]',
        'chambers' => '\OSDN\Model\SimpleChamber[]',
        'skills' => '\OSDN\Model\Skill[]'
    );

    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 = array(
        'id' => 'id',
        'name' => 'name',
        'display_name' => 'display_name',
        'authorized_keys' => 'authorized_keys',
        'email' => 'email',
        'ranking' => 'ranking',
        'blog' => 'blog',
        'timezone' => 'timezone',
        'last_update' => 'last_update',
        'add_date' => 'add_date',
        'language' => 'language',
        'images' => 'images',
        'groups' => 'groups',
        'chambers' => 'chambers',
        'skills' => 'skills'
    );

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

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = array(
        'id' => 'setId',
        'name' => 'setName',
        'display_name' => 'setDisplayName',
        'authorized_keys' => 'setAuthorizedKeys',
        'email' => 'setEmail',
        'ranking' => 'setRanking',
        'blog' => 'setBlog',
        'timezone' => 'setTimezone',
        'last_update' => 'setLastUpdate',
        'add_date' => 'setAddDate',
        'language' => 'setLanguage',
        'images' => 'setImages',
        'groups' => 'setGroups',
        'chambers' => 'setChambers',
        'skills' => 'setSkills'
    );

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

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = array(
        'id' => 'getId',
        'name' => 'getName',
        'display_name' => 'getDisplayName',
        'authorized_keys' => 'getAuthorizedKeys',
        'email' => 'getEmail',
        'ranking' => 'getRanking',
        'blog' => 'getBlog',
        'timezone' => 'getTimezone',
        'last_update' => 'getLastUpdate',
        'add_date' => 'getAddDate',
        'language' => 'getLanguage',
        'images' => 'getImages',
        'groups' => 'getGroups',
        'chambers' => 'getChambers',
        'skills' => 'getSkills'
    );

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

    

    

    /**
     * Associative array for storing property values
     * @var mixed[]
     */
    protected $container = array();

    /**
     * Constructor
     * @param mixed[] $data Associated array of property value initalizing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['id'] = isset($data['id']) ? $data['id'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['display_name'] = isset($data['display_name']) ? $data['display_name'] : null;
        $this->container['authorized_keys'] = isset($data['authorized_keys']) ? $data['authorized_keys'] : null;
        $this->container['email'] = isset($data['email']) ? $data['email'] : null;
        $this->container['ranking'] = isset($data['ranking']) ? $data['ranking'] : null;
        $this->container['blog'] = isset($data['blog']) ? $data['blog'] : null;
        $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null;
        $this->container['last_update'] = isset($data['last_update']) ? $data['last_update'] : null;
        $this->container['add_date'] = isset($data['add_date']) ? $data['add_date'] : null;
        $this->container['language'] = isset($data['language']) ? $data['language'] : null;
        $this->container['images'] = isset($data['images']) ? $data['images'] : null;
        $this->container['groups'] = isset($data['groups']) ? $data['groups'] : null;
        $this->container['chambers'] = isset($data['chambers']) ? $data['chambers'] : null;
        $this->container['skills'] = isset($data['skills']) ? $data['skills'] : null;
    }

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

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properteis are valid
     */
    public function valid()
    {
        return true;
    }


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

    /**
     * Sets id
     * @param int $id
     * @return $this
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

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

    /**
     * Sets name
     * @param string $name
     * @return $this
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

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

    /**
     * Sets display_name
     * @param string $display_name
     * @return $this
     */
    public function setDisplayName($display_name)
    {
        $this->container['display_name'] = $display_name;

        return $this;
    }

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

    /**
     * Sets authorized_keys
     * @param string[] $authorized_keys
     * @return $this
     */
    public function setAuthorizedKeys($authorized_keys)
    {
        $this->container['authorized_keys'] = $authorized_keys;

        return $this;
    }

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

    /**
     * Sets email
     * @param string $email
     * @return $this
     */
    public function setEmail($email)
    {
        $this->container['email'] = $email;

        return $this;
    }

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

    /**
     * Sets ranking
     * @param int $ranking
     * @return $this
     */
    public function setRanking($ranking)
    {
        $this->container['ranking'] = $ranking;

        return $this;
    }

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

    /**
     * Sets blog
     * @param string $blog
     * @return $this
     */
    public function setBlog($blog)
    {
        $this->container['blog'] = $blog;

        return $this;
    }

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

    /**
     * Sets timezone
     * @param string $timezone
     * @return $this
     */
    public function setTimezone($timezone)
    {
        $this->container['timezone'] = $timezone;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets language
     * @param string $language
     * @return $this
     */
    public function setLanguage($language)
    {
        $this->container['language'] = $language;

        return $this;
    }

    /**
     * Gets images
     * @return \OSDN\Model\UserImages
     */
    public function getImages()
    {
        return $this->container['images'];
    }

    /**
     * Sets images
     * @param \OSDN\Model\UserImages $images
     * @return $this
     */
    public function setImages($images)
    {
        $this->container['images'] = $images;

        return $this;
    }

    /**
     * Gets groups
     * @return \OSDN\Model\SimpleGroup[]
     */
    public function getGroups()
    {
        return $this->container['groups'];
    }

    /**
     * Sets groups
     * @param \OSDN\Model\SimpleGroup[] $groups
     * @return $this
     */
    public function setGroups($groups)
    {
        $this->container['groups'] = $groups;

        return $this;
    }

    /**
     * Gets chambers
     * @return \OSDN\Model\SimpleChamber[]
     */
    public function getChambers()
    {
        return $this->container['chambers'];
    }

    /**
     * Sets chambers
     * @param \OSDN\Model\SimpleChamber[] $chambers
     * @return $this
     */
    public function setChambers($chambers)
    {
        $this->container['chambers'] = $chambers;

        return $this;
    }

    /**
     * Gets skills
     * @return \OSDN\Model\Skill[]
     */
    public function getSkills()
    {
        return $this->container['skills'];
    }

    /**
     * Sets skills
     * @param \OSDN\Model\Skill[] $skills
     * @return $this
     */
    public function setSkills($skills)
    {
        $this->container['skills'] = $skills;

        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(\OSDN\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\OSDN\ObjectSerializer::sanitizeForSerialization($this));
    }
}


