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

/**
 * FeedbackCreationRequest Class Doc Comment.
 *
 * @category Class
 *
 * @description Request model for creating a feedback entry.
 */
class FeedbackCreationRequest extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable
{
    /**
     * Array of property to type mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $modelTypes = [
        'messageId' => 'string',
        'agentId' => 'string',
        'vote' => '\Algolia\AlgoliaSearch\Model\AgentStudio\VoteEnum',
        'tags' => 'string[]',
        'notes' => 'string',
    ];

    /**
     * Array of property to format mappings. Used for (de)serialization.
     *
     * @var string[]
     */
    protected static $modelFormats = [
        'messageId' => null,
        'agentId' => null,
        'vote' => null,
        'tags' => null,
        'notes' => null,
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name.
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'messageId' => 'messageId',
        'agentId' => 'agentId',
        'vote' => 'vote',
        'tags' => 'tags',
        'notes' => 'notes',
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses).
     *
     * @var string[]
     */
    protected static $setters = [
        'messageId' => 'setMessageId',
        'agentId' => 'setAgentId',
        'vote' => 'setVote',
        'tags' => 'setTags',
        'notes' => 'setNotes',
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests).
     *
     * @var string[]
     */
    protected static $getters = [
        'messageId' => 'getMessageId',
        'agentId' => 'getAgentId',
        'vote' => 'getVote',
        'tags' => 'getTags',
        'notes' => 'getNotes',
    ];

    /**
     * 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['messageId'])) {
            $this->container['messageId'] = $data['messageId'];
        }
        if (isset($data['agentId'])) {
            $this->container['agentId'] = $data['agentId'];
        }
        if (isset($data['vote'])) {
            $this->container['vote'] = $data['vote'];
        }
        if (isset($data['tags'])) {
            $this->container['tags'] = $data['tags'];
        }
        if (isset($data['notes'])) {
            $this->container['notes'] = $data['notes'];
        }
    }

    /**
     * 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['messageId']) || null === $this->container['messageId']) {
            $invalidProperties[] = "'messageId' can't be null";
        }
        if (!isset($this->container['agentId']) || null === $this->container['agentId']) {
            $invalidProperties[] = "'agentId' can't be null";
        }
        if (!isset($this->container['vote']) || null === $this->container['vote']) {
            $invalidProperties[] = "'vote' 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 messageId.
     *
     * @return string
     */
    public function getMessageId()
    {
        return $this->container['messageId'] ?? null;
    }

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets vote.
     *
     * @return VoteEnum
     */
    public function getVote()
    {
        return $this->container['vote'] ?? null;
    }

    /**
     * Sets vote.
     *
     * @param VoteEnum $vote vote
     *
     * @return self
     */
    public function setVote($vote)
    {
        $this->container['vote'] = $vote;

        return $this;
    }

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

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

        return $this;
    }

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

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

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