<?php
/**
 * Contact
 *
 * 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;

/**
 * Contact 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 Contact implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

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

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'first_name' => 'string',
        'last_name' => 'string',
        'company_name' => 'string',
        'phone' => 'string',
        'mobile' => 'string',
        'fax' => 'string',
        'website' => 'string',
        'email' => 'string',
        'postal_address1' => 'string',
        'postal_address2' => 'string',
        'postal_suburb' => 'string',
        'postal_postcode' => 'string',
        'postal_state' => 'string',
        'postal_country_id' => 'string',
        'physical_address1' => 'string',
        'physical_address2' => 'string',
        'physical_suburb' => 'string',
        'physical_postcode' => 'string',
        'physical_state' => 'string',
        'physical_country_id' => '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 = [
        'first_name' => null,
        'last_name' => null,
        'company_name' => null,
        'phone' => null,
        'mobile' => null,
        'fax' => null,
        'website' => null,
        'email' => null,
        'postal_address1' => null,
        'postal_address2' => null,
        'postal_suburb' => null,
        'postal_postcode' => null,
        'postal_state' => null,
        'postal_country_id' => null,
        'physical_address1' => null,
        'physical_address2' => null,
        'physical_suburb' => null,
        'physical_postcode' => null,
        'physical_state' => null,
        'physical_country_id' => 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 = [
        'first_name' => 'first_name',
        'last_name' => 'last_name',
        'company_name' => 'company_name',
        'phone' => 'phone',
        'mobile' => 'mobile',
        'fax' => 'fax',
        'website' => 'website',
        'email' => 'email',
        'postal_address1' => 'postal_address1',
        'postal_address2' => 'postal_address2',
        'postal_suburb' => 'postal_suburb',
        'postal_postcode' => 'postal_postcode',
        'postal_state' => 'postal_state',
        'postal_country_id' => 'postal_country_id',
        'physical_address1' => 'physical_address1',
        'physical_address2' => 'physical_address2',
        'physical_suburb' => 'physical_suburb',
        'physical_postcode' => 'physical_postcode',
        'physical_state' => 'physical_state',
        'physical_country_id' => 'physical_country_id'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'first_name' => 'setFirstName',
        'last_name' => 'setLastName',
        'company_name' => 'setCompanyName',
        'phone' => 'setPhone',
        'mobile' => 'setMobile',
        'fax' => 'setFax',
        'website' => 'setWebsite',
        'email' => 'setEmail',
        'postal_address1' => 'setPostalAddress1',
        'postal_address2' => 'setPostalAddress2',
        'postal_suburb' => 'setPostalSuburb',
        'postal_postcode' => 'setPostalPostcode',
        'postal_state' => 'setPostalState',
        'postal_country_id' => 'setPostalCountryId',
        'physical_address1' => 'setPhysicalAddress1',
        'physical_address2' => 'setPhysicalAddress2',
        'physical_suburb' => 'setPhysicalSuburb',
        'physical_postcode' => 'setPhysicalPostcode',
        'physical_state' => 'setPhysicalState',
        'physical_country_id' => 'setPhysicalCountryId'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'first_name' => 'getFirstName',
        'last_name' => 'getLastName',
        'company_name' => 'getCompanyName',
        'phone' => 'getPhone',
        'mobile' => 'getMobile',
        'fax' => 'getFax',
        'website' => 'getWebsite',
        'email' => 'getEmail',
        'postal_address1' => 'getPostalAddress1',
        'postal_address2' => 'getPostalAddress2',
        'postal_suburb' => 'getPostalSuburb',
        'postal_postcode' => 'getPostalPostcode',
        'postal_state' => 'getPostalState',
        'postal_country_id' => 'getPostalCountryId',
        'physical_address1' => 'getPhysicalAddress1',
        'physical_address2' => 'getPhysicalAddress2',
        'physical_suburb' => 'getPhysicalSuburb',
        'physical_postcode' => 'getPhysicalPostcode',
        'physical_state' => 'getPhysicalState',
        'physical_country_id' => 'getPhysicalCountryId'
    ];

    /**
     * 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['company_name'] = $data['company_name'] ?? null;
        $this->container['phone'] = $data['phone'] ?? null;
        $this->container['mobile'] = $data['mobile'] ?? null;
        $this->container['fax'] = $data['fax'] ?? null;
        $this->container['website'] = $data['website'] ?? null;
        $this->container['email'] = $data['email'] ?? null;
        $this->container['postal_address1'] = $data['postal_address1'] ?? null;
        $this->container['postal_address2'] = $data['postal_address2'] ?? null;
        $this->container['postal_suburb'] = $data['postal_suburb'] ?? 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['physical_address1'] = $data['physical_address1'] ?? null;
        $this->container['physical_address2'] = $data['physical_address2'] ?? null;
        $this->container['physical_suburb'] = $data['physical_suburb'] ?? 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;
    }

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

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

        return $this;
    }

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

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

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

    /**
     * Sets phone
     *
     * @param string|null $phone phone
     *
     * @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
     *
     * @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
     *
     * @return self
     */
    public function setFax($fax)
    {
        $this->container['fax'] = $fax;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        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_suburb
     *
     * @return self
     */
    public function setPostalSuburb($postal_suburb)
    {
        $this->container['postal_suburb'] = $postal_suburb;

        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_postcode
     *
     * @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_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_country_id
     *
     * @return self
     */
    public function setPostalCountryId($postal_country_id)
    {
        $this->container['postal_country_id'] = $postal_country_id;

        return $this;
    }

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

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

        return $this;
    }

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

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

        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_suburb
     *
     * @return self
     */
    public function setPhysicalSuburb($physical_suburb)
    {
        $this->container['physical_suburb'] = $physical_suburb;

        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_postcode
     *
     * @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_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_country_id
     *
     * @return self
     */
    public function setPhysicalCountryId($physical_country_id)
    {
        $this->container['physical_country_id'] = $physical_country_id;

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


