<?php
/**
 * BureauKYCAssignment
 *
 * 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;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'bureau_id' => 'int',
        'client_id' => 'string',
        'company_name' => 'string',
        'date_created' => '\DateTime',
        'date_stopped' => '\DateTime',
        'has_access' => 'bool',
        'has_urgent_pending_actions' => 'bool',
        'id' => 'string',
        'link' => 'string',
        'next_kyc_date' => '\DateTime',
        'private_individual' => 'bool',
        'prospect' => 'bool',
        'risk_level' => 'string',
        'risk_severity' => 'string',
        'status' => 'string'
    ];

    /**
      * 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 = [
        'bureau_id' => 'int64',
        'client_id' => 'uuid',
        'company_name' => null,
        'date_created' => 'date-time',
        'date_stopped' => 'date-time',
        'has_access' => null,
        'has_urgent_pending_actions' => null,
        'id' => 'uuid',
        'link' => null,
        'next_kyc_date' => 'date',
        'private_individual' => null,
        'prospect' => null,
        'risk_level' => null,
        'risk_severity' => null,
        'status' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'bureau_id' => false,
        'client_id' => false,
        'company_name' => false,
        'date_created' => false,
        'date_stopped' => false,
        'has_access' => false,
        'has_urgent_pending_actions' => false,
        'id' => false,
        'link' => false,
        'next_kyc_date' => false,
        'private_individual' => false,
        'prospect' => false,
        'risk_level' => false,
        'risk_severity' => false,
        'status' => 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 = [
        'bureau_id' => 'bureauId',
        'client_id' => 'clientId',
        'company_name' => 'companyName',
        'date_created' => 'dateCreated',
        'date_stopped' => 'dateStopped',
        'has_access' => 'hasAccess',
        'has_urgent_pending_actions' => 'hasUrgentPendingActions',
        'id' => 'id',
        'link' => 'link',
        'next_kyc_date' => 'nextKycDate',
        'private_individual' => 'privateIndividual',
        'prospect' => 'prospect',
        'risk_level' => 'riskLevel',
        'risk_severity' => 'riskSeverity',
        'status' => 'status'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'bureau_id' => 'setBureauId',
        'client_id' => 'setClientId',
        'company_name' => 'setCompanyName',
        'date_created' => 'setDateCreated',
        'date_stopped' => 'setDateStopped',
        'has_access' => 'setHasAccess',
        'has_urgent_pending_actions' => 'setHasUrgentPendingActions',
        'id' => 'setId',
        'link' => 'setLink',
        'next_kyc_date' => 'setNextKycDate',
        'private_individual' => 'setPrivateIndividual',
        'prospect' => 'setProspect',
        'risk_level' => 'setRiskLevel',
        'risk_severity' => 'setRiskSeverity',
        'status' => 'setStatus'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'bureau_id' => 'getBureauId',
        'client_id' => 'getClientId',
        'company_name' => 'getCompanyName',
        'date_created' => 'getDateCreated',
        'date_stopped' => 'getDateStopped',
        'has_access' => 'getHasAccess',
        'has_urgent_pending_actions' => 'getHasUrgentPendingActions',
        'id' => 'getId',
        'link' => 'getLink',
        'next_kyc_date' => 'getNextKycDate',
        'private_individual' => 'getPrivateIndividual',
        'prospect' => 'getProspect',
        'risk_level' => 'getRiskLevel',
        'risk_severity' => 'getRiskSeverity',
        'status' => 'getStatus'
    ];

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


    /**
     * 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('bureau_id', $data ?? [], null);
        $this->setIfExists('client_id', $data ?? [], null);
        $this->setIfExists('company_name', $data ?? [], null);
        $this->setIfExists('date_created', $data ?? [], null);
        $this->setIfExists('date_stopped', $data ?? [], null);
        $this->setIfExists('has_access', $data ?? [], null);
        $this->setIfExists('has_urgent_pending_actions', $data ?? [], null);
        $this->setIfExists('id', $data ?? [], null);
        $this->setIfExists('link', $data ?? [], null);
        $this->setIfExists('next_kyc_date', $data ?? [], null);
        $this->setIfExists('private_individual', $data ?? [], null);
        $this->setIfExists('prospect', $data ?? [], null);
        $this->setIfExists('risk_level', $data ?? [], null);
        $this->setIfExists('risk_severity', $data ?? [], null);
        $this->setIfExists('status', $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 = [];

        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 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_id
     *
     * @return string|null
     */
    public function getClientId()
    {
        return $this->container['client_id'];
    }

    /**
     * Sets client_id
     *
     * @param string|null $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 company_name
     *
     * @return string|null
     */
    public function getCompanyName()
    {
        return $this->container['company_name'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets has_access
     *
     * @return bool|null
     */
    public function getHasAccess()
    {
        return $this->container['has_access'];
    }

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

        return $this;
    }

    /**
     * Gets has_urgent_pending_actions
     *
     * @return bool|null
     */
    public function getHasUrgentPendingActions()
    {
        return $this->container['has_urgent_pending_actions'];
    }

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

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Gets private_individual
     *
     * @return bool|null
     */
    public function getPrivateIndividual()
    {
        return $this->container['private_individual'];
    }

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

        return $this;
    }

    /**
     * Gets prospect
     *
     * @return bool|null
     */
    public function getProspect()
    {
        return $this->container['prospect'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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');
        }
        $this->container['status'] = $status;

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


