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

/**
 * Paperless Document
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * 
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 3.0.50
 */
/**
 * 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 UPS\Paperless\Paperless;

use \ArrayAccess;
use \UPS\Paperless\ObjectSerializer;

/**
 * UploadRequestUserCreatedForm Class Doc Comment
 *
 * @category Class
 * @description The container for User Created Form. The container holds the file. Total number of allowed files per shipment is 13.
 * @package  UPS\Paperless
 * @author   Swagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class UploadRequestUserCreatedForm implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'user_created_form_file_name' => 'string',
        'user_created_form_file' => 'string',
        'user_created_form_file_format' => 'string',
        'user_created_form_document_type' => 'string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'user_created_form_file_name' => null,
        'user_created_form_file' => null,
        'user_created_form_file_format' => null,
        'user_created_form_document_type' => 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 = [
        'user_created_form_file_name' => 'UserCreatedFormFileName',
        'user_created_form_file' => 'UserCreatedFormFile',
        'user_created_form_file_format' => 'UserCreatedFormFileFormat',
        'user_created_form_document_type' => 'UserCreatedFormDocumentType'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'user_created_form_file_name' => 'setUserCreatedFormFileName',
        'user_created_form_file' => 'setUserCreatedFormFile',
        'user_created_form_file_format' => 'setUserCreatedFormFileFormat',
        'user_created_form_document_type' => 'setUserCreatedFormDocumentType'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'user_created_form_file_name' => 'getUserCreatedFormFileName',
        'user_created_form_file' => 'getUserCreatedFormFile',
        'user_created_form_file_format' => 'getUserCreatedFormFileFormat',
        'user_created_form_document_type' => 'getUserCreatedFormDocumentType'
    ];

    /**
     * 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['user_created_form_file_name'] = isset($data['user_created_form_file_name']) ? $data['user_created_form_file_name'] : null;
        $this->container['user_created_form_file'] = isset($data['user_created_form_file']) ? $data['user_created_form_file'] : null;
        $this->container['user_created_form_file_format'] = isset($data['user_created_form_file_format']) ? $data['user_created_form_file_format'] : null;
        $this->container['user_created_form_document_type'] = isset($data['user_created_form_document_type']) ? $data['user_created_form_document_type'] : null;
    }

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

        if ($this->container['user_created_form_file_name'] === null) {
            $invalidProperties[] = "'user_created_form_file_name' can't be null";
        }
        if ($this->container['user_created_form_file'] === null) {
            $invalidProperties[] = "'user_created_form_file' can't be null";
        }
        if ($this->container['user_created_form_file_format'] === null) {
            $invalidProperties[] = "'user_created_form_file_format' can't be null";
        }
        if ($this->container['user_created_form_document_type'] === null) {
            $invalidProperties[] = "'user_created_form_document_type' 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 user_created_form_file_name
     *
     * @return string
     */
    public function getUserCreatedFormFileName()
    {
        return $this->container['user_created_form_file_name'];
    }

    /**
     * Sets user_created_form_file_name
     *
     * @param string $user_created_form_file_name The name of the file.
     *
     * @return $this
     */
    public function setUserCreatedFormFileName($user_created_form_file_name)
    {
        $this->container['user_created_form_file_name'] = $user_created_form_file_name;

        return $this;
    }

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

    /**
     * Sets user_created_form_file
     *
     * @param string $user_created_form_file The user created form file.  The maximum allowable size of each file is restricted to 10 MB. Should be a base64 encoded string.  Note: The maximum allowable size of each file is restriced to 1MB in CIE (Customer Integration Environment).
     *
     * @return $this
     */
    public function setUserCreatedFormFile($user_created_form_file)
    {
        $this->container['user_created_form_file'] = $user_created_form_file;

        return $this;
    }

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

    /**
     * Sets user_created_form_file_format
     *
     * @param string $user_created_form_file_format The UserCreatedForm file format.  The allowed file formats are bmp, doc, gif, jpg, pdf, png, rtf, tif, txt and xls. The only exceptions for having file format of length 4 character are docx and xlsx. All other file formats needs to be of length 3.
     *
     * @return $this
     */
    public function setUserCreatedFormFileFormat($user_created_form_file_format)
    {
        $this->container['user_created_form_file_format'] = $user_created_form_file_format;

        return $this;
    }

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

    /**
     * Sets user_created_form_document_type
     *
     * @param string $user_created_form_document_type The type of documents in UserCreatedForm file.  The allowed document types are 001 - Authorization Form, 002 - Commercial Invoice, 003 - Certificate of Origin, 004 - Export Accompanying Document, 005 - Export License, 006 - Import Permit, 007 - One Time NAFTA, 008 - Other Document, 009 - Power of Attorney, 010 - Packing List, 011 - SED Document, 012 - Shipper's Letter of Instruction, 013 - Declaration. The total number of documents allowed per file or per shipment is 13. Each document type needs to be three digits.
     *
     * @return $this
     */
    public function setUserCreatedFormDocumentType($user_created_form_document_type)
    {
        $this->container['user_created_form_document_type'] = $user_created_form_document_type;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    #[\ReturnTypeWillChange]
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed
     */
    #[\ReturnTypeWillChange]
    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
     */
    #[\ReturnTypeWillChange]
    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
     */
    #[\ReturnTypeWillChange]
    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));
    }
}
