<?php

/**
 * Legal Entity Management API
 *
 * The version of the OpenAPI document: 4
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.1
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


namespace Adyen\Model\LegalEntityManagement;

use ArrayAccess;
use Adyen\Model\LegalEntityManagement\ObjectSerializer;

/**
 * Organization Class Doc Comment
 *
 * @package  Adyen
 * @implements ArrayAccess<string, mixed>
 */
class Organization implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'countryOfGoverningLaw' => 'string',
        'dateOfIncorporation' => 'string',
        'dateOfInitiationOfLegalProceeding' => 'string',
        'description' => 'string',
        'doingBusinessAs' => 'string',
        'doingBusinessAsAbsent' => 'bool',
        'economicSector' => 'string',
        'email' => 'string',
        'financialReports' => '\Adyen\Model\LegalEntityManagement\FinancialReport[]',
        'globalLegalEntityIdentifier' => 'string',
        'headOfficeIndicator' => 'bool',
        'institutionalSector' => 'string',
        'legalForm' => 'string',
        'legalName' => 'string',
        'phone' => '\Adyen\Model\LegalEntityManagement\PhoneNumber',
        'principalPlaceOfBusiness' => '\Adyen\Model\LegalEntityManagement\Address',
        'registeredAddress' => '\Adyen\Model\LegalEntityManagement\Address',
        'registrationNumber' => 'string',
        'registrationNumberAbsent' => 'bool',
        'statusOfLegalProceeding' => 'string',
        'stockData' => '\Adyen\Model\LegalEntityManagement\StockData',
        'support' => '\Adyen\Model\LegalEntityManagement\Support',
        'taxInformation' => '\Adyen\Model\LegalEntityManagement\TaxInformation[]',
        'taxReportingClassification' => '\Adyen\Model\LegalEntityManagement\TaxReportingClassification',
        'type' => 'string',
        'vatAbsenceReason' => 'string',
        'vatNumber' => 'string',
        'webData' => '\Adyen\Model\LegalEntityManagement\WebData'
    ];

    /**
      * 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 = [
        'countryOfGoverningLaw' => null,
        'dateOfIncorporation' => null,
        'dateOfInitiationOfLegalProceeding' => null,
        'description' => null,
        'doingBusinessAs' => null,
        'doingBusinessAsAbsent' => null,
        'economicSector' => null,
        'email' => null,
        'financialReports' => null,
        'globalLegalEntityIdentifier' => null,
        'headOfficeIndicator' => null,
        'institutionalSector' => null,
        'legalForm' => null,
        'legalName' => null,
        'phone' => null,
        'principalPlaceOfBusiness' => null,
        'registeredAddress' => null,
        'registrationNumber' => null,
        'registrationNumberAbsent' => null,
        'statusOfLegalProceeding' => null,
        'stockData' => null,
        'support' => null,
        'taxInformation' => null,
        'taxReportingClassification' => null,
        'type' => null,
        'vatAbsenceReason' => null,
        'vatNumber' => null,
        'webData' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static $openAPINullables = [
        'countryOfGoverningLaw' => false,
        'dateOfIncorporation' => false,
        'dateOfInitiationOfLegalProceeding' => false,
        'description' => false,
        'doingBusinessAs' => false,
        'doingBusinessAsAbsent' => true,
        'economicSector' => false,
        'email' => false,
        'financialReports' => false,
        'globalLegalEntityIdentifier' => false,
        'headOfficeIndicator' => false,
        'institutionalSector' => false,
        'legalForm' => false,
        'legalName' => false,
        'phone' => false,
        'principalPlaceOfBusiness' => false,
        'registeredAddress' => false,
        'registrationNumber' => false,
        'registrationNumberAbsent' => true,
        'statusOfLegalProceeding' => false,
        'stockData' => false,
        'support' => false,
        'taxInformation' => false,
        'taxReportingClassification' => false,
        'type' => false,
        'vatAbsenceReason' => false,
        'vatNumber' => false,
        'webData' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected $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 = [
        'countryOfGoverningLaw' => 'countryOfGoverningLaw',
        'dateOfIncorporation' => 'dateOfIncorporation',
        'dateOfInitiationOfLegalProceeding' => 'dateOfInitiationOfLegalProceeding',
        'description' => 'description',
        'doingBusinessAs' => 'doingBusinessAs',
        'doingBusinessAsAbsent' => 'doingBusinessAsAbsent',
        'economicSector' => 'economicSector',
        'email' => 'email',
        'financialReports' => 'financialReports',
        'globalLegalEntityIdentifier' => 'globalLegalEntityIdentifier',
        'headOfficeIndicator' => 'headOfficeIndicator',
        'institutionalSector' => 'institutionalSector',
        'legalForm' => 'legalForm',
        'legalName' => 'legalName',
        'phone' => 'phone',
        'principalPlaceOfBusiness' => 'principalPlaceOfBusiness',
        'registeredAddress' => 'registeredAddress',
        'registrationNumber' => 'registrationNumber',
        'registrationNumberAbsent' => 'registrationNumberAbsent',
        'statusOfLegalProceeding' => 'statusOfLegalProceeding',
        'stockData' => 'stockData',
        'support' => 'support',
        'taxInformation' => 'taxInformation',
        'taxReportingClassification' => 'taxReportingClassification',
        'type' => 'type',
        'vatAbsenceReason' => 'vatAbsenceReason',
        'vatNumber' => 'vatNumber',
        'webData' => 'webData'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'countryOfGoverningLaw' => 'setCountryOfGoverningLaw',
        'dateOfIncorporation' => 'setDateOfIncorporation',
        'dateOfInitiationOfLegalProceeding' => 'setDateOfInitiationOfLegalProceeding',
        'description' => 'setDescription',
        'doingBusinessAs' => 'setDoingBusinessAs',
        'doingBusinessAsAbsent' => 'setDoingBusinessAsAbsent',
        'economicSector' => 'setEconomicSector',
        'email' => 'setEmail',
        'financialReports' => 'setFinancialReports',
        'globalLegalEntityIdentifier' => 'setGlobalLegalEntityIdentifier',
        'headOfficeIndicator' => 'setHeadOfficeIndicator',
        'institutionalSector' => 'setInstitutionalSector',
        'legalForm' => 'setLegalForm',
        'legalName' => 'setLegalName',
        'phone' => 'setPhone',
        'principalPlaceOfBusiness' => 'setPrincipalPlaceOfBusiness',
        'registeredAddress' => 'setRegisteredAddress',
        'registrationNumber' => 'setRegistrationNumber',
        'registrationNumberAbsent' => 'setRegistrationNumberAbsent',
        'statusOfLegalProceeding' => 'setStatusOfLegalProceeding',
        'stockData' => 'setStockData',
        'support' => 'setSupport',
        'taxInformation' => 'setTaxInformation',
        'taxReportingClassification' => 'setTaxReportingClassification',
        'type' => 'setType',
        'vatAbsenceReason' => 'setVatAbsenceReason',
        'vatNumber' => 'setVatNumber',
        'webData' => 'setWebData'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'countryOfGoverningLaw' => 'getCountryOfGoverningLaw',
        'dateOfIncorporation' => 'getDateOfIncorporation',
        'dateOfInitiationOfLegalProceeding' => 'getDateOfInitiationOfLegalProceeding',
        'description' => 'getDescription',
        'doingBusinessAs' => 'getDoingBusinessAs',
        'doingBusinessAsAbsent' => 'getDoingBusinessAsAbsent',
        'economicSector' => 'getEconomicSector',
        'email' => 'getEmail',
        'financialReports' => 'getFinancialReports',
        'globalLegalEntityIdentifier' => 'getGlobalLegalEntityIdentifier',
        'headOfficeIndicator' => 'getHeadOfficeIndicator',
        'institutionalSector' => 'getInstitutionalSector',
        'legalForm' => 'getLegalForm',
        'legalName' => 'getLegalName',
        'phone' => 'getPhone',
        'principalPlaceOfBusiness' => 'getPrincipalPlaceOfBusiness',
        'registeredAddress' => 'getRegisteredAddress',
        'registrationNumber' => 'getRegistrationNumber',
        'registrationNumberAbsent' => 'getRegistrationNumberAbsent',
        'statusOfLegalProceeding' => 'getStatusOfLegalProceeding',
        'stockData' => 'getStockData',
        'support' => 'getSupport',
        'taxInformation' => 'getTaxInformation',
        'taxReportingClassification' => 'getTaxReportingClassification',
        'type' => 'getType',
        'vatAbsenceReason' => 'getVatAbsenceReason',
        'vatNumber' => 'getVatNumber',
        'webData' => 'getWebData'
    ];

    /**
     * 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 INSTITUTIONAL_SECTOR_NON_FINANCIAL_CORPORATION = 'nonFinancialCorporation';
    public const INSTITUTIONAL_SECTOR_CENTRAL_BANK = 'centralBank';
    public const INSTITUTIONAL_SECTOR_CREDIT_INSTITUTIONS = 'creditInstitutions';
    public const INSTITUTIONAL_SECTOR_DEPOSIT_TAKING_CORPORATIONS = 'depositTakingCorporations';
    public const INSTITUTIONAL_SECTOR_MONEY_MARKET_FUNDS = 'moneyMarketFunds';
    public const INSTITUTIONAL_SECTOR_NON_MMF_INVESTMENT_FUNDS = 'nonMMFInvestmentFunds';
    public const INSTITUTIONAL_SECTOR_FINANCIAL_VEHICLE_CORPORATION = 'financialVehicleCorporation';
    public const INSTITUTIONAL_SECTOR_OTHER_FINANCIAL_INTERMEDIARIES = 'otherFinancialIntermediaries';
    public const INSTITUTIONAL_SECTOR_FINANCIAL_AUXILIARIES = 'financialAuxiliaries';
    public const INSTITUTIONAL_SECTOR_CAPTIVE_FINANCIAL_INSTITUTIONS_AND_MONEY_LENDERS = 'captiveFinancialInstitutionsAndMoneyLenders';
    public const INSTITUTIONAL_SECTOR_INSURANCE_CORPORATIONS = 'insuranceCorporations';
    public const INSTITUTIONAL_SECTOR_PENSION_FUNDS = 'pensionFunds';
    public const INSTITUTIONAL_SECTOR_CENTRAL_GOVERNMENT = 'centralGovernment';
    public const INSTITUTIONAL_SECTOR_STATE_GOVERNMENT = 'stateGovernment';
    public const INSTITUTIONAL_SECTOR_LOCAL_GOVERNMENT = 'localGovernment';
    public const INSTITUTIONAL_SECTOR_SOCIAL_SECURITY_FUNDS = 'socialSecurityFunds';
    public const INSTITUTIONAL_SECTOR_NON_PROFIT_INSTITUTIONS_SERVING_HOUSEHOLDS = 'nonProfitInstitutionsServingHouseholds';
    public const STATUS_OF_LEGAL_PROCEEDING_NO_LEGAL_ACTIONS_TAKEN = 'noLegalActionsTaken';
    public const STATUS_OF_LEGAL_PROCEEDING_UNDER_JUDICIAL_ADMINISTRATION = 'underJudicialAdministration';
    public const STATUS_OF_LEGAL_PROCEEDING_BANKRUPTCY_INSOLVENCY = 'bankruptcyInsolvency';
    public const STATUS_OF_LEGAL_PROCEEDING_OTHER_LEGAL_MEASURES = 'otherLegalMeasures';
    public const TYPE_ASSOCIATION_INCORPORATED = 'associationIncorporated';
    public const TYPE_GOVERNMENTAL_ORGANIZATION = 'governmentalOrganization';
    public const TYPE_LISTED_PUBLIC_COMPANY = 'listedPublicCompany';
    public const TYPE_NON_PROFIT = 'nonProfit';
    public const TYPE_PARTNERSHIP_INCORPORATED = 'partnershipIncorporated';
    public const TYPE_PRIVATE_COMPANY = 'privateCompany';
    public const VAT_ABSENCE_REASON_INDUSTRY_EXEMPTION = 'industryExemption';
    public const VAT_ABSENCE_REASON_BELOW_TAX_THRESHOLD = 'belowTaxThreshold';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getInstitutionalSectorAllowableValues()
    {
        return [
            self::INSTITUTIONAL_SECTOR_NON_FINANCIAL_CORPORATION,
            self::INSTITUTIONAL_SECTOR_CENTRAL_BANK,
            self::INSTITUTIONAL_SECTOR_CREDIT_INSTITUTIONS,
            self::INSTITUTIONAL_SECTOR_DEPOSIT_TAKING_CORPORATIONS,
            self::INSTITUTIONAL_SECTOR_MONEY_MARKET_FUNDS,
            self::INSTITUTIONAL_SECTOR_NON_MMF_INVESTMENT_FUNDS,
            self::INSTITUTIONAL_SECTOR_FINANCIAL_VEHICLE_CORPORATION,
            self::INSTITUTIONAL_SECTOR_OTHER_FINANCIAL_INTERMEDIARIES,
            self::INSTITUTIONAL_SECTOR_FINANCIAL_AUXILIARIES,
            self::INSTITUTIONAL_SECTOR_CAPTIVE_FINANCIAL_INSTITUTIONS_AND_MONEY_LENDERS,
            self::INSTITUTIONAL_SECTOR_INSURANCE_CORPORATIONS,
            self::INSTITUTIONAL_SECTOR_PENSION_FUNDS,
            self::INSTITUTIONAL_SECTOR_CENTRAL_GOVERNMENT,
            self::INSTITUTIONAL_SECTOR_STATE_GOVERNMENT,
            self::INSTITUTIONAL_SECTOR_LOCAL_GOVERNMENT,
            self::INSTITUTIONAL_SECTOR_SOCIAL_SECURITY_FUNDS,
            self::INSTITUTIONAL_SECTOR_NON_PROFIT_INSTITUTIONS_SERVING_HOUSEHOLDS,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getStatusOfLegalProceedingAllowableValues()
    {
        return [
            self::STATUS_OF_LEGAL_PROCEEDING_NO_LEGAL_ACTIONS_TAKEN,
            self::STATUS_OF_LEGAL_PROCEEDING_UNDER_JUDICIAL_ADMINISTRATION,
            self::STATUS_OF_LEGAL_PROCEEDING_BANKRUPTCY_INSOLVENCY,
            self::STATUS_OF_LEGAL_PROCEEDING_OTHER_LEGAL_MEASURES,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getTypeAllowableValues()
    {
        return [
            self::TYPE_ASSOCIATION_INCORPORATED,
            self::TYPE_GOVERNMENTAL_ORGANIZATION,
            self::TYPE_LISTED_PUBLIC_COMPANY,
            self::TYPE_NON_PROFIT,
            self::TYPE_PARTNERSHIP_INCORPORATED,
            self::TYPE_PRIVATE_COMPANY,
        ];
    }
    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getVatAbsenceReasonAllowableValues()
    {
        return [
            self::VAT_ABSENCE_REASON_INDUSTRY_EXEMPTION,
            self::VAT_ABSENCE_REASON_BELOW_TAX_THRESHOLD,
        ];
    }
    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(?array $data = null)
    {
        $this->setIfExists('countryOfGoverningLaw', $data ?? [], null);
        $this->setIfExists('dateOfIncorporation', $data ?? [], null);
        $this->setIfExists('dateOfInitiationOfLegalProceeding', $data ?? [], null);
        $this->setIfExists('description', $data ?? [], null);
        $this->setIfExists('doingBusinessAs', $data ?? [], null);
        $this->setIfExists('doingBusinessAsAbsent', $data ?? [], null);
        $this->setIfExists('economicSector', $data ?? [], null);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('financialReports', $data ?? [], null);
        $this->setIfExists('globalLegalEntityIdentifier', $data ?? [], null);
        $this->setIfExists('headOfficeIndicator', $data ?? [], null);
        $this->setIfExists('institutionalSector', $data ?? [], null);
        $this->setIfExists('legalForm', $data ?? [], null);
        $this->setIfExists('legalName', $data ?? [], null);
        $this->setIfExists('phone', $data ?? [], null);
        $this->setIfExists('principalPlaceOfBusiness', $data ?? [], null);
        $this->setIfExists('registeredAddress', $data ?? [], null);
        $this->setIfExists('registrationNumber', $data ?? [], null);
        $this->setIfExists('registrationNumberAbsent', $data ?? [], null);
        $this->setIfExists('statusOfLegalProceeding', $data ?? [], null);
        $this->setIfExists('stockData', $data ?? [], null);
        $this->setIfExists('support', $data ?? [], null);
        $this->setIfExists('taxInformation', $data ?? [], null);
        $this->setIfExists('taxReportingClassification', $data ?? [], null);
        $this->setIfExists('type', $data ?? [], null);
        $this->setIfExists('vatAbsenceReason', $data ?? [], null);
        $this->setIfExists('vatNumber', $data ?? [], null);
        $this->setIfExists('webData', $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 = [];

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

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

        $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->getVatAbsenceReasonAllowableValues();
        if (!is_null($this->container['vatAbsenceReason']) && !in_array($this->container['vatAbsenceReason'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'vatAbsenceReason', must be one of '%s'",
                $this->container['vatAbsenceReason'],
                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 countryOfGoverningLaw
     *
     * @return string|null
     */
    public function getCountryOfGoverningLaw()
    {
        return $this->container['countryOfGoverningLaw'];
    }

    /**
     * Sets countryOfGoverningLaw
     *
     * @param string|null $countryOfGoverningLaw The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the governing country.
     *
     * @return self
     */
    public function setCountryOfGoverningLaw($countryOfGoverningLaw)
    {
        $this->container['countryOfGoverningLaw'] = $countryOfGoverningLaw;

        return $this;
    }

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

    /**
     * Sets dateOfIncorporation
     *
     * @param string|null $dateOfIncorporation The date when the organization was incorporated in YYYY-MM-DD format.
     *
     * @return self
     */
    public function setDateOfIncorporation($dateOfIncorporation)
    {
        $this->container['dateOfIncorporation'] = $dateOfIncorporation;

        return $this;
    }

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

    /**
     * Sets dateOfInitiationOfLegalProceeding
     *
     * @param string|null $dateOfInitiationOfLegalProceeding Required if the value of `statusOfLegalProceeding` is one of the following:  **underJudicialAdministration**, **bankruptcyInsolvency**, **otherLegalMeasures**  The date at which a legal proceeding was initiated, in **YYYY-MM-DD** format. Example: **2000-02-12**
     *
     * @return self
     */
    public function setDateOfInitiationOfLegalProceeding($dateOfInitiationOfLegalProceeding)
    {
        $this->container['dateOfInitiationOfLegalProceeding'] = $dateOfInitiationOfLegalProceeding;

        return $this;
    }

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

    /**
     * Sets description
     *
     * @param string|null $description Your description for the organization.
     *
     * @return self
     */
    public function setDescription($description)
    {
        $this->container['description'] = $description;

        return $this;
    }

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

    /**
     * Sets doingBusinessAs
     *
     * @param string|null $doingBusinessAs The organization's trading name, if different from the registered legal name.
     *
     * @return self
     */
    public function setDoingBusinessAs($doingBusinessAs)
    {
        $this->container['doingBusinessAs'] = $doingBusinessAs;

        return $this;
    }

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

    /**
     * Sets doingBusinessAsAbsent
     *
     * @param bool|null $doingBusinessAsAbsent Set this to **true** if the organization or legal arrangement does not have a `Doing business as` name.
     *
     * @return self
     */
    public function setDoingBusinessAsAbsent($doingBusinessAsAbsent)
    {
        if (is_null($doingBusinessAsAbsent)) {
            array_push($this->openAPINullablesSetToNull, 'doingBusinessAsAbsent');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('doingBusinessAsAbsent', $nullablesSetToNull);
            if ($index !== false) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['doingBusinessAsAbsent'] = $doingBusinessAsAbsent;

        return $this;
    }

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

    /**
     * Sets economicSector
     *
     * @param string|null $economicSector The sector of the economy the legal entity operates within, represented by a 2-4 digit code that may include a \".\". Example: 45.11  You can locate economic sector codes for your area by referencing codes defined by the NACE (Nomenclature of Economic Activities) used in the European Union.
     *
     * @return self
     */
    public function setEconomicSector($economicSector)
    {
        $this->container['economicSector'] = $economicSector;

        return $this;
    }

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

    /**
     * Sets email
     *
     * @param string|null $email The email address of the legal entity.
     *
     * @return self
     */
    public function setEmail($email)
    {
        $this->container['email'] = $email;

        return $this;
    }

    /**
     * Gets financialReports
     *
     * @return \Adyen\Model\LegalEntityManagement\FinancialReport[]|null
     */
    public function getFinancialReports()
    {
        return $this->container['financialReports'];
    }

    /**
     * Sets financialReports
     *
     * @param \Adyen\Model\LegalEntityManagement\FinancialReport[]|null $financialReports The financial report information of the organization.
     *
     * @return self
     */
    public function setFinancialReports($financialReports)
    {
        $this->container['financialReports'] = $financialReports;

        return $this;
    }

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

    /**
     * Sets globalLegalEntityIdentifier
     *
     * @param string|null $globalLegalEntityIdentifier The global legal entity identifier for the organization.  This field is not required if the `registrationNumber` for the organization has been provided.
     *
     * @return self
     */
    public function setGlobalLegalEntityIdentifier($globalLegalEntityIdentifier)
    {
        $this->container['globalLegalEntityIdentifier'] = $globalLegalEntityIdentifier;

        return $this;
    }

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

    /**
     * Sets headOfficeIndicator
     *
     * @param bool|null $headOfficeIndicator Indicates that the registered business address is also the company's headquarters.
     *
     * @return self
     */
    public function setHeadOfficeIndicator($headOfficeIndicator)
    {
        $this->container['headOfficeIndicator'] = $headOfficeIndicator;

        return $this;
    }

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

    /**
     * Sets institutionalSector
     *
     * @param string|null $institutionalSector The institutional sector the organization operates within.
     *
     * @return self
     */
    public function setInstitutionalSector($institutionalSector)
    {
        $allowedValues = $this->getInstitutionalSectorAllowableValues();
        if (!in_array($institutionalSector, $allowedValues, true)) {
            error_log(
                sprintf(
                    "institutionalSector: unexpected enum value '%s' - Supported values are [%s]",
                    $institutionalSector,
                    implode(', ', $allowedValues)
                )
            );
        }
        $this->container['institutionalSector'] = $institutionalSector;

        return $this;
    }

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

    /**
     * Sets legalForm
     *
     * @param string|null $legalForm The type of business entity as defined in the national legal system. Use a legal form listed within the accepted legal forms compiled by the Central Bank of Europe.
     *
     * @return self
     */
    public function setLegalForm($legalForm)
    {
        $this->container['legalForm'] = $legalForm;

        return $this;
    }

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

    /**
     * Sets legalName
     *
     * @param string $legalName The organization's legal name.
     *
     * @return self
     */
    public function setLegalName($legalName)
    {
        $this->container['legalName'] = $legalName;

        return $this;
    }

    /**
     * Gets phone
     *
     * @return \Adyen\Model\LegalEntityManagement\PhoneNumber|null
     */
    public function getPhone()
    {
        return $this->container['phone'];
    }

    /**
     * Sets phone
     *
     * @param \Adyen\Model\LegalEntityManagement\PhoneNumber|null $phone phone
     *
     * @return self
     */
    public function setPhone($phone)
    {
        $this->container['phone'] = $phone;

        return $this;
    }

    /**
     * Gets principalPlaceOfBusiness
     *
     * @return \Adyen\Model\LegalEntityManagement\Address|null
     */
    public function getPrincipalPlaceOfBusiness()
    {
        return $this->container['principalPlaceOfBusiness'];
    }

    /**
     * Sets principalPlaceOfBusiness
     *
     * @param \Adyen\Model\LegalEntityManagement\Address|null $principalPlaceOfBusiness principalPlaceOfBusiness
     *
     * @return self
     */
    public function setPrincipalPlaceOfBusiness($principalPlaceOfBusiness)
    {
        $this->container['principalPlaceOfBusiness'] = $principalPlaceOfBusiness;

        return $this;
    }

    /**
     * Gets registeredAddress
     *
     * @return \Adyen\Model\LegalEntityManagement\Address
     */
    public function getRegisteredAddress()
    {
        return $this->container['registeredAddress'];
    }

    /**
     * Sets registeredAddress
     *
     * @param \Adyen\Model\LegalEntityManagement\Address $registeredAddress registeredAddress
     *
     * @return self
     */
    public function setRegisteredAddress($registeredAddress)
    {
        $this->container['registeredAddress'] = $registeredAddress;

        return $this;
    }

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

    /**
     * Sets registrationNumber
     *
     * @param string|null $registrationNumber The organization's registration number.
     *
     * @return self
     */
    public function setRegistrationNumber($registrationNumber)
    {
        $this->container['registrationNumber'] = $registrationNumber;

        return $this;
    }

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

    /**
     * Sets registrationNumberAbsent
     *
     * @param bool|null $registrationNumberAbsent Set this to **true** if the organization does not have a registration number available. Only applicable for organizations in New Zealand, and incorporated partnerships and government organizations in Australia.
     *
     * @return self
     */
    public function setRegistrationNumberAbsent($registrationNumberAbsent)
    {
        if (is_null($registrationNumberAbsent)) {
            array_push($this->openAPINullablesSetToNull, 'registrationNumberAbsent');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('registrationNumberAbsent', $nullablesSetToNull);
            if ($index !== false) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['registrationNumberAbsent'] = $registrationNumberAbsent;

        return $this;
    }

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

    /**
     * Sets statusOfLegalProceeding
     *
     * @param string|null $statusOfLegalProceeding The status of any current or past legal action taken against the legal entity.  Possible values: **noLegalActionsTaken**, **underJudicialAdministration**, **bankruptcyInsolvency**, **otherLegalMeasures**  If the value of this field is **noLegalActionsTaken**, then `dateOfInitiationOfLegalProceeding` is not required. Otherwise, it is required.
     *
     * @return self
     */
    public function setStatusOfLegalProceeding($statusOfLegalProceeding)
    {
        $allowedValues = $this->getStatusOfLegalProceedingAllowableValues();
        if (!in_array($statusOfLegalProceeding, $allowedValues, true)) {
            error_log(
                sprintf(
                    "statusOfLegalProceeding: unexpected enum value '%s' - Supported values are [%s]",
                    $statusOfLegalProceeding,
                    implode(', ', $allowedValues)
                )
            );
        }
        $this->container['statusOfLegalProceeding'] = $statusOfLegalProceeding;

        return $this;
    }

    /**
     * Gets stockData
     *
     * @return \Adyen\Model\LegalEntityManagement\StockData|null
     */
    public function getStockData()
    {
        return $this->container['stockData'];
    }

    /**
     * Sets stockData
     *
     * @param \Adyen\Model\LegalEntityManagement\StockData|null $stockData stockData
     *
     * @return self
     */
    public function setStockData($stockData)
    {
        $this->container['stockData'] = $stockData;

        return $this;
    }

    /**
     * Gets support
     *
     * @return \Adyen\Model\LegalEntityManagement\Support|null
     */
    public function getSupport()
    {
        return $this->container['support'];
    }

    /**
     * Sets support
     *
     * @param \Adyen\Model\LegalEntityManagement\Support|null $support support
     *
     * @return self
     */
    public function setSupport($support)
    {
        $this->container['support'] = $support;

        return $this;
    }

    /**
     * Gets taxInformation
     *
     * @return \Adyen\Model\LegalEntityManagement\TaxInformation[]|null
     */
    public function getTaxInformation()
    {
        return $this->container['taxInformation'];
    }

    /**
     * Sets taxInformation
     *
     * @param \Adyen\Model\LegalEntityManagement\TaxInformation[]|null $taxInformation The tax information of the organization.
     *
     * @return self
     */
    public function setTaxInformation($taxInformation)
    {
        $this->container['taxInformation'] = $taxInformation;

        return $this;
    }

    /**
     * Gets taxReportingClassification
     *
     * @return \Adyen\Model\LegalEntityManagement\TaxReportingClassification|null
     */
    public function getTaxReportingClassification()
    {
        return $this->container['taxReportingClassification'];
    }

    /**
     * Sets taxReportingClassification
     *
     * @param \Adyen\Model\LegalEntityManagement\TaxReportingClassification|null $taxReportingClassification taxReportingClassification
     *
     * @return self
     */
    public function setTaxReportingClassification($taxReportingClassification)
    {
        $this->container['taxReportingClassification'] = $taxReportingClassification;

        return $this;
    }

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

    /**
     * Sets type
     *
     * @param string|null $type Type of organization.  Possible values: **associationIncorporated**, **governmentalOrganization**, **listedPublicCompany**, **nonProfit**, **partnershipIncorporated**, **privateCompany**.
     *
     * @return self
     */
    public function setType($type)
    {
        $allowedValues = $this->getTypeAllowableValues();
        if (!in_array($type, $allowedValues, true)) {
            error_log(
                sprintf(
                    "type: unexpected enum value '%s' - Supported values are [%s]",
                    $type,
                    implode(', ', $allowedValues)
                )
            );
        }
        $this->container['type'] = $type;

        return $this;
    }

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

    /**
     * Sets vatAbsenceReason
     *
     * @param string|null $vatAbsenceReason The reason the organization has not provided a VAT number.  Possible values: **industryExemption**, **belowTaxThreshold**.
     *
     * @return self
     */
    public function setVatAbsenceReason($vatAbsenceReason)
    {
        $allowedValues = $this->getVatAbsenceReasonAllowableValues();
        if (!in_array($vatAbsenceReason, $allowedValues, true)) {
            error_log(
                sprintf(
                    "vatAbsenceReason: unexpected enum value '%s' - Supported values are [%s]",
                    $vatAbsenceReason,
                    implode(', ', $allowedValues)
                )
            );
        }
        $this->container['vatAbsenceReason'] = $vatAbsenceReason;

        return $this;
    }

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

    /**
     * Sets vatNumber
     *
     * @param string|null $vatNumber The organization's VAT number.
     *
     * @return self
     */
    public function setVatNumber($vatNumber)
    {
        $this->container['vatNumber'] = $vatNumber;

        return $this;
    }

    /**
     * Gets webData
     *
     * @return \Adyen\Model\LegalEntityManagement\WebData|null
     */
    public function getWebData()
    {
        return $this->container['webData'];
    }

    /**
     * Sets webData
     *
     * @param \Adyen\Model\LegalEntityManagement\WebData|null $webData webData
     *
     * @return self
     */
    public function setWebData($webData)
    {
        $this->container['webData'] = $webData;

        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|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($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 $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.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
        return ObjectSerializer::sanitizeForSerialization($this);
    }

    public function toArray(): array
    {
        $array = [];
        foreach (self::$openAPITypes as $propertyName => $propertyType) {
            $propertyValue = $this[$propertyName];
            if ($propertyValue !== null) {
                // Check if the property value is an object and has a toArray() method
                if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) {
                    $array[$propertyName] = $propertyValue->toArray();
                // Check if it's type datetime
                } elseif ($propertyValue instanceof \DateTime) {
                    $array[$propertyName] = $propertyValue->format(DATE_ATOM);
                // If it's an array type we should check whether it contains objects and if so call toArray method
                } elseif (is_array($propertyValue)) {
                    $array[$propertyName] = array_map(function ($item) {
                        return $item instanceof ModelInterface ? $item->toArray() : $item;
                    }, $propertyValue);
                } else {
                    // Otherwise, directly assign the property value to the array
                    $array[$propertyName] = $propertyValue;
                }
            }
        }
        return $array;
    }

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