<?php

// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

namespace Algolia\AlgoliaSearch\Model\AgentStudio;

use Algolia\AlgoliaSearch\Model\AbstractModel;
use Algolia\AlgoliaSearch\Model\ModelInterface;

/**
 * AgentWithVersionResponse Class Doc Comment.
 *
 * @category Class
 */
class AgentWithVersionResponse extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $modelTypes = [
        'id' => 'string',
        'name' => 'string',
        'description' => 'string',
        'status' => '\Algolia\AlgoliaSearch\Model\AgentStudio\AgentStatus',
        'providerId' => 'string',
        'model' => 'string',
        'instructions' => 'string',
        'systemPrompt' => 'string',
        'config' => 'array<string,mixed>',
        'tools' => '\Algolia\AlgoliaSearch\Model\AgentStudio\ToolConfigInput[]',
        'templateType' => 'string',
        'createdAt' => 'string',
        'updatedAt' => 'string',
        'lastUsedAt' => 'string',
    ];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $modelFormats = [
        'id' => null,
        'name' => null,
        'description' => null,
        'status' => null,
        'providerId' => null,
        'model' => null,
        'instructions' => null,
        'systemPrompt' => null,
        'config' => null,
        'tools' => null,
        'templateType' => null,
        'createdAt' => null,
        'updatedAt' => null,
        'lastUsedAt' => null,
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'name' => 'name',
        'description' => 'description',
        'status' => 'status',
        'providerId' => 'providerId',
        'model' => 'model',
        'instructions' => 'instructions',
        'systemPrompt' => 'systemPrompt',
        'config' => 'config',
        'tools' => 'tools',
        'templateType' => 'templateType',
        'createdAt' => 'createdAt',
        'updatedAt' => 'updatedAt',
        'lastUsedAt' => 'lastUsedAt',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'name' => 'setName',
        'description' => 'setDescription',
        'status' => 'setStatus',
        'providerId' => 'setProviderId',
        'model' => 'setModel',
        'instructions' => 'setInstructions',
        'systemPrompt' => 'setSystemPrompt',
        'config' => 'setConfig',
        'tools' => 'setTools',
        'templateType' => 'setTemplateType',
        'createdAt' => 'setCreatedAt',
        'updatedAt' => 'setUpdatedAt',
        'lastUsedAt' => 'setLastUsedAt',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'name' => 'getName',
        'description' => 'getDescription',
        'status' => 'getStatus',
        'providerId' => 'getProviderId',
        'model' => 'getModel',
        'instructions' => 'getInstructions',
        'systemPrompt' => 'getSystemPrompt',
        'config' => 'getConfig',
        'tools' => 'getTools',
        'templateType' => 'getTemplateType',
        'createdAt' => 'getCreatedAt',
        'updatedAt' => 'getUpdatedAt',
        'lastUsedAt' => 'getLastUsedAt',
    ];

    /**
     * Associative array for storing property values.
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor.
     *
     * @param mixed[] $data Associated array of property values
     */
    public function __construct(?array $data = null)
    {
        if (isset($data['id'])) {
            $this->container['id'] = $data['id'];
        }
        if (isset($data['name'])) {
            $this->container['name'] = $data['name'];
        }
        if (isset($data['description'])) {
            $this->container['description'] = $data['description'];
        }
        if (isset($data['status'])) {
            $this->container['status'] = $data['status'];
        }
        if (isset($data['providerId'])) {
            $this->container['providerId'] = $data['providerId'];
        }
        if (isset($data['model'])) {
            $this->container['model'] = $data['model'];
        }
        if (isset($data['instructions'])) {
            $this->container['instructions'] = $data['instructions'];
        }
        if (isset($data['systemPrompt'])) {
            $this->container['systemPrompt'] = $data['systemPrompt'];
        }
        if (isset($data['config'])) {
            $this->container['config'] = $data['config'];
        }
        if (isset($data['tools'])) {
            $this->container['tools'] = $data['tools'];
        }
        if (isset($data['templateType'])) {
            $this->container['templateType'] = $data['templateType'];
        }
        if (isset($data['createdAt'])) {
            $this->container['createdAt'] = $data['createdAt'];
        }
        if (isset($data['updatedAt'])) {
            $this->container['updatedAt'] = $data['updatedAt'];
        }
        if (isset($data['lastUsedAt'])) {
            $this->container['lastUsedAt'] = $data['lastUsedAt'];
        }
    }

    /**
     * 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 property to type mappings. Used for (de)serialization.
     *
     * @return array
     */
    public static function modelTypes()
    {
        return self::$modelTypes;
    }

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

    /**
     * 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;
    }

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

        if (!isset($this->container['id']) || null === $this->container['id']) {
            $invalidProperties[] = "'id' can't be null";
        }
        if (!isset($this->container['name']) || null === $this->container['name']) {
            $invalidProperties[] = "'name' can't be null";
        }
        if (!isset($this->container['description']) || null === $this->container['description']) {
            $invalidProperties[] = "'description' can't be null";
        }
        if (!isset($this->container['status']) || null === $this->container['status']) {
            $invalidProperties[] = "'status' can't be null";
        }
        if (!isset($this->container['providerId']) || null === $this->container['providerId']) {
            $invalidProperties[] = "'providerId' can't be null";
        }
        if (!isset($this->container['instructions']) || null === $this->container['instructions']) {
            $invalidProperties[] = "'instructions' can't be null";
        }
        if (!isset($this->container['config']) || null === $this->container['config']) {
            $invalidProperties[] = "'config' can't be null";
        }
        if (!isset($this->container['createdAt']) || null === $this->container['createdAt']) {
            $invalidProperties[] = "'createdAt' can't be null";
        }
        if (!isset($this->container['updatedAt']) || null === $this->container['updatedAt']) {
            $invalidProperties[] = "'updatedAt' can't be null";
        }
        if (!isset($this->container['lastUsedAt']) || null === $this->container['lastUsedAt']) {
            $invalidProperties[] = "'lastUsedAt' 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 0 === count($this->listInvalidProperties());
    }

    /**
     * Gets id.
     *
     * @return string
     */
    public function getId()
    {
        return $this->container['id'] ?? null;
    }

    /**
     * Sets id.
     *
     * @param string $id id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets providerId.
     *
     * @return string
     */
    public function getProviderId()
    {
        return $this->container['providerId'] ?? null;
    }

    /**
     * Sets providerId.
     *
     * @param string $providerId providerId
     *
     * @return self
     */
    public function setProviderId($providerId)
    {
        $this->container['providerId'] = $providerId;

        return $this;
    }

    /**
     * Gets model.
     *
     * @return null|string
     */
    public function getModel()
    {
        return $this->container['model'] ?? null;
    }

    /**
     * Sets model.
     *
     * @param null|string $model model
     *
     * @return self
     */
    public function setModel($model)
    {
        $this->container['model'] = $model;

        return $this;
    }

    /**
     * Gets instructions.
     *
     * @return string
     */
    public function getInstructions()
    {
        return $this->container['instructions'] ?? null;
    }

    /**
     * Sets instructions.
     *
     * @param string $instructions instructions
     *
     * @return self
     */
    public function setInstructions($instructions)
    {
        $this->container['instructions'] = $instructions;

        return $this;
    }

    /**
     * Gets systemPrompt.
     *
     * @return null|string
     */
    public function getSystemPrompt()
    {
        return $this->container['systemPrompt'] ?? null;
    }

    /**
     * Sets systemPrompt.
     *
     * @param null|string $systemPrompt systemPrompt
     *
     * @return self
     */
    public function setSystemPrompt($systemPrompt)
    {
        $this->container['systemPrompt'] = $systemPrompt;

        return $this;
    }

    /**
     * Gets config.
     *
     * @return array<string,mixed>
     */
    public function getConfig()
    {
        return $this->container['config'] ?? null;
    }

    /**
     * Sets config.
     *
     * @param array<string,mixed> $config config
     *
     * @return self
     */
    public function setConfig($config)
    {
        $this->container['config'] = $config;

        return $this;
    }

    /**
     * Gets tools.
     *
     * @return null|ToolConfigInput[]
     */
    public function getTools()
    {
        return $this->container['tools'] ?? null;
    }

    /**
     * Sets tools.
     *
     * @param null|ToolConfigInput[] $tools tools
     *
     * @return self
     */
    public function setTools($tools)
    {
        $this->container['tools'] = $tools;

        return $this;
    }

    /**
     * Gets templateType.
     *
     * @return null|string
     */
    public function getTemplateType()
    {
        return $this->container['templateType'] ?? null;
    }

    /**
     * Sets templateType.
     *
     * @param null|string $templateType templateType
     *
     * @return self
     */
    public function setTemplateType($templateType)
    {
        $this->container['templateType'] = $templateType;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets lastUsedAt.
     *
     * @return string
     */
    public function getLastUsedAt()
    {
        return $this->container['lastUsedAt'] ?? null;
    }

    /**
     * Sets lastUsedAt.
     *
     * @param string $lastUsedAt lastUsedAt
     *
     * @return self
     */
    public function setLastUsedAt($lastUsedAt)
    {
        $this->container['lastUsedAt'] = $lastUsedAt;

        return $this;
    }

    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param int $offset Offset
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param int $offset Offset
     *
     * @return null|mixed
     */
    public function offsetGet($offset): mixed
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param null|int $offset Offset
     * @param mixed    $value  Value to be set
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param int $offset Offset
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }
}
