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

/**
 * API 2.0
 *
 * Early release of version 2.0 of the Vend API.
 *
 * The version of the OpenAPI document: 2.0
 * Contact: api@vendhq.com
 * 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 Vend20\Model;

use \ArrayAccess;
use \Vend20\ObjectSerializer;

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

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'first_name' => 'string',
        'last_name' => 'string',
        'id' => 'string',
        'customer_code' => 'string',
        'customer_group_id' => 'string',
        'enable_loyalty' => 'bool',
        'email' => 'string',
        'note' => 'string',
        'gender' => 'string',
        'date_of_birth' => 'string',
        'company_name' => 'string',
        'do_not_email' => 'bool',
        'phone' => 'string',
        'mobile' => 'string',
        'fax' => 'string',
        'twitter' => 'string',
        'website' => 'string',
        'physical_address_1' => 'string',
        'physical_address_2' => 'string',
        'physical_suburb' => 'string',
        'physical_city' => 'string',
        'physical_postcode' => 'string',
        'physical_state' => 'string',
        'physical_country_id' => 'string',
        'postal_address_1' => 'string',
        'postal_address_2' => 'string',
        'postal_suburb' => 'string',
        'postal_city' => 'string',
        'postal_postcode' => 'string',
        'postal_state' => 'string',
        'postal_country_id' => 'string',
        'custom_field_1' => 'string',
        'custom_field_2' => 'string',
        'custom_field_3' => 'string',
        'custom_field_4' => 'string',
        'name' => 'string',
        'year_to_date' => 'double',
        'balance' => 'double',
        'loyalty_balance' => 'double',
        'created_at' => 'string',
        'updated_at' => 'string',
        'deleted_at' => 'string',
        'version' => 'int'
    ];

    /**
      * 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 = [
        'first_name' => null,
        'last_name' => null,
        'id' => null,
        'customer_code' => null,
        'customer_group_id' => null,
        'enable_loyalty' => null,
        'email' => null,
        'note' => null,
        'gender' => null,
        'date_of_birth' => null,
        'company_name' => null,
        'do_not_email' => null,
        'phone' => null,
        'mobile' => null,
        'fax' => null,
        'twitter' => null,
        'website' => null,
        'physical_address_1' => null,
        'physical_address_2' => null,
        'physical_suburb' => null,
        'physical_city' => null,
        'physical_postcode' => null,
        'physical_state' => null,
        'physical_country_id' => null,
        'postal_address_1' => null,
        'postal_address_2' => null,
        'postal_suburb' => null,
        'postal_city' => null,
        'postal_postcode' => null,
        'postal_state' => null,
        'postal_country_id' => null,
        'custom_field_1' => null,
        'custom_field_2' => null,
        'custom_field_3' => null,
        'custom_field_4' => null,
        'name' => null,
        'year_to_date' => 'double',
        'balance' => 'double',
        'loyalty_balance' => 'double',
        'created_at' => null,
        'updated_at' => null,
        'deleted_at' => null,
        'version' => 'int64'
    ];

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

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'first_name' => 'setFirstName',
        'last_name' => 'setLastName',
        'id' => 'setId',
        'customer_code' => 'setCustomerCode',
        'customer_group_id' => 'setCustomerGroupId',
        'enable_loyalty' => 'setEnableLoyalty',
        'email' => 'setEmail',
        'note' => 'setNote',
        'gender' => 'setGender',
        'date_of_birth' => 'setDateOfBirth',
        'company_name' => 'setCompanyName',
        'do_not_email' => 'setDoNotEmail',
        'phone' => 'setPhone',
        'mobile' => 'setMobile',
        'fax' => 'setFax',
        'twitter' => 'setTwitter',
        'website' => 'setWebsite',
        'physical_address_1' => 'setPhysicalAddress1',
        'physical_address_2' => 'setPhysicalAddress2',
        'physical_suburb' => 'setPhysicalSuburb',
        'physical_city' => 'setPhysicalCity',
        'physical_postcode' => 'setPhysicalPostcode',
        'physical_state' => 'setPhysicalState',
        'physical_country_id' => 'setPhysicalCountryId',
        'postal_address_1' => 'setPostalAddress1',
        'postal_address_2' => 'setPostalAddress2',
        'postal_suburb' => 'setPostalSuburb',
        'postal_city' => 'setPostalCity',
        'postal_postcode' => 'setPostalPostcode',
        'postal_state' => 'setPostalState',
        'postal_country_id' => 'setPostalCountryId',
        'custom_field_1' => 'setCustomField1',
        'custom_field_2' => 'setCustomField2',
        'custom_field_3' => 'setCustomField3',
        'custom_field_4' => 'setCustomField4',
        'name' => 'setName',
        'year_to_date' => 'setYearToDate',
        'balance' => 'setBalance',
        'loyalty_balance' => 'setLoyaltyBalance',
        'created_at' => 'setCreatedAt',
        'updated_at' => 'setUpdatedAt',
        'deleted_at' => 'setDeletedAt',
        'version' => 'setVersion'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'first_name' => 'getFirstName',
        'last_name' => 'getLastName',
        'id' => 'getId',
        'customer_code' => 'getCustomerCode',
        'customer_group_id' => 'getCustomerGroupId',
        'enable_loyalty' => 'getEnableLoyalty',
        'email' => 'getEmail',
        'note' => 'getNote',
        'gender' => 'getGender',
        'date_of_birth' => 'getDateOfBirth',
        'company_name' => 'getCompanyName',
        'do_not_email' => 'getDoNotEmail',
        'phone' => 'getPhone',
        'mobile' => 'getMobile',
        'fax' => 'getFax',
        'twitter' => 'getTwitter',
        'website' => 'getWebsite',
        'physical_address_1' => 'getPhysicalAddress1',
        'physical_address_2' => 'getPhysicalAddress2',
        'physical_suburb' => 'getPhysicalSuburb',
        'physical_city' => 'getPhysicalCity',
        'physical_postcode' => 'getPhysicalPostcode',
        'physical_state' => 'getPhysicalState',
        'physical_country_id' => 'getPhysicalCountryId',
        'postal_address_1' => 'getPostalAddress1',
        'postal_address_2' => 'getPostalAddress2',
        'postal_suburb' => 'getPostalSuburb',
        'postal_city' => 'getPostalCity',
        'postal_postcode' => 'getPostalPostcode',
        'postal_state' => 'getPostalState',
        'postal_country_id' => 'getPostalCountryId',
        'custom_field_1' => 'getCustomField1',
        'custom_field_2' => 'getCustomField2',
        'custom_field_3' => 'getCustomField3',
        'custom_field_4' => 'getCustomField4',
        'name' => 'getName',
        'year_to_date' => 'getYearToDate',
        'balance' => 'getBalance',
        'loyalty_balance' => 'getLoyaltyBalance',
        'created_at' => 'getCreatedAt',
        'updated_at' => 'getUpdatedAt',
        'deleted_at' => 'getDeletedAt',
        'version' => 'getVersion'
    ];

    /**
     * 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['first_name'] = $data['first_name'] ?? null;
        $this->container['last_name'] = $data['last_name'] ?? null;
        $this->container['id'] = $data['id'] ?? null;
        $this->container['customer_code'] = $data['customer_code'] ?? null;
        $this->container['customer_group_id'] = $data['customer_group_id'] ?? null;
        $this->container['enable_loyalty'] = $data['enable_loyalty'] ?? null;
        $this->container['email'] = $data['email'] ?? null;
        $this->container['note'] = $data['note'] ?? null;
        $this->container['gender'] = $data['gender'] ?? null;
        $this->container['date_of_birth'] = $data['date_of_birth'] ?? null;
        $this->container['company_name'] = $data['company_name'] ?? null;
        $this->container['do_not_email'] = $data['do_not_email'] ?? false;
        $this->container['phone'] = $data['phone'] ?? null;
        $this->container['mobile'] = $data['mobile'] ?? null;
        $this->container['fax'] = $data['fax'] ?? null;
        $this->container['twitter'] = $data['twitter'] ?? null;
        $this->container['website'] = $data['website'] ?? null;
        $this->container['physical_address_1'] = $data['physical_address_1'] ?? null;
        $this->container['physical_address_2'] = $data['physical_address_2'] ?? null;
        $this->container['physical_suburb'] = $data['physical_suburb'] ?? null;
        $this->container['physical_city'] = $data['physical_city'] ?? null;
        $this->container['physical_postcode'] = $data['physical_postcode'] ?? null;
        $this->container['physical_state'] = $data['physical_state'] ?? null;
        $this->container['physical_country_id'] = $data['physical_country_id'] ?? null;
        $this->container['postal_address_1'] = $data['postal_address_1'] ?? null;
        $this->container['postal_address_2'] = $data['postal_address_2'] ?? null;
        $this->container['postal_suburb'] = $data['postal_suburb'] ?? null;
        $this->container['postal_city'] = $data['postal_city'] ?? null;
        $this->container['postal_postcode'] = $data['postal_postcode'] ?? null;
        $this->container['postal_state'] = $data['postal_state'] ?? null;
        $this->container['postal_country_id'] = $data['postal_country_id'] ?? null;
        $this->container['custom_field_1'] = $data['custom_field_1'] ?? null;
        $this->container['custom_field_2'] = $data['custom_field_2'] ?? null;
        $this->container['custom_field_3'] = $data['custom_field_3'] ?? null;
        $this->container['custom_field_4'] = $data['custom_field_4'] ?? null;
        $this->container['name'] = $data['name'] ?? null;
        $this->container['year_to_date'] = $data['year_to_date'] ?? null;
        $this->container['balance'] = $data['balance'] ?? null;
        $this->container['loyalty_balance'] = $data['loyalty_balance'] ?? null;
        $this->container['created_at'] = $data['created_at'] ?? null;
        $this->container['updated_at'] = $data['updated_at'] ?? null;
        $this->container['deleted_at'] = $data['deleted_at'] ?? null;
        $this->container['version'] = $data['version'] ?? null;
    }

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

        if ($this->container['first_name'] === null) {
            $invalidProperties[] = "'first_name' can't be null";
        }
        if ($this->container['last_name'] === null) {
            $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 first_name
     *
     * @return string
     */
    public function getFirstName()
    {
        return $this->container['first_name'];
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Sets id
     *
     * @param string|null $id Auto-generated object ID.
     *
     * @return self
     */
    public function setId($id)
    {
        $this->container['id'] = $id;

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

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

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

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

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

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

        return $this;
    }

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

    /**
     * Sets company_name
     *
     * @param string|null $company_name Company name.
     *
     * @return self
     */
    public function setCompanyName($company_name)
    {
        $this->container['company_name'] = $company_name;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return $this;
    }

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

    /**
     * Sets name
     *
     * @param string|null $name Customers full name. **deprecated**
     *
     * @return self
     */
    public function setName($name)
    {
        $this->container['name'] = $name;

        return $this;
    }

    /**
     * Gets year_to_date
     *
     * @return double|null
     */
    public function getYearToDate()
    {
        return $this->container['year_to_date'];
    }

    /**
     * Sets year_to_date
     *
     * @param double|null $year_to_date Customer's spending this year.
     *
     * @return self
     */
    public function setYearToDate($year_to_date)
    {
        $this->container['year_to_date'] = $year_to_date;

        return $this;
    }

    /**
     * Gets balance
     *
     * @return double|null
     */
    public function getBalance()
    {
        return $this->container['balance'];
    }

    /**
     * Sets balance
     *
     * @param double|null $balance Customer's unpaid balance.
     *
     * @return self
     */
    public function setBalance($balance)
    {
        $this->container['balance'] = $balance;

        return $this;
    }

    /**
     * Gets loyalty_balance
     *
     * @return double|null
     */
    public function getLoyaltyBalance()
    {
        return $this->container['loyalty_balance'];
    }

    /**
     * Sets loyalty_balance
     *
     * @param double|null $loyalty_balance Customer's loyalty balance.
     *
     * @return self
     */
    public function setLoyaltyBalance($loyalty_balance)
    {
        $this->container['loyalty_balance'] = $loyalty_balance;

        return $this;
    }

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

    /**
     * Sets created_at
     *
     * @param string|null $created_at Creation timestamp in UTC.
     *
     * @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 Last update timestamp in UTC.
     *
     * @return self
     */
    public function setUpdatedAt($updated_at)
    {
        $this->container['updated_at'] = $updated_at;

        return $this;
    }

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

    /**
     * Sets deleted_at
     *
     * @param string|null $deleted_at Deletion timestamp in UTC.
     *
     * @return self
     */
    public function setDeletedAt($deleted_at)
    {
        $this->container['deleted_at'] = $deleted_at;

        return $this;
    }

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

    /**
     * Sets version
     *
     * @param int|null $version Auto-incrementing object version number.
     *
     * @return self
     */
    public function setVersion($version)
    {
        $this->container['version'] = $version;

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


