<?php
/**
 * MailMessageData
 *
 * PHP version 7.3
 *
 * @category Class
 * @package  Pipedrive
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Pipedrive API v1
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 5.3.0
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Pipedrive\Model;

use ArrayAccess;
use JsonException;
use JsonSerializable;
use Pipedrive\Traits\RawData;
use Pipedrive\ObjectSerializer;

/**
 * MailMessageData Class Doc Comment
 *
 * @category Class
 * @package  Pipedrive
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class MailMessageData implements ModelInterface, ArrayAccess, JsonSerializable
{
    use RawData;

    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static string $openAPIModelName = 'MailMessageData';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string>
      * @phpsalm-var array<string, string>
      */
    protected static array $openAPITypes = [
        'id' => 'int',
        'from' => '\Pipedrive\Model\MailParticipant[]',
        'to' => '\Pipedrive\Model\MailParticipant[]',
        'cc' => '\Pipedrive\Model\MailParticipant[]',
        'bcc' => '\Pipedrive\Model\MailParticipant[]',
        'body_url' => 'string',
        'account_id' => 'string',
        'user_id' => 'int',
        'mail_thread_id' => 'int',
        'subject' => 'string',
        'snippet' => 'string',
        'mail_tracking_status' => 'string',
        'mail_link_tracking_enabled_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'read_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'draft' => 'string',
        'draft_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'synced_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'deleted_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'has_body_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'sent_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'sent_from_pipedrive_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'smart_bcc_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'message_time' => '\DateTime',
        'add_time' => '\DateTime',
        'update_time' => '\DateTime',
        'has_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'has_inline_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0',
        'has_real_attachments_flag' => '\Pipedrive\Model\NumberBooleanDefault0'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'id' => null,
        'from' => null,
        'to' => null,
        'cc' => null,
        'bcc' => null,
        'body_url' => null,
        'account_id' => null,
        'user_id' => null,
        'mail_thread_id' => null,
        'subject' => null,
        'snippet' => null,
        'mail_tracking_status' => null,
        'mail_link_tracking_enabled_flag' => null,
        'read_flag' => null,
        'draft' => null,
        'draft_flag' => null,
        'synced_flag' => null,
        'deleted_flag' => null,
        'has_body_flag' => null,
        'sent_flag' => null,
        'sent_from_pipedrive_flag' => null,
        'smart_bcc_flag' => null,
        'message_time' => 'date-time',
        'add_time' => 'date-time',
        'update_time' => 'date-time',
        'has_attachments_flag' => null,
        'has_inline_attachments_flag' => null,
        'has_real_attachments_flag' => null
    ];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @phpstan-return array<string, string>
     * @psalm-return array<string, string>
     * @return array
     */
    public static function openAPITypes(): array
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @phpstan-return array<string, string|null>
     * @psalm-return array<string, string|null>
     * @return array
     */
    public static function openAPIFormats(): array
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'from' => 'from',
        'to' => 'to',
        'cc' => 'cc',
        'bcc' => 'bcc',
        'body_url' => 'body_url',
        'account_id' => 'account_id',
        'user_id' => 'user_id',
        'mail_thread_id' => 'mail_thread_id',
        'subject' => 'subject',
        'snippet' => 'snippet',
        'mail_tracking_status' => 'mail_tracking_status',
        'mail_link_tracking_enabled_flag' => 'mail_link_tracking_enabled_flag',
        'read_flag' => 'read_flag',
        'draft' => 'draft',
        'draft_flag' => 'draft_flag',
        'synced_flag' => 'synced_flag',
        'deleted_flag' => 'deleted_flag',
        'has_body_flag' => 'has_body_flag',
        'sent_flag' => 'sent_flag',
        'sent_from_pipedrive_flag' => 'sent_from_pipedrive_flag',
        'smart_bcc_flag' => 'smart_bcc_flag',
        'message_time' => 'message_time',
        'add_time' => 'add_time',
        'update_time' => 'update_time',
        'has_attachments_flag' => 'has_attachments_flag',
        'has_inline_attachments_flag' => 'has_inline_attachments_flag',
        'has_real_attachments_flag' => 'has_real_attachments_flag'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'from' => 'setFrom',
        'to' => 'setTo',
        'cc' => 'setCc',
        'bcc' => 'setBcc',
        'body_url' => 'setBodyUrl',
        'account_id' => 'setAccountId',
        'user_id' => 'setUserId',
        'mail_thread_id' => 'setMailThreadId',
        'subject' => 'setSubject',
        'snippet' => 'setSnippet',
        'mail_tracking_status' => 'setMailTrackingStatus',
        'mail_link_tracking_enabled_flag' => 'setMailLinkTrackingEnabledFlag',
        'read_flag' => 'setReadFlag',
        'draft' => 'setDraft',
        'draft_flag' => 'setDraftFlag',
        'synced_flag' => 'setSyncedFlag',
        'deleted_flag' => 'setDeletedFlag',
        'has_body_flag' => 'setHasBodyFlag',
        'sent_flag' => 'setSentFlag',
        'sent_from_pipedrive_flag' => 'setSentFromPipedriveFlag',
        'smart_bcc_flag' => 'setSmartBccFlag',
        'message_time' => 'setMessageTime',
        'add_time' => 'setAddTime',
        'update_time' => 'setUpdateTime',
        'has_attachments_flag' => 'setHasAttachmentsFlag',
        'has_inline_attachments_flag' => 'setHasInlineAttachmentsFlag',
        'has_real_attachments_flag' => 'setHasRealAttachmentsFlag'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'from' => 'getFrom',
        'to' => 'getTo',
        'cc' => 'getCc',
        'bcc' => 'getBcc',
        'body_url' => 'getBodyUrl',
        'account_id' => 'getAccountId',
        'user_id' => 'getUserId',
        'mail_thread_id' => 'getMailThreadId',
        'subject' => 'getSubject',
        'snippet' => 'getSnippet',
        'mail_tracking_status' => 'getMailTrackingStatus',
        'mail_link_tracking_enabled_flag' => 'getMailLinkTrackingEnabledFlag',
        'read_flag' => 'getReadFlag',
        'draft' => 'getDraft',
        'draft_flag' => 'getDraftFlag',
        'synced_flag' => 'getSyncedFlag',
        'deleted_flag' => 'getDeletedFlag',
        'has_body_flag' => 'getHasBodyFlag',
        'sent_flag' => 'getSentFlag',
        'sent_from_pipedrive_flag' => 'getSentFromPipedriveFlag',
        'smart_bcc_flag' => 'getSmartBccFlag',
        'message_time' => 'getMessageTime',
        'add_time' => 'getAddTime',
        'update_time' => 'getUpdateTime',
        'has_attachments_flag' => 'getHasAttachmentsFlag',
        'has_inline_attachments_flag' => 'getHasInlineAttachmentsFlag',
        'has_real_attachments_flag' => 'getHasRealAttachmentsFlag'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @phpstan-return array<string, string>
     * @psalm-return array<string, string>
     * @return array
     */
    public static function attributeMap(): array
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @phpstan-return array<string, string>
     * @psalm-return array<string, string>
     * @return array
     */
    public static function setters(): array
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @phpstan-return array<string, string>
     * @psalm-return array<string, string>
     * @return array
     */
    public static function getters(): array
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName(): string
    {
        return self::$openAPIModelName;
    }

    const MAIL_TRACKING_STATUS_OPENED = 'opened';
    const MAIL_TRACKING_STATUS_NOT_OPENED = 'not opened';

    /**
     * Gets allowable values of the enum
     *
     * @phpstan-return  array<string|int>
     * @phpsalm-return  array<string|int>
     * @return (string|int)[]
     */
    public function getMailTrackingStatusAllowableValues(): array
    {
        return [
            self::MAIL_TRACKING_STATUS_OPENED,
            self::MAIL_TRACKING_STATUS_NOT_OPENED,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var array
     * @phpstan-var array<int|string, mixed>
     * @psalm-var array<int|string, mixed>
     */
    protected array $container = [];

    /**
     * Constructor
     *
     * @phpstan-param array<string, mixed>|null $data
     * @psalm-param array<string, mixed>|null $data
     * @param array|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['id'] = $data['id'] ?? null;
        $this->container['from'] = $data['from'] ?? null;
        $this->container['to'] = $data['to'] ?? null;
        $this->container['cc'] = $data['cc'] ?? null;
        $this->container['bcc'] = $data['bcc'] ?? null;
        $this->container['body_url'] = $data['body_url'] ?? null;
        $this->container['account_id'] = $data['account_id'] ?? null;
        $this->container['user_id'] = $data['user_id'] ?? null;
        $this->container['mail_thread_id'] = $data['mail_thread_id'] ?? null;
        $this->container['subject'] = $data['subject'] ?? null;
        $this->container['snippet'] = $data['snippet'] ?? null;
        $this->container['mail_tracking_status'] = $data['mail_tracking_status'] ?? null;
        $this->container['mail_link_tracking_enabled_flag'] = $data['mail_link_tracking_enabled_flag'] ?? null;
        $this->container['read_flag'] = $data['read_flag'] ?? null;
        $this->container['draft'] = $data['draft'] ?? null;
        $this->container['draft_flag'] = $data['draft_flag'] ?? null;
        $this->container['synced_flag'] = $data['synced_flag'] ?? null;
        $this->container['deleted_flag'] = $data['deleted_flag'] ?? null;
        $this->container['has_body_flag'] = $data['has_body_flag'] ?? null;
        $this->container['sent_flag'] = $data['sent_flag'] ?? null;
        $this->container['sent_from_pipedrive_flag'] = $data['sent_from_pipedrive_flag'] ?? null;
        $this->container['smart_bcc_flag'] = $data['smart_bcc_flag'] ?? null;
        $this->container['message_time'] = $data['message_time'] ?? null;
        $this->container['add_time'] = $data['add_time'] ?? null;
        $this->container['update_time'] = $data['update_time'] ?? null;
        $this->container['has_attachments_flag'] = $data['has_attachments_flag'] ?? null;
        $this->container['has_inline_attachments_flag'] = $data['has_inline_attachments_flag'] ?? null;
        $this->container['has_real_attachments_flag'] = $data['has_real_attachments_flag'] ?? null;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     * @phpstan-return array<int, string>
     * @psalm-return array<int, string>
     */
    public function listInvalidProperties(): array
    {
        $invalidProperties = [];

        $allowedValues = $this->getMailTrackingStatusAllowableValues();
        if (!is_null($this->container['mail_tracking_status']) && !in_array($this->container['mail_tracking_status'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'mail_tracking_status', must be one of '%s'",
                $this->container['mail_tracking_status'],
                implode("', '", $allowedValues)
            );
        }

        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(): bool
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets id
     *
     * @param int|null $id ID of the mail message.
     *
     * @return self
     */
    public function setId($id): self
    {
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets from
     *
     * @return \Pipedrive\Model\MailParticipant[]|null
     */
    public function getFrom()
    {
        return $this->container['from'];
    }

    /**
     * Sets from
     *
     * @param \Pipedrive\Model\MailParticipant[]|null $from The array of mail message sender (object)
     *
     * @return self
     */
    public function setFrom($from): self
    {
        $this->container['from'] = $from;

        return $this;
    }

    /**
     * Gets to
     *
     * @return \Pipedrive\Model\MailParticipant[]|null
     */
    public function getTo()
    {
        return $this->container['to'];
    }

    /**
     * Sets to
     *
     * @param \Pipedrive\Model\MailParticipant[]|null $to The array of mail message receiver (object)
     *
     * @return self
     */
    public function setTo($to): self
    {
        $this->container['to'] = $to;

        return $this;
    }

    /**
     * Gets cc
     *
     * @return \Pipedrive\Model\MailParticipant[]|null
     */
    public function getCc()
    {
        return $this->container['cc'];
    }

    /**
     * Sets cc
     *
     * @param \Pipedrive\Model\MailParticipant[]|null $cc The array of mail message copies (object)
     *
     * @return self
     */
    public function setCc($cc): self
    {
        $this->container['cc'] = $cc;

        return $this;
    }

    /**
     * Gets bcc
     *
     * @return \Pipedrive\Model\MailParticipant[]|null
     */
    public function getBcc()
    {
        return $this->container['bcc'];
    }

    /**
     * Sets bcc
     *
     * @param \Pipedrive\Model\MailParticipant[]|null $bcc The array of mail message blind copies (object)
     *
     * @return self
     */
    public function setBcc($bcc): self
    {
        $this->container['bcc'] = $bcc;

        return $this;
    }

    /**
     * Gets body_url
     *
     * @return string|null
     */
    public function getBodyUrl()
    {
        return $this->container['body_url'];
    }

    /**
     * Sets body_url
     *
     * @param string|null $body_url The mail message body URL
     *
     * @return self
     */
    public function setBodyUrl($body_url): self
    {
        $this->container['body_url'] = $body_url;

        return $this;
    }

    /**
     * Gets account_id
     *
     * @return string|null
     */
    public function getAccountId()
    {
        return $this->container['account_id'];
    }

    /**
     * Sets account_id
     *
     * @param string|null $account_id The connection account ID
     *
     * @return self
     */
    public function setAccountId($account_id): self
    {
        $this->container['account_id'] = $account_id;

        return $this;
    }

    /**
     * Gets user_id
     *
     * @return int|null
     */
    public function getUserId()
    {
        return $this->container['user_id'];
    }

    /**
     * Sets user_id
     *
     * @param int|null $user_id ID of the user whom mail message will be assigned to
     *
     * @return self
     */
    public function setUserId($user_id): self
    {
        $this->container['user_id'] = $user_id;

        return $this;
    }

    /**
     * Gets mail_thread_id
     *
     * @return int|null
     */
    public function getMailThreadId()
    {
        return $this->container['mail_thread_id'];
    }

    /**
     * Sets mail_thread_id
     *
     * @param int|null $mail_thread_id ID of the mail message thread
     *
     * @return self
     */
    public function setMailThreadId($mail_thread_id): self
    {
        $this->container['mail_thread_id'] = $mail_thread_id;

        return $this;
    }

    /**
     * Gets subject
     *
     * @return string|null
     */
    public function getSubject()
    {
        return $this->container['subject'];
    }

    /**
     * Sets subject
     *
     * @param string|null $subject The subject of mail message
     *
     * @return self
     */
    public function setSubject($subject): self
    {
        $this->container['subject'] = $subject;

        return $this;
    }

    /**
     * Gets snippet
     *
     * @return string|null
     */
    public function getSnippet()
    {
        return $this->container['snippet'];
    }

    /**
     * Sets snippet
     *
     * @param string|null $snippet The snippet of mail message. Snippet length is up to 225 characters.
     *
     * @return self
     */
    public function setSnippet($snippet): self
    {
        $this->container['snippet'] = $snippet;

        return $this;
    }

    /**
     * Gets mail_tracking_status
     *
     * @return string|null
     */
    public function getMailTrackingStatus()
    {
        return $this->container['mail_tracking_status'];
    }

    /**
     * Sets mail_tracking_status
     *
     * @param string|null $mail_tracking_status The status of tracking mail message. Value is `null` if tracking is not enabled.
     *
     * @return self
     */
    public function setMailTrackingStatus($mail_tracking_status): self
    {
        $allowedValues = $this->getMailTrackingStatusAllowableValues();
        if (!is_null($mail_tracking_status) && !in_array($mail_tracking_status, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'mail_tracking_status', must be one of '%s'",
                    $mail_tracking_status,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['mail_tracking_status'] = $mail_tracking_status;

        return $this;
    }

    /**
     * Gets mail_link_tracking_enabled_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getMailLinkTrackingEnabledFlag()
    {
        return $this->container['mail_link_tracking_enabled_flag'];
    }

    /**
     * Sets mail_link_tracking_enabled_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $mail_link_tracking_enabled_flag Whether the link tracking in mail message body is enabled.
     *
     * @return self
     */
    public function setMailLinkTrackingEnabledFlag($mail_link_tracking_enabled_flag): self
    {
        $this->container['mail_link_tracking_enabled_flag'] = $mail_link_tracking_enabled_flag;

        return $this;
    }

    /**
     * Gets read_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getReadFlag()
    {
        return $this->container['read_flag'];
    }

    /**
     * Sets read_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $read_flag Whether the mail message is read or not by the user
     *
     * @return self
     */
    public function setReadFlag($read_flag): self
    {
        $this->container['read_flag'] = $read_flag;

        return $this;
    }

    /**
     * Gets draft
     *
     * @return string|null
     */
    public function getDraft()
    {
        return $this->container['draft'];
    }

    /**
     * Sets draft
     *
     * @param string|null $draft If the mail message has a draft status then the value is the mail message object as JSON formatted string, otherwise `null`.
     *
     * @return self
     */
    public function setDraft($draft): self
    {
        $this->container['draft'] = $draft;

        return $this;
    }

    /**
     * Gets draft_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getDraftFlag()
    {
        return $this->container['draft_flag'];
    }

    /**
     * Sets draft_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $draft_flag Whether the mail message is a draft or not
     *
     * @return self
     */
    public function setDraftFlag($draft_flag): self
    {
        $this->container['draft_flag'] = $draft_flag;

        return $this;
    }

    /**
     * Gets synced_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getSyncedFlag()
    {
        return $this->container['synced_flag'];
    }

    /**
     * Sets synced_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $synced_flag Whether the mail message is synced with the provider or not
     *
     * @return self
     */
    public function setSyncedFlag($synced_flag): self
    {
        $this->container['synced_flag'] = $synced_flag;

        return $this;
    }

    /**
     * Gets deleted_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getDeletedFlag()
    {
        return $this->container['deleted_flag'];
    }

    /**
     * Sets deleted_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $deleted_flag Whether the mail message is deleted or not
     *
     * @return self
     */
    public function setDeletedFlag($deleted_flag): self
    {
        $this->container['deleted_flag'] = $deleted_flag;

        return $this;
    }

    /**
     * Gets has_body_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getHasBodyFlag()
    {
        return $this->container['has_body_flag'];
    }

    /**
     * Sets has_body_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_body_flag Whether the mail message has a body or not
     *
     * @return self
     */
    public function setHasBodyFlag($has_body_flag): self
    {
        $this->container['has_body_flag'] = $has_body_flag;

        return $this;
    }

    /**
     * Gets sent_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getSentFlag()
    {
        return $this->container['sent_flag'];
    }

    /**
     * Sets sent_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_flag Whether the mail message has been sent or not
     *
     * @return self
     */
    public function setSentFlag($sent_flag): self
    {
        $this->container['sent_flag'] = $sent_flag;

        return $this;
    }

    /**
     * Gets sent_from_pipedrive_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getSentFromPipedriveFlag()
    {
        return $this->container['sent_from_pipedrive_flag'];
    }

    /**
     * Sets sent_from_pipedrive_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $sent_from_pipedrive_flag Whether the mail message has been sent from Pipedrive app or not
     *
     * @return self
     */
    public function setSentFromPipedriveFlag($sent_from_pipedrive_flag): self
    {
        $this->container['sent_from_pipedrive_flag'] = $sent_from_pipedrive_flag;

        return $this;
    }

    /**
     * Gets smart_bcc_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getSmartBccFlag()
    {
        return $this->container['smart_bcc_flag'];
    }

    /**
     * Sets smart_bcc_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $smart_bcc_flag Whether the mail message has been created by Smart Email BCC feature or not
     *
     * @return self
     */
    public function setSmartBccFlag($smart_bcc_flag): self
    {
        $this->container['smart_bcc_flag'] = $smart_bcc_flag;

        return $this;
    }

    /**
     * Gets message_time
     *
     * @return \DateTime|null
     */
    public function getMessageTime()
    {
        return $this->container['message_time'];
    }

    /**
     * Sets message_time
     *
     * @param \DateTime|null $message_time Creation or receival time of the mail message
     *
     * @return self
     */
    public function setMessageTime($message_time): self
    {
        $this->container['message_time'] = $message_time;

        return $this;
    }

    /**
     * Gets add_time
     *
     * @return \DateTime|null
     */
    public function getAddTime()
    {
        return $this->container['add_time'];
    }

    /**
     * Sets add_time
     *
     * @param \DateTime|null $add_time The insertion into the database time of the mail message
     *
     * @return self
     */
    public function setAddTime($add_time): self
    {
        $this->container['add_time'] = $add_time;

        return $this;
    }

    /**
     * Gets update_time
     *
     * @return \DateTime|null
     */
    public function getUpdateTime()
    {
        return $this->container['update_time'];
    }

    /**
     * Sets update_time
     *
     * @param \DateTime|null $update_time The updating time in the database of the mail message
     *
     * @return self
     */
    public function setUpdateTime($update_time): self
    {
        $this->container['update_time'] = $update_time;

        return $this;
    }

    /**
     * Gets has_attachments_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getHasAttachmentsFlag()
    {
        return $this->container['has_attachments_flag'];
    }

    /**
     * Sets has_attachments_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_attachments_flag Whether the mail message has an attachment or not
     *
     * @return self
     */
    public function setHasAttachmentsFlag($has_attachments_flag): self
    {
        $this->container['has_attachments_flag'] = $has_attachments_flag;

        return $this;
    }

    /**
     * Gets has_inline_attachments_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getHasInlineAttachmentsFlag()
    {
        return $this->container['has_inline_attachments_flag'];
    }

    /**
     * Sets has_inline_attachments_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_inline_attachments_flag Whether the mail message has an inline attachment or not
     *
     * @return self
     */
    public function setHasInlineAttachmentsFlag($has_inline_attachments_flag): self
    {
        $this->container['has_inline_attachments_flag'] = $has_inline_attachments_flag;

        return $this;
    }

    /**
     * Gets has_real_attachments_flag
     *
     * @return \Pipedrive\Model\NumberBooleanDefault0|null
     */
    public function getHasRealAttachmentsFlag()
    {
        return $this->container['has_real_attachments_flag'];
    }

    /**
     * Sets has_real_attachments_flag
     *
     * @param \Pipedrive\Model\NumberBooleanDefault0|null $has_real_attachments_flag Whether the mail message has an attachment (which is not inline) or not
     *
     * @return self
     */
    public function setHasRealAttachmentsFlag($has_real_attachments_flag): self
    {
        $this->container['has_real_attachments_flag'] = $has_real_attachments_flag;

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

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

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

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

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    public function jsonSerialize(): mixed
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @throws JsonException
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @throws JsonException
     * @return string
     */
    public function toHeaderValue(): string
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this), JSON_THROW_ON_ERROR);
    }
}


