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

/**
 * ProjectTicketItem 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 ProjectTicketItem implements ArrayAccess
{
    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'ProjectTicketItem';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'id' => 'int',
        'name' => 'string',
        'description' => 'string',
        'description_html' => 'string',
        'opned_at' => '\DateTime',
        'closed_at' => '\DateTime',
        'status' => 'string',
        'type_id' => 'int',
        'component_id' => 'int',
        'milestone_id' => 'int',
        'priority' => 'int',
        'severity' => 'int',
        'resolution' => 'string',
        'reporter' => 'int',
        'owner' => 'int',
        'last_update' => '\DateTime',
        'comment' => '\OSDN\Model\ProjectTicketComment[]',
        'history' => '\OSDN\Model\ProjectTicketHistory[]'
    );

    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',
        'description' => 'description',
        'description_html' => 'description_html',
        'opned_at' => 'opned_at',
        'closed_at' => 'closed_at',
        'status' => 'status',
        'type_id' => 'type_id',
        'component_id' => 'component_id',
        'milestone_id' => 'milestone_id',
        'priority' => 'priority',
        'severity' => 'severity',
        'resolution' => 'resolution',
        'reporter' => 'reporter',
        'owner' => 'owner',
        'last_update' => 'last_update',
        'comment' => 'comment',
        'history' => 'history'
    );

    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',
        'description' => 'setDescription',
        'description_html' => 'setDescriptionHtml',
        'opned_at' => 'setOpnedAt',
        'closed_at' => 'setClosedAt',
        'status' => 'setStatus',
        'type_id' => 'setTypeId',
        'component_id' => 'setComponentId',
        'milestone_id' => 'setMilestoneId',
        'priority' => 'setPriority',
        'severity' => 'setSeverity',
        'resolution' => 'setResolution',
        'reporter' => 'setReporter',
        'owner' => 'setOwner',
        'last_update' => 'setLastUpdate',
        'comment' => 'setComment',
        'history' => 'setHistory'
    );

    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',
        'description' => 'getDescription',
        'description_html' => 'getDescriptionHtml',
        'opned_at' => 'getOpnedAt',
        'closed_at' => 'getClosedAt',
        'status' => 'getStatus',
        'type_id' => 'getTypeId',
        'component_id' => 'getComponentId',
        'milestone_id' => 'getMilestoneId',
        'priority' => 'getPriority',
        'severity' => 'getSeverity',
        'resolution' => 'getResolution',
        'reporter' => 'getReporter',
        'owner' => 'getOwner',
        'last_update' => 'getLastUpdate',
        'comment' => 'getComment',
        'history' => 'getHistory'
    );

    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['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['description_html'] = isset($data['description_html']) ? $data['description_html'] : null;
        $this->container['opned_at'] = isset($data['opned_at']) ? $data['opned_at'] : null;
        $this->container['closed_at'] = isset($data['closed_at']) ? $data['closed_at'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : null;
        $this->container['type_id'] = isset($data['type_id']) ? $data['type_id'] : null;
        $this->container['component_id'] = isset($data['component_id']) ? $data['component_id'] : null;
        $this->container['milestone_id'] = isset($data['milestone_id']) ? $data['milestone_id'] : null;
        $this->container['priority'] = isset($data['priority']) ? $data['priority'] : null;
        $this->container['severity'] = isset($data['severity']) ? $data['severity'] : null;
        $this->container['resolution'] = isset($data['resolution']) ? $data['resolution'] : null;
        $this->container['reporter'] = isset($data['reporter']) ? $data['reporter'] : null;
        $this->container['owner'] = isset($data['owner']) ? $data['owner'] : null;
        $this->container['last_update'] = isset($data['last_update']) ? $data['last_update'] : null;
        $this->container['comment'] = isset($data['comment']) ? $data['comment'] : null;
        $this->container['history'] = isset($data['history']) ? $data['history'] : 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 description
     * @return string
     */
    public function getDescription()
    {
        return $this->container['description'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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 comment
     * @return \OSDN\Model\ProjectTicketComment[]
     */
    public function getComment()
    {
        return $this->container['comment'];
    }

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

        return $this;
    }

    /**
     * Gets history
     * @return \OSDN\Model\ProjectTicketHistory[]
     */
    public function getHistory()
    {
        return $this->container['history'];
    }

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

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


