<?php
/**
 * BureauActivity
 *
 * PHP version 8.1
 *
 * @category Class
 * @package  Fortnox
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Fortnox API
 *
 * # Documentation   The Fortnox API is organized around REST. This means that we’ve designed it to have resource-oriented URLs and be as predictable as possible for you as developer.  It also means that we use HTTP status codes when something goes wrong and HTTP verbs understod by many API clients around the web.  We use a modified version of OAuth2 for authentication to offer a secure way for both you and our users to interact.  The API is generally built to support both XML and JSON but in this documentation all the examples will be in JSON.  We encourage you to read all the articles in the [Guides & Good to Know section](https://www.fortnox.se/developer/guides-and-good-to-know/)</a> first, before going forward and learning about the different resources.  This to ensure you get an understanding of some of the shared components of the API such as parameters and error handling.  ## Rate limits  The limit per access-token is 25 requests per 5 seconds. This equals to 300 requests per minute.  [Read more about this here.](https://www.fortnox.se/developer/guides-and-good-to-know/rate-limits-for-fortnox-api/)  ## Query parameters  Use query parameters with the ?-character and separate parameters with the &-character.   **Example:**  GET - https://api.fortnox.se/3/invoices?accountnumberfrom=3000&accountnumberto=4000 Read more about our parameters [here](https://www.fortnox.se/developer/guides-and-good-to-know/parameters/)   Search the documentation using the search field in the top left corner.
 *
 * The version of the OpenAPI document: 
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.19.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 Fortnox\Model;

use \ArrayAccess;
use \Fortnox\ObjectSerializer;

/**
 * BureauActivity Class Doc Comment
 *
 * @category Class
 * @package  Fortnox
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class BureauActivity implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'assignees' => 'string[]',
        'assignment_id' => 'string',
        'bureau_id' => 'int',
        'client_db_id' => 'int',
        'client_id' => 'string',
        'comment' => 'string',
        'date' => '\DateTime',
        'digital_activity_type' => 'string',
        'estimated_time_minutes' => 'int',
        'finished' => 'bool',
        'id' => 'string',
        'meta_data' => 'array<string,string>',
        'related_period_end' => '\DateTime',
        'related_period_start' => '\DateTime',
        'reminder_date' => '\DateTime',
        'status' => 'string',
        'sub_type' => 'string',
        'title' => 'string',
        'type' => 'string',
        'urgency' => 'string',
        'warning_date' => '\DateTime'
    ];

    /**
      * 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 = [
        'assignees' => null,
        'assignment_id' => null,
        'bureau_id' => 'int64',
        'client_db_id' => 'int64',
        'client_id' => null,
        'comment' => null,
        'date' => 'date',
        'digital_activity_type' => null,
        'estimated_time_minutes' => 'int64',
        'finished' => null,
        'id' => null,
        'meta_data' => null,
        'related_period_end' => 'date',
        'related_period_start' => 'date',
        'reminder_date' => 'date',
        'status' => null,
        'sub_type' => null,
        'title' => null,
        'type' => null,
        'urgency' => null,
        'warning_date' => 'date'
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'assignees' => false,
        'assignment_id' => false,
        'bureau_id' => false,
        'client_db_id' => false,
        'client_id' => false,
        'comment' => false,
        'date' => false,
        'digital_activity_type' => false,
        'estimated_time_minutes' => false,
        'finished' => false,
        'id' => false,
        'meta_data' => false,
        'related_period_end' => false,
        'related_period_start' => false,
        'reminder_date' => false,
        'status' => false,
        'sub_type' => false,
        'title' => false,
        'type' => false,
        'urgency' => false,
        'warning_date' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected array $openAPINullablesSetToNull = [];

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

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

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'assignees' => 'assignees',
        'assignment_id' => 'assignmentId',
        'bureau_id' => 'bureauId',
        'client_db_id' => 'clientDbId',
        'client_id' => 'clientId',
        'comment' => 'comment',
        'date' => 'date',
        'digital_activity_type' => 'digitalActivityType',
        'estimated_time_minutes' => 'estimatedTimeMinutes',
        'finished' => 'finished',
        'id' => 'id',
        'meta_data' => 'metaData',
        'related_period_end' => 'relatedPeriodEnd',
        'related_period_start' => 'relatedPeriodStart',
        'reminder_date' => 'reminderDate',
        'status' => 'status',
        'sub_type' => 'subType',
        'title' => 'title',
        'type' => 'type',
        'urgency' => 'urgency',
        'warning_date' => 'warningDate'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'assignees' => 'setAssignees',
        'assignment_id' => 'setAssignmentId',
        'bureau_id' => 'setBureauId',
        'client_db_id' => 'setClientDbId',
        'client_id' => 'setClientId',
        'comment' => 'setComment',
        'date' => 'setDate',
        'digital_activity_type' => 'setDigitalActivityType',
        'estimated_time_minutes' => 'setEstimatedTimeMinutes',
        'finished' => 'setFinished',
        'id' => 'setId',
        'meta_data' => 'setMetaData',
        'related_period_end' => 'setRelatedPeriodEnd',
        'related_period_start' => 'setRelatedPeriodStart',
        'reminder_date' => 'setReminderDate',
        'status' => 'setStatus',
        'sub_type' => 'setSubType',
        'title' => 'setTitle',
        'type' => 'setType',
        'urgency' => 'setUrgency',
        'warning_date' => 'setWarningDate'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'assignees' => 'getAssignees',
        'assignment_id' => 'getAssignmentId',
        'bureau_id' => 'getBureauId',
        'client_db_id' => 'getClientDbId',
        'client_id' => 'getClientId',
        'comment' => 'getComment',
        'date' => 'getDate',
        'digital_activity_type' => 'getDigitalActivityType',
        'estimated_time_minutes' => 'getEstimatedTimeMinutes',
        'finished' => 'getFinished',
        'id' => 'getId',
        'meta_data' => 'getMetaData',
        'related_period_end' => 'getRelatedPeriodEnd',
        'related_period_start' => 'getRelatedPeriodStart',
        'reminder_date' => 'getReminderDate',
        'status' => 'getStatus',
        'sub_type' => 'getSubType',
        'title' => 'getTitle',
        'type' => 'getType',
        'urgency' => 'getUrgency',
        'warning_date' => 'getWarningDate'
    ];

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

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

    public const DIGITAL_ACTIVITY_TYPE_TO_HANDLE = 'TO_HANDLE';
    public const DIGITAL_ACTIVITY_TYPE_SENDER_TO_HANDLE = 'SENDER_TO_HANDLE';
    public const DIGITAL_ACTIVITY_TYPE_PAYMENTS_TO_BOOKKEEP = 'PAYMENTS_TO_BOOKKEEP';
    public const DIGITAL_ACTIVITY_TYPE_INTERPRETING_IN_PROGRESS = 'INTERPRETING_IN_PROGRESS';
    public const DIGITAL_ACTIVITY_TYPE_INCOMING_INVOICE = 'INCOMING_INVOICE';
    public const DIGITAL_ACTIVITY_TYPE_TO_AUTHORIZE = 'TO_AUTHORIZE';
    public const DIGITAL_ACTIVITY_TYPE_TO_BOOKKEEP = 'TO_BOOKKEEP';
    public const DIGITAL_ACTIVITY_TYPE_PAYMENTS_TO_AUTHORIZE = 'PAYMENTS_TO_AUTHORIZE';
    public const DIGITAL_ACTIVITY_TYPE_TO_PAY = 'TO_PAY';
    public const DIGITAL_ACTIVITY_TYPE_INACTIVE_PAYMENT_FILE = 'INACTIVE_PAYMENT_FILE';
    public const DIGITAL_ACTIVITY_TYPE_PAYMENT_PENDING = 'PAYMENT_PENDING';
    public const DIGITAL_ACTIVITY_TYPE_CUSTOMER_INVOICES_TO_BOOKKEEP = 'CUSTOMER_INVOICES_TO_BOOKKEEP';
    public const DIGITAL_ACTIVITY_TYPE_TO_APPLY_FOR = 'TO_APPLY_FOR';
    public const DIGITAL_ACTIVITY_TYPE_REPORTS_TO_ATTEST = 'REPORTS_TO_ATTEST';
    public const DIGITAL_ACTIVITY_TYPE_REPORTS_TO_SEND = 'REPORTS_TO_SEND';
    public const DIGITAL_ACTIVITY_TYPE_INVALID_REPORTS = 'INVALID_REPORTS';
    public const DIGITAL_ACTIVITY_TYPE_PARTIAL_REPORTS = 'PARTIAL_REPORTS';
    public const DIGITAL_ACTIVITY_TYPE_INCOMING_REQUESTS = 'INCOMING_REQUESTS';
    public const STATUS__NEW = 'NEW';
    public const STATUS_MIN = 'MIN';
    public const STATUS_MAR = 'MAR';
    public const STATUS_COM = 'COM';
    public const STATUS_DON = 'DON';
    public const SUB_TYPE_ACC = 'ACC';
    public const SUB_TYPE_DCA = 'DCA';
    public const SUB_TYPE_CAP = 'CAP';
    public const SUB_TYPE_REC = 'REC';
    public const SUB_TYPE_RTC = 'RTC';
    public const SUB_TYPE_DVO = 'DVO';
    public const SUB_TYPE_DDT = 'DDT';
    public const SUB_TYPE_DER = 'DER';
    public const SUB_TYPE_DEP = 'DEP';
    public const SUB_TYPE_DBT = 'DBT';
    public const SUB_TYPE_OAC = 'OAC';
    public const SUB_TYPE_VAT = 'VAT';
    public const SUB_TYPE_EBD = 'EBD';
    public const SUB_TYPE_RVT = 'RVT';
    public const SUB_TYPE_PAV = 'PAV';
    public const SUB_TYPE_SAL = 'SAL';
    public const SUB_TYPE_CIV = 'CIV';
    public const SUB_TYPE_ECI = 'ECI';
    public const SUB_TYPE_MAR = 'MAR';
    public const SUB_TYPE_RAR = 'RAR';
    public const SUB_TYPE_CRE = 'CRE';
    public const SUB_TYPE_TRE = 'TRE';
    public const SUB_TYPE_DCI = 'DCI';
    public const SUB_TYPE_SIV = 'SIV';
    public const SUB_TYPE_SIN = 'SIN';
    public const SUB_TYPE_SIA = 'SIA';
    public const SUB_TYPE_CPP = 'CPP';
    public const SUB_TYPE_PAL = 'PAL';
    public const SUB_TYPE_SIB = 'SIB';
    public const SUB_TYPE_SID = 'SID';
    public const SUB_TYPE_SRG = 'SRG';
    public const SUB_TYPE_SPY = 'SPY';
    public const SUB_TYPE_SRP = 'SRP';
    public const SUB_TYPE_REQ = 'REQ';
    public const SUB_TYPE_OSI = 'OSI';
    public const SUB_TYPE_FBK = 'FBK';
    public const SUB_TYPE_PEC = 'PEC';
    public const SUB_TYPE_OER = 'OER';
    public const SUB_TYPE_AIS = 'AIS';
    public const SUB_TYPE_FSA = 'FSA';
    public const SUB_TYPE_QFA = 'QFA';
    public const SUB_TYPE_PRY = 'PRY';
    public const SUB_TYPE_COR = 'COR';
    public const SUB_TYPE_MFA = 'MFA';
    public const SUB_TYPE_OWN = 'OWN';
    public const SUB_TYPE_OWS = 'OWS';
    public const SUB_TYPE_ANR = 'ANR';
    public const SUB_TYPE_DEC = 'DEC';
    public const SUB_TYPE_SAA = 'SAA';
    public const SUB_TYPE_FAR = 'FAR';
    public const SUB_TYPE_OAR = 'OAR';
    public const SUB_TYPE_INC = 'INC';
    public const SUB_TYPE_EPD = 'EPD';
    public const SUB_TYPE_EPA = 'EPA';
    public const SUB_TYPE_IIT = 'IIT';
    public const SUB_TYPE_PLA = 'PLA';
    public const SUB_TYPE_QID = 'QID';
    public const SUB_TYPE_PIN = 'PIN';
    public const SUB_TYPE_LID = 'LID';
    public const SUB_TYPE_PAR = 'PAR';
    public const SUB_TYPE_CRP = 'CRP';
    public const SUB_TYPE_SPC = 'SPC';
    public const SUB_TYPE_PAY = 'PAY';
    public const SUB_TYPE_AVD = 'AVD';
    public const SUB_TYPE_ADI = 'ADI';
    public const SUB_TYPE_PAT = 'PAT';
    public const SUB_TYPE_ORE = 'ORE';
    public const SUB_TYPE_FRE = 'FRE';
    public const SUB_TYPE_STA = 'STA';
    public const SUB_TYPE_KUS = 'KUS';
    public const SUB_TYPE_KUI = 'KUI';
    public const SUB_TYPE_KUD = 'KUD';
    public const SUB_TYPE_OW1 = 'OW1';
    public const TYPE_ACC = 'ACC';
    public const TYPE_VAT = 'VAT';
    public const TYPE_SAL = 'SAL';
    public const TYPE_CIV = 'CIV';
    public const TYPE_SIV = 'SIV';
    public const TYPE_FBK = 'FBK';
    public const TYPE_ANR = 'ANR';
    public const TYPE_INC = 'INC';
    public const TYPE_PAR = 'PAR';
    public const TYPE_OW1 = 'OW1';
    public const URGENCY_URGENT = 'URGENT';
    public const URGENCY_FUTURE = 'FUTURE';
    public const URGENCY_AVAILABLE = 'AVAILABLE';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getDigitalActivityTypeAllowableValues()
    {
        return [
            self::DIGITAL_ACTIVITY_TYPE_TO_HANDLE,
            self::DIGITAL_ACTIVITY_TYPE_SENDER_TO_HANDLE,
            self::DIGITAL_ACTIVITY_TYPE_PAYMENTS_TO_BOOKKEEP,
            self::DIGITAL_ACTIVITY_TYPE_INTERPRETING_IN_PROGRESS,
            self::DIGITAL_ACTIVITY_TYPE_INCOMING_INVOICE,
            self::DIGITAL_ACTIVITY_TYPE_TO_AUTHORIZE,
            self::DIGITAL_ACTIVITY_TYPE_TO_BOOKKEEP,
            self::DIGITAL_ACTIVITY_TYPE_PAYMENTS_TO_AUTHORIZE,
            self::DIGITAL_ACTIVITY_TYPE_TO_PAY,
            self::DIGITAL_ACTIVITY_TYPE_INACTIVE_PAYMENT_FILE,
            self::DIGITAL_ACTIVITY_TYPE_PAYMENT_PENDING,
            self::DIGITAL_ACTIVITY_TYPE_CUSTOMER_INVOICES_TO_BOOKKEEP,
            self::DIGITAL_ACTIVITY_TYPE_TO_APPLY_FOR,
            self::DIGITAL_ACTIVITY_TYPE_REPORTS_TO_ATTEST,
            self::DIGITAL_ACTIVITY_TYPE_REPORTS_TO_SEND,
            self::DIGITAL_ACTIVITY_TYPE_INVALID_REPORTS,
            self::DIGITAL_ACTIVITY_TYPE_PARTIAL_REPORTS,
            self::DIGITAL_ACTIVITY_TYPE_INCOMING_REQUESTS,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getStatusAllowableValues()
    {
        return [
            self::STATUS__NEW,
            self::STATUS_MIN,
            self::STATUS_MAR,
            self::STATUS_COM,
            self::STATUS_DON,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getSubTypeAllowableValues()
    {
        return [
            self::SUB_TYPE_ACC,
            self::SUB_TYPE_DCA,
            self::SUB_TYPE_CAP,
            self::SUB_TYPE_REC,
            self::SUB_TYPE_RTC,
            self::SUB_TYPE_DVO,
            self::SUB_TYPE_DDT,
            self::SUB_TYPE_DER,
            self::SUB_TYPE_DEP,
            self::SUB_TYPE_DBT,
            self::SUB_TYPE_OAC,
            self::SUB_TYPE_VAT,
            self::SUB_TYPE_EBD,
            self::SUB_TYPE_RVT,
            self::SUB_TYPE_PAV,
            self::SUB_TYPE_SAL,
            self::SUB_TYPE_CIV,
            self::SUB_TYPE_ECI,
            self::SUB_TYPE_MAR,
            self::SUB_TYPE_RAR,
            self::SUB_TYPE_CRE,
            self::SUB_TYPE_TRE,
            self::SUB_TYPE_DCI,
            self::SUB_TYPE_SIV,
            self::SUB_TYPE_SIN,
            self::SUB_TYPE_SIA,
            self::SUB_TYPE_CPP,
            self::SUB_TYPE_PAL,
            self::SUB_TYPE_SIB,
            self::SUB_TYPE_SID,
            self::SUB_TYPE_SRG,
            self::SUB_TYPE_SPY,
            self::SUB_TYPE_SRP,
            self::SUB_TYPE_REQ,
            self::SUB_TYPE_OSI,
            self::SUB_TYPE_FBK,
            self::SUB_TYPE_PEC,
            self::SUB_TYPE_OER,
            self::SUB_TYPE_AIS,
            self::SUB_TYPE_FSA,
            self::SUB_TYPE_QFA,
            self::SUB_TYPE_PRY,
            self::SUB_TYPE_COR,
            self::SUB_TYPE_MFA,
            self::SUB_TYPE_OWN,
            self::SUB_TYPE_OWS,
            self::SUB_TYPE_ANR,
            self::SUB_TYPE_DEC,
            self::SUB_TYPE_SAA,
            self::SUB_TYPE_FAR,
            self::SUB_TYPE_OAR,
            self::SUB_TYPE_INC,
            self::SUB_TYPE_EPD,
            self::SUB_TYPE_EPA,
            self::SUB_TYPE_IIT,
            self::SUB_TYPE_PLA,
            self::SUB_TYPE_QID,
            self::SUB_TYPE_PIN,
            self::SUB_TYPE_LID,
            self::SUB_TYPE_PAR,
            self::SUB_TYPE_CRP,
            self::SUB_TYPE_SPC,
            self::SUB_TYPE_PAY,
            self::SUB_TYPE_AVD,
            self::SUB_TYPE_ADI,
            self::SUB_TYPE_PAT,
            self::SUB_TYPE_ORE,
            self::SUB_TYPE_FRE,
            self::SUB_TYPE_STA,
            self::SUB_TYPE_KUS,
            self::SUB_TYPE_KUI,
            self::SUB_TYPE_KUD,
            self::SUB_TYPE_OW1,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTypeAllowableValues()
    {
        return [
            self::TYPE_ACC,
            self::TYPE_VAT,
            self::TYPE_SAL,
            self::TYPE_CIV,
            self::TYPE_SIV,
            self::TYPE_FBK,
            self::TYPE_ANR,
            self::TYPE_INC,
            self::TYPE_PAR,
            self::TYPE_OW1,
        ];
    }

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getUrgencyAllowableValues()
    {
        return [
            self::URGENCY_URGENT,
            self::URGENCY_FUTURE,
            self::URGENCY_AVAILABLE,
        ];
    }

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

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('assignees', $data ?? [], null);
        $this->setIfExists('assignment_id', $data ?? [], null);
        $this->setIfExists('bureau_id', $data ?? [], null);
        $this->setIfExists('client_db_id', $data ?? [], null);
        $this->setIfExists('client_id', $data ?? [], null);
        $this->setIfExists('comment', $data ?? [], null);
        $this->setIfExists('date', $data ?? [], null);
        $this->setIfExists('digital_activity_type', $data ?? [], null);
        $this->setIfExists('estimated_time_minutes', $data ?? [], null);
        $this->setIfExists('finished', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('meta_data', $data ?? [], null);
        $this->setIfExists('related_period_end', $data ?? [], null);
        $this->setIfExists('related_period_start', $data ?? [], null);
        $this->setIfExists('reminder_date', $data ?? [], null);
        $this->setIfExists('status', $data ?? [], null);
        $this->setIfExists('sub_type', $data ?? [], null);
        $this->setIfExists('title', $data ?? [], null);
        $this->setIfExists('type', $data ?? [], null);
        $this->setIfExists('urgency', $data ?? [], null);
        $this->setIfExists('warning_date', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

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

        if (!is_null($this->container['assignees']) && (count($this->container['assignees']) > 2147483647)) {
            $invalidProperties[] = "invalid value for 'assignees', number of items must be less than or equal to 2147483647.";
        }

        if (!is_null($this->container['assignees']) && (count($this->container['assignees']) < 1)) {
            $invalidProperties[] = "invalid value for 'assignees', number of items must be greater than or equal to 1.";
        }

        if ($this->container['client_id'] === null) {
            $invalidProperties[] = "'client_id' can't be null";
        }
        if (!is_null($this->container['comment']) && (mb_strlen($this->container['comment']) > 1024)) {
            $invalidProperties[] = "invalid value for 'comment', the character length must be smaller than or equal to 1024.";
        }

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

        if (!is_null($this->container['estimated_time_minutes']) && ($this->container['estimated_time_minutes'] > 45000)) {
            $invalidProperties[] = "invalid value for 'estimated_time_minutes', must be smaller than or equal to 45000.";
        }

        if (!is_null($this->container['estimated_time_minutes']) && ($this->container['estimated_time_minutes'] < 0)) {
            $invalidProperties[] = "invalid value for 'estimated_time_minutes', must be bigger than or equal to 0.";
        }

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

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

        if ($this->container['title'] === null) {
            $invalidProperties[] = "'title' can't be null";
        }
        if ((mb_strlen($this->container['title']) > 255)) {
            $invalidProperties[] = "invalid value for 'title', the character length must be smaller than or equal to 255.";
        }

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

        $allowedValues = $this->getUrgencyAllowableValues();
        if (!is_null($this->container['urgency']) && !in_array($this->container['urgency'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'urgency', must be one of '%s'",
                $this->container['urgency'],
                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()
    {
        return count($this->listInvalidProperties()) === 0;
    }


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

    /**
     * Sets assignees
     *
     * @param string[]|null $assignees assignees
     *
     * @return self
     */
    public function setAssignees($assignees)
    {
        if (is_null($assignees)) {
            throw new \InvalidArgumentException('non-nullable assignees cannot be null');
        }

        if ((count($assignees) > 2147483647)) {
            throw new \InvalidArgumentException('invalid value for $assignees when calling BureauActivity., number of items must be less than or equal to 2147483647.');
        }
        if ((count($assignees) < 1)) {
            throw new \InvalidArgumentException('invalid length for $assignees when calling BureauActivity., number of items must be greater than or equal to 1.');
        }
        $this->container['assignees'] = $assignees;

        return $this;
    }

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

    /**
     * Sets assignment_id
     *
     * @param string|null $assignment_id assignment_id
     *
     * @return self
     */
    public function setAssignmentId($assignment_id)
    {
        if (is_null($assignment_id)) {
            throw new \InvalidArgumentException('non-nullable assignment_id cannot be null');
        }
        $this->container['assignment_id'] = $assignment_id;

        return $this;
    }

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

    /**
     * Sets bureau_id
     *
     * @param int|null $bureau_id bureau_id
     *
     * @return self
     */
    public function setBureauId($bureau_id)
    {
        if (is_null($bureau_id)) {
            throw new \InvalidArgumentException('non-nullable bureau_id cannot be null');
        }
        $this->container['bureau_id'] = $bureau_id;

        return $this;
    }

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

    /**
     * Sets client_db_id
     *
     * @param int|null $client_db_id client_db_id
     *
     * @return self
     */
    public function setClientDbId($client_db_id)
    {
        if (is_null($client_db_id)) {
            throw new \InvalidArgumentException('non-nullable client_db_id cannot be null');
        }
        $this->container['client_db_id'] = $client_db_id;

        return $this;
    }

    /**
     * Gets client_id
     *
     * @return string
     */
    public function getClientId()
    {
        return $this->container['client_id'];
    }

    /**
     * Sets client_id
     *
     * @param string $client_id client_id
     *
     * @return self
     */
    public function setClientId($client_id)
    {
        if (is_null($client_id)) {
            throw new \InvalidArgumentException('non-nullable client_id cannot be null');
        }
        $this->container['client_id'] = $client_id;

        return $this;
    }

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

    /**
     * Sets comment
     *
     * @param string|null $comment comment
     *
     * @return self
     */
    public function setComment($comment)
    {
        if (is_null($comment)) {
            throw new \InvalidArgumentException('non-nullable comment cannot be null');
        }
        if ((mb_strlen($comment) > 1024)) {
            throw new \InvalidArgumentException('invalid length for $comment when calling BureauActivity., must be smaller than or equal to 1024.');
        }

        $this->container['comment'] = $comment;

        return $this;
    }

    /**
     * Gets date
     *
     * @return \DateTime
     */
    public function getDate()
    {
        return $this->container['date'];
    }

    /**
     * Sets date
     *
     * @param \DateTime $date date
     *
     * @return self
     */
    public function setDate($date)
    {
        if (is_null($date)) {
            throw new \InvalidArgumentException('non-nullable date cannot be null');
        }
        $this->container['date'] = $date;

        return $this;
    }

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

    /**
     * Sets digital_activity_type
     *
     * @param string|null $digital_activity_type digital_activity_type
     *
     * @return self
     */
    public function setDigitalActivityType($digital_activity_type)
    {
        if (is_null($digital_activity_type)) {
            throw new \InvalidArgumentException('non-nullable digital_activity_type cannot be null');
        }
        $allowedValues = $this->getDigitalActivityTypeAllowableValues();
        if (!in_array($digital_activity_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'digital_activity_type', must be one of '%s'",
                    $digital_activity_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['digital_activity_type'] = $digital_activity_type;

        return $this;
    }

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

    /**
     * Sets estimated_time_minutes
     *
     * @param int|null $estimated_time_minutes estimated_time_minutes
     *
     * @return self
     */
    public function setEstimatedTimeMinutes($estimated_time_minutes)
    {
        if (is_null($estimated_time_minutes)) {
            throw new \InvalidArgumentException('non-nullable estimated_time_minutes cannot be null');
        }

        if (($estimated_time_minutes > 45000)) {
            throw new \InvalidArgumentException('invalid value for $estimated_time_minutes when calling BureauActivity., must be smaller than or equal to 45000.');
        }
        if (($estimated_time_minutes < 0)) {
            throw new \InvalidArgumentException('invalid value for $estimated_time_minutes when calling BureauActivity., must be bigger than or equal to 0.');
        }

        $this->container['estimated_time_minutes'] = $estimated_time_minutes;

        return $this;
    }

    /**
     * Gets finished
     *
     * @return bool
     */
    public function getFinished()
    {
        return $this->container['finished'];
    }

    /**
     * Sets finished
     *
     * @param bool $finished finished
     *
     * @return self
     */
    public function setFinished($finished)
    {
        if (is_null($finished)) {
            throw new \InvalidArgumentException('non-nullable finished cannot be null');
        }
        $this->container['finished'] = $finished;

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id id
     *
     * @return self
     */
    public function setId($id)
    {
        if (is_null($id)) {
            throw new \InvalidArgumentException('non-nullable id cannot be null');
        }
        $this->container['id'] = $id;

        return $this;
    }

    /**
     * Gets meta_data
     *
     * @return array<string,string>|null
     */
    public function getMetaData()
    {
        return $this->container['meta_data'];
    }

    /**
     * Sets meta_data
     *
     * @param array<string,string>|null $meta_data meta_data
     *
     * @return self
     */
    public function setMetaData($meta_data)
    {
        if (is_null($meta_data)) {
            throw new \InvalidArgumentException('non-nullable meta_data cannot be null');
        }
        $this->container['meta_data'] = $meta_data;

        return $this;
    }

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

    /**
     * Sets related_period_end
     *
     * @param \DateTime|null $related_period_end related_period_end
     *
     * @return self
     */
    public function setRelatedPeriodEnd($related_period_end)
    {
        if (is_null($related_period_end)) {
            throw new \InvalidArgumentException('non-nullable related_period_end cannot be null');
        }
        $this->container['related_period_end'] = $related_period_end;

        return $this;
    }

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

    /**
     * Sets related_period_start
     *
     * @param \DateTime|null $related_period_start related_period_start
     *
     * @return self
     */
    public function setRelatedPeriodStart($related_period_start)
    {
        if (is_null($related_period_start)) {
            throw new \InvalidArgumentException('non-nullable related_period_start cannot be null');
        }
        $this->container['related_period_start'] = $related_period_start;

        return $this;
    }

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

    /**
     * Sets reminder_date
     *
     * @param \DateTime|null $reminder_date reminder_date
     *
     * @return self
     */
    public function setReminderDate($reminder_date)
    {
        if (is_null($reminder_date)) {
            throw new \InvalidArgumentException('non-nullable reminder_date cannot be null');
        }
        $this->container['reminder_date'] = $reminder_date;

        return $this;
    }

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

    /**
     * Sets status
     *
     * @param string|null $status status
     *
     * @return self
     */
    public function setStatus($status)
    {
        if (is_null($status)) {
            throw new \InvalidArgumentException('non-nullable status cannot be null');
        }
        $allowedValues = $this->getStatusAllowableValues();
        if (!in_array($status, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'status', must be one of '%s'",
                    $status,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['status'] = $status;

        return $this;
    }

    /**
     * Gets sub_type
     *
     * @return string
     */
    public function getSubType()
    {
        return $this->container['sub_type'];
    }

    /**
     * Sets sub_type
     *
     * @param string $sub_type sub_type
     *
     * @return self
     */
    public function setSubType($sub_type)
    {
        if (is_null($sub_type)) {
            throw new \InvalidArgumentException('non-nullable sub_type cannot be null');
        }
        $allowedValues = $this->getSubTypeAllowableValues();
        if (!in_array($sub_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'sub_type', must be one of '%s'",
                    $sub_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['sub_type'] = $sub_type;

        return $this;
    }

    /**
     * Gets title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->container['title'];
    }

    /**
     * Sets title
     *
     * @param string $title title
     *
     * @return self
     */
    public function setTitle($title)
    {
        if (is_null($title)) {
            throw new \InvalidArgumentException('non-nullable title cannot be null');
        }
        if ((mb_strlen($title) > 255)) {
            throw new \InvalidArgumentException('invalid length for $title when calling BureauActivity., must be smaller than or equal to 255.');
        }

        $this->container['title'] = $title;

        return $this;
    }

    /**
     * Gets type
     *
     * @return string
     */
    public function getType()
    {
        return $this->container['type'];
    }

    /**
     * Sets type
     *
     * @param string $type type
     *
     * @return self
     */
    public function setType($type)
    {
        if (is_null($type)) {
            throw new \InvalidArgumentException('non-nullable type cannot be null');
        }
        $allowedValues = $this->getTypeAllowableValues();
        if (!in_array($type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'type', must be one of '%s'",
                    $type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['type'] = $type;

        return $this;
    }

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

    /**
     * Sets urgency
     *
     * @param string|null $urgency urgency
     *
     * @return self
     */
    public function setUrgency($urgency)
    {
        if (is_null($urgency)) {
            throw new \InvalidArgumentException('non-nullable urgency cannot be null');
        }
        $allowedValues = $this->getUrgencyAllowableValues();
        if (!in_array($urgency, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'urgency', must be one of '%s'",
                    $urgency,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['urgency'] = $urgency;

        return $this;
    }

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

    /**
     * Sets warning_date
     *
     * @param \DateTime|null $warning_date warning_date
     *
     * @return self
     */
    public function setWarningDate($warning_date)
    {
        if (is_null($warning_date)) {
            throw new \InvalidArgumentException('non-nullable warning_date cannot be null');
        }
        $this->container['warning_date'] = $warning_date;

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

    /**
     * Gets offset.
     *
     * @param integer|string $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet(mixed $offset)
    {
        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|string $offset Offset
     *
     * @return void
     */
    public function offsetUnset(mixed $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.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

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

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


