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

/**
 * SV Register Web-services
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.15
 * 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 SmartVolution\Model;

use \ArrayAccess;
use \SmartVolution\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'tenantId' => 'int',
        'code' => 'string',
        'firstName' => 'string',
        'lastName' => 'string',
        'address1' => 'string',
        'address2' => 'string',
        'city' => 'string',
        'region' => 'string',
        'country' => 'string',
        'internationalisationId' => 'int',
        'postcode' => 'string',
        'phone1' => 'string',
        'phone2' => 'string',
        'email' => 'string',
        'gender' => 'string',
        'preferredClerkId' => 'int',
        'preferredStoreId' => 'int',
        'dob' => '\DateTime',
        'acceptReminders' => 'bool',
        'acceptMarketing' => 'bool',
        'accept3rdPartyMarketing' => 'bool',
        'serverOnly' => 'bool',
        'customFields' => '\SmartVolution\Model\CustomerFieldValue[]'
    ];

    /**
      * 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 = [
        'tenantId' => 'int64',
        'code' => null,
        'firstName' => null,
        'lastName' => null,
        'address1' => null,
        'address2' => null,
        'city' => null,
        'region' => null,
        'country' => null,
        'internationalisationId' => 'int32',
        'postcode' => null,
        'phone1' => null,
        'phone2' => null,
        'email' => null,
        'gender' => null,
        'preferredClerkId' => 'int64',
        'preferredStoreId' => 'int64',
        'dob' => 'date-time',
        'acceptReminders' => null,
        'acceptMarketing' => null,
        'accept3rdPartyMarketing' => null,
        'serverOnly' => null,
        'customFields' => 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 = [
        'tenantId' => 'tenantId',
        'code' => 'code',
        'firstName' => 'firstName',
        'lastName' => 'lastName',
        'address1' => 'address1',
        'address2' => 'address2',
        'city' => 'city',
        'region' => 'region',
        'country' => 'country',
        'internationalisationId' => 'internationalisationId',
        'postcode' => 'postcode',
        'phone1' => 'phone1',
        'phone2' => 'phone2',
        'email' => 'email',
        'gender' => 'gender',
        'preferredClerkId' => 'preferredClerkId',
        'preferredStoreId' => 'preferredStoreId',
        'dob' => 'dob',
        'acceptReminders' => 'acceptReminders',
        'acceptMarketing' => 'acceptMarketing',
        'accept3rdPartyMarketing' => 'accept3rdPartyMarketing',
        'serverOnly' => 'serverOnly',
        'customFields' => 'customFields'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'tenantId' => 'setTenantId',
        'code' => 'setCode',
        'firstName' => 'setFirstName',
        'lastName' => 'setLastName',
        'address1' => 'setAddress1',
        'address2' => 'setAddress2',
        'city' => 'setCity',
        'region' => 'setRegion',
        'country' => 'setCountry',
        'internationalisationId' => 'setInternationalisationId',
        'postcode' => 'setPostcode',
        'phone1' => 'setPhone1',
        'phone2' => 'setPhone2',
        'email' => 'setEmail',
        'gender' => 'setGender',
        'preferredClerkId' => 'setPreferredClerkId',
        'preferredStoreId' => 'setPreferredStoreId',
        'dob' => 'setDob',
        'acceptReminders' => 'setAcceptReminders',
        'acceptMarketing' => 'setAcceptMarketing',
        'accept3rdPartyMarketing' => 'setAccept3rdPartyMarketing',
        'serverOnly' => 'setServerOnly',
        'customFields' => 'setCustomFields'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'tenantId' => 'getTenantId',
        'code' => 'getCode',
        'firstName' => 'getFirstName',
        'lastName' => 'getLastName',
        'address1' => 'getAddress1',
        'address2' => 'getAddress2',
        'city' => 'getCity',
        'region' => 'getRegion',
        'country' => 'getCountry',
        'internationalisationId' => 'getInternationalisationId',
        'postcode' => 'getPostcode',
        'phone1' => 'getPhone1',
        'phone2' => 'getPhone2',
        'email' => 'getEmail',
        'gender' => 'getGender',
        'preferredClerkId' => 'getPreferredClerkId',
        'preferredStoreId' => 'getPreferredStoreId',
        'dob' => 'getDob',
        'acceptReminders' => 'getAcceptReminders',
        'acceptMarketing' => 'getAcceptMarketing',
        'accept3rdPartyMarketing' => 'getAccept3rdPartyMarketing',
        'serverOnly' => 'getServerOnly',
        'customFields' => 'getCustomFields'
    ];

    /**
     * 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['tenantId'] = $data['tenantId'] ?? null;
        $this->container['code'] = $data['code'] ?? null;
        $this->container['firstName'] = $data['firstName'] ?? null;
        $this->container['lastName'] = $data['lastName'] ?? null;
        $this->container['address1'] = $data['address1'] ?? null;
        $this->container['address2'] = $data['address2'] ?? null;
        $this->container['city'] = $data['city'] ?? null;
        $this->container['region'] = $data['region'] ?? null;
        $this->container['country'] = $data['country'] ?? null;
        $this->container['internationalisationId'] = $data['internationalisationId'] ?? null;
        $this->container['postcode'] = $data['postcode'] ?? null;
        $this->container['phone1'] = $data['phone1'] ?? null;
        $this->container['phone2'] = $data['phone2'] ?? null;
        $this->container['email'] = $data['email'] ?? null;
        $this->container['gender'] = $data['gender'] ?? null;
        $this->container['preferredClerkId'] = $data['preferredClerkId'] ?? null;
        $this->container['preferredStoreId'] = $data['preferredStoreId'] ?? null;
        $this->container['dob'] = $data['dob'] ?? null;
        $this->container['acceptReminders'] = $data['acceptReminders'] ?? null;
        $this->container['acceptMarketing'] = $data['acceptMarketing'] ?? null;
        $this->container['accept3rdPartyMarketing'] = $data['accept3rdPartyMarketing'] ?? null;
        $this->container['serverOnly'] = $data['serverOnly'] ?? null;
        $this->container['customFields'] = $data['customFields'] ?? null;
    }

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

        return $invalidProperties;
    }

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


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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets firstName
     *
     * @param string|null $firstName Customer first name
     *
     * @return self
     */
    public function setFirstName($firstName)
    {
        $this->container['firstName'] = $firstName;

        return $this;
    }

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

    /**
     * Sets lastName
     *
     * @param string|null $lastName Customer last name
     *
     * @return self
     */
    public function setLastName($lastName)
    {
        $this->container['lastName'] = $lastName;

        return $this;
    }

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

    /**
     * Sets address1
     *
     * @param string|null $address1 Customer address 1
     *
     * @return self
     */
    public function setAddress1($address1)
    {
        $this->container['address1'] = $address1;

        return $this;
    }

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

    /**
     * Sets address2
     *
     * @param string|null $address2 Customer address 2
     *
     * @return self
     */
    public function setAddress2($address2)
    {
        $this->container['address2'] = $address2;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets internationalisationId
     *
     * @param int|null $internationalisationId Internationalisation Id
     *
     * @return self
     */
    public function setInternationalisationId($internationalisationId)
    {
        $this->container['internationalisationId'] = $internationalisationId;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets dob
     *
     * @param \DateTime|null $dob Customer date of birthday
     *
     * @return self
     */
    public function setDob($dob)
    {
        $this->container['dob'] = $dob;

        return $this;
    }

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

    /**
     * Sets acceptReminders
     *
     * @param bool|null $acceptReminders Customer accept reminders
     *
     * @return self
     */
    public function setAcceptReminders($acceptReminders)
    {
        $this->container['acceptReminders'] = $acceptReminders;

        return $this;
    }

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

    /**
     * Sets acceptMarketing
     *
     * @param bool|null $acceptMarketing Customer accept marketing
     *
     * @return self
     */
    public function setAcceptMarketing($acceptMarketing)
    {
        $this->container['acceptMarketing'] = $acceptMarketing;

        return $this;
    }

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

    /**
     * Sets accept3rdPartyMarketing
     *
     * @param bool|null $accept3rdPartyMarketing Customer accept 3rd party marketing
     *
     * @return self
     */
    public function setAccept3rdPartyMarketing($accept3rdPartyMarketing)
    {
        $this->container['accept3rdPartyMarketing'] = $accept3rdPartyMarketing;

        return $this;
    }

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

    /**
     * Sets serverOnly
     *
     * @param bool|null $serverOnly Customer server only
     *
     * @return self
     */
    public function setServerOnly($serverOnly)
    {
        $this->container['serverOnly'] = $serverOnly;

        return $this;
    }

    /**
     * Gets customFields
     *
     * @return \SmartVolution\Model\CustomerFieldValue[]|null
     */
    public function getCustomFields()
    {
        return $this->container['customFields'];
    }

    /**
     * Sets customFields
     *
     * @param \SmartVolution\Model\CustomerFieldValue[]|null $customFields Customer customer-design fields value
     *
     * @return self
     */
    public function setCustomFields($customFields)
    {
        $this->container['customFields'] = $customFields;

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


