1168 lines
34 KiB
PHP
1168 lines
34 KiB
PHP
<?php
|
||
/**
|
||
* Billing
|
||
*
|
||
* PHP version 8.1
|
||
*
|
||
* @category Class
|
||
* @package Europharmacy\EuromedicaClient
|
||
* @author OpenAPI Generator team
|
||
* @link https://openapi-generator.tech
|
||
*/
|
||
|
||
/**
|
||
* Euromedica Two Web Api
|
||
*
|
||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||
*
|
||
* The version of the OpenAPI document: v1
|
||
* Contact: development@europharmacy.gr
|
||
* Generated by: https://openapi-generator.tech
|
||
* Generator version: 7.20.0
|
||
*/
|
||
|
||
/**
|
||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||
* https://openapi-generator.tech
|
||
* Do not edit the class manually.
|
||
*/
|
||
|
||
namespace Europharmacy\EuromedicaClient\Model;
|
||
|
||
use \ArrayAccess;
|
||
use \Europharmacy\EuromedicaClient\ObjectSerializer;
|
||
|
||
/**
|
||
* Billing Class Doc Comment
|
||
*
|
||
* @category Class
|
||
* @package Europharmacy\EuromedicaClient
|
||
* @author OpenAPI Generator team
|
||
* @link https://openapi-generator.tech
|
||
* @implements \ArrayAccess<string, mixed>
|
||
*/
|
||
class Billing implements ModelInterface, ArrayAccess, \JsonSerializable
|
||
{
|
||
public const DISCRIMINATOR = null;
|
||
|
||
/**
|
||
* The original name of the model.
|
||
*
|
||
* @var string
|
||
*/
|
||
protected static $openAPIModelName = 'billing';
|
||
|
||
/**
|
||
* Array of property to type mappings. Used for (de)serialization
|
||
*
|
||
* @var string[]
|
||
*/
|
||
protected static $openAPITypes = [
|
||
'last_name' => 'string',
|
||
'first_name' => 'string',
|
||
'address' => 'string',
|
||
'city' => 'string',
|
||
'postcode' => 'string',
|
||
'state' => 'string',
|
||
'country' => 'string',
|
||
'country_code' => 'string',
|
||
'phone' => 'string',
|
||
'cellphone' => 'string',
|
||
'email' => 'string',
|
||
'is_invoice' => 'int',
|
||
'commercial_name' => 'string',
|
||
'tax_number' => 'string',
|
||
'tax_office' => 'string',
|
||
'activity' => '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 = [
|
||
'last_name' => null,
|
||
'first_name' => null,
|
||
'address' => null,
|
||
'city' => null,
|
||
'postcode' => null,
|
||
'state' => null,
|
||
'country' => null,
|
||
'country_code' => null,
|
||
'phone' => null,
|
||
'cellphone' => null,
|
||
'email' => null,
|
||
'is_invoice' => 'int32',
|
||
'commercial_name' => null,
|
||
'tax_number' => null,
|
||
'tax_office' => null,
|
||
'activity' => null
|
||
];
|
||
|
||
/**
|
||
* Array of nullable properties. Used for (de)serialization
|
||
*
|
||
* @var boolean[]
|
||
*/
|
||
protected static array $openAPINullables = [
|
||
'last_name' => true,
|
||
'first_name' => true,
|
||
'address' => true,
|
||
'city' => true,
|
||
'postcode' => true,
|
||
'state' => true,
|
||
'country' => true,
|
||
'country_code' => true,
|
||
'phone' => true,
|
||
'cellphone' => true,
|
||
'email' => true,
|
||
'is_invoice' => false,
|
||
'commercial_name' => true,
|
||
'tax_number' => true,
|
||
'tax_office' => true,
|
||
'activity' => true
|
||
];
|
||
|
||
/**
|
||
* If a nullable field gets set to null, insert it here
|
||
*
|
||
* @var boolean[]
|
||
*/
|
||
protected array $openAPINullablesSetToNull = [];
|
||
|
||
/**
|
||
* Array of property to type mappings. Used for (de)serialization
|
||
*
|
||
* @return array
|
||
*/
|
||
public static function openAPITypes()
|
||
{
|
||
return self::$openAPITypes;
|
||
}
|
||
|
||
/**
|
||
* Array of property to format mappings. Used for (de)serialization
|
||
*
|
||
* @return array
|
||
*/
|
||
public static function openAPIFormats()
|
||
{
|
||
return self::$openAPIFormats;
|
||
}
|
||
|
||
/**
|
||
* Array of nullable properties
|
||
*
|
||
* @return array
|
||
*/
|
||
protected static function openAPINullables(): array
|
||
{
|
||
return self::$openAPINullables;
|
||
}
|
||
|
||
/**
|
||
* Array of nullable field names deliberately set to null
|
||
*
|
||
* @return boolean[]
|
||
*/
|
||
private function getOpenAPINullablesSetToNull(): array
|
||
{
|
||
return $this->openAPINullablesSetToNull;
|
||
}
|
||
|
||
/**
|
||
* Setter - Array of nullable field names deliberately set to null
|
||
*
|
||
* @param boolean[] $openAPINullablesSetToNull
|
||
*/
|
||
private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
|
||
{
|
||
$this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
|
||
}
|
||
|
||
/**
|
||
* Checks if a property is nullable
|
||
*
|
||
* @param string $property
|
||
* @return bool
|
||
*/
|
||
public static function isNullable(string $property): bool
|
||
{
|
||
return self::openAPINullables()[$property] ?? false;
|
||
}
|
||
|
||
/**
|
||
* Checks if a nullable property is set to null.
|
||
*
|
||
* @param string $property
|
||
* @return bool
|
||
*/
|
||
public function isNullableSetToNull(string $property): bool
|
||
{
|
||
return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
|
||
}
|
||
|
||
/**
|
||
* Array of attributes where the key is the local name,
|
||
* and the value is the original name
|
||
*
|
||
* @var string[]
|
||
*/
|
||
protected static $attributeMap = [
|
||
'last_name' => 'lastName',
|
||
'first_name' => 'firstName',
|
||
'address' => 'address',
|
||
'city' => 'city',
|
||
'postcode' => 'postcode',
|
||
'state' => 'state',
|
||
'country' => 'country',
|
||
'country_code' => 'countryCode',
|
||
'phone' => 'phone',
|
||
'cellphone' => 'cellphone',
|
||
'email' => 'email',
|
||
'is_invoice' => 'isInvoice',
|
||
'commercial_name' => 'commercialName',
|
||
'tax_number' => 'taxNumber',
|
||
'tax_office' => 'taxOffice',
|
||
'activity' => 'activity'
|
||
];
|
||
|
||
/**
|
||
* Array of attributes to setter functions (for deserialization of responses)
|
||
*
|
||
* @var string[]
|
||
*/
|
||
protected static $setters = [
|
||
'last_name' => 'setLastName',
|
||
'first_name' => 'setFirstName',
|
||
'address' => 'setAddress',
|
||
'city' => 'setCity',
|
||
'postcode' => 'setPostcode',
|
||
'state' => 'setState',
|
||
'country' => 'setCountry',
|
||
'country_code' => 'setCountryCode',
|
||
'phone' => 'setPhone',
|
||
'cellphone' => 'setCellphone',
|
||
'email' => 'setEmail',
|
||
'is_invoice' => 'setIsInvoice',
|
||
'commercial_name' => 'setCommercialName',
|
||
'tax_number' => 'setTaxNumber',
|
||
'tax_office' => 'setTaxOffice',
|
||
'activity' => 'setActivity'
|
||
];
|
||
|
||
/**
|
||
* Array of attributes to getter functions (for serialization of requests)
|
||
*
|
||
* @var string[]
|
||
*/
|
||
protected static $getters = [
|
||
'last_name' => 'getLastName',
|
||
'first_name' => 'getFirstName',
|
||
'address' => 'getAddress',
|
||
'city' => 'getCity',
|
||
'postcode' => 'getPostcode',
|
||
'state' => 'getState',
|
||
'country' => 'getCountry',
|
||
'country_code' => 'getCountryCode',
|
||
'phone' => 'getPhone',
|
||
'cellphone' => 'getCellphone',
|
||
'email' => 'getEmail',
|
||
'is_invoice' => 'getIsInvoice',
|
||
'commercial_name' => 'getCommercialName',
|
||
'tax_number' => 'getTaxNumber',
|
||
'tax_office' => 'getTaxOffice',
|
||
'activity' => 'getActivity'
|
||
];
|
||
|
||
/**
|
||
* Array of attributes where the key is the local name,
|
||
* and the value is the original name
|
||
*
|
||
* @return array
|
||
*/
|
||
public static function attributeMap()
|
||
{
|
||
return self::$attributeMap;
|
||
}
|
||
|
||
/**
|
||
* Array of attributes to setter functions (for deserialization of responses)
|
||
*
|
||
* @return array
|
||
*/
|
||
public static function setters()
|
||
{
|
||
return self::$setters;
|
||
}
|
||
|
||
/**
|
||
* Array of attributes to getter functions (for serialization of requests)
|
||
*
|
||
* @return array
|
||
*/
|
||
public static function getters()
|
||
{
|
||
return self::$getters;
|
||
}
|
||
|
||
/**
|
||
* The original name of the model.
|
||
*
|
||
* @return string
|
||
*/
|
||
public function getModelName()
|
||
{
|
||
return self::$openAPIModelName;
|
||
}
|
||
|
||
|
||
/**
|
||
* Associative array for storing property values
|
||
*
|
||
* @var mixed[]
|
||
*/
|
||
protected $container = [];
|
||
|
||
/**
|
||
* Constructor
|
||
*
|
||
* @param mixed[]|null $data Associated array of property values
|
||
* initializing the model
|
||
*/
|
||
public function __construct(?array $data = null)
|
||
{
|
||
$this->setIfExists('last_name', $data ?? [], null);
|
||
$this->setIfExists('first_name', $data ?? [], null);
|
||
$this->setIfExists('address', $data ?? [], null);
|
||
$this->setIfExists('city', $data ?? [], null);
|
||
$this->setIfExists('postcode', $data ?? [], null);
|
||
$this->setIfExists('state', $data ?? [], null);
|
||
$this->setIfExists('country', $data ?? [], null);
|
||
$this->setIfExists('country_code', $data ?? [], null);
|
||
$this->setIfExists('phone', $data ?? [], null);
|
||
$this->setIfExists('cellphone', $data ?? [], null);
|
||
$this->setIfExists('email', $data ?? [], null);
|
||
$this->setIfExists('is_invoice', $data ?? [], null);
|
||
$this->setIfExists('commercial_name', $data ?? [], null);
|
||
$this->setIfExists('tax_number', $data ?? [], null);
|
||
$this->setIfExists('tax_office', $data ?? [], null);
|
||
$this->setIfExists('activity', $data ?? [], null);
|
||
}
|
||
|
||
/**
|
||
* Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
|
||
* is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
|
||
* $this->openAPINullablesSetToNull array
|
||
*
|
||
* @param string $variableName
|
||
* @param array $fields
|
||
* @param mixed $defaultValue
|
||
*/
|
||
private function setIfExists(string $variableName, array $fields, $defaultValue): void
|
||
{
|
||
if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
|
||
$this->openAPINullablesSetToNull[] = $variableName;
|
||
}
|
||
|
||
$this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
|
||
}
|
||
|
||
/**
|
||
* Show all the invalid properties with reasons.
|
||
*
|
||
* @return array invalid properties with reasons
|
||
*/
|
||
public function listInvalidProperties()
|
||
{
|
||
$invalidProperties = [];
|
||
|
||
if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) > 60)) {
|
||
$invalidProperties[] = "invalid value for 'last_name', the character length must be smaller than or equal to 60.";
|
||
}
|
||
|
||
if (!is_null($this->container['last_name']) && (mb_strlen($this->container['last_name']) < 1)) {
|
||
$invalidProperties[] = "invalid value for 'last_name', the character length must be bigger than or equal to 1.";
|
||
}
|
||
|
||
if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) > 60)) {
|
||
$invalidProperties[] = "invalid value for 'first_name', the character length must be smaller than or equal to 60.";
|
||
}
|
||
|
||
if (!is_null($this->container['first_name']) && (mb_strlen($this->container['first_name']) < 1)) {
|
||
$invalidProperties[] = "invalid value for 'first_name', the character length must be bigger than or equal to 1.";
|
||
}
|
||
|
||
if (!is_null($this->container['address']) && (mb_strlen($this->container['address']) > 120)) {
|
||
$invalidProperties[] = "invalid value for 'address', the character length must be smaller than or equal to 120.";
|
||
}
|
||
|
||
if (!is_null($this->container['city']) && (mb_strlen($this->container['city']) > 60)) {
|
||
$invalidProperties[] = "invalid value for 'city', the character length must be smaller than or equal to 60.";
|
||
}
|
||
|
||
if (!is_null($this->container['postcode']) && (mb_strlen($this->container['postcode']) > 10)) {
|
||
$invalidProperties[] = "invalid value for 'postcode', the character length must be smaller than or equal to 10.";
|
||
}
|
||
|
||
if (!is_null($this->container['state']) && (mb_strlen($this->container['state']) > 60)) {
|
||
$invalidProperties[] = "invalid value for 'state', the character length must be smaller than or equal to 60.";
|
||
}
|
||
|
||
if (!is_null($this->container['country']) && (mb_strlen($this->container['country']) > 20)) {
|
||
$invalidProperties[] = "invalid value for 'country', the character length must be smaller than or equal to 20.";
|
||
}
|
||
|
||
if (!is_null($this->container['country_code']) && (mb_strlen($this->container['country_code']) > 2)) {
|
||
$invalidProperties[] = "invalid value for 'country_code', the character length must be smaller than or equal to 2.";
|
||
}
|
||
|
||
if (!is_null($this->container['phone']) && (mb_strlen($this->container['phone']) > 15)) {
|
||
$invalidProperties[] = "invalid value for 'phone', the character length must be smaller than or equal to 15.";
|
||
}
|
||
|
||
if (!is_null($this->container['cellphone']) && (mb_strlen($this->container['cellphone']) > 15)) {
|
||
$invalidProperties[] = "invalid value for 'cellphone', the character length must be smaller than or equal to 15.";
|
||
}
|
||
|
||
if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 60)) {
|
||
$invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 60.";
|
||
}
|
||
|
||
if (!is_null($this->container['is_invoice']) && ($this->container['is_invoice'] > 1)) {
|
||
$invalidProperties[] = "invalid value for 'is_invoice', must be smaller than or equal to 1.";
|
||
}
|
||
|
||
if (!is_null($this->container['is_invoice']) && ($this->container['is_invoice'] < 0)) {
|
||
$invalidProperties[] = "invalid value for 'is_invoice', must be bigger than or equal to 0.";
|
||
}
|
||
|
||
if (!is_null($this->container['tax_number']) && (mb_strlen($this->container['tax_number']) > 15)) {
|
||
$invalidProperties[] = "invalid value for 'tax_number', the character length must be smaller than or equal to 15.";
|
||
}
|
||
|
||
if (!is_null($this->container['tax_office']) && (mb_strlen($this->container['tax_office']) > 40)) {
|
||
$invalidProperties[] = "invalid value for 'tax_office', the character length must be smaller than or equal to 40.";
|
||
}
|
||
|
||
if (!is_null($this->container['activity']) && (mb_strlen($this->container['activity']) > 80)) {
|
||
$invalidProperties[] = "invalid value for 'activity', the character length must be smaller than or equal to 80.";
|
||
}
|
||
|
||
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 last_name
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getLastName()
|
||
{
|
||
return $this->container['last_name'];
|
||
}
|
||
|
||
/**
|
||
* Sets last_name
|
||
*
|
||
* @param string|null $last_name Επίθετο
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setLastName($last_name)
|
||
{
|
||
if (is_null($last_name)) {
|
||
array_push($this->openAPINullablesSetToNull, 'last_name');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('last_name', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($last_name) && (mb_strlen($last_name) > 60)) {
|
||
throw new \InvalidArgumentException('invalid length for $last_name when calling Billing., must be smaller than or equal to 60.');
|
||
}
|
||
if (!is_null($last_name) && (mb_strlen($last_name) < 1)) {
|
||
throw new \InvalidArgumentException('invalid length for $last_name when calling Billing., must be bigger than or equal to 1.');
|
||
}
|
||
|
||
$this->container['last_name'] = $last_name;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets first_name
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getFirstName()
|
||
{
|
||
return $this->container['first_name'];
|
||
}
|
||
|
||
/**
|
||
* Sets first_name
|
||
*
|
||
* @param string|null $first_name Όνομα
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setFirstName($first_name)
|
||
{
|
||
if (is_null($first_name)) {
|
||
array_push($this->openAPINullablesSetToNull, 'first_name');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('first_name', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($first_name) && (mb_strlen($first_name) > 60)) {
|
||
throw new \InvalidArgumentException('invalid length for $first_name when calling Billing., must be smaller than or equal to 60.');
|
||
}
|
||
if (!is_null($first_name) && (mb_strlen($first_name) < 1)) {
|
||
throw new \InvalidArgumentException('invalid length for $first_name when calling Billing., must be bigger than or equal to 1.');
|
||
}
|
||
|
||
$this->container['first_name'] = $first_name;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets address
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getAddress()
|
||
{
|
||
return $this->container['address'];
|
||
}
|
||
|
||
/**
|
||
* Sets address
|
||
*
|
||
* @param string|null $address Διεύθυνση
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setAddress($address)
|
||
{
|
||
if (is_null($address)) {
|
||
array_push($this->openAPINullablesSetToNull, 'address');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('address', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($address) && (mb_strlen($address) > 120)) {
|
||
throw new \InvalidArgumentException('invalid length for $address when calling Billing., must be smaller than or equal to 120.');
|
||
}
|
||
|
||
$this->container['address'] = $address;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets city
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getCity()
|
||
{
|
||
return $this->container['city'];
|
||
}
|
||
|
||
/**
|
||
* Sets city
|
||
*
|
||
* @param string|null $city city
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setCity($city)
|
||
{
|
||
if (is_null($city)) {
|
||
array_push($this->openAPINullablesSetToNull, 'city');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('city', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($city) && (mb_strlen($city) > 60)) {
|
||
throw new \InvalidArgumentException('invalid length for $city when calling Billing., must be smaller than or equal to 60.');
|
||
}
|
||
|
||
$this->container['city'] = $city;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets postcode
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getPostcode()
|
||
{
|
||
return $this->container['postcode'];
|
||
}
|
||
|
||
/**
|
||
* Sets postcode
|
||
*
|
||
* @param string|null $postcode postcode
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setPostcode($postcode)
|
||
{
|
||
if (is_null($postcode)) {
|
||
array_push($this->openAPINullablesSetToNull, 'postcode');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('postcode', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($postcode) && (mb_strlen($postcode) > 10)) {
|
||
throw new \InvalidArgumentException('invalid length for $postcode when calling Billing., must be smaller than or equal to 10.');
|
||
}
|
||
|
||
$this->container['postcode'] = $postcode;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets state
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getState()
|
||
{
|
||
return $this->container['state'];
|
||
}
|
||
|
||
/**
|
||
* Sets state
|
||
*
|
||
* @param string|null $state state
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setState($state)
|
||
{
|
||
if (is_null($state)) {
|
||
array_push($this->openAPINullablesSetToNull, 'state');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('state', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($state) && (mb_strlen($state) > 60)) {
|
||
throw new \InvalidArgumentException('invalid length for $state when calling Billing., must be smaller than or equal to 60.');
|
||
}
|
||
|
||
$this->container['state'] = $state;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets country
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getCountry()
|
||
{
|
||
return $this->container['country'];
|
||
}
|
||
|
||
/**
|
||
* Sets country
|
||
*
|
||
* @param string|null $country country
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setCountry($country)
|
||
{
|
||
if (is_null($country)) {
|
||
array_push($this->openAPINullablesSetToNull, 'country');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('country', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($country) && (mb_strlen($country) > 20)) {
|
||
throw new \InvalidArgumentException('invalid length for $country when calling Billing., must be smaller than or equal to 20.');
|
||
}
|
||
|
||
$this->container['country'] = $country;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets country_code
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getCountryCode()
|
||
{
|
||
return $this->container['country_code'];
|
||
}
|
||
|
||
/**
|
||
* Sets country_code
|
||
*
|
||
* @param string|null $country_code ΚΩΔΙΚΟΣ ΧΩΡΑΣ ISO 3166 ALPHA-2
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setCountryCode($country_code)
|
||
{
|
||
if (is_null($country_code)) {
|
||
array_push($this->openAPINullablesSetToNull, 'country_code');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('country_code', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($country_code) && (mb_strlen($country_code) > 2)) {
|
||
throw new \InvalidArgumentException('invalid length for $country_code when calling Billing., must be smaller than or equal to 2.');
|
||
}
|
||
|
||
$this->container['country_code'] = $country_code;
|
||
|
||
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)
|
||
{
|
||
if (is_null($phone)) {
|
||
array_push($this->openAPINullablesSetToNull, 'phone');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('phone', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($phone) && (mb_strlen($phone) > 15)) {
|
||
throw new \InvalidArgumentException('invalid length for $phone when calling Billing., must be smaller than or equal to 15.');
|
||
}
|
||
|
||
$this->container['phone'] = $phone;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets cellphone
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getCellphone()
|
||
{
|
||
return $this->container['cellphone'];
|
||
}
|
||
|
||
/**
|
||
* Sets cellphone
|
||
*
|
||
* @param string|null $cellphone cellphone
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setCellphone($cellphone)
|
||
{
|
||
if (is_null($cellphone)) {
|
||
array_push($this->openAPINullablesSetToNull, 'cellphone');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('cellphone', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($cellphone) && (mb_strlen($cellphone) > 15)) {
|
||
throw new \InvalidArgumentException('invalid length for $cellphone when calling Billing., must be smaller than or equal to 15.');
|
||
}
|
||
|
||
$this->container['cellphone'] = $cellphone;
|
||
|
||
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)
|
||
{
|
||
if (is_null($email)) {
|
||
array_push($this->openAPINullablesSetToNull, 'email');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('email', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($email) && (mb_strlen($email) > 60)) {
|
||
throw new \InvalidArgumentException('invalid length for $email when calling Billing., must be smaller than or equal to 60.');
|
||
}
|
||
|
||
$this->container['email'] = $email;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets is_invoice
|
||
*
|
||
* @return int|null
|
||
*/
|
||
public function getIsInvoice()
|
||
{
|
||
return $this->container['is_invoice'];
|
||
}
|
||
|
||
/**
|
||
* Sets is_invoice
|
||
*
|
||
* @param int|null $is_invoice Αν ο πελάτης θέλει τιμολόγιο τιμή 1
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setIsInvoice($is_invoice)
|
||
{
|
||
if (is_null($is_invoice)) {
|
||
throw new \InvalidArgumentException('non-nullable is_invoice cannot be null');
|
||
}
|
||
|
||
if (($is_invoice > 1)) {
|
||
throw new \InvalidArgumentException('invalid value for $is_invoice when calling Billing., must be smaller than or equal to 1.');
|
||
}
|
||
if (($is_invoice < 0)) {
|
||
throw new \InvalidArgumentException('invalid value for $is_invoice when calling Billing., must be bigger than or equal to 0.');
|
||
}
|
||
|
||
$this->container['is_invoice'] = $is_invoice;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets commercial_name
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getCommercialName()
|
||
{
|
||
return $this->container['commercial_name'];
|
||
}
|
||
|
||
/**
|
||
* Sets commercial_name
|
||
*
|
||
* @param string|null $commercial_name η επωνυμία που θα κοπεί το τιμολόγιο
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setCommercialName($commercial_name)
|
||
{
|
||
if (is_null($commercial_name)) {
|
||
array_push($this->openAPINullablesSetToNull, 'commercial_name');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('commercial_name', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
$this->container['commercial_name'] = $commercial_name;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets tax_number
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getTaxNumber()
|
||
{
|
||
return $this->container['tax_number'];
|
||
}
|
||
|
||
/**
|
||
* Sets tax_number
|
||
*
|
||
* @param string|null $tax_number Αφμ πελάτη , υποχρεωτικό σε περίπτωση τιμολογίου
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setTaxNumber($tax_number)
|
||
{
|
||
if (is_null($tax_number)) {
|
||
array_push($this->openAPINullablesSetToNull, 'tax_number');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('tax_number', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($tax_number) && (mb_strlen($tax_number) > 15)) {
|
||
throw new \InvalidArgumentException('invalid length for $tax_number when calling Billing., must be smaller than or equal to 15.');
|
||
}
|
||
|
||
$this->container['tax_number'] = $tax_number;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets tax_office
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getTaxOffice()
|
||
{
|
||
return $this->container['tax_office'];
|
||
}
|
||
|
||
/**
|
||
* Sets tax_office
|
||
*
|
||
* @param string|null $tax_office ΔΟΥ πελάτη , υποχρεωτικό σε περίπτωση τιμολογίου
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setTaxOffice($tax_office)
|
||
{
|
||
if (is_null($tax_office)) {
|
||
array_push($this->openAPINullablesSetToNull, 'tax_office');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('tax_office', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($tax_office) && (mb_strlen($tax_office) > 40)) {
|
||
throw new \InvalidArgumentException('invalid length for $tax_office when calling Billing., must be smaller than or equal to 40.');
|
||
}
|
||
|
||
$this->container['tax_office'] = $tax_office;
|
||
|
||
return $this;
|
||
}
|
||
|
||
/**
|
||
* Gets activity
|
||
*
|
||
* @return string|null
|
||
*/
|
||
public function getActivity()
|
||
{
|
||
return $this->container['activity'];
|
||
}
|
||
|
||
/**
|
||
* Sets activity
|
||
*
|
||
* @param string|null $activity Επάγγελμα , υποχρεωτικό σε περίπτωση τιμολογίου
|
||
*
|
||
* @return self
|
||
*/
|
||
public function setActivity($activity)
|
||
{
|
||
if (is_null($activity)) {
|
||
array_push($this->openAPINullablesSetToNull, 'activity');
|
||
} else {
|
||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||
$index = array_search('activity', $nullablesSetToNull);
|
||
if ($index !== FALSE) {
|
||
unset($nullablesSetToNull[$index]);
|
||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||
}
|
||
}
|
||
if (!is_null($activity) && (mb_strlen($activity) > 80)) {
|
||
throw new \InvalidArgumentException('invalid length for $activity when calling Billing., must be smaller than or equal to 80.');
|
||
}
|
||
|
||
$this->container['activity'] = $activity;
|
||
|
||
return $this;
|
||
}
|
||
/**
|
||
* Returns true if offset exists. False otherwise.
|
||
*
|
||
* @param integer|string $offset Offset
|
||
*
|
||
* @return boolean
|
||
*/
|
||
public function offsetExists(mixed $offset): bool
|
||
{
|
||
return isset($this->container[$offset]);
|
||
}
|
||
|
||
/**
|
||
* Gets offset.
|
||
*
|
||
* @param integer|string $offset Offset
|
||
*
|
||
* @return mixed|null
|
||
*/
|
||
#[\ReturnTypeWillChange]
|
||
public function offsetGet(mixed $offset)
|
||
{
|
||
return $this->container[$offset] ?? null;
|
||
}
|
||
|
||
/**
|
||
* Sets value based on offset.
|
||
*
|
||
* @param int|null $offset Offset
|
||
* @param mixed $value Value to be set
|
||
*
|
||
* @return void
|
||
*/
|
||
public function offsetSet($offset, $value): void
|
||
{
|
||
if (is_null($offset)) {
|
||
$this->container[] = $value;
|
||
} else {
|
||
$this->container[$offset] = $value;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Unsets offset.
|
||
*
|
||
* @param integer|string $offset Offset
|
||
*
|
||
* @return void
|
||
*/
|
||
public function offsetUnset(mixed $offset): void
|
||
{
|
||
unset($this->container[$offset]);
|
||
}
|
||
|
||
/**
|
||
* Serializes the object to a value that can be serialized natively by json_encode().
|
||
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
|
||
*
|
||
* @return mixed Returns data which can be serialized by json_encode(), which is a value
|
||
* of any type other than a resource.
|
||
*/
|
||
#[\ReturnTypeWillChange]
|
||
public function jsonSerialize()
|
||
{
|
||
return ObjectSerializer::sanitizeForSerialization($this);
|
||
}
|
||
|
||
/**
|
||
* Gets the string presentation of the object
|
||
*
|
||
* @return string
|
||
*/
|
||
public function __toString()
|
||
{
|
||
return json_encode(
|
||
ObjectSerializer::sanitizeForSerialization($this),
|
||
JSON_PRETTY_PRINT
|
||
);
|
||
}
|
||
|
||
/**
|
||
* Gets a header-safe presentation of the object
|
||
*
|
||
* @return string
|
||
*/
|
||
public function toHeaderValue()
|
||
{
|
||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||
}
|
||
}
|
||
|
||
|