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

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

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $modelFormats = [
        'id' => null,
        'providerId' => null,
        'model' => null,
        'instructions' => null,
        'systemPrompt' => null,
        'config' => null,
        'tools' => 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',
        'providerId' => 'providerId',
        'model' => 'model',
        'instructions' => 'instructions',
        'systemPrompt' => 'systemPrompt',
        'config' => 'config',
        'tools' => 'tools',
    ];

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

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

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

    /**
     * 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['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['tools']) || null === $this->container['tools']) {
            $invalidProperties[] = "'tools' 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 null|string
     */
    public function getId()
    {
        return $this->container['id'] ?? null;
    }

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

        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 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 ToolConfigInput[]
     */
    public function getTools()
    {
        return $this->container['tools'] ?? null;
    }

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

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