<?php
/**
 * DocGenFormField
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  DocuSign\eSign
 * @author   Swagger Codegen team <apihelp@docusign.com>
 * @license  The Docusign PHP Client SDK is licensed under the MIT License.
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Docusign eSignature REST API
 *
 * The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.
 *
 * OpenAPI spec version: v2.1
 * Contact: devcenter@docusign.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 * Swagger Codegen version: 2.4.21
 */

/**
 * 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 DocuSign\eSign\Model;

use \ArrayAccess;
use DocuSign\eSign\ObjectSerializer;

/**
 * DocGenFormField Class Doc Comment
 *
 * @category    Class
 * @package     DocuSign\eSign
 * @author      Swagger Codegen team <apihelp@docusign.com>
 * @license     The Docusign PHP Client SDK is licensed under the MIT License.
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class DocGenFormField implements ModelInterface, ArrayAccess
{
    const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerTypes = [
        'connected_object_details' => '\DocuSign\eSign\Model\ConnectedObjectDetails',
        'description' => '?string',
        'fully_qualified_path' => '?string',
        'label' => '?string',
        'name' => '?string',
        'options' => '\DocuSign\eSign\Model\DocGenFormFieldOption[]',
        'order' => '?string',
        'predefined_validation' => '?string',
        'required' => '?string',
        'row_values' => '\DocuSign\eSign\Model\DocGenFormFieldRowValue[]',
        'type' => '?string',
        'validation' => '\DocuSign\eSign\Model\DocGenFormFieldValidation',
        'value' => '?string'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $swaggerFormats = [
        'connected_object_details' => null,
        'description' => null,
        'fully_qualified_path' => null,
        'label' => null,
        'name' => null,
        'options' => null,
        'order' => null,
        'predefined_validation' => null,
        'required' => null,
        'row_values' => null,
        'type' => null,
        'validation' => null,
        'value' => 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 = [
        'connected_object_details' => 'connectedObjectDetails',
        'description' => 'description',
        'fully_qualified_path' => 'fullyQualifiedPath',
        'label' => 'label',
        'name' => 'name',
        'options' => 'options',
        'order' => 'order',
        'predefined_validation' => 'predefinedValidation',
        'required' => 'required',
        'row_values' => 'rowValues',
        'type' => 'type',
        'validation' => 'validation',
        'value' => 'value'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'connected_object_details' => 'setConnectedObjectDetails',
        'description' => 'setDescription',
        'fully_qualified_path' => 'setFullyQualifiedPath',
        'label' => 'setLabel',
        'name' => 'setName',
        'options' => 'setOptions',
        'order' => 'setOrder',
        'predefined_validation' => 'setPredefinedValidation',
        'required' => 'setRequired',
        'row_values' => 'setRowValues',
        'type' => 'setType',
        'validation' => 'setValidation',
        'value' => 'setValue'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'connected_object_details' => 'getConnectedObjectDetails',
        'description' => 'getDescription',
        'fully_qualified_path' => 'getFullyQualifiedPath',
        'label' => 'getLabel',
        'name' => 'getName',
        'options' => 'getOptions',
        'order' => 'getOrder',
        'predefined_validation' => 'getPredefinedValidation',
        'required' => 'getRequired',
        'row_values' => 'getRowValues',
        'type' => 'getType',
        'validation' => 'getValidation',
        'value' => 'getValue'
    ];

    /**
     * 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['connected_object_details'] = isset($data['connected_object_details']) ? $data['connected_object_details'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['fully_qualified_path'] = isset($data['fully_qualified_path']) ? $data['fully_qualified_path'] : null;
        $this->container['label'] = isset($data['label']) ? $data['label'] : null;
        $this->container['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['options'] = isset($data['options']) ? $data['options'] : null;
        $this->container['order'] = isset($data['order']) ? $data['order'] : null;
        $this->container['predefined_validation'] = isset($data['predefined_validation']) ? $data['predefined_validation'] : null;
        $this->container['required'] = isset($data['required']) ? $data['required'] : null;
        $this->container['row_values'] = isset($data['row_values']) ? $data['row_values'] : null;
        $this->container['type'] = isset($data['type']) ? $data['type'] : null;
        $this->container['validation'] = isset($data['validation']) ? $data['validation'] : null;
        $this->container['value'] = isset($data['value']) ? $data['value'] : null;
    }

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

        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 connected_object_details
     *
     * @return \DocuSign\eSign\Model\ConnectedObjectDetails
     */
    public function getConnectedObjectDetails()
    {
        return $this->container['connected_object_details'];
    }

    /**
     * Sets connected_object_details
     *
     * @param \DocuSign\eSign\Model\ConnectedObjectDetails $connected_object_details 
     *
     * @return $this
     */
    public function setConnectedObjectDetails($connected_object_details)
    {
        $this->container['connected_object_details'] = $connected_object_details;

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

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

        return $this;
    }

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

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

        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 options
     *
     * @return \DocuSign\eSign\Model\DocGenFormFieldOption[]
     */
    public function getOptions()
    {
        return $this->container['options'];
    }

    /**
     * Sets options
     *
     * @param \DocuSign\eSign\Model\DocGenFormFieldOption[] $options 
     *
     * @return $this
     */
    public function setOptions($options)
    {
        $this->container['options'] = $options;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets required
     *
     * @param ?string $required When set to **true**, the signer is required to fill out this tab
     *
     * @return $this
     */
    public function setRequired($required)
    {
        $this->container['required'] = $required;

        return $this;
    }

    /**
     * Gets row_values
     *
     * @return \DocuSign\eSign\Model\DocGenFormFieldRowValue[]
     */
    public function getRowValues()
    {
        return $this->container['row_values'];
    }

    /**
     * Sets row_values
     *
     * @param \DocuSign\eSign\Model\DocGenFormFieldRowValue[] $row_values 
     *
     * @return $this
     */
    public function setRowValues($row_values)
    {
        $this->container['row_values'] = $row_values;

        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 validation
     *
     * @return \DocuSign\eSign\Model\DocGenFormFieldValidation
     */
    public function getValidation()
    {
        return $this->container['validation'];
    }

    /**
     * Sets validation
     *
     * @param \DocuSign\eSign\Model\DocGenFormFieldValidation $validation 
     *
     * @return $this
     */
    public function setValidation($validation)
    {
        $this->container['validation'] = $validation;

        return $this;
    }

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

    /**
     * Sets value
     *
     * @param ?string $value Specifies the value of the tab.
     *
     * @return $this
     */
    public function setValue($value)
    {
        $this->container['value'] = $value;

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

