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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'id' => 'int',
        'created' => 'bool',
        'active' => 'bool',
        'setting_applied' => 'bool',
        'name' => 'string',
        'description' => 'string',
        'type' => 'string',
        'mail_enabled' => 'bool',
        'mail_recipients' => 'string',
        'url_viewer' => 'string',
        'url_rw' => 'string',
        'url_ro' => 'string',
        'last_commit' => '\OSDN\Model\ProjectSCMLastCommit',
        'branches' => 'string[]',
        'tags' => '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 = array(
        'id' => 'id',
        'created' => 'created',
        'active' => 'active',
        'setting_applied' => 'setting_applied',
        'name' => 'name',
        'description' => 'description',
        'type' => 'type',
        'mail_enabled' => 'mail_enabled',
        'mail_recipients' => 'mail_recipients',
        'url_viewer' => 'url_viewer',
        'url_rw' => 'url_rw',
        'url_ro' => 'url_ro',
        'last_commit' => 'last_commit',
        'branches' => 'branches',
        'tags' => 'tags'
    );

    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',
        'created' => 'setCreated',
        'active' => 'setActive',
        'setting_applied' => 'setSettingApplied',
        'name' => 'setName',
        'description' => 'setDescription',
        'type' => 'setType',
        'mail_enabled' => 'setMailEnabled',
        'mail_recipients' => 'setMailRecipients',
        'url_viewer' => 'setUrlViewer',
        'url_rw' => 'setUrlRw',
        'url_ro' => 'setUrlRo',
        'last_commit' => 'setLastCommit',
        'branches' => 'setBranches',
        'tags' => 'setTags'
    );

    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',
        'created' => 'getCreated',
        'active' => 'getActive',
        'setting_applied' => 'getSettingApplied',
        'name' => 'getName',
        'description' => 'getDescription',
        'type' => 'getType',
        'mail_enabled' => 'getMailEnabled',
        'mail_recipients' => 'getMailRecipients',
        'url_viewer' => 'getUrlViewer',
        'url_rw' => 'getUrlRw',
        'url_ro' => 'getUrlRo',
        'last_commit' => 'getLastCommit',
        'branches' => 'getBranches',
        'tags' => 'getTags'
    );

    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['created'] = isset($data['created']) ? $data['created'] : null;
        $this->container['active'] = isset($data['active']) ? $data['active'] : null;
        $this->container['setting_applied'] = isset($data['setting_applied']) ? $data['setting_applied'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['type'] = isset($data['type']) ? $data['type'] : null;
        $this->container['mail_enabled'] = isset($data['mail_enabled']) ? $data['mail_enabled'] : null;
        $this->container['mail_recipients'] = isset($data['mail_recipients']) ? $data['mail_recipients'] : null;
        $this->container['url_viewer'] = isset($data['url_viewer']) ? $data['url_viewer'] : null;
        $this->container['url_rw'] = isset($data['url_rw']) ? $data['url_rw'] : null;
        $this->container['url_ro'] = isset($data['url_ro']) ? $data['url_ro'] : null;
        $this->container['last_commit'] = isset($data['last_commit']) ? $data['last_commit'] : null;
        $this->container['branches'] = isset($data['branches']) ? $data['branches'] : null;
        $this->container['tags'] = isset($data['tags']) ? $data['tags'] : 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 created
     * @return bool
     */
    public function getCreated()
    {
        return $this->container['created'];
    }

    /**
     * Sets created
     * @param bool $created
     * @return $this
     */
    public function setCreated($created)
    {
        $this->container['created'] = $created;

        return $this;
    }

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

    /**
     * Sets active
     * @param bool $active
     * @return $this
     */
    public function setActive($active)
    {
        $this->container['active'] = $active;

        return $this;
    }

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

    /**
     * Sets setting_applied
     * @param bool $setting_applied
     * @return $this
     */
    public function setSettingApplied($setting_applied)
    {
        $this->container['setting_applied'] = $setting_applied;

        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 type
     * @return string
     */
    public function getType()
    {
        return $this->container['type'];
    }

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

        return $this;
    }

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

    /**
     * Sets mail_enabled
     * @param bool $mail_enabled
     * @return $this
     */
    public function setMailEnabled($mail_enabled)
    {
        $this->container['mail_enabled'] = $mail_enabled;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets last_commit
     * @return \OSDN\Model\ProjectSCMLastCommit
     */
    public function getLastCommit()
    {
        return $this->container['last_commit'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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


