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

/**
 * API 2026-01
 *
 * Lightspeed Retail (X-Series) API.
 *
 * The version of the OpenAPI document: 2026-01
 * Contact: x-series.api@lightspeedhq.com
 * Generated by: https://openapi-generator.tech
 * Generator version: 7.20.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 Vend202601\Model;

use \ArrayAccess;
use \Vend202601\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'company_name' => 'string',
        'custom_field_1' => 'string',
        'custom_field_2' => 'string',
        'custom_field_3' => 'string',
        'custom_field_4' => 'string',
        'customer_code' => 'string',
        'customer_group_id' => 'string',
        'date_of_birth' => 'string',
        'do_not_email' => 'bool',
        'email' => 'string',
        'enable_loyalty' => 'bool',
        'enable_promotional_sms' => 'bool',
        'fax' => 'string',
        'first_name' => 'string',
        'gender' => 'string',
        'last_name' => 'string',
        'mobile' => 'string',
        'note' => 'string',
        'on_account_limit' => 'float',
        'phone' => 'string',
        'physical_address_1' => 'string',
        'physical_address_2' => 'string',
        'physical_city' => 'string',
        'physical_country_id' => 'string',
        'physical_postcode' => 'string',
        'physical_state' => 'string',
        'physical_suburb' => 'string',
        'postal_address_1' => 'string',
        'postal_address_2' => 'string',
        'postal_city' => 'string',
        'postal_country_id' => 'string',
        'postal_postcode' => 'string',
        'postal_state' => 'string',
        'postal_suburb' => 'string',
        'tax_id' => 'string',
        'twitter' => 'string',
        'website' => '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 = [
        'company_name' => null,
        'custom_field_1' => null,
        'custom_field_2' => null,
        'custom_field_3' => null,
        'custom_field_4' => null,
        'customer_code' => null,
        'customer_group_id' => null,
        'date_of_birth' => null,
        'do_not_email' => null,
        'email' => null,
        'enable_loyalty' => null,
        'enable_promotional_sms' => null,
        'fax' => null,
        'first_name' => null,
        'gender' => null,
        'last_name' => null,
        'mobile' => null,
        'note' => null,
        'on_account_limit' => 'double',
        'phone' => null,
        'physical_address_1' => null,
        'physical_address_2' => null,
        'physical_city' => null,
        'physical_country_id' => null,
        'physical_postcode' => null,
        'physical_state' => null,
        'physical_suburb' => null,
        'postal_address_1' => null,
        'postal_address_2' => null,
        'postal_city' => null,
        'postal_country_id' => null,
        'postal_postcode' => null,
        'postal_state' => null,
        'postal_suburb' => null,
        'tax_id' => null,
        'twitter' => null,
        'website' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'company_name' => true,
        'custom_field_1' => true,
        'custom_field_2' => true,
        'custom_field_3' => true,
        'custom_field_4' => true,
        'customer_code' => false,
        'customer_group_id' => false,
        'date_of_birth' => false,
        'do_not_email' => false,
        'email' => true,
        'enable_loyalty' => false,
        'enable_promotional_sms' => false,
        'fax' => true,
        'first_name' => true,
        'gender' => true,
        'last_name' => true,
        'mobile' => true,
        'note' => true,
        'on_account_limit' => true,
        'phone' => true,
        'physical_address_1' => true,
        'physical_address_2' => true,
        'physical_city' => true,
        'physical_country_id' => true,
        'physical_postcode' => true,
        'physical_state' => true,
        'physical_suburb' => true,
        'postal_address_1' => true,
        'postal_address_2' => true,
        'postal_city' => true,
        'postal_country_id' => true,
        'postal_postcode' => true,
        'postal_state' => true,
        'postal_suburb' => true,
        'tax_id' => true,
        'twitter' => true,
        'website' => true
    ];

    /**
      * 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 = [
        'company_name' => 'company_name',
        'custom_field_1' => 'custom_field_1',
        'custom_field_2' => 'custom_field_2',
        'custom_field_3' => 'custom_field_3',
        'custom_field_4' => 'custom_field_4',
        'customer_code' => 'customer_code',
        'customer_group_id' => 'customer_group_id',
        'date_of_birth' => 'date_of_birth',
        'do_not_email' => 'do_not_email',
        'email' => 'email',
        'enable_loyalty' => 'enable_loyalty',
        'enable_promotional_sms' => 'enable_promotional_sms',
        'fax' => 'fax',
        'first_name' => 'first_name',
        'gender' => 'gender',
        'last_name' => 'last_name',
        'mobile' => 'mobile',
        'note' => 'note',
        'on_account_limit' => 'on_account_limit',
        'phone' => 'phone',
        'physical_address_1' => 'physical_address_1',
        'physical_address_2' => 'physical_address_2',
        'physical_city' => 'physical_city',
        'physical_country_id' => 'physical_country_id',
        'physical_postcode' => 'physical_postcode',
        'physical_state' => 'physical_state',
        'physical_suburb' => 'physical_suburb',
        'postal_address_1' => 'postal_address_1',
        'postal_address_2' => 'postal_address_2',
        'postal_city' => 'postal_city',
        'postal_country_id' => 'postal_country_id',
        'postal_postcode' => 'postal_postcode',
        'postal_state' => 'postal_state',
        'postal_suburb' => 'postal_suburb',
        'tax_id' => 'tax_id',
        'twitter' => 'twitter',
        'website' => 'website'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'company_name' => 'setCompanyName',
        'custom_field_1' => 'setCustomField1',
        'custom_field_2' => 'setCustomField2',
        'custom_field_3' => 'setCustomField3',
        'custom_field_4' => 'setCustomField4',
        'customer_code' => 'setCustomerCode',
        'customer_group_id' => 'setCustomerGroupId',
        'date_of_birth' => 'setDateOfBirth',
        'do_not_email' => 'setDoNotEmail',
        'email' => 'setEmail',
        'enable_loyalty' => 'setEnableLoyalty',
        'enable_promotional_sms' => 'setEnablePromotionalSms',
        'fax' => 'setFax',
        'first_name' => 'setFirstName',
        'gender' => 'setGender',
        'last_name' => 'setLastName',
        'mobile' => 'setMobile',
        'note' => 'setNote',
        'on_account_limit' => 'setOnAccountLimit',
        'phone' => 'setPhone',
        'physical_address_1' => 'setPhysicalAddress1',
        'physical_address_2' => 'setPhysicalAddress2',
        'physical_city' => 'setPhysicalCity',
        'physical_country_id' => 'setPhysicalCountryId',
        'physical_postcode' => 'setPhysicalPostcode',
        'physical_state' => 'setPhysicalState',
        'physical_suburb' => 'setPhysicalSuburb',
        'postal_address_1' => 'setPostalAddress1',
        'postal_address_2' => 'setPostalAddress2',
        'postal_city' => 'setPostalCity',
        'postal_country_id' => 'setPostalCountryId',
        'postal_postcode' => 'setPostalPostcode',
        'postal_state' => 'setPostalState',
        'postal_suburb' => 'setPostalSuburb',
        'tax_id' => 'setTaxId',
        'twitter' => 'setTwitter',
        'website' => 'setWebsite'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'company_name' => 'getCompanyName',
        'custom_field_1' => 'getCustomField1',
        'custom_field_2' => 'getCustomField2',
        'custom_field_3' => 'getCustomField3',
        'custom_field_4' => 'getCustomField4',
        'customer_code' => 'getCustomerCode',
        'customer_group_id' => 'getCustomerGroupId',
        'date_of_birth' => 'getDateOfBirth',
        'do_not_email' => 'getDoNotEmail',
        'email' => 'getEmail',
        'enable_loyalty' => 'getEnableLoyalty',
        'enable_promotional_sms' => 'getEnablePromotionalSms',
        'fax' => 'getFax',
        'first_name' => 'getFirstName',
        'gender' => 'getGender',
        'last_name' => 'getLastName',
        'mobile' => 'getMobile',
        'note' => 'getNote',
        'on_account_limit' => 'getOnAccountLimit',
        'phone' => 'getPhone',
        'physical_address_1' => 'getPhysicalAddress1',
        'physical_address_2' => 'getPhysicalAddress2',
        'physical_city' => 'getPhysicalCity',
        'physical_country_id' => 'getPhysicalCountryId',
        'physical_postcode' => 'getPhysicalPostcode',
        'physical_state' => 'getPhysicalState',
        'physical_suburb' => 'getPhysicalSuburb',
        'postal_address_1' => 'getPostalAddress1',
        'postal_address_2' => 'getPostalAddress2',
        'postal_city' => 'getPostalCity',
        'postal_country_id' => 'getPostalCountryId',
        'postal_postcode' => 'getPostalPostcode',
        'postal_state' => 'getPostalState',
        'postal_suburb' => 'getPostalSuburb',
        'tax_id' => 'getTaxId',
        'twitter' => 'getTwitter',
        'website' => 'getWebsite'
    ];

    /**
     * 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('company_name', $data ?? [], null);
        $this->setIfExists('custom_field_1', $data ?? [], null);
        $this->setIfExists('custom_field_2', $data ?? [], null);
        $this->setIfExists('custom_field_3', $data ?? [], null);
        $this->setIfExists('custom_field_4', $data ?? [], null);
        $this->setIfExists('customer_code', $data ?? [], null);
        $this->setIfExists('customer_group_id', $data ?? [], null);
        $this->setIfExists('date_of_birth', $data ?? [], null);
        $this->setIfExists('do_not_email', $data ?? [], false);
        $this->setIfExists('email', $data ?? [], null);
        $this->setIfExists('enable_loyalty', $data ?? [], null);
        $this->setIfExists('enable_promotional_sms', $data ?? [], false);
        $this->setIfExists('fax', $data ?? [], null);
        $this->setIfExists('first_name', $data ?? [], null);
        $this->setIfExists('gender', $data ?? [], null);
        $this->setIfExists('last_name', $data ?? [], null);
        $this->setIfExists('mobile', $data ?? [], null);
        $this->setIfExists('note', $data ?? [], null);
        $this->setIfExists('on_account_limit', $data ?? [], null);
        $this->setIfExists('phone', $data ?? [], null);
        $this->setIfExists('physical_address_1', $data ?? [], null);
        $this->setIfExists('physical_address_2', $data ?? [], null);
        $this->setIfExists('physical_city', $data ?? [], null);
        $this->setIfExists('physical_country_id', $data ?? [], null);
        $this->setIfExists('physical_postcode', $data ?? [], null);
        $this->setIfExists('physical_state', $data ?? [], null);
        $this->setIfExists('physical_suburb', $data ?? [], null);
        $this->setIfExists('postal_address_1', $data ?? [], null);
        $this->setIfExists('postal_address_2', $data ?? [], null);
        $this->setIfExists('postal_city', $data ?? [], null);
        $this->setIfExists('postal_country_id', $data ?? [], null);
        $this->setIfExists('postal_postcode', $data ?? [], null);
        $this->setIfExists('postal_state', $data ?? [], null);
        $this->setIfExists('postal_suburb', $data ?? [], null);
        $this->setIfExists('tax_id', $data ?? [], null);
        $this->setIfExists('twitter', $data ?? [], null);
        $this->setIfExists('website', $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 ($this->container['first_name'] === null && !$this->isNullableSetToNull('first_name')) {
            $invalidProperties[] = "'first_name' can't be null";
        }
        if ($this->container['last_name'] === null && !$this->isNullableSetToNull('last_name')) {
            $invalidProperties[] = "'last_name' can't be null";
        }
        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * 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)) {
            array_push($this->openAPINullablesSetToNull, 'company_name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('company_name', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['company_name'] = $company_name;

        return $this;
    }

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

    /**
     * Sets custom_field_1
     *
     * @param string|null $custom_field_1 Custom field 1. Can be used to store random data.
     *
     * @return self
     */
    public function setCustomField1($custom_field_1)
    {
        if (is_null($custom_field_1)) {
            array_push($this->openAPINullablesSetToNull, 'custom_field_1');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('custom_field_1', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['custom_field_1'] = $custom_field_1;

        return $this;
    }

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

    /**
     * Sets custom_field_2
     *
     * @param string|null $custom_field_2 Custom field 2.
     *
     * @return self
     */
    public function setCustomField2($custom_field_2)
    {
        if (is_null($custom_field_2)) {
            array_push($this->openAPINullablesSetToNull, 'custom_field_2');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('custom_field_2', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['custom_field_2'] = $custom_field_2;

        return $this;
    }

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

    /**
     * Sets custom_field_3
     *
     * @param string|null $custom_field_3 Custom field 3.
     *
     * @return self
     */
    public function setCustomField3($custom_field_3)
    {
        if (is_null($custom_field_3)) {
            array_push($this->openAPINullablesSetToNull, 'custom_field_3');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('custom_field_3', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['custom_field_3'] = $custom_field_3;

        return $this;
    }

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

    /**
     * Sets custom_field_4
     *
     * @param string|null $custom_field_4 Custom field 4.
     *
     * @return self
     */
    public function setCustomField4($custom_field_4)
    {
        if (is_null($custom_field_4)) {
            array_push($this->openAPINullablesSetToNull, 'custom_field_4');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('custom_field_4', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['custom_field_4'] = $custom_field_4;

        return $this;
    }

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

    /**
     * Sets customer_code
     *
     * @param string|null $customer_code Customer code used for claiming loyalty.
     *
     * @return self
     */
    public function setCustomerCode($customer_code)
    {
        if (is_null($customer_code)) {
            throw new \InvalidArgumentException('non-nullable customer_code cannot be null');
        }
        $this->container['customer_code'] = $customer_code;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets do_not_email
     *
     * @param bool|null $do_not_email Indicates whether the customer opted out of email communications.
     *
     * @return self
     */
    public function setDoNotEmail($do_not_email)
    {
        if (is_null($do_not_email)) {
            throw new \InvalidArgumentException('non-nullable do_not_email cannot be null');
        }
        $this->container['do_not_email'] = $do_not_email;

        return $this;
    }

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

    /**
     * Sets email
     *
     * @param string|null $email Customer's email address.
     *
     * @return self
     */
    public function setEmail($email)
    {
        if (is_null($email)) {
            array_push($this->openAPINullablesSetToNull, 'email');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('email', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['email'] = $email;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets enable_promotional_sms
     *
     * @param bool|null $enable_promotional_sms Indicates whether the customer opted in to SMS communications.
     *
     * @return self
     */
    public function setEnablePromotionalSms($enable_promotional_sms)
    {
        if (is_null($enable_promotional_sms)) {
            throw new \InvalidArgumentException('non-nullable enable_promotional_sms cannot be null');
        }
        $this->container['enable_promotional_sms'] = $enable_promotional_sms;

        return $this;
    }

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

    /**
     * Sets fax
     *
     * @param string|null $fax Fax no.
     *
     * @return self
     */
    public function setFax($fax)
    {
        if (is_null($fax)) {
            array_push($this->openAPINullablesSetToNull, 'fax');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('fax', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['fax'] = $fax;

        return $this;
    }

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

    /**
     * Sets first_name
     *
     * @param string|null $first_name Customer's first name.
     *
     * @return self
     */
    public function setFirstName($first_name)
    {
        if (is_null($first_name)) {
            array_push($this->openAPINullablesSetToNull, 'first_name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('first_name', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['first_name'] = $first_name;

        return $this;
    }

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

    /**
     * Sets gender
     *
     * @param string|null $gender Customer's gender. Can be `M`, `F` or null.
     *
     * @return self
     */
    public function setGender($gender)
    {
        if (is_null($gender)) {
            array_push($this->openAPINullablesSetToNull, 'gender');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('gender', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['gender'] = $gender;

        return $this;
    }

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

    /**
     * Sets last_name
     *
     * @param string|null $last_name Customer 's last name.
     *
     * @return self
     */
    public function setLastName($last_name)
    {
        if (is_null($last_name)) {
            array_push($this->openAPINullablesSetToNull, 'last_name');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('last_name', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['last_name'] = $last_name;

        return $this;
    }

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

    /**
     * Sets mobile
     *
     * @param string|null $mobile Mobile phone no.
     *
     * @return self
     */
    public function setMobile($mobile)
    {
        if (is_null($mobile)) {
            array_push($this->openAPINullablesSetToNull, 'mobile');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('mobile', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['mobile'] = $mobile;

        return $this;
    }

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

    /**
     * Sets note
     *
     * @param string|null $note Customer note.
     *
     * @return self
     */
    public function setNote($note)
    {
        if (is_null($note)) {
            array_push($this->openAPINullablesSetToNull, 'note');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('note', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['note'] = $note;

        return $this;
    }

    /**
     * Gets on_account_limit
     *
     * @return float|null
     */
    public function getOnAccountLimit()
    {
        return $this->container['on_account_limit'];
    }

    /**
     * Sets on_account_limit
     *
     * @param float|null $on_account_limit Customer's OnAccount Limit.
     *
     * @return self
     */
    public function setOnAccountLimit($on_account_limit)
    {
        if (is_null($on_account_limit)) {
            array_push($this->openAPINullablesSetToNull, 'on_account_limit');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('on_account_limit', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['on_account_limit'] = $on_account_limit;

        return $this;
    }

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

    /**
     * Sets phone
     *
     * @param string|null $phone Phone no.
     *
     * @return self
     */
    public function setPhone($phone)
    {
        if (is_null($phone)) {
            array_push($this->openAPINullablesSetToNull, 'phone');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('phone', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['phone'] = $phone;

        return $this;
    }

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

    /**
     * Sets physical_address_1
     *
     * @param string|null $physical_address_1 Physical address, line 1.
     *
     * @return self
     */
    public function setPhysicalAddress1($physical_address_1)
    {
        if (is_null($physical_address_1)) {
            array_push($this->openAPINullablesSetToNull, 'physical_address_1');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_address_1', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_address_1'] = $physical_address_1;

        return $this;
    }

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

    /**
     * Sets physical_address_2
     *
     * @param string|null $physical_address_2 Physical address, line 2.
     *
     * @return self
     */
    public function setPhysicalAddress2($physical_address_2)
    {
        if (is_null($physical_address_2)) {
            array_push($this->openAPINullablesSetToNull, 'physical_address_2');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_address_2', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_address_2'] = $physical_address_2;

        return $this;
    }

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

    /**
     * Sets physical_city
     *
     * @param string|null $physical_city Physical address, city.
     *
     * @return self
     */
    public function setPhysicalCity($physical_city)
    {
        if (is_null($physical_city)) {
            array_push($this->openAPINullablesSetToNull, 'physical_city');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_city', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_city'] = $physical_city;

        return $this;
    }

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

    /**
     * Sets physical_country_id
     *
     * @param string|null $physical_country_id Physical address, country code.
     *
     * @return self
     */
    public function setPhysicalCountryId($physical_country_id)
    {
        if (is_null($physical_country_id)) {
            array_push($this->openAPINullablesSetToNull, 'physical_country_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_country_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_country_id'] = $physical_country_id;

        return $this;
    }

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

    /**
     * Sets physical_postcode
     *
     * @param string|null $physical_postcode Physical address, post code.
     *
     * @return self
     */
    public function setPhysicalPostcode($physical_postcode)
    {
        if (is_null($physical_postcode)) {
            array_push($this->openAPINullablesSetToNull, 'physical_postcode');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_postcode', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_postcode'] = $physical_postcode;

        return $this;
    }

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

    /**
     * Sets physical_state
     *
     * @param string|null $physical_state Physical address, state.
     *
     * @return self
     */
    public function setPhysicalState($physical_state)
    {
        if (is_null($physical_state)) {
            array_push($this->openAPINullablesSetToNull, 'physical_state');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_state', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_state'] = $physical_state;

        return $this;
    }

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

    /**
     * Sets physical_suburb
     *
     * @param string|null $physical_suburb Physical address, suburb.
     *
     * @return self
     */
    public function setPhysicalSuburb($physical_suburb)
    {
        if (is_null($physical_suburb)) {
            array_push($this->openAPINullablesSetToNull, 'physical_suburb');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('physical_suburb', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['physical_suburb'] = $physical_suburb;

        return $this;
    }

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

    /**
     * Sets postal_address_1
     *
     * @param string|null $postal_address_1 Postal address, line 1.
     *
     * @return self
     */
    public function setPostalAddress1($postal_address_1)
    {
        if (is_null($postal_address_1)) {
            array_push($this->openAPINullablesSetToNull, 'postal_address_1');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_address_1', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_address_1'] = $postal_address_1;

        return $this;
    }

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

    /**
     * Sets postal_address_2
     *
     * @param string|null $postal_address_2 Postal address, line 2.
     *
     * @return self
     */
    public function setPostalAddress2($postal_address_2)
    {
        if (is_null($postal_address_2)) {
            array_push($this->openAPINullablesSetToNull, 'postal_address_2');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_address_2', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_address_2'] = $postal_address_2;

        return $this;
    }

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

    /**
     * Sets postal_city
     *
     * @param string|null $postal_city Postal address, city.
     *
     * @return self
     */
    public function setPostalCity($postal_city)
    {
        if (is_null($postal_city)) {
            array_push($this->openAPINullablesSetToNull, 'postal_city');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_city', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_city'] = $postal_city;

        return $this;
    }

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

    /**
     * Sets postal_country_id
     *
     * @param string|null $postal_country_id Postal address, country code.
     *
     * @return self
     */
    public function setPostalCountryId($postal_country_id)
    {
        if (is_null($postal_country_id)) {
            array_push($this->openAPINullablesSetToNull, 'postal_country_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_country_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_country_id'] = $postal_country_id;

        return $this;
    }

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

    /**
     * Sets postal_postcode
     *
     * @param string|null $postal_postcode Postal address, post code.
     *
     * @return self
     */
    public function setPostalPostcode($postal_postcode)
    {
        if (is_null($postal_postcode)) {
            array_push($this->openAPINullablesSetToNull, 'postal_postcode');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_postcode', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_postcode'] = $postal_postcode;

        return $this;
    }

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

    /**
     * Sets postal_state
     *
     * @param string|null $postal_state Postal address, state.
     *
     * @return self
     */
    public function setPostalState($postal_state)
    {
        if (is_null($postal_state)) {
            array_push($this->openAPINullablesSetToNull, 'postal_state');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_state', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_state'] = $postal_state;

        return $this;
    }

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

    /**
     * Sets postal_suburb
     *
     * @param string|null $postal_suburb Postal address, suburb.
     *
     * @return self
     */
    public function setPostalSuburb($postal_suburb)
    {
        if (is_null($postal_suburb)) {
            array_push($this->openAPINullablesSetToNull, 'postal_suburb');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('postal_suburb', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['postal_suburb'] = $postal_suburb;

        return $this;
    }

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

    /**
     * Sets tax_id
     *
     * @param string|null $tax_id Customer's tax ID.
     *
     * @return self
     */
    public function setTaxId($tax_id)
    {
        if (is_null($tax_id)) {
            array_push($this->openAPINullablesSetToNull, 'tax_id');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('tax_id', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['tax_id'] = $tax_id;

        return $this;
    }

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

    /**
     * Sets twitter
     *
     * @param string|null $twitter Twitter handle.
     *
     * @return self
     */
    public function setTwitter($twitter)
    {
        if (is_null($twitter)) {
            array_push($this->openAPINullablesSetToNull, 'twitter');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('twitter', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['twitter'] = $twitter;

        return $this;
    }

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

    /**
     * Sets website
     *
     * @param string|null $website Website URL.
     *
     * @return self
     */
    public function setWebsite($website)
    {
        if (is_null($website)) {
            array_push($this->openAPINullablesSetToNull, 'website');
        } else {
            $nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
            $index = array_search('website', $nullablesSetToNull);
            if ($index !== FALSE) {
                unset($nullablesSetToNull[$index]);
                $this->setOpenAPINullablesSetToNull($nullablesSetToNull);
            }
        }
        $this->container['website'] = $website;

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


