<?php
/**
 * CustomerDataCustomerInterface
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Magento2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Magento Community
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.3
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 6.0.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 Magento2\Model;

use \ArrayAccess;
use \Magento2\ObjectSerializer;

/**
 * CustomerDataCustomerInterface Class Doc Comment
 *
 * @category Class
 * @description Customer interface.
 * @package  Magento2
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<TKey, TValue>
 * @template TKey int|null
 * @template TValue mixed|null
 */
class CustomerDataCustomerInterface implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'customer-data-customer-interface';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'id' => 'int',
        'group_id' => 'int',
        'default_billing' => 'string',
        'default_shipping' => 'string',
        'confirmation' => 'string',
        'created_at' => 'string',
        'updated_at' => 'string',
        'created_in' => 'string',
        'dob' => 'string',
        'email' => 'string',
        'firstname' => 'string',
        'lastname' => 'string',
        'middlename' => 'string',
        'prefix' => 'string',
        'suffix' => 'string',
        'gender' => 'int',
        'store_id' => 'int',
        'taxvat' => 'string',
        'website_id' => 'int',
        'addresses' => '\Magento2\Model\CustomerDataAddressInterface[]',
        'disable_auto_group_change' => 'int',
        'extension_attributes' => '\Magento2\Model\CustomerDataCustomerExtensionInterface',
        'custom_attributes' => '\Magento2\Model\FrameworkAttributeInterface[]'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'id' => null,
        'group_id' => null,
        'default_billing' => null,
        'default_shipping' => null,
        'confirmation' => null,
        'created_at' => null,
        'updated_at' => null,
        'created_in' => null,
        'dob' => null,
        'email' => null,
        'firstname' => null,
        'lastname' => null,
        'middlename' => null,
        'prefix' => null,
        'suffix' => null,
        'gender' => null,
        'store_id' => null,
        'taxvat' => null,
        'website_id' => null,
        'addresses' => null,
        'disable_auto_group_change' => null,
        'extension_attributes' => null,
        'custom_attributes' => null
    ];

    /**
     * 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 attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'id' => 'id',
        'group_id' => 'group_id',
        'default_billing' => 'default_billing',
        'default_shipping' => 'default_shipping',
        'confirmation' => 'confirmation',
        'created_at' => 'created_at',
        'updated_at' => 'updated_at',
        'created_in' => 'created_in',
        'dob' => 'dob',
        'email' => 'email',
        'firstname' => 'firstname',
        'lastname' => 'lastname',
        'middlename' => 'middlename',
        'prefix' => 'prefix',
        'suffix' => 'suffix',
        'gender' => 'gender',
        'store_id' => 'store_id',
        'taxvat' => 'taxvat',
        'website_id' => 'website_id',
        'addresses' => 'addresses',
        'disable_auto_group_change' => 'disable_auto_group_change',
        'extension_attributes' => 'extension_attributes',
        'custom_attributes' => 'custom_attributes'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'id' => 'setId',
        'group_id' => 'setGroupId',
        'default_billing' => 'setDefaultBilling',
        'default_shipping' => 'setDefaultShipping',
        'confirmation' => 'setConfirmation',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt',
        'created_in' => 'setCreatedIn',
        'dob' => 'setDob',
        'email' => 'setEmail',
        'firstname' => 'setFirstname',
        'lastname' => 'setLastname',
        'middlename' => 'setMiddlename',
        'prefix' => 'setPrefix',
        'suffix' => 'setSuffix',
        'gender' => 'setGender',
        'store_id' => 'setStoreId',
        'taxvat' => 'setTaxvat',
        'website_id' => 'setWebsiteId',
        'addresses' => 'setAddresses',
        'disable_auto_group_change' => 'setDisableAutoGroupChange',
        'extension_attributes' => 'setExtensionAttributes',
        'custom_attributes' => 'setCustomAttributes'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'id' => 'getId',
        'group_id' => 'getGroupId',
        'default_billing' => 'getDefaultBilling',
        'default_shipping' => 'getDefaultShipping',
        'confirmation' => 'getConfirmation',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt',
        'created_in' => 'getCreatedIn',
        'dob' => 'getDob',
        'email' => 'getEmail',
        'firstname' => 'getFirstname',
        'lastname' => 'getLastname',
        'middlename' => 'getMiddlename',
        'prefix' => 'getPrefix',
        'suffix' => 'getSuffix',
        'gender' => 'getGender',
        'store_id' => 'getStoreId',
        'taxvat' => 'getTaxvat',
        'website_id' => 'getWebsiteId',
        'addresses' => 'getAddresses',
        'disable_auto_group_change' => 'getDisableAutoGroupChange',
        'extension_attributes' => 'getExtensionAttributes',
        'custom_attributes' => 'getCustomAttributes'
    ];

    /**
     * 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[] $data Associated array of property values
     *                      initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['id'] = $data['id'] ?? null;
        $this->container['group_id'] = $data['group_id'] ?? null;
        $this->container['default_billing'] = $data['default_billing'] ?? null;
        $this->container['default_shipping'] = $data['default_shipping'] ?? null;
        $this->container['confirmation'] = $data['confirmation'] ?? null;
        $this->container['created_at'] = $data['created_at'] ?? null;
        $this->container['updated_at'] = $data['updated_at'] ?? null;
        $this->container['created_in'] = $data['created_in'] ?? null;
        $this->container['dob'] = $data['dob'] ?? null;
        $this->container['email'] = $data['email'] ?? null;
        $this->container['firstname'] = $data['firstname'] ?? null;
        $this->container['lastname'] = $data['lastname'] ?? null;
        $this->container['middlename'] = $data['middlename'] ?? null;
        $this->container['prefix'] = $data['prefix'] ?? null;
        $this->container['suffix'] = $data['suffix'] ?? null;
        $this->container['gender'] = $data['gender'] ?? null;
        $this->container['store_id'] = $data['store_id'] ?? null;
        $this->container['taxvat'] = $data['taxvat'] ?? null;
        $this->container['website_id'] = $data['website_id'] ?? null;
        $this->container['addresses'] = $data['addresses'] ?? null;
        $this->container['disable_auto_group_change'] = $data['disable_auto_group_change'] ?? null;
        $this->container['extension_attributes'] = $data['extension_attributes'] ?? null;
        $this->container['custom_attributes'] = $data['custom_attributes'] ?? null;
    }

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

        if ($this->container['email'] === null) {
            $invalidProperties[] = "'email' can't be null";
        }
        if ($this->container['firstname'] === null) {
            $invalidProperties[] = "'firstname' can't be null";
        }
        if ($this->container['lastname'] === null) {
            $invalidProperties[] = "'lastname' 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 id
     *
     * @return int|null
     */
    public function getId()
    {
        return $this->container['id'];
    }

    /**
     * Sets id
     *
     * @param int|null $id Customer id
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

        return $this;
    }

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

    /**
     * Sets group_id
     *
     * @param int|null $group_id Group id
     *
     * @return self
     */
    public function setGroupId($group_id)
    {
        $this->container['group_id'] = $group_id;

        return $this;
    }

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

    /**
     * Sets default_billing
     *
     * @param string|null $default_billing Default billing address id
     *
     * @return self
     */
    public function setDefaultBilling($default_billing)
    {
        $this->container['default_billing'] = $default_billing;

        return $this;
    }

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

    /**
     * Sets default_shipping
     *
     * @param string|null $default_shipping Default shipping address id
     *
     * @return self
     */
    public function setDefaultShipping($default_shipping)
    {
        $this->container['default_shipping'] = $default_shipping;

        return $this;
    }

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

    /**
     * Sets confirmation
     *
     * @param string|null $confirmation Confirmation
     *
     * @return self
     */
    public function setConfirmation($confirmation)
    {
        $this->container['confirmation'] = $confirmation;

        return $this;
    }

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

    /**
     * Sets created_at
     *
     * @param string|null $created_at Created at time
     *
     * @return self
     */
    public function setCreatedAt($created_at)
    {
        $this->container['created_at'] = $created_at;

        return $this;
    }

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

    /**
     * Sets updated_at
     *
     * @param string|null $updated_at Updated at time
     *
     * @return self
     */
    public function setUpdatedAt($updated_at)
    {
        $this->container['updated_at'] = $updated_at;

        return $this;
    }

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

    /**
     * Sets created_in
     *
     * @param string|null $created_in Created in area
     *
     * @return self
     */
    public function setCreatedIn($created_in)
    {
        $this->container['created_in'] = $created_in;

        return $this;
    }

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

    /**
     * Sets dob
     *
     * @param string|null $dob Date of birth
     *
     * @return self
     */
    public function setDob($dob)
    {
        $this->container['dob'] = $dob;

        return $this;
    }

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

    /**
     * Sets email
     *
     * @param string $email Email address
     *
     * @return self
     */
    public function setEmail($email)
    {
        $this->container['email'] = $email;

        return $this;
    }

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

    /**
     * Sets firstname
     *
     * @param string $firstname First name
     *
     * @return self
     */
    public function setFirstname($firstname)
    {
        $this->container['firstname'] = $firstname;

        return $this;
    }

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

    /**
     * Sets lastname
     *
     * @param string $lastname Last name
     *
     * @return self
     */
    public function setLastname($lastname)
    {
        $this->container['lastname'] = $lastname;

        return $this;
    }

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

    /**
     * Sets middlename
     *
     * @param string|null $middlename Middle name
     *
     * @return self
     */
    public function setMiddlename($middlename)
    {
        $this->container['middlename'] = $middlename;

        return $this;
    }

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

    /**
     * Sets prefix
     *
     * @param string|null $prefix Prefix
     *
     * @return self
     */
    public function setPrefix($prefix)
    {
        $this->container['prefix'] = $prefix;

        return $this;
    }

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

    /**
     * Sets suffix
     *
     * @param string|null $suffix Suffix
     *
     * @return self
     */
    public function setSuffix($suffix)
    {
        $this->container['suffix'] = $suffix;

        return $this;
    }

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

    /**
     * Sets gender
     *
     * @param int|null $gender Gender
     *
     * @return self
     */
    public function setGender($gender)
    {
        $this->container['gender'] = $gender;

        return $this;
    }

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

    /**
     * Sets store_id
     *
     * @param int|null $store_id Store id
     *
     * @return self
     */
    public function setStoreId($store_id)
    {
        $this->container['store_id'] = $store_id;

        return $this;
    }

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

    /**
     * Sets taxvat
     *
     * @param string|null $taxvat Tax Vat
     *
     * @return self
     */
    public function setTaxvat($taxvat)
    {
        $this->container['taxvat'] = $taxvat;

        return $this;
    }

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

    /**
     * Sets website_id
     *
     * @param int|null $website_id Website id
     *
     * @return self
     */
    public function setWebsiteId($website_id)
    {
        $this->container['website_id'] = $website_id;

        return $this;
    }

    /**
     * Gets addresses
     *
     * @return \Magento2\Model\CustomerDataAddressInterface[]|null
     */
    public function getAddresses()
    {
        return $this->container['addresses'];
    }

    /**
     * Sets addresses
     *
     * @param \Magento2\Model\CustomerDataAddressInterface[]|null $addresses Customer addresses.
     *
     * @return self
     */
    public function setAddresses($addresses)
    {
        $this->container['addresses'] = $addresses;

        return $this;
    }

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

    /**
     * Sets disable_auto_group_change
     *
     * @param int|null $disable_auto_group_change Disable auto group change flag.
     *
     * @return self
     */
    public function setDisableAutoGroupChange($disable_auto_group_change)
    {
        $this->container['disable_auto_group_change'] = $disable_auto_group_change;

        return $this;
    }

    /**
     * Gets extension_attributes
     *
     * @return \Magento2\Model\CustomerDataCustomerExtensionInterface|null
     */
    public function getExtensionAttributes()
    {
        return $this->container['extension_attributes'];
    }

    /**
     * Sets extension_attributes
     *
     * @param \Magento2\Model\CustomerDataCustomerExtensionInterface|null $extension_attributes extension_attributes
     *
     * @return self
     */
    public function setExtensionAttributes($extension_attributes)
    {
        $this->container['extension_attributes'] = $extension_attributes;

        return $this;
    }

    /**
     * Gets custom_attributes
     *
     * @return \Magento2\Model\FrameworkAttributeInterface[]|null
     */
    public function getCustomAttributes()
    {
        return $this->container['custom_attributes'];
    }

    /**
     * Sets custom_attributes
     *
     * @param \Magento2\Model\FrameworkAttributeInterface[]|null $custom_attributes Custom attributes values.
     *
     * @return self
     */
    public function setCustomAttributes($custom_attributes)
    {
        $this->container['custom_attributes'] = $custom_attributes;

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

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


