<?php
/**
 * FileInfo
 *
 * PHP version 5
 *
 * @category Class
 * @package  PartScannerClient
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Partscanner API
 *
 * This is a partscanner API
 *
 * OpenAPI spec version: 1.0.0
 * Contact: info@studio-7.ru
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.32
 */
/**
 * 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 PartScannerClient\Model;

use \ArrayAccess;
use \PartScannerClient\ObjectSerializer;

/**
 * FileInfo Class Doc Comment
 *
 * @category Class
 * @package  PartScannerClient
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class FileInfo implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'hash' => 'string',
'status' => 'string',
'progress' => 'int',
'file_orig' => 'string',
'file_orig_size' => 'int',
'file_temp' => 'string',
'file_temp_size' => 'int'    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'hash' => null,
'status' => null,
'progress' => null,
'file_orig' => null,
'file_orig_size' => null,
'file_temp' => null,
'file_temp_size' => null    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function swaggerFormats()
    {
        return self::$swaggerFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'hash' => 'hash',
'status' => 'status',
'progress' => 'progress',
'file_orig' => 'fileOrig',
'file_orig_size' => 'fileOrigSize',
'file_temp' => 'fileTemp',
'file_temp_size' => 'fileTempSize'    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'hash' => 'setHash',
'status' => 'setStatus',
'progress' => 'setProgress',
'file_orig' => 'setFileOrig',
'file_orig_size' => 'setFileOrigSize',
'file_temp' => 'setFileTemp',
'file_temp_size' => 'setFileTempSize'    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'hash' => 'getHash',
'status' => 'getStatus',
'progress' => 'getProgress',
'file_orig' => 'getFileOrig',
'file_orig_size' => 'getFileOrigSize',
'file_temp' => 'getFileTemp',
'file_temp_size' => 'getFileTempSize'    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$swaggerModelName;
    }

    

    /**
     * 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['hash'] = isset($data['hash']) ? $data['hash'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : null;
        $this->container['progress'] = isset($data['progress']) ? $data['progress'] : null;
        $this->container['file_orig'] = isset($data['file_orig']) ? $data['file_orig'] : null;
        $this->container['file_orig_size'] = isset($data['file_orig_size']) ? $data['file_orig_size'] : null;
        $this->container['file_temp'] = isset($data['file_temp']) ? $data['file_temp'] : null;
        $this->container['file_temp_size'] = isset($data['file_temp_size']) ? $data['file_temp_size'] : null;
    }

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

        if ($this->container['hash'] === null) {
            $invalidProperties[] = "'hash' can't be null";
        }
        if ($this->container['status'] === null) {
            $invalidProperties[] = "'status' can't be null";
        }
        if ($this->container['progress'] === null) {
            $invalidProperties[] = "'progress' can't be null";
        }
        if ($this->container['file_orig'] === null) {
            $invalidProperties[] = "'file_orig' can't be null";
        }
        if ($this->container['file_orig_size'] === null) {
            $invalidProperties[] = "'file_orig_size' can't be null";
        }
        if ($this->container['file_temp'] === null) {
            $invalidProperties[] = "'file_temp' can't be null";
        }
        if ($this->container['file_temp_size'] === null) {
            $invalidProperties[] = "'file_temp_size' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

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