<?php
/**
 * Version
 *
 * PHP version 5
 *
 * @category Class
 * @package  Swagger\Client
 * @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
 */

/**
 * Swagger Blended Hub API Explorer
 *
 * A collection of Swagger documentation for the Blended Hub APIs.
 *
 * OpenAPI spec version: 1.0.0
 * Contact: api@blended.co
 * 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 Swagger\Client\Model;

use \ArrayAccess;

/**
 * Version Class Doc Comment
 *
 * @category    Class */
/** 
 * @package     Swagger\Client
 * @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 Version implements ArrayAccess
{
    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'Version';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'href' => 'string',
        'thumbnail_image' => 'string',
        'details_image' => 'string',
        'grid_layout_image' => 'string',
        'block_layout_image' => 'string',
        'description' => 'string',
        'rating_avg' => 'float',
        'rating_count' => 'float',
        'slug' => 'string',
        'account' => 'string',
        'name' => 'string',
        'type' => 'string',
        'title' => 'string',
        'pk' => 'int',
        'package' => 'int',
        'label' => 'string',
        'modified_date' => '\DateTime',
        'created_date' => '\DateTime',
        'user' => 'string',
        'validatorplan' => 'object'
    );

    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(
        'href' => 'href',
        'thumbnail_image' => 'thumbnail_image',
        'details_image' => 'details_image',
        'grid_layout_image' => 'grid_layout_image',
        'block_layout_image' => 'block_layout_image',
        'description' => 'description',
        'rating_avg' => 'rating_avg',
        'rating_count' => 'rating_count',
        'slug' => 'slug',
        'account' => 'account',
        'name' => 'name',
        'type' => 'type',
        'title' => 'title',
        'pk' => 'pk',
        'package' => 'package',
        'label' => 'label',
        'modified_date' => 'modified_date',
        'created_date' => 'created_date',
        'user' => 'user',
        'validatorplan' => 'validatorplan'
    );

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

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = array(
        'href' => 'setHref',
        'thumbnail_image' => 'setThumbnailImage',
        'details_image' => 'setDetailsImage',
        'grid_layout_image' => 'setGridLayoutImage',
        'block_layout_image' => 'setBlockLayoutImage',
        'description' => 'setDescription',
        'rating_avg' => 'setRatingAvg',
        'rating_count' => 'setRatingCount',
        'slug' => 'setSlug',
        'account' => 'setAccount',
        'name' => 'setName',
        'type' => 'setType',
        'title' => 'setTitle',
        'pk' => 'setPk',
        'package' => 'setPackage',
        'label' => 'setLabel',
        'modified_date' => 'setModifiedDate',
        'created_date' => 'setCreatedDate',
        'user' => 'setUser',
        'validatorplan' => 'setValidatorplan'
    );

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

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = array(
        'href' => 'getHref',
        'thumbnail_image' => 'getThumbnailImage',
        'details_image' => 'getDetailsImage',
        'grid_layout_image' => 'getGridLayoutImage',
        'block_layout_image' => 'getBlockLayoutImage',
        'description' => 'getDescription',
        'rating_avg' => 'getRatingAvg',
        'rating_count' => 'getRatingCount',
        'slug' => 'getSlug',
        'account' => 'getAccount',
        'name' => 'getName',
        'type' => 'getType',
        'title' => 'getTitle',
        'pk' => 'getPk',
        'package' => 'getPackage',
        'label' => 'getLabel',
        'modified_date' => 'getModifiedDate',
        'created_date' => 'getCreatedDate',
        'user' => 'getUser',
        'validatorplan' => 'getValidatorplan'
    );

    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['href'] = isset($data['href']) ? $data['href'] : null;
        $this->container['thumbnail_image'] = isset($data['thumbnail_image']) ? $data['thumbnail_image'] : null;
        $this->container['details_image'] = isset($data['details_image']) ? $data['details_image'] : null;
        $this->container['grid_layout_image'] = isset($data['grid_layout_image']) ? $data['grid_layout_image'] : null;
        $this->container['block_layout_image'] = isset($data['block_layout_image']) ? $data['block_layout_image'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['rating_avg'] = isset($data['rating_avg']) ? $data['rating_avg'] : null;
        $this->container['rating_count'] = isset($data['rating_count']) ? $data['rating_count'] : null;
        $this->container['slug'] = isset($data['slug']) ? $data['slug'] : null;
        $this->container['account'] = isset($data['account']) ? $data['account'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['type'] = isset($data['type']) ? $data['type'] : null;
        $this->container['title'] = isset($data['title']) ? $data['title'] : null;
        $this->container['pk'] = isset($data['pk']) ? $data['pk'] : null;
        $this->container['package'] = isset($data['package']) ? $data['package'] : null;
        $this->container['label'] = isset($data['label']) ? $data['label'] : null;
        $this->container['modified_date'] = isset($data['modified_date']) ? $data['modified_date'] : null;
        $this->container['created_date'] = isset($data['created_date']) ? $data['created_date'] : null;
        $this->container['user'] = isset($data['user']) ? $data['user'] : null;
        $this->container['validatorplan'] = isset($data['validatorplan']) ? $data['validatorplan'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = array();
        if ($this->container['href'] === null) {
            $invalid_properties[] = "'href' can't be null";
        }
        if ($this->container['pk'] === null) {
            $invalid_properties[] = "'pk' can't be null";
        }
        if ($this->container['package'] === null) {
            $invalid_properties[] = "'package' can't be null";
        }
        if ($this->container['label'] === null) {
            $invalid_properties[] = "'label' can't be null";
        }
        if ($this->container['modified_date'] === null) {
            $invalid_properties[] = "'modified_date' can't be null";
        }
        if ($this->container['created_date'] === null) {
            $invalid_properties[] = "'created_date' can't be null";
        }
        if ($this->container['user'] === null) {
            $invalid_properties[] = "'user' can't be null";
        }
        if ($this->container['validatorplan'] === null) {
            $invalid_properties[] = "'validatorplan' can't be null";
        }
        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()
    {
        if ($this->container['href'] === null) {
            return false;
        }
        if ($this->container['pk'] === null) {
            return false;
        }
        if ($this->container['package'] === null) {
            return false;
        }
        if ($this->container['label'] === null) {
            return false;
        }
        if ($this->container['modified_date'] === null) {
            return false;
        }
        if ($this->container['created_date'] === null) {
            return false;
        }
        if ($this->container['user'] === null) {
            return false;
        }
        if ($this->container['validatorplan'] === null) {
            return false;
        }
        return true;
    }


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

    /**
     * Sets href
     * @param string $href current object reference url
     * @return $this
     */
    public function setHref($href)
    {
        $this->container['href'] = $href;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets rating_avg
     * @param float $rating_avg average rating of package.
     * @return $this
     */
    public function setRatingAvg($rating_avg)
    {
        $this->container['rating_avg'] = $rating_avg;

        return $this;
    }

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

    /**
     * Sets rating_count
     * @param float $rating_count package total rating submitted.
     * @return $this
     */
    public function setRatingCount($rating_count)
    {
        $this->container['rating_count'] = $rating_count;

        return $this;
    }

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

    /**
     * Sets slug
     * @param string $slug value used to uniquely identify package.
     * @return $this
     */
    public function setSlug($slug)
    {
        $this->container['slug'] = $slug;

        return $this;
    }

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

    /**
     * Sets account
     * @param string $account value used to uniquely identify account.
     * @return $this
     */
    public function setAccount($account)
    {
        $this->container['account'] = $account;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets title
     * @param string $title package title.
     * @return $this
     */
    public function setTitle($title)
    {
        $this->container['title'] = $title;

        return $this;
    }

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

    /**
     * Sets pk
     * @param int $pk unique identifier of version.
     * @return $this
     */
    public function setPk($pk)
    {
        $this->container['pk'] = $pk;

        return $this;
    }

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

    /**
     * Sets package
     * @param int $package package pk.
     * @return $this
     */
    public function setPackage($package)
    {
        $this->container['package'] = $package;

        return $this;
    }

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

    /**
     * Sets label
     * @param string $label version label.
     * @return $this
     */
    public function setLabel($label)
    {
        $this->container['label'] = $label;

        return $this;
    }

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

    /**
     * Sets modified_date
     * @param \DateTime $modified_date last modified date.
     * @return $this
     */
    public function setModifiedDate($modified_date)
    {
        $this->container['modified_date'] = $modified_date;

        return $this;
    }

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

    /**
     * Sets created_date
     * @param \DateTime $created_date package version creation date.
     * @return $this
     */
    public function setCreatedDate($created_date)
    {
        $this->container['created_date'] = $created_date;

        return $this;
    }

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

    /**
     * Sets user
     * @param string $user package creator name.
     * @return $this
     */
    public function setUser($user)
    {
        $this->container['user'] = $user;

        return $this;
    }

    /**
     * Gets validatorplan
     * @return object
     */
    public function getValidatorplan()
    {
        return $this->container['validatorplan'];
    }

    /**
     * Sets validatorplan
     * @param object $validatorplan Detail view of Validatorplan of package.
     * @return $this
     */
    public function setValidatorplan($validatorplan)
    {
        $this->container['validatorplan'] = $validatorplan;

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

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


