<?php
/**
 * FlowAttributes
 *
 * PHP version 5
 *
 * @category Class
 * @package  ProcessMaker\PMIO
 * @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
 */

/**
 * ProcessMaker API
 *
 * This ProcessMaker I/O API provides access to a BPMN 2.0 compliant workflow engine API that is designed to be used as a microservice to support enterprise cloud applications. The current Alpha 1.0 version supports most of the descriptive classes of the BPMN 2.0 specification.
 *
 * OpenAPI spec version: 1.0.0
 * Contact: support@processmaker.io
 * 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 ProcessMaker\PMIO\Model;

use \ArrayAccess;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'name' => 'string',
        'description' => 'string',
        'process_id' => 'string',
        'from_object_id' => 'string',
        'from_object_type' => 'string',
        'to_object_id' => 'string',
        'to_object_type' => 'string',
        'type' => 'string',
        'condition' => 'string',
        'default' => 'bool',
        'optional' => 'bool',
        'created_at' => 'string',
        'updated_at' => '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(
        'name' => 'name',
        'description' => 'description',
        'process_id' => 'process_id',
        'from_object_id' => 'from_object_id',
        'from_object_type' => 'from_object_type',
        'to_object_id' => 'to_object_id',
        'to_object_type' => 'to_object_type',
        'type' => 'type',
        'condition' => 'condition',
        'default' => 'default',
        'optional' => 'optional',
        'created_at' => 'created_at',
        'updated_at' => 'updated_at'
    );

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

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = array(
        'name' => 'setName',
        'description' => 'setDescription',
        'process_id' => 'setProcessId',
        'from_object_id' => 'setFromObjectId',
        'from_object_type' => 'setFromObjectType',
        'to_object_id' => 'setToObjectId',
        'to_object_type' => 'setToObjectType',
        'type' => 'setType',
        'condition' => 'setCondition',
        'default' => 'setDefault',
        'optional' => 'setOptional',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt'
    );

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

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = array(
        'name' => 'getName',
        'description' => 'getDescription',
        'process_id' => 'getProcessId',
        'from_object_id' => 'getFromObjectId',
        'from_object_type' => 'getFromObjectType',
        'to_object_id' => 'getToObjectId',
        'to_object_type' => 'getToObjectType',
        'type' => 'getType',
        'condition' => 'getCondition',
        'default' => 'getDefault',
        'optional' => 'getOptional',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt'
    );

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

    const TYPE_SEQUENTIAL = 'SEQUENTIAL';
    const TYPE_EVALUATE = 'EVALUATE';
    const TYPE_SELECT = 'SELECT';
    const TYPE_PARALLEL = 'PARALLEL';
    const TYPE_PARALLEL_BY_EVALUATION = 'PARALLEL-BY-EVALUATION';
    const TYPE_SEC_JOIN = 'SEC-JOIN';
    const TYPE_DISCRIMINATOR = 'DISCRIMINATOR';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getTypeAllowableValues()
    {
        return [
            self::TYPE_SEQUENTIAL,
            self::TYPE_EVALUATE,
            self::TYPE_SELECT,
            self::TYPE_PARALLEL,
            self::TYPE_PARALLEL_BY_EVALUATION,
            self::TYPE_SEC_JOIN,
            self::TYPE_DISCRIMINATOR,
        ];
    }

    /**
     * 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['name'] = isset($data['name']) ? $data['name'] : null;
        $this->container['description'] = isset($data['description']) ? $data['description'] : null;
        $this->container['process_id'] = isset($data['process_id']) ? $data['process_id'] : null;
        $this->container['from_object_id'] = isset($data['from_object_id']) ? $data['from_object_id'] : null;
        $this->container['from_object_type'] = isset($data['from_object_type']) ? $data['from_object_type'] : null;
        $this->container['to_object_id'] = isset($data['to_object_id']) ? $data['to_object_id'] : null;
        $this->container['to_object_type'] = isset($data['to_object_type']) ? $data['to_object_type'] : null;
        $this->container['type'] = isset($data['type']) ? $data['type'] : 'SEQUENTIAL';
        $this->container['condition'] = isset($data['condition']) ? $data['condition'] : null;
        $this->container['default'] = isset($data['default']) ? $data['default'] : false;
        $this->container['optional'] = isset($data['optional']) ? $data['optional'] : false;
        $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null;
        $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = array();
        if ($this->container['process_id'] === null) {
            $invalid_properties[] = "'process_id' can't be null";
        }
        if ($this->container['from_object_id'] === null) {
            $invalid_properties[] = "'from_object_id' can't be null";
        }
        if ($this->container['from_object_type'] === null) {
            $invalid_properties[] = "'from_object_type' can't be null";
        }
        if ($this->container['to_object_id'] === null) {
            $invalid_properties[] = "'to_object_id' can't be null";
        }
        if ($this->container['to_object_type'] === null) {
            $invalid_properties[] = "'to_object_type' can't be null";
        }
        if ($this->container['type'] === null) {
            $invalid_properties[] = "'type' can't be null";
        }
        $allowed_values = array("SEQUENTIAL", "EVALUATE", "SELECT", "PARALLEL", "PARALLEL-BY-EVALUATION", "SEC-JOIN", "DISCRIMINATOR");
        if (!in_array($this->container['type'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'type', must be one of #{allowed_values}.";
        }

        if ($this->container['default'] === null) {
            $invalid_properties[] = "'default' can't be null";
        }
        if ($this->container['optional'] === null) {
            $invalid_properties[] = "'optional' 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['process_id'] === null) {
            return false;
        }
        if ($this->container['from_object_id'] === null) {
            return false;
        }
        if ($this->container['from_object_type'] === null) {
            return false;
        }
        if ($this->container['to_object_id'] === null) {
            return false;
        }
        if ($this->container['to_object_type'] === null) {
            return false;
        }
        if ($this->container['type'] === null) {
            return false;
        }
        $allowed_values = array("SEQUENTIAL", "EVALUATE", "SELECT", "PARALLEL", "PARALLEL-BY-EVALUATION", "SEC-JOIN", "DISCRIMINATOR");
        if (!in_array($this->container['type'], $allowed_values)) {
            return false;
        }
        if ($this->container['default'] === null) {
            return false;
        }
        if ($this->container['optional'] === null) {
            return false;
        }
        return true;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets type
     * @param string $type
     * @return $this
     */
    public function setType($type)
    {
        $allowed_values = array('SEQUENTIAL', 'EVALUATE', 'SELECT', 'PARALLEL', 'PARALLEL-BY-EVALUATION', 'SEC-JOIN', 'DISCRIMINATOR');
        if (!in_array($type, $allowed_values)) {
            throw new \InvalidArgumentException("Invalid value for 'type', must be one of 'SEQUENTIAL', 'EVALUATE', 'SELECT', 'PARALLEL', 'PARALLEL-BY-EVALUATION', 'SEC-JOIN', 'DISCRIMINATOR'");
        }
        $this->container['type'] = $type;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return json_encode(\ProcessMaker\PMIO\ObjectSerializer::sanitizeForSerialization($this));
    }
}


<?php

namespace Nur\Http;

class Session
{
    /**
     * Set session method.
     *
     * @param string $key
     * @param mixed  $value
     *
     * @return void
     */
    public function set($key, $value)
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $_SESSION[$k] = $v;
            }
        } else {
            $_SESSION[$key] = $value;
        }

        return;
    }

    /**
     * Get session method.
     *
     * @param string $key
     *
     * @return null|mixed
     */
    public function get($key = null)
    {
        return (is_null($key) ? $_SESSION : ($this->has($key) ? $_SESSION[$key] : null));
    }

    /**
     * Session has key ?
     *
     * @param string $key
     *
     * @return bool
     */
    public function has($key)
    {
        return isset($_SESSION[$key]);
    }

    /**
     * Setting Flash Message
     *
     * @param string $key
     * @param mixed $value
     * @param string $redirect
     *
     * @return bool
     */
    public function setFlash($key, $value, $redirect = null)
    {
        $this->set('_nur_flash', [$key => $value]);

        if (! is_null($redirect)) {
            uri()->redirect($redirect);
        }

        return false;
    }

    /**
     * Getting Flash Message
     *
     * @param string $key
     *
     * @return null|string
     */
    public function getFlash($key = null)
    {
        if (! is_null($key)) {
            $value = null;

            if ($this->hasFlash($key)) {
                $value = $this->get('_nur_flash')[$key];
                unset($_SESSION['_nur_flash'][$key]);
            }

            return $value;
        }

        return $key;
    }

    /**
     * Session has flash key ?
     *
     * @param string $key
     *
     * @return bool
     */
    public function hasFlash($key)
    {
        return isset($_SESSION['_nur_flash'][$key]);
    }

    /**
     * Delete session method.
     *
     * @param string $key
     *
     * @return void
     */
    public function delete($key)
    {
        if ($this->has($key)) {
            unset($_SESSION[$key]);
        }

        return;
    }

    /**
     * Delete all session method.
     *
     * @return void
     */
    public function destroy()
    {
        $_SESSION = [];
        session_destroy();
        return;
    }

    /**
     * Get Session ID
     *
     * @return string
     */
    public function id()
    {
        return session_id();
    }
}


<?php
/**
 * InstanceAttributes
 *
 * PHP version 5
 *
 * @category Class
 * @package  ProcessMaker\PMIO
 * @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
 */

/**
 * ProcessMaker API
 *
 * This ProcessMaker I/O API provides access to a BPMN 2.0 compliant workflow engine API that is designed to be used as a microservice to support enterprise cloud applications. The current Alpha 1.0 version supports most of the descriptive classes of the BPMN 2.0 specification.
 *
 * OpenAPI spec version: 1.0.0
 * Contact: support@processmaker.io
 * 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 ProcessMaker\PMIO\Model;

use \ArrayAccess;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = array(
        'process_id' => 'string',
        'parent_instance_id' => 'string',
        'init_user_id' => 'string',
        'pin' => 'string',
        'duration' => 'int',
        'status' => 'string',
        'created_at' => 'string',
        'updated_at' => '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(
        'process_id' => 'process_id',
        'parent_instance_id' => 'parent_instance_id',
        'init_user_id' => 'init_user_id',
        'pin' => 'pin',
        'duration' => 'duration',
        'status' => 'status',
        'created_at' => 'created_at',
        'updated_at' => 'updated_at'
    );

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

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = array(
        'process_id' => 'setProcessId',
        'parent_instance_id' => 'setParentInstanceId',
        'init_user_id' => 'setInitUserId',
        'pin' => 'setPin',
        'duration' => 'setDuration',
        'status' => 'setStatus',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt'
    );

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

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = array(
        'process_id' => 'getProcessId',
        'parent_instance_id' => 'getParentInstanceId',
        'init_user_id' => 'getInitUserId',
        'pin' => 'getPin',
        'duration' => 'getDuration',
        'status' => 'getStatus',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt'
    );

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

    const STATUS_RUNNING = 'RUNNING';
    const STATUS_TODO = 'TODO';
    const STATUS_PAUSED = 'PAUSED';
    const STATUS_COMPLETED = 'COMPLETED';
    const STATUS_CANCELLED = 'CANCELLED';

    /**
     * Gets allowable values of the enum
     * @return string[]
     */
    public function getStatusAllowableValues()
    {
        return [
            self::STATUS_RUNNING,
            self::STATUS_TODO,
            self::STATUS_PAUSED,
            self::STATUS_COMPLETED,
            self::STATUS_CANCELLED,
        ];
    }

    /**
     * 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['process_id'] = isset($data['process_id']) ? $data['process_id'] : null;
        $this->container['parent_instance_id'] = isset($data['parent_instance_id']) ? $data['parent_instance_id'] : null;
        $this->container['init_user_id'] = isset($data['init_user_id']) ? $data['init_user_id'] : null;
        $this->container['pin'] = isset($data['pin']) ? $data['pin'] : null;
        $this->container['duration'] = isset($data['duration']) ? $data['duration'] : null;
        $this->container['status'] = isset($data['status']) ? $data['status'] : 'RUNNING';
        $this->container['created_at'] = isset($data['created_at']) ? $data['created_at'] : null;
        $this->container['updated_at'] = isset($data['updated_at']) ? $data['updated_at'] : null;
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = array();
        if ($this->container['process_id'] === null) {
            $invalid_properties[] = "'process_id' can't be null";
        }
        if ($this->container['status'] === null) {
            $invalid_properties[] = "'status' can't be null";
        }
        $allowed_values = array("RUNNING", "TODO", "PAUSED", "COMPLETED", "CANCELLED");
        if (!in_array($this->container['status'], $allowed_values)) {
            $invalid_properties[] = "invalid value for 'status', must be one of #{allowed_values}.";
        }

        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['process_id'] === null) {
            return false;
        }
        if ($this->container['status'] === null) {
            return false;
        }
        $allowed_values = array("RUNNING", "TODO", "PAUSED", "COMPLETED", "CANCELLED");
        if (!in_array($this->container['status'], $allowed_values)) {
            return false;
        }
        return true;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets status
     * @param string $status
     * @return $this
     */
    public function setStatus($status)
    {
        $allowed_values = array('RUNNING', 'TODO', 'PAUSED', 'COMPLETED', 'CANCELLED');
        if (!in_array($status, $allowed_values)) {
            throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'RUNNING', 'TODO', 'PAUSED', 'COMPLETED', 'CANCELLED'");
        }
        $this->container['status'] = $status;

        return $this;
    }

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

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

        return $this;
    }

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

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

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

        return json_encode(\ProcessMaker\PMIO\ObjectSerializer::sanitizeForSerialization($this));
    }
}