<?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;

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

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

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

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

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

    /**
     * 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['name'])) {
            $this->container['name'] = $data['name'];
        }
        if (isset($data['description'])) {
            $this->container['description'] = $data['description'];
        }
        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'];
        }
    }

    /**
     * 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()
    {
        return [];
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets providerId.
     *
     * @param null|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 null|string
     */
    public function getInstructions()
    {
        return $this->container['instructions'] ?? null;
    }

    /**
     * Sets instructions.
     *
     * @param null|string $instructions The agent prompt: defines the agent's role, tone, and goals. Guides how it answers using the provided context. Corresponds to the 'Agent prompt' field in the dashboard.
     *
     * @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 The system prompt: defines system-level rules and constraints. Guides how the agent uses tools, features, and generates context. Prepended before `instructions` in the final prompt sent to the LLM. Typically injected by an agent template — modify with caution, as changes may affect behavior, tool usage, or response accuracy. Corresponds to the 'System prompt' field in the dashboard.
     *
     * @return self
     */
    public function setSystemPrompt($systemPrompt)
    {
        $this->container['systemPrompt'] = $systemPrompt;

        return $this;
    }

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

    /**
     * Sets config.
     *
     * @param null|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;
    }

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