diff --git a/sdk-generation-log/balanceplatform.json b/sdk-generation-log/balanceplatform.json new file mode 100644 index 000000000..b6a720b70 --- /dev/null +++ b/sdk-generation-log/balanceplatform.json @@ -0,0 +1,8 @@ +{ + "service": "balanceplatform", + "project": "php", + "generatedAt": "2026-09-10T21:01:04Z", + "openapiCommitSha": "c4e0d44cf6c0f3dcdff65be8e250fdbfa9da1076", + "automationCommitSha": "d34376385296d6c542a454096b5081b467e00415", + "libraryCommitSha": "aeb3d01eede213f09109f197b5487dc80dcaee1a" +} diff --git a/src/Adyen/Model/BalancePlatform/AmountDTO.php b/src/Adyen/Model/BalancePlatform/AmountDTO.php new file mode 100644 index 000000000..8a8567c0f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AmountDTO.php @@ -0,0 +1,441 @@ + + */ +class AmountDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AmountDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * 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->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $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 ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php b/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php new file mode 100644 index 000000000..7f5e794b1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php @@ -0,0 +1,509 @@ + + */ +class ApproveAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApproveAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceIds' => 'string[]', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceIds' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceIds' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceIds' => 'scaDeviceIds', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceIds' => 'setScaDeviceIds', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceIds' => 'getScaDeviceIds', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceIds', $data ?? [], null); + $this->setIfExists('status', $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 ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceIds'] === null) { + $invalidProperties[] = "'scaDeviceIds' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' 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 entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceIds + * + * @return string[] + */ + public function getScaDeviceIds() + { + return $this->container['scaDeviceIds']; + } + + /** + * Sets scaDeviceIds + * + * @param string[] $scaDeviceIds List of device ids associated to the entity that will be approved. + * + * @return self + */ + public function setScaDeviceIds($scaDeviceIds) + { + $this->container['scaDeviceIds'] = $scaDeviceIds; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php b/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php new file mode 100644 index 000000000..c91c8e027 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php @@ -0,0 +1,407 @@ + + */ +class ApproveAssociationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApproveAssociationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaAssociations' => '\Adyen\Model\BalancePlatform\Association[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaAssociations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaAssociations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'scaAssociations' => 'scaAssociations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaAssociations' => 'setScaAssociations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaAssociations' => 'getScaAssociations' + ]; + + /** + * 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->setIfExists('scaAssociations', $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 ($this->container['scaAssociations'] === null) { + $invalidProperties[] = "'scaAssociations' 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 scaAssociations + * + * @return \Adyen\Model\BalancePlatform\Association[] + */ + public function getScaAssociations() + { + return $this->container['scaAssociations']; + } + + /** + * Sets scaAssociations + * + * @param \Adyen\Model\BalancePlatform\Association[] $scaAssociations The list of associations. + * + * @return self + */ + public function setScaAssociations($scaAssociations) + { + $this->container['scaAssociations'] = $scaAssociations; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Association.php b/src/Adyen/Model/BalancePlatform/Association.php new file mode 100644 index 000000000..a67c041b4 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Association.php @@ -0,0 +1,509 @@ + + */ +class Association implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Association'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceId' => 'string', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceId' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceId' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceId' => 'scaDeviceId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceId' => 'setScaDeviceId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceId' => 'getScaDeviceId', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceId', $data ?? [], null); + $this->setIfExists('status', $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 ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceId'] === null) { + $invalidProperties[] = "'scaDeviceId' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' 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 entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceId + * + * @return string + */ + public function getScaDeviceId() + { + return $this->container['scaDeviceId']; + } + + /** + * Sets scaDeviceId + * + * @param string $scaDeviceId The unique identifier for the SCA device. + * + * @return self + */ + public function setScaDeviceId($scaDeviceId) + { + $this->container['scaDeviceId'] = $scaDeviceId; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AssociationListing.php b/src/Adyen/Model/BalancePlatform/AssociationListing.php new file mode 100644 index 000000000..5ffdbfb64 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AssociationListing.php @@ -0,0 +1,608 @@ + + */ +class AssociationListing implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AssociationListing'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceId' => 'string', + 'scaDeviceName' => 'string', + 'scaDeviceType' => '\Adyen\Model\BalancePlatform\ScaDeviceType', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'entityId' => null, + 'entityType' => null, + 'scaDeviceId' => null, + 'scaDeviceName' => null, + 'scaDeviceType' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + 'entityId' => false, + 'entityType' => false, + 'scaDeviceId' => false, + 'scaDeviceName' => false, + 'scaDeviceType' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'createdAt' => 'createdAt', + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceId' => 'scaDeviceId', + 'scaDeviceName' => 'scaDeviceName', + 'scaDeviceType' => 'scaDeviceType', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceId' => 'setScaDeviceId', + 'scaDeviceName' => 'setScaDeviceName', + 'scaDeviceType' => 'setScaDeviceType', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceId' => 'getScaDeviceId', + 'scaDeviceName' => 'getScaDeviceName', + 'scaDeviceType' => 'getScaDeviceType', + 'status' => 'getStatus' + ]; + + /** + * 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->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceId', $data ?? [], null); + $this->setIfExists('scaDeviceName', $data ?? [], null); + $this->setIfExists('scaDeviceType', $data ?? [], null); + $this->setIfExists('status', $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 ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceId'] === null) { + $invalidProperties[] = "'scaDeviceId' can't be null"; + } + if ($this->container['scaDeviceType'] === null) { + $invalidProperties[] = "'scaDeviceType' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' 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 createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt The date and time when the association was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceId + * + * @return string + */ + public function getScaDeviceId() + { + return $this->container['scaDeviceId']; + } + + /** + * Sets scaDeviceId + * + * @param string $scaDeviceId The unique identifier of the SCA device. + * + * @return self + */ + public function setScaDeviceId($scaDeviceId) + { + $this->container['scaDeviceId'] = $scaDeviceId; + + return $this; + } + + /** + * Gets scaDeviceName + * + * @return string|null + */ + public function getScaDeviceName() + { + return $this->container['scaDeviceName']; + } + + /** + * Sets scaDeviceName + * + * @param string|null $scaDeviceName The human-readable name for the SCA device that was registered. + * + * @return self + */ + public function setScaDeviceName($scaDeviceName) + { + $this->container['scaDeviceName'] = $scaDeviceName; + + return $this; + } + + /** + * Gets scaDeviceType + * + * @return \Adyen\Model\BalancePlatform\ScaDeviceType + */ + public function getScaDeviceType() + { + return $this->container['scaDeviceType']; + } + + /** + * Sets scaDeviceType + * + * @param \Adyen\Model\BalancePlatform\ScaDeviceType $scaDeviceType scaDeviceType + * + * @return self + */ + public function setScaDeviceType($scaDeviceType) + { + $this->container['scaDeviceType'] = $scaDeviceType; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AssociationStatus.php b/src/Adyen/Model/BalancePlatform/AssociationStatus.php new file mode 100644 index 000000000..073d176a0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AssociationStatus.php @@ -0,0 +1,45 @@ + 'int', 'currency' => 'string', 'pending' => 'int', + 'pendingAvailable' => 'int', 'reserved' => 'int' ]; @@ -60,6 +61,7 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable 'balance' => 'int64', 'currency' => null, 'pending' => 'int64', + 'pendingAvailable' => 'int64', 'reserved' => 'int64' ]; @@ -73,6 +75,7 @@ class Balance implements ModelInterface, ArrayAccess, \JsonSerializable 'balance' => false, 'currency' => false, 'pending' => false, + 'pendingAvailable' => false, 'reserved' => false ]; @@ -166,6 +169,7 @@ public function isNullableSetToNull(string $property): bool 'balance' => 'balance', 'currency' => 'currency', 'pending' => 'pending', + 'pendingAvailable' => 'pendingAvailable', 'reserved' => 'reserved' ]; @@ -179,6 +183,7 @@ public function isNullableSetToNull(string $property): bool 'balance' => 'setBalance', 'currency' => 'setCurrency', 'pending' => 'setPending', + 'pendingAvailable' => 'setPendingAvailable', 'reserved' => 'setReserved' ]; @@ -192,6 +197,7 @@ public function isNullableSetToNull(string $property): bool 'balance' => 'getBalance', 'currency' => 'getCurrency', 'pending' => 'getPending', + 'pendingAvailable' => 'getPendingAvailable', 'reserved' => 'getReserved' ]; @@ -256,6 +262,7 @@ public function __construct(?array $data = null) $this->setIfExists('balance', $data ?? [], null); $this->setIfExists('currency', $data ?? [], null); $this->setIfExists('pending', $data ?? [], null); + $this->setIfExists('pendingAvailable', $data ?? [], null); $this->setIfExists('reserved', $data ?? [], null); } @@ -409,6 +416,30 @@ public function setPending($pending) return $this; } + /** + * Gets pendingAvailable + * + * @return int|null + */ + public function getPendingAvailable() + { + return $this->container['pendingAvailable']; + } + + /** + * Sets pendingAvailable + * + * @param int|null $pendingAvailable The balance that will become the available balance after the pending balance is settled. The pending available balance is equal to the lower of the following: - The `pending` balance - The `pending` balance plus the `available` balance. + * + * @return self + */ + public function setPendingAvailable($pendingAvailable) + { + $this->container['pendingAvailable'] = $pendingAvailable; + + return $this; + } + /** * Gets reserved * diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountConfiguration.php b/src/Adyen/Model/BalancePlatform/BalanceAccountConfiguration.php new file mode 100644 index 000000000..4b1ae3544 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountConfiguration.php @@ -0,0 +1,914 @@ + + */ +class BalanceAccountConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'balancePlatformPayoutScheduleId' => 'string', + 'createdAt' => '\DateTime', + 'currency' => 'string', + 'description' => 'string', + 'enabled' => 'bool', + 'frequency' => 'string', + 'frequencyValue' => 'int', + 'id' => 'string', + 'maxPayoutAmount' => 'int', + 'minPayoutAmount' => 'int', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', + 'retainedAmount' => 'int', + 'salesDayClosingTime' => 'string', + 'transferInstrumentId' => 'string', + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'balancePlatformPayoutScheduleId' => null, + 'createdAt' => 'date-time', + 'currency' => null, + 'description' => null, + 'enabled' => null, + 'frequency' => null, + 'frequencyValue' => 'int32', + 'id' => null, + 'maxPayoutAmount' => 'int64', + 'minPayoutAmount' => 'int64', + 'reference' => null, + 'referenceForBeneficiary' => null, + 'retainedAmount' => 'int64', + 'salesDayClosingTime' => null, + 'transferInstrumentId' => null, + 'updatedAt' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'balancePlatformPayoutScheduleId' => false, + 'createdAt' => false, + 'currency' => false, + 'description' => false, + 'enabled' => false, + 'frequency' => false, + 'frequencyValue' => true, + 'id' => false, + 'maxPayoutAmount' => false, + 'minPayoutAmount' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, + 'retainedAmount' => false, + 'salesDayClosingTime' => false, + 'transferInstrumentId' => false, + 'updatedAt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balanceAccountId' => 'balanceAccountId', + 'balancePlatformPayoutScheduleId' => 'balancePlatformPayoutScheduleId', + 'createdAt' => 'createdAt', + 'currency' => 'currency', + 'description' => 'description', + 'enabled' => 'enabled', + 'frequency' => 'frequency', + 'frequencyValue' => 'frequencyValue', + 'id' => 'id', + 'maxPayoutAmount' => 'maxPayoutAmount', + 'minPayoutAmount' => 'minPayoutAmount', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'retainedAmount' => 'retainedAmount', + 'salesDayClosingTime' => 'salesDayClosingTime', + 'transferInstrumentId' => 'transferInstrumentId', + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'balancePlatformPayoutScheduleId' => 'setBalancePlatformPayoutScheduleId', + 'createdAt' => 'setCreatedAt', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'frequency' => 'setFrequency', + 'frequencyValue' => 'setFrequencyValue', + 'id' => 'setId', + 'maxPayoutAmount' => 'setMaxPayoutAmount', + 'minPayoutAmount' => 'setMinPayoutAmount', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'retainedAmount' => 'setRetainedAmount', + 'salesDayClosingTime' => 'setSalesDayClosingTime', + 'transferInstrumentId' => 'setTransferInstrumentId', + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'balancePlatformPayoutScheduleId' => 'getBalancePlatformPayoutScheduleId', + 'createdAt' => 'getCreatedAt', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'frequency' => 'getFrequency', + 'frequencyValue' => 'getFrequencyValue', + 'id' => 'getId', + 'maxPayoutAmount' => 'getMaxPayoutAmount', + 'minPayoutAmount' => 'getMinPayoutAmount', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'retainedAmount' => 'getRetainedAmount', + 'salesDayClosingTime' => 'getSalesDayClosingTime', + 'transferInstrumentId' => 'getTransferInstrumentId', + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * 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->setIfExists('balanceAccountId', $data ?? [], null); + $this->setIfExists('balancePlatformPayoutScheduleId', $data ?? [], null); + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('frequencyValue', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('maxPayoutAmount', $data ?? [], null); + $this->setIfExists('minPayoutAmount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('retainedAmount', $data ?? [], null); + $this->setIfExists('salesDayClosingTime', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $data ?? [], null); + $this->setIfExists('updatedAt', $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 ($this->container['balanceAccountId'] === null) { + $invalidProperties[] = "'balanceAccountId' can't be null"; + } + if ($this->container['balancePlatformPayoutScheduleId'] === null) { + $invalidProperties[] = "'balancePlatformPayoutScheduleId' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['transferInstrumentId'] === null) { + $invalidProperties[] = "'transferInstrumentId' 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 balanceAccountId + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string $balanceAccountId The unique identifier of the balance account to which you apply the payout schedule. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets balancePlatformPayoutScheduleId + * + * @return string + */ + public function getBalancePlatformPayoutScheduleId() + { + return $this->container['balancePlatformPayoutScheduleId']; + } + + /** + * Sets balancePlatformPayoutScheduleId + * + * @param string $balancePlatformPayoutScheduleId The unique identifier of the balance platform payout schedule that is applied to the balance account. + * + * @return self + */ + public function setBalancePlatformPayoutScheduleId($balancePlatformPayoutScheduleId) + { + $this->container['balancePlatformPayoutScheduleId'] = $balancePlatformPayoutScheduleId; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt The date and time when the payout schedule was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO code](https://docs.adyen.com/development-resources/currency-codes) of the currency used for this schedule. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description used for all payouts initiated by this payout schedule. Maximum length: 140 characters. If your description is longer, it may be truncated. Default value: The `defaultDescription` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Specifies whether the payout schedule is active. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets frequency + * + * @return string|null + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param string|null $frequency frequency + * + * @return self + */ + public function setFrequency($frequency) + { + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets frequencyValue + * + * @return int|null + */ + public function getFrequencyValue() + { + return $this->container['frequencyValue']; + } + + /** + * Sets frequencyValue + * + * @param int|null $frequencyValue The date of the month or day of the week when payouts are initiated. Allowed only if `frequency` is **monthly** or **weekly**. Possible values if `frequency` is **monthly**: **[1 - 31]**. * If your specified date happens on a weekend, the payout is initiated on the next business day. * If your specified date (**29**, **30**, or **31**) does not exist in a month, the payout is initiated on the last day of that month. Possible values if `frequency` is **weekly**: **[1 - 5]**. Default value: The `defaultFrequencyValue` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setFrequencyValue($frequencyValue) + { + $this->container['frequencyValue'] = $frequencyValue; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the payout schedule for the balance account. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets maxPayoutAmount + * + * @return int|null + */ + public function getMaxPayoutAmount() + { + return $this->container['maxPayoutAmount']; + } + + /** + * Sets maxPayoutAmount + * + * @param int|null $maxPayoutAmount The maximum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMaxPayoutAmount($maxPayoutAmount) + { + $this->container['maxPayoutAmount'] = $maxPayoutAmount; + + return $this; + } + + /** + * Gets minPayoutAmount + * + * @return int|null + */ + public function getMinPayoutAmount() + { + return $this->container['minPayoutAmount']; + } + + /** + * Sets minPayoutAmount + * + * @param int|null $minPayoutAmount The minimum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMinPayoutAmount($minPayoutAmount) + { + $this->container['minPayoutAmount'] = $minPayoutAmount; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference Your reference for the payout schedule. This reference does not appear on statements of payouts initiated by the payout schedule. + * + * @return self + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference for beneficiary used for all payouts initiated by this payout schedule. This reference is sent to the recipient of the payout and is included in all webhooks related to the payout. Supported characters: **a-z**, **A-Z**, **0-9**. Default value: The `defaultReferenceForBeneficiary` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets retainedAmount + * + * @return int|null + */ + public function getRetainedAmount() + { + return $this->container['retainedAmount']; + } + + /** + * Sets retainedAmount + * + * @param int|null $retainedAmount The amount of funds that must remain available in the balance account after an execution of the payout schedule. If the funds in the balance account are less than the retained amount, the execution is not initiated. Default value: **0** + * + * @return self + */ + public function setRetainedAmount($retainedAmount) + { + $this->container['retainedAmount'] = $retainedAmount; + + return $this; + } + + /** + * Gets salesDayClosingTime + * + * @return string|null + * @deprecated + */ + public function getSalesDayClosingTime() + { + return $this->container['salesDayClosingTime']; + } + + /** + * Sets salesDayClosingTime + * + * @param string|null $salesDayClosingTime The time of day when the sales day is closed in balance account time zone. The sales day closing time can be between 00:00 to 07:00. Format: **HH:mm:ss** + * + * @return self + * @deprecated + */ + public function setSalesDayClosingTime($salesDayClosingTime) + { + $this->container['salesDayClosingTime'] = $salesDayClosingTime; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string $transferInstrumentId The unique identifier of the transfer instrument to which the funds are paid out. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime|null $updatedAt The date and time when the payout schedule was updated. + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationRequest.php b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationRequest.php new file mode 100644 index 000000000..847275402 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationRequest.php @@ -0,0 +1,824 @@ + + */ +class BalanceAccountConfigurationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountConfigurationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatformPayoutScheduleId' => 'string', + 'currency' => 'string', + 'description' => 'string', + 'enabled' => 'bool', + 'frequency' => 'string', + 'frequencyValue' => 'int', + 'maxPayoutAmount' => 'int', + 'minPayoutAmount' => 'int', + 'reference' => 'string', + 'referenceForBeneficiary' => 'string', + 'retainedAmount' => 'int', + 'salesDayClosingTime' => 'string', + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatformPayoutScheduleId' => null, + 'currency' => null, + 'description' => null, + 'enabled' => null, + 'frequency' => null, + 'frequencyValue' => 'int32', + 'maxPayoutAmount' => 'int64', + 'minPayoutAmount' => 'int64', + 'reference' => null, + 'referenceForBeneficiary' => null, + 'retainedAmount' => 'int64', + 'salesDayClosingTime' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatformPayoutScheduleId' => false, + 'currency' => false, + 'description' => false, + 'enabled' => false, + 'frequency' => false, + 'frequencyValue' => true, + 'maxPayoutAmount' => false, + 'minPayoutAmount' => false, + 'reference' => false, + 'referenceForBeneficiary' => false, + 'retainedAmount' => false, + 'salesDayClosingTime' => false, + 'transferInstrumentId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balancePlatformPayoutScheduleId' => 'balancePlatformPayoutScheduleId', + 'currency' => 'currency', + 'description' => 'description', + 'enabled' => 'enabled', + 'frequency' => 'frequency', + 'frequencyValue' => 'frequencyValue', + 'maxPayoutAmount' => 'maxPayoutAmount', + 'minPayoutAmount' => 'minPayoutAmount', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'retainedAmount' => 'retainedAmount', + 'salesDayClosingTime' => 'salesDayClosingTime', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatformPayoutScheduleId' => 'setBalancePlatformPayoutScheduleId', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'frequency' => 'setFrequency', + 'frequencyValue' => 'setFrequencyValue', + 'maxPayoutAmount' => 'setMaxPayoutAmount', + 'minPayoutAmount' => 'setMinPayoutAmount', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'retainedAmount' => 'setRetainedAmount', + 'salesDayClosingTime' => 'setSalesDayClosingTime', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatformPayoutScheduleId' => 'getBalancePlatformPayoutScheduleId', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'frequency' => 'getFrequency', + 'frequencyValue' => 'getFrequencyValue', + 'maxPayoutAmount' => 'getMaxPayoutAmount', + 'minPayoutAmount' => 'getMinPayoutAmount', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'retainedAmount' => 'getRetainedAmount', + 'salesDayClosingTime' => 'getSalesDayClosingTime', + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * 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; + } + + public const FREQUENCY_DAILY = 'daily'; + public const FREQUENCY_WEEKLY = 'weekly'; + public const FREQUENCY_WEEKDAYS = 'weekdays'; + public const FREQUENCY_MONTHLY = 'monthly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFrequencyAllowableValues() + { + return [ + self::FREQUENCY_DAILY, + self::FREQUENCY_WEEKLY, + self::FREQUENCY_WEEKDAYS, + self::FREQUENCY_MONTHLY, + ]; + } + /** + * 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->setIfExists('balancePlatformPayoutScheduleId', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('frequencyValue', $data ?? [], null); + $this->setIfExists('maxPayoutAmount', $data ?? [], null); + $this->setIfExists('minPayoutAmount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('retainedAmount', $data ?? [], null); + $this->setIfExists('salesDayClosingTime', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $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 ($this->container['balancePlatformPayoutScheduleId'] === null) { + $invalidProperties[] = "'balancePlatformPayoutScheduleId' can't be null"; + } + if ($this->container['frequency'] === null) { + $invalidProperties[] = "'frequency' can't be null"; + } + $allowedValues = $this->getFrequencyAllowableValues(); + if (!is_null($this->container['frequency']) && !in_array($this->container['frequency'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'frequency', must be one of '%s'", + $this->container['frequency'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['transferInstrumentId'] === null) { + $invalidProperties[] = "'transferInstrumentId' 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 balancePlatformPayoutScheduleId + * + * @return string + */ + public function getBalancePlatformPayoutScheduleId() + { + return $this->container['balancePlatformPayoutScheduleId']; + } + + /** + * Sets balancePlatformPayoutScheduleId + * + * @param string $balancePlatformPayoutScheduleId The unique identifier of the payout schedule that is applied to the balance account. + * + * @return self + */ + public function setBalancePlatformPayoutScheduleId($balancePlatformPayoutScheduleId) + { + $this->container['balancePlatformPayoutScheduleId'] = $balancePlatformPayoutScheduleId; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO code](https://docs.adyen.com/development-resources/currency-codes) of the currency used for this schedule. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The description used for all payouts initiated by this payout schedule. Maximum length: 140 characters. If your description is longer, it may be truncated. Default value: The `defaultDescription` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Specifies whether the payout schedule is enabled immediately after it is created. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets frequency + * + * @return string + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param string $frequency The frequency of payouts initiated by this payout schedule. Possible values: * daily * weekdays * weekly * monthly Default value: The `defaultFrequency` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setFrequency($frequency) + { + $allowedValues = $this->getFrequencyAllowableValues(); + if (!in_array($frequency, $allowedValues, true)) { + error_log( + sprintf( + "frequency: unexpected enum value '%s' - Supported values are [%s]", + $frequency, + implode(', ', $allowedValues) + ) + ); + } + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets frequencyValue + * + * @return int|null + */ + public function getFrequencyValue() + { + return $this->container['frequencyValue']; + } + + /** + * Sets frequencyValue + * + * @param int|null $frequencyValue The date of the month or day of the week when payouts are initiated. Allowed only if `frequency` is **monthly** or **weekly**. Possible values if `frequency` is **monthly**: **[1 - 31]**. * If your specified date happens on a weekend, the payout is initiated on the next business day. * If your specified date (**29**, **30**, or **31**) does not exist in a month, the payout is initiated on the last day of that month. Possible values if `frequency` is **weekly**: **[1 - 5]**. Default value: The `defaultFrequencyValue` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setFrequencyValue($frequencyValue) + { + $this->container['frequencyValue'] = $frequencyValue; + + return $this; + } + + /** + * Gets maxPayoutAmount + * + * @return int|null + */ + public function getMaxPayoutAmount() + { + return $this->container['maxPayoutAmount']; + } + + /** + * Sets maxPayoutAmount + * + * @param int|null $maxPayoutAmount The maximum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMaxPayoutAmount($maxPayoutAmount) + { + $this->container['maxPayoutAmount'] = $maxPayoutAmount; + + return $this; + } + + /** + * Gets minPayoutAmount + * + * @return int|null + */ + public function getMinPayoutAmount() + { + return $this->container['minPayoutAmount']; + } + + /** + * Sets minPayoutAmount + * + * @param int|null $minPayoutAmount The minimum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMinPayoutAmount($minPayoutAmount) + { + $this->container['minPayoutAmount'] = $minPayoutAmount; + + return $this; + } + + /** + * Gets reference + * + * @return string|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param string|null $reference The merchant reference that will be shown only in the schedule. + * + * @return self + */ + public function setReference($reference) + { + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary The reference for beneficiary used for all payouts initiated by this payout schedule. This reference is sent to the recipient of the transfer and is included in all webhooks related to the payout. Supported characters: **a-z**, **A-Z**, **0-9**, **-** and space. Spaces might be replaced with **-** if the recipient bank or payment infrastructure does not allow spaces. Default value: The `defaultReferenceForBeneficiary` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets retainedAmount + * + * @return int|null + */ + public function getRetainedAmount() + { + return $this->container['retainedAmount']; + } + + /** + * Sets retainedAmount + * + * @param int|null $retainedAmount The amount of funds that must remain available in the balance account after an execution of the payout schedule. If the funds in the balance account are less than the retained amount, the execution is not initiated. Default value: **0** + * + * @return self + */ + public function setRetainedAmount($retainedAmount) + { + $this->container['retainedAmount'] = $retainedAmount; + + return $this; + } + + /** + * Gets salesDayClosingTime + * + * @return string|null + * @deprecated + */ + public function getSalesDayClosingTime() + { + return $this->container['salesDayClosingTime']; + } + + /** + * Sets salesDayClosingTime + * + * @param string|null $salesDayClosingTime The time of day when the sales day is closed in balance account time zone. The sales day closing time can be between 00:00 to 07:00. Format: **HH:mm:ss** + * + * @return self + * @deprecated + */ + public function setSalesDayClosingTime($salesDayClosingTime) + { + $this->container['salesDayClosingTime'] = $salesDayClosingTime; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string $transferInstrumentId The unique identifier of the transfer instrument to which the funds are paid out. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationUpdate.php b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationUpdate.php new file mode 100644 index 000000000..2a15ad7cd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurationUpdate.php @@ -0,0 +1,833 @@ + + */ +class BalanceAccountConfigurationUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountConfigurationUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'mixed', + 'enabled' => 'mixed', + 'frequency' => 'string', + 'frequencyValue' => 'mixed', + 'maxPayoutAmount' => 'mixed', + 'minPayoutAmount' => 'mixed', + 'reference' => 'mixed', + 'referenceForBeneficiary' => 'mixed', + 'retainedAmount' => 'mixed', + 'salesDayClosingTime' => 'string', + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'enabled' => null, + 'frequency' => null, + 'frequencyValue' => 'int32', + 'maxPayoutAmount' => 'int64', + 'minPayoutAmount' => 'int64', + 'reference' => null, + 'referenceForBeneficiary' => null, + 'retainedAmount' => 'int64', + 'salesDayClosingTime' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => true, + 'enabled' => true, + 'frequency' => false, + 'frequencyValue' => true, + 'maxPayoutAmount' => true, + 'minPayoutAmount' => true, + 'reference' => true, + 'referenceForBeneficiary' => true, + 'retainedAmount' => true, + 'salesDayClosingTime' => false, + 'transferInstrumentId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'description' => 'description', + 'enabled' => 'enabled', + 'frequency' => 'frequency', + 'frequencyValue' => 'frequencyValue', + 'maxPayoutAmount' => 'maxPayoutAmount', + 'minPayoutAmount' => 'minPayoutAmount', + 'reference' => 'reference', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'retainedAmount' => 'retainedAmount', + 'salesDayClosingTime' => 'salesDayClosingTime', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'enabled' => 'setEnabled', + 'frequency' => 'setFrequency', + 'frequencyValue' => 'setFrequencyValue', + 'maxPayoutAmount' => 'setMaxPayoutAmount', + 'minPayoutAmount' => 'setMinPayoutAmount', + 'reference' => 'setReference', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'retainedAmount' => 'setRetainedAmount', + 'salesDayClosingTime' => 'setSalesDayClosingTime', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'enabled' => 'getEnabled', + 'frequency' => 'getFrequency', + 'frequencyValue' => 'getFrequencyValue', + 'maxPayoutAmount' => 'getMaxPayoutAmount', + 'minPayoutAmount' => 'getMinPayoutAmount', + 'reference' => 'getReference', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'retainedAmount' => 'getRetainedAmount', + 'salesDayClosingTime' => 'getSalesDayClosingTime', + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * 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; + } + + public const FREQUENCY_DAILY = 'daily'; + public const FREQUENCY_WEEKLY = 'weekly'; + public const FREQUENCY_WEEKDAYS = 'weekdays'; + public const FREQUENCY_MONTHLY = 'monthly'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFrequencyAllowableValues() + { + return [ + self::FREQUENCY_DAILY, + self::FREQUENCY_WEEKLY, + self::FREQUENCY_WEEKDAYS, + self::FREQUENCY_MONTHLY, + ]; + } + /** + * 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->setIfExists('description', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('frequency', $data ?? [], null); + $this->setIfExists('frequencyValue', $data ?? [], null); + $this->setIfExists('maxPayoutAmount', $data ?? [], null); + $this->setIfExists('minPayoutAmount', $data ?? [], null); + $this->setIfExists('reference', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('retainedAmount', $data ?? [], null); + $this->setIfExists('salesDayClosingTime', $data ?? [], null); + $this->setIfExists('transferInstrumentId', $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 = []; + + $allowedValues = $this->getFrequencyAllowableValues(); + if (!is_null($this->container['frequency']) && !in_array($this->container['frequency'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'frequency', must be one of '%s'", + $this->container['frequency'], + implode("', '", $allowedValues) + ); + } + + 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 description + * + * @return mixed|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param mixed|null $description The description used for all payouts initiated by this payout schedule. Maximum length: 140 characters. If your description is longer, it may be truncated. Default value: The `defaultDescription` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets enabled + * + * @return mixed|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param mixed|null $enabled Specifies whether the payout schedule is enabled immediately after it is created. + * + * @return self + */ + public function setEnabled($enabled) + { + if (is_null($enabled)) { + array_push($this->openAPINullablesSetToNull, 'enabled'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('enabled', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets frequency + * + * @return string|null + */ + public function getFrequency() + { + return $this->container['frequency']; + } + + /** + * Sets frequency + * + * @param string|null $frequency The frequency of payouts initiated by this payout schedule. Possible values: * daily * weekdays * weekly * monthly Default value: The `defaultFrequency` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setFrequency($frequency) + { + $allowedValues = $this->getFrequencyAllowableValues(); + if (!in_array($frequency, $allowedValues, true)) { + error_log( + sprintf( + "frequency: unexpected enum value '%s' - Supported values are [%s]", + $frequency, + implode(', ', $allowedValues) + ) + ); + } + $this->container['frequency'] = $frequency; + + return $this; + } + + /** + * Gets frequencyValue + * + * @return mixed|null + */ + public function getFrequencyValue() + { + return $this->container['frequencyValue']; + } + + /** + * Sets frequencyValue + * + * @param mixed|null $frequencyValue The date of the month or day of the week when payouts are initiated. Allowed only if `frequency` is **monthly** or **weekly**. Possible values if `frequency` is **monthly**: **[1 - 31]**. * If your specified date happens on a weekend, the payout is initiated on the next business day. * If your specified date (**29**, **30**, or **31**) does not exist in a month, the payout is initiated on the last day of that month. Possible values if `frequency` is **weekly**: **[1 - 5]**. Default value: The `defaultFrequencyValue` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setFrequencyValue($frequencyValue) + { + if (is_null($frequencyValue)) { + array_push($this->openAPINullablesSetToNull, 'frequencyValue'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('frequencyValue', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['frequencyValue'] = $frequencyValue; + + return $this; + } + + /** + * Gets maxPayoutAmount + * + * @return mixed|null + */ + public function getMaxPayoutAmount() + { + return $this->container['maxPayoutAmount']; + } + + /** + * Sets maxPayoutAmount + * + * @param mixed|null $maxPayoutAmount The maximum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMaxPayoutAmount($maxPayoutAmount) + { + if (is_null($maxPayoutAmount)) { + array_push($this->openAPINullablesSetToNull, 'maxPayoutAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('maxPayoutAmount', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['maxPayoutAmount'] = $maxPayoutAmount; + + return $this; + } + + /** + * Gets minPayoutAmount + * + * @return mixed|null + */ + public function getMinPayoutAmount() + { + return $this->container['minPayoutAmount']; + } + + /** + * Sets minPayoutAmount + * + * @param mixed|null $minPayoutAmount The minimum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0** + * + * @return self + */ + public function setMinPayoutAmount($minPayoutAmount) + { + if (is_null($minPayoutAmount)) { + array_push($this->openAPINullablesSetToNull, 'minPayoutAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('minPayoutAmount', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['minPayoutAmount'] = $minPayoutAmount; + + return $this; + } + + /** + * Gets reference + * + * @return mixed|null + */ + public function getReference() + { + return $this->container['reference']; + } + + /** + * Sets reference + * + * @param mixed|null $reference The merchant reference that will be shown only in the schedule. + * + * @return self + */ + public function setReference($reference) + { + if (is_null($reference)) { + array_push($this->openAPINullablesSetToNull, 'reference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reference', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reference'] = $reference; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return mixed|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param mixed|null $referenceForBeneficiary The reference for beneficiary used for all payouts initiated by this payout schedule. This reference is sent to the recipient of the transfer and is included in all webhooks related to the payout. Supported characters: **a-z**, **A-Z**, **0-9**, **-** and space. Spaces might be replaced with **-** if the recipient bank or payment infrastructure does not allow spaces. Default value: The `defaultReferenceForBeneficiary` from the balance platform schedule that you are applying. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + array_push($this->openAPINullablesSetToNull, 'referenceForBeneficiary'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('referenceForBeneficiary', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets retainedAmount + * + * @return mixed|null + */ + public function getRetainedAmount() + { + return $this->container['retainedAmount']; + } + + /** + * Sets retainedAmount + * + * @param mixed|null $retainedAmount The amount of funds that must remain available in the balance account after an execution of the payout schedule. If the funds in the balance account are less than the retained amount, the execution is not initiated. Default value: **0** + * + * @return self + */ + public function setRetainedAmount($retainedAmount) + { + if (is_null($retainedAmount)) { + array_push($this->openAPINullablesSetToNull, 'retainedAmount'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('retainedAmount', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['retainedAmount'] = $retainedAmount; + + return $this; + } + + /** + * Gets salesDayClosingTime + * + * @return string|null + * @deprecated + */ + public function getSalesDayClosingTime() + { + return $this->container['salesDayClosingTime']; + } + + /** + * Sets salesDayClosingTime + * + * @param string|null $salesDayClosingTime The time of day when the sales day is closed in balance account time zone. The sales day closing time can be between 00:00 to 07:00. Format: **HH:mm:ss** + * + * @return self + * @deprecated + */ + public function setSalesDayClosingTime($salesDayClosingTime) + { + $this->container['salesDayClosingTime'] = $salesDayClosingTime; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId The unique identifier of the transfer instrument to which the funds are paid out. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurations.php b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurations.php new file mode 100644 index 000000000..b6c769246 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceAccountConfigurations.php @@ -0,0 +1,441 @@ + + */ +class BalanceAccountConfigurations implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountConfigurations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountPayoutSchedules' => '\Adyen\Model\BalancePlatform\BalanceAccountConfiguration[]', + 'link' => '\Adyen\Model\BalancePlatform\Link' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountPayoutSchedules' => null, + 'link' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountPayoutSchedules' => false, + 'link' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balanceAccountPayoutSchedules' => 'balanceAccountPayoutSchedules', + 'link' => 'link' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountPayoutSchedules' => 'setBalanceAccountPayoutSchedules', + 'link' => 'setLink' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountPayoutSchedules' => 'getBalanceAccountPayoutSchedules', + 'link' => 'getLink' + ]; + + /** + * 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->setIfExists('balanceAccountPayoutSchedules', $data ?? [], null); + $this->setIfExists('link', $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 ($this->container['balanceAccountPayoutSchedules'] === null) { + $invalidProperties[] = "'balanceAccountPayoutSchedules' can't be null"; + } + if ($this->container['link'] === null) { + $invalidProperties[] = "'link' 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 balanceAccountPayoutSchedules + * + * @return \Adyen\Model\BalancePlatform\BalanceAccountConfiguration[] + */ + public function getBalanceAccountPayoutSchedules() + { + return $this->container['balanceAccountPayoutSchedules']; + } + + /** + * Sets balanceAccountPayoutSchedules + * + * @param \Adyen\Model\BalancePlatform\BalanceAccountConfiguration[] $balanceAccountPayoutSchedules Contains a list of the Balance Account payout schedules. + * + * @return self + */ + public function setBalanceAccountPayoutSchedules($balanceAccountPayoutSchedules) + { + $this->container['balanceAccountPayoutSchedules'] = $balanceAccountPayoutSchedules; + + return $this; + } + + /** + * Gets link + * + * @return \Adyen\Model\BalancePlatform\Link + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param \Adyen\Model\BalancePlatform\Link $link link + * + * @return self + */ + public function setLink($link) + { + $this->container['link'] = $link; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatformConfiguration.php b/src/Adyen/Model/BalancePlatform/BalancePlatformConfiguration.php new file mode 100644 index 000000000..4aeb79f29 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalancePlatformConfiguration.php @@ -0,0 +1,1011 @@ + + */ +class BalancePlatformConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformConfiguration'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'automaticApplication' => 'bool', + 'balancePlatformId' => 'string', + 'countryCode' => 'string', + 'createdAt' => '\DateTime', + 'currency' => 'string', + 'defaultDescription' => 'string', + 'defaultFrequency' => 'string', + 'defaultFrequencyValue' => 'int', + 'defaultReference' => 'string', + 'defaultReferenceForBeneficiary' => 'string', + 'enabled' => 'bool', + 'id' => 'string', + 'maxPayoutAmount' => 'int', + 'minPayoutAmount' => 'int', + 'payoutScheduleDescription' => 'string', + 'retainedAmount' => 'int', + 'updatedAt' => '\DateTime', + 'userSettlementDelay' => 'int', + 'userSettlementTime' => '\Adyen\Model\BalancePlatform\LocalTime', + 'userSettlementTimeZone' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'automaticApplication' => null, + 'balancePlatformId' => null, + 'countryCode' => null, + 'createdAt' => 'date-time', + 'currency' => null, + 'defaultDescription' => null, + 'defaultFrequency' => null, + 'defaultFrequencyValue' => 'int32', + 'defaultReference' => null, + 'defaultReferenceForBeneficiary' => null, + 'enabled' => null, + 'id' => null, + 'maxPayoutAmount' => 'int64', + 'minPayoutAmount' => 'int64', + 'payoutScheduleDescription' => null, + 'retainedAmount' => 'int64', + 'updatedAt' => 'date-time', + 'userSettlementDelay' => 'int32', + 'userSettlementTime' => null, + 'userSettlementTimeZone' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'automaticApplication' => false, + 'balancePlatformId' => false, + 'countryCode' => false, + 'createdAt' => false, + 'currency' => false, + 'defaultDescription' => false, + 'defaultFrequency' => false, + 'defaultFrequencyValue' => true, + 'defaultReference' => false, + 'defaultReferenceForBeneficiary' => false, + 'enabled' => false, + 'id' => false, + 'maxPayoutAmount' => false, + 'minPayoutAmount' => false, + 'payoutScheduleDescription' => false, + 'retainedAmount' => false, + 'updatedAt' => false, + 'userSettlementDelay' => true, + 'userSettlementTime' => false, + 'userSettlementTimeZone' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'automaticApplication' => 'automaticApplication', + 'balancePlatformId' => 'balancePlatformId', + 'countryCode' => 'countryCode', + 'createdAt' => 'createdAt', + 'currency' => 'currency', + 'defaultDescription' => 'defaultDescription', + 'defaultFrequency' => 'defaultFrequency', + 'defaultFrequencyValue' => 'defaultFrequencyValue', + 'defaultReference' => 'defaultReference', + 'defaultReferenceForBeneficiary' => 'defaultReferenceForBeneficiary', + 'enabled' => 'enabled', + 'id' => 'id', + 'maxPayoutAmount' => 'maxPayoutAmount', + 'minPayoutAmount' => 'minPayoutAmount', + 'payoutScheduleDescription' => 'payoutScheduleDescription', + 'retainedAmount' => 'retainedAmount', + 'updatedAt' => 'updatedAt', + 'userSettlementDelay' => 'userSettlementDelay', + 'userSettlementTime' => 'userSettlementTime', + 'userSettlementTimeZone' => 'userSettlementTimeZone' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'automaticApplication' => 'setAutomaticApplication', + 'balancePlatformId' => 'setBalancePlatformId', + 'countryCode' => 'setCountryCode', + 'createdAt' => 'setCreatedAt', + 'currency' => 'setCurrency', + 'defaultDescription' => 'setDefaultDescription', + 'defaultFrequency' => 'setDefaultFrequency', + 'defaultFrequencyValue' => 'setDefaultFrequencyValue', + 'defaultReference' => 'setDefaultReference', + 'defaultReferenceForBeneficiary' => 'setDefaultReferenceForBeneficiary', + 'enabled' => 'setEnabled', + 'id' => 'setId', + 'maxPayoutAmount' => 'setMaxPayoutAmount', + 'minPayoutAmount' => 'setMinPayoutAmount', + 'payoutScheduleDescription' => 'setPayoutScheduleDescription', + 'retainedAmount' => 'setRetainedAmount', + 'updatedAt' => 'setUpdatedAt', + 'userSettlementDelay' => 'setUserSettlementDelay', + 'userSettlementTime' => 'setUserSettlementTime', + 'userSettlementTimeZone' => 'setUserSettlementTimeZone' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'automaticApplication' => 'getAutomaticApplication', + 'balancePlatformId' => 'getBalancePlatformId', + 'countryCode' => 'getCountryCode', + 'createdAt' => 'getCreatedAt', + 'currency' => 'getCurrency', + 'defaultDescription' => 'getDefaultDescription', + 'defaultFrequency' => 'getDefaultFrequency', + 'defaultFrequencyValue' => 'getDefaultFrequencyValue', + 'defaultReference' => 'getDefaultReference', + 'defaultReferenceForBeneficiary' => 'getDefaultReferenceForBeneficiary', + 'enabled' => 'getEnabled', + 'id' => 'getId', + 'maxPayoutAmount' => 'getMaxPayoutAmount', + 'minPayoutAmount' => 'getMinPayoutAmount', + 'payoutScheduleDescription' => 'getPayoutScheduleDescription', + 'retainedAmount' => 'getRetainedAmount', + 'updatedAt' => 'getUpdatedAt', + 'userSettlementDelay' => 'getUserSettlementDelay', + 'userSettlementTime' => 'getUserSettlementTime', + 'userSettlementTimeZone' => 'getUserSettlementTimeZone' + ]; + + /** + * 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->setIfExists('automaticApplication', $data ?? [], null); + $this->setIfExists('balancePlatformId', $data ?? [], null); + $this->setIfExists('countryCode', $data ?? [], null); + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('defaultDescription', $data ?? [], null); + $this->setIfExists('defaultFrequency', $data ?? [], null); + $this->setIfExists('defaultFrequencyValue', $data ?? [], null); + $this->setIfExists('defaultReference', $data ?? [], null); + $this->setIfExists('defaultReferenceForBeneficiary', $data ?? [], null); + $this->setIfExists('enabled', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('maxPayoutAmount', $data ?? [], null); + $this->setIfExists('minPayoutAmount', $data ?? [], null); + $this->setIfExists('payoutScheduleDescription', $data ?? [], null); + $this->setIfExists('retainedAmount', $data ?? [], null); + $this->setIfExists('updatedAt', $data ?? [], null); + $this->setIfExists('userSettlementDelay', $data ?? [], null); + $this->setIfExists('userSettlementTime', $data ?? [], null); + $this->setIfExists('userSettlementTimeZone', $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 ($this->container['balancePlatformId'] === null) { + $invalidProperties[] = "'balancePlatformId' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['payoutScheduleDescription'] === null) { + $invalidProperties[] = "'payoutScheduleDescription' can't be null"; + } + if ($this->container['userSettlementDelay'] === null) { + $invalidProperties[] = "'userSettlementDelay' can't be null"; + } + if ($this->container['userSettlementTime'] === null) { + $invalidProperties[] = "'userSettlementTime' can't be null"; + } + if ($this->container['userSettlementTimeZone'] === null) { + $invalidProperties[] = "'userSettlementTimeZone' 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 automaticApplication + * + * @return bool|null + */ + public function getAutomaticApplication() + { + return $this->container['automaticApplication']; + } + + /** + * Sets automaticApplication + * + * @param bool|null $automaticApplication Specifies whether this payout schedule is automatically applied to new balance accounts. + * + * @return self + */ + public function setAutomaticApplication($automaticApplication) + { + $this->container['automaticApplication'] = $automaticApplication; + + return $this; + } + + /** + * Gets balancePlatformId + * + * @return string + */ + public function getBalancePlatformId() + { + return $this->container['balancePlatformId']; + } + + /** + * Sets balancePlatformId + * + * @param string $balancePlatformId The balance platform to which the payout schedule applies. + * + * @return self + */ + public function setBalancePlatformId($balancePlatformId) + { + $this->container['balancePlatformId'] = $balancePlatformId; + + return $this; + } + + /** + * Gets countryCode + * + * @return string|null + */ + public function getCountryCode() + { + return $this->container['countryCode']; + } + + /** + * Sets countryCode + * + * @param string|null $countryCode The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of the country to which the payout schedule applies. + * + * @return self + */ + public function setCountryCode($countryCode) + { + $this->container['countryCode'] = $countryCode; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt The date when the payout schedule was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO code](https://docs.adyen.com/development-resources/currency-codes) of the currency used for the payout schedule. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets defaultDescription + * + * @return string|null + */ + public function getDefaultDescription() + { + return $this->container['defaultDescription']; + } + + /** + * Sets defaultDescription + * + * @param string|null $defaultDescription The default description for payouts initiated by this payout schedule. + * + * @return self + */ + public function setDefaultDescription($defaultDescription) + { + $this->container['defaultDescription'] = $defaultDescription; + + return $this; + } + + /** + * Gets defaultFrequency + * + * @return string|null + */ + public function getDefaultFrequency() + { + return $this->container['defaultFrequency']; + } + + /** + * Sets defaultFrequency + * + * @param string|null $defaultFrequency defaultFrequency + * + * @return self + */ + public function setDefaultFrequency($defaultFrequency) + { + $this->container['defaultFrequency'] = $defaultFrequency; + + return $this; + } + + /** + * Gets defaultFrequencyValue + * + * @return int|null + */ + public function getDefaultFrequencyValue() + { + return $this->container['defaultFrequencyValue']; + } + + /** + * Sets defaultFrequencyValue + * + * @param int|null $defaultFrequencyValue The default value for date of the month or day of the week when payouts are initiated. Allowed only if `defaultFrequency` is **monthly** or **weekly**. Possible values if `defaultFrequency` is **monthly**: **[1 - 31]**. * If your specified date happens on a weekend, the payout is initiated on the next business day. * If your specified date (**29**, **30**, or **31**) does not exist in a month, the payout is initiated on the last day of that month. Possible values if `defaultFrequency` is **weekly**: **[1 - 5]**. + * + * @return self + */ + public function setDefaultFrequencyValue($defaultFrequencyValue) + { + $this->container['defaultFrequencyValue'] = $defaultFrequencyValue; + + return $this; + } + + /** + * Gets defaultReference + * + * @return string|null + */ + public function getDefaultReference() + { + return $this->container['defaultReference']; + } + + /** + * Sets defaultReference + * + * @param string|null $defaultReference Your internal default reference for the payout schedule.When the payout schedule is applied to a balance account, this reference is also used for that payout schedule. + * + * @return self + */ + public function setDefaultReference($defaultReference) + { + $this->container['defaultReference'] = $defaultReference; + + return $this; + } + + /** + * Gets defaultReferenceForBeneficiary + * + * @return string|null + */ + public function getDefaultReferenceForBeneficiary() + { + return $this->container['defaultReferenceForBeneficiary']; + } + + /** + * Sets defaultReferenceForBeneficiary + * + * @param string|null $defaultReferenceForBeneficiary The default reference for beneficiary for payouts initiated by this payout schedule. + * + * @return self + */ + public function setDefaultReferenceForBeneficiary($defaultReferenceForBeneficiary) + { + $this->container['defaultReferenceForBeneficiary'] = $defaultReferenceForBeneficiary; + + return $this; + } + + /** + * Gets enabled + * + * @return bool|null + */ + public function getEnabled() + { + return $this->container['enabled']; + } + + /** + * Sets enabled + * + * @param bool|null $enabled Specifies whether the payout schedule is enabled immediately after it is created. + * + * @return self + */ + public function setEnabled($enabled) + { + $this->container['enabled'] = $enabled; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the payout schedule for your balance platform. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets maxPayoutAmount + * + * @return int|null + */ + public function getMaxPayoutAmount() + { + return $this->container['maxPayoutAmount']; + } + + /** + * Sets maxPayoutAmount + * + * @param int|null $maxPayoutAmount The maximum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0**, which means that there is no maximum limit. + * + * @return self + */ + public function setMaxPayoutAmount($maxPayoutAmount) + { + $this->container['maxPayoutAmount'] = $maxPayoutAmount; + + return $this; + } + + /** + * Gets minPayoutAmount + * + * @return int|null + */ + public function getMinPayoutAmount() + { + return $this->container['minPayoutAmount']; + } + + /** + * Sets minPayoutAmount + * + * @param int|null $minPayoutAmount The minimum amount that can be paid out from balance accounts that use this payout schedule. Default value: **0**. + * + * @return self + */ + public function setMinPayoutAmount($minPayoutAmount) + { + $this->container['minPayoutAmount'] = $minPayoutAmount; + + return $this; + } + + /** + * Gets payoutScheduleDescription + * + * @return string + */ + public function getPayoutScheduleDescription() + { + return $this->container['payoutScheduleDescription']; + } + + /** + * Sets payoutScheduleDescription + * + * @param string $payoutScheduleDescription The type of payout schedule. This type indicates how fast funds are paid out to your user. Possible values: - **Standard**: The funds arrive in your user's transfer instrument two days after the funds are settled. - **Accelerated**: The funds arrive to your user's transfer instrument the day after the funds are settled. + * + * @return self + */ + public function setPayoutScheduleDescription($payoutScheduleDescription) + { + $this->container['payoutScheduleDescription'] = $payoutScheduleDescription; + + return $this; + } + + /** + * Gets retainedAmount + * + * @return int|null + */ + public function getRetainedAmount() + { + return $this->container['retainedAmount']; + } + + /** + * Sets retainedAmount + * + * @param int|null $retainedAmount The amount of funds that must remain available in a balance account after an execution of the payout schedule. If the funds in the balance account are less than the retained amount, the execution is not initiated. Default value: **0** + * + * @return self + */ + public function setRetainedAmount($retainedAmount) + { + $this->container['retainedAmount'] = $retainedAmount; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime|null $updatedAt The date when the payout schedule was updated. + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets userSettlementDelay + * + * @return int + */ + public function getUserSettlementDelay() + { + return $this->container['userSettlementDelay']; + } + + /** + * Sets userSettlementDelay + * + * @param int $userSettlementDelay The default [settlement delay](https://docs.adyen.com/platforms/settle-funds/#settlement-delay) for this payout schedule. + * + * @return self + */ + public function setUserSettlementDelay($userSettlementDelay) + { + $this->container['userSettlementDelay'] = $userSettlementDelay; + + return $this; + } + + /** + * Gets userSettlementTime + * + * @return \Adyen\Model\BalancePlatform\LocalTime + */ + public function getUserSettlementTime() + { + return $this->container['userSettlementTime']; + } + + /** + * Sets userSettlementTime + * + * @param \Adyen\Model\BalancePlatform\LocalTime $userSettlementTime userSettlementTime + * + * @return self + */ + public function setUserSettlementTime($userSettlementTime) + { + $this->container['userSettlementTime'] = $userSettlementTime; + + return $this; + } + + /** + * Gets userSettlementTimeZone + * + * @return string + */ + public function getUserSettlementTimeZone() + { + return $this->container['userSettlementTimeZone']; + } + + /** + * Sets userSettlementTimeZone + * + * @param string $userSettlementTimeZone The timezone of the `userSettlementTime`. + * + * @return self + */ + public function setUserSettlementTimeZone($userSettlementTimeZone) + { + $this->container['userSettlementTimeZone'] = $userSettlementTimeZone; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalancePlatformConfigurations.php b/src/Adyen/Model/BalancePlatform/BalancePlatformConfigurations.php new file mode 100644 index 000000000..4acb2f9da --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalancePlatformConfigurations.php @@ -0,0 +1,407 @@ + + */ +class BalancePlatformConfigurations implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalancePlatformConfigurations'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatformPayoutSchedules' => '\Adyen\Model\BalancePlatform\BalancePlatformConfiguration[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatformPayoutSchedules' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatformPayoutSchedules' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balancePlatformPayoutSchedules' => 'balancePlatformPayoutSchedules' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatformPayoutSchedules' => 'setBalancePlatformPayoutSchedules' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatformPayoutSchedules' => 'getBalancePlatformPayoutSchedules' + ]; + + /** + * 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->setIfExists('balancePlatformPayoutSchedules', $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 ($this->container['balancePlatformPayoutSchedules'] === null) { + $invalidProperties[] = "'balancePlatformPayoutSchedules' 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 balancePlatformPayoutSchedules + * + * @return \Adyen\Model\BalancePlatform\BalancePlatformConfiguration[] + */ + public function getBalancePlatformPayoutSchedules() + { + return $this->container['balancePlatformPayoutSchedules']; + } + + /** + * Sets balancePlatformPayoutSchedules + * + * @param \Adyen\Model\BalancePlatform\BalancePlatformConfiguration[] $balancePlatformPayoutSchedules Contains a list of the payout schedules configured in your balance platform. + * + * @return self + */ + public function setBalancePlatformPayoutSchedules($balancePlatformPayoutSchedules) + { + $this->container['balancePlatformPayoutSchedules'] = $balancePlatformPayoutSchedules; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php new file mode 100644 index 000000000..3678ea9d6 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php @@ -0,0 +1,399 @@ + + */ +class BalanceWebhookSetting extends WebhookSetting +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSetting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 = [ + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('conditions', $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 = parent::listInvalidProperties(); + + 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 conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated). + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php new file mode 100644 index 000000000..d6b4d70f7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php @@ -0,0 +1,404 @@ + + */ +class BalanceWebhookSettingAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSetting_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions' + ]; + + /** + * 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->setIfExists('conditions', $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 = []; + + 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 conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated). + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php new file mode 100644 index 000000000..3515fc886 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php @@ -0,0 +1,604 @@ + + */ +class BalanceWebhookSettingInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSettingInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]', + 'currency' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\Target', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null, + 'currency' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false, + 'currency' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'conditions' => 'conditions', + 'currency' => 'currency', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'currency' => 'setCurrency', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'currency' => 'getCurrency', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_BALANCE = 'balance'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE, + ]; + } + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $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 ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The array of conditions a balance change must meet for Adyen to send the webhook. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\Target + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\Target $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of the webhook you are configuring. Set to **balance**. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php new file mode 100644 index 000000000..23e452248 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php @@ -0,0 +1,592 @@ + + */ +class BalanceWebhookSettingInfoUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSettingInfoUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]', + 'currency' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\TargetUpdate', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null, + 'currency' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false, + 'currency' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'conditions' => 'conditions', + 'currency' => 'currency', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'currency' => 'setCurrency', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'currency' => 'getCurrency', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_BALANCE = 'balance'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE, + ]; + } + /** + * 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->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $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 = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + 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 conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The array of conditions a balance change must meet for Adyen to send the webhook. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\TargetUpdate|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\TargetUpdate|null $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the webhook you are configuring. Set to **balance**. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php index f6129cc13..5fb2f83af 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php @@ -28,7 +28,7 @@ */ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -53,9 +53,9 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ 'institutionNumber' => 'string', 'transitNumber' => 'string', 'clearingCode' => 'string', + 'bic' => 'string', 'iban' => 'string', 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', - 'bic' => 'string', 'clearingNumber' => 'string', 'sortCode' => 'string', 'routingNumber' => 'string' @@ -79,9 +79,9 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ 'institutionNumber' => null, 'transitNumber' => null, 'clearingCode' => null, + 'bic' => null, 'iban' => null, 'additionalBankIdentification' => null, - 'bic' => null, 'clearingNumber' => null, 'sortCode' => null, 'routingNumber' => null @@ -103,9 +103,9 @@ class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \ 'institutionNumber' => false, 'transitNumber' => false, 'clearingCode' => false, + 'bic' => false, 'iban' => false, 'additionalBankIdentification' => false, - 'bic' => false, 'clearingNumber' => false, 'sortCode' => false, 'routingNumber' => false @@ -207,9 +207,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'clearingCode' => 'clearingCode', + 'bic' => 'bic', 'iban' => 'iban', 'additionalBankIdentification' => 'additionalBankIdentification', - 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', 'sortCode' => 'sortCode', 'routingNumber' => 'routingNumber' @@ -231,9 +231,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'clearingCode' => 'setClearingCode', + 'bic' => 'setBic', 'iban' => 'setIban', 'additionalBankIdentification' => 'setAdditionalBankIdentification', - 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', 'sortCode' => 'setSortCode', 'routingNumber' => 'setRoutingNumber' @@ -255,9 +255,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'clearingCode' => 'getClearingCode', + 'bic' => 'getBic', 'iban' => 'getIban', 'additionalBankIdentification' => 'getAdditionalBankIdentification', - 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', 'sortCode' => 'getSortCode', 'routingNumber' => 'getRoutingNumber' @@ -329,12 +329,15 @@ public function __construct(?array $data = null) $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); - $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -390,12 +393,12 @@ public function listInvalidProperties() if ($this->container['clearingCode'] === null) { $invalidProperties[] = "'clearingCode' can't be null"; } - if ($this->container['iban'] === null) { - $invalidProperties[] = "'iban' can't be null"; - } if ($this->container['bic'] === null) { $invalidProperties[] = "'bic' can't be null"; } + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } if ($this->container['clearingNumber'] === null) { $invalidProperties[] = "'clearingNumber' can't be null"; } @@ -661,73 +664,73 @@ public function setClearingCode($clearingCode) } /** - * Gets iban + * Gets bic * * @return string */ - public function getIban() + public function getBic() { - return $this->container['iban']; + return $this->container['bic']; } /** - * Sets iban + * Sets bic * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. * * @return self */ - public function setIban($iban) + public function setBic($bic) { - $this->container['iban'] = $iban; + $this->container['bic'] = $bic; return $this; } /** - * Gets additionalBankIdentification + * Gets iban * - * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null + * @return string */ - public function getAdditionalBankIdentification() + public function getIban() { - return $this->container['additionalBankIdentification']; + return $this->container['iban']; } /** - * Sets additionalBankIdentification + * Sets iban * - * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. * * @return self */ - public function setAdditionalBankIdentification($additionalBankIdentification) + public function setIban($iban) { - $this->container['additionalBankIdentification'] = $additionalBankIdentification; + $this->container['iban'] = $iban; return $this; } /** - * Gets bic + * Gets additionalBankIdentification * - * @return string + * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null */ - public function getBic() + public function getAdditionalBankIdentification() { - return $this->container['bic']; + return $this->container['additionalBankIdentification']; } /** - * Sets bic + * Sets additionalBankIdentification * - * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification * * @return self */ - public function setBic($bic) + public function setAdditionalBankIdentification($additionalBankIdentification) { - $this->container['bic'] = $bic; + $this->container['additionalBankIdentification'] = $additionalBankIdentification; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php index 27858a61a..6c581e585 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php @@ -232,7 +232,11 @@ public function getModelName() public const BANK_ACCOUNT_IDENTIFICATION_TYPES_HK_LOCAL = 'hkLocal'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_HU_LOCAL = 'huLocal'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_IBAN = 'iban'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_IN_LOCAL = 'inLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_JP_LOCAL = 'jpLocal'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_LEGACY = 'legacy'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_MX_LOCAL = 'mxLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_MY_LOCAL = 'myLocal'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_NO_LOCAL = 'noLocal'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_NUMBER_AND_BIC = 'numberAndBic'; public const BANK_ACCOUNT_IDENTIFICATION_TYPES_NZ_LOCAL = 'nzLocal'; @@ -259,7 +263,11 @@ public function getBankAccountIdentificationTypesAllowableValues() self::BANK_ACCOUNT_IDENTIFICATION_TYPES_HK_LOCAL, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_HU_LOCAL, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_IBAN, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_IN_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_JP_LOCAL, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_LEGACY, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_MX_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_MY_LOCAL, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NO_LOCAL, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NUMBER_AND_BIC, self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NZ_LOCAL, diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index 4c1447cfa..3c3809695 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -28,7 +28,7 @@ */ class BankAccountIdentificationValidationRequestAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -53,9 +53,9 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'institutionNumber' => 'string', 'transitNumber' => 'string', 'clearingCode' => 'string', + 'bic' => 'string', 'iban' => 'string', 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', - 'bic' => 'string', 'clearingNumber' => 'string', 'sortCode' => 'string', 'routingNumber' => 'string' @@ -79,9 +79,9 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'institutionNumber' => null, 'transitNumber' => null, 'clearingCode' => null, + 'bic' => null, 'iban' => null, 'additionalBankIdentification' => null, - 'bic' => null, 'clearingNumber' => null, 'sortCode' => null, 'routingNumber' => null @@ -103,9 +103,9 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'institutionNumber' => false, 'transitNumber' => false, 'clearingCode' => false, + 'bic' => false, 'iban' => false, 'additionalBankIdentification' => false, - 'bic' => false, 'clearingNumber' => false, 'sortCode' => false, 'routingNumber' => false @@ -207,9 +207,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', 'clearingCode' => 'clearingCode', + 'bic' => 'bic', 'iban' => 'iban', 'additionalBankIdentification' => 'additionalBankIdentification', - 'bic' => 'bic', 'clearingNumber' => 'clearingNumber', 'sortCode' => 'sortCode', 'routingNumber' => 'routingNumber' @@ -231,9 +231,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', 'clearingCode' => 'setClearingCode', + 'bic' => 'setBic', 'iban' => 'setIban', 'additionalBankIdentification' => 'setAdditionalBankIdentification', - 'bic' => 'setBic', 'clearingNumber' => 'setClearingNumber', 'sortCode' => 'setSortCode', 'routingNumber' => 'setRoutingNumber' @@ -255,9 +255,9 @@ public function isNullableSetToNull(string $property): bool 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', 'clearingCode' => 'getClearingCode', + 'bic' => 'getBic', 'iban' => 'getIban', 'additionalBankIdentification' => 'getAdditionalBankIdentification', - 'bic' => 'getBic', 'clearingNumber' => 'getClearingNumber', 'sortCode' => 'getSortCode', 'routingNumber' => 'getRoutingNumber' @@ -329,12 +329,15 @@ public function __construct(?array $data = null) $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); $this->setIfExists('clearingCode', $data ?? [], null); + $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); - $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('clearingNumber', $data ?? [], null); $this->setIfExists('sortCode', $data ?? [], null); $this->setIfExists('routingNumber', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -390,12 +393,12 @@ public function listInvalidProperties() if ($this->container['clearingCode'] === null) { $invalidProperties[] = "'clearingCode' can't be null"; } - if ($this->container['iban'] === null) { - $invalidProperties[] = "'iban' can't be null"; - } if ($this->container['bic'] === null) { $invalidProperties[] = "'bic' can't be null"; } + if ($this->container['iban'] === null) { + $invalidProperties[] = "'iban' can't be null"; + } if ($this->container['clearingNumber'] === null) { $invalidProperties[] = "'clearingNumber' can't be null"; } @@ -661,73 +664,73 @@ public function setClearingCode($clearingCode) } /** - * Gets iban + * Gets bic * * @return string */ - public function getIban() + public function getBic() { - return $this->container['iban']; + return $this->container['bic']; } /** - * Sets iban + * Sets bic * - * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. * * @return self */ - public function setIban($iban) + public function setBic($bic) { - $this->container['iban'] = $iban; + $this->container['bic'] = $bic; return $this; } /** - * Gets additionalBankIdentification + * Gets iban * - * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null + * @return string */ - public function getAdditionalBankIdentification() + public function getIban() { - return $this->container['additionalBankIdentification']; + return $this->container['iban']; } /** - * Sets additionalBankIdentification + * Sets iban * - * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * @param string $iban The international bank account number as defined in the [ISO-13616](https://www.iso.org/standard/81090.html) standard. * * @return self */ - public function setAdditionalBankIdentification($additionalBankIdentification) + public function setIban($iban) { - $this->container['additionalBankIdentification'] = $additionalBankIdentification; + $this->container['iban'] = $iban; return $this; } /** - * Gets bic + * Gets additionalBankIdentification * - * @return string + * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null */ - public function getBic() + public function getAdditionalBankIdentification() { - return $this->container['bic']; + return $this->container['additionalBankIdentification']; } /** - * Sets bic + * Sets additionalBankIdentification * - * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification * * @return self */ - public function setBic($bic) + public function setAdditionalBankIdentification($additionalBankIdentification) { - $this->container['bic'] = $bic; + $this->container['additionalBankIdentification'] = $additionalBankIdentification; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php new file mode 100644 index 000000000..c948966bd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php @@ -0,0 +1,441 @@ + + */ +class BeginScaDeviceRegistrationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BeginScaDeviceRegistrationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'sdkOutput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'sdkOutput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'sdkOutput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'name' => 'name', + 'sdkOutput' => 'sdkOutput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'sdkOutput' => 'setSdkOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'sdkOutput' => 'getSdkOutput' + ]; + + /** + * 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->setIfExists('name', $data ?? [], null); + $this->setIfExists('sdkOutput', $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 ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['sdkOutput'] === null) { + $invalidProperties[] = "'sdkOutput' 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the SCA device that you are registering. You can use it to help your users identify the device. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sdkOutput + * + * @return string + */ + public function getSdkOutput() + { + return $this->container['sdkOutput']; + } + + /** + * Sets sdkOutput + * + * @param string $sdkOutput A base64-encoded block with the data required to register the SCA device. You obtain this information by using Adyen's authentication SDK. + * + * @return self + */ + public function setSdkOutput($sdkOutput) + { + $this->container['sdkOutput'] = $sdkOutput; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php new file mode 100644 index 000000000..97c87ef03 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php @@ -0,0 +1,435 @@ + + */ +class BeginScaDeviceRegistrationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BeginScaDeviceRegistrationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaDevice' => '\Adyen\Model\BalancePlatform\ScaDevice', + 'sdkInput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaDevice' => null, + 'sdkInput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaDevice' => false, + 'sdkInput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'scaDevice' => 'scaDevice', + 'sdkInput' => 'sdkInput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaDevice' => 'setScaDevice', + 'sdkInput' => 'setSdkInput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaDevice' => 'getScaDevice', + 'sdkInput' => 'getSdkInput' + ]; + + /** + * 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->setIfExists('scaDevice', $data ?? [], null); + $this->setIfExists('sdkInput', $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 = []; + + 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 scaDevice + * + * @return \Adyen\Model\BalancePlatform\ScaDevice|null + */ + public function getScaDevice() + { + return $this->container['scaDevice']; + } + + /** + * Sets scaDevice + * + * @param \Adyen\Model\BalancePlatform\ScaDevice|null $scaDevice scaDevice + * + * @return self + */ + public function setScaDevice($scaDevice) + { + $this->container['scaDevice'] = $scaDevice; + + return $this; + } + + /** + * Gets sdkInput + * + * @return string|null + */ + public function getSdkInput() + { + return $this->container['sdkInput']; + } + + /** + * Sets sdkInput + * + * @param string|null $sdkInput A string that you must pass to the authentication SDK to continue with the registration process. + * + * @return self + */ + public function setSdkInput($sdkInput) + { + $this->container['sdkInput'] = $sdkInput; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 69848132b..ef639ad69 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -54,6 +54,7 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl 'language' => 'string', 'logoImageId' => 'string', 'pinMailer' => 'string', + 'printLine' => 'string', 'shipmentMethod' => 'string' ]; @@ -78,6 +79,7 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl 'language' => null, 'logoImageId' => null, 'pinMailer' => null, + 'printLine' => null, 'shipmentMethod' => null ]; @@ -100,6 +102,7 @@ class CardConfiguration implements ModelInterface, ArrayAccess, \JsonSerializabl 'language' => false, 'logoImageId' => false, 'pinMailer' => false, + 'printLine' => false, 'shipmentMethod' => false ]; @@ -202,6 +205,7 @@ public function isNullableSetToNull(string $property): bool 'language' => 'language', 'logoImageId' => 'logoImageId', 'pinMailer' => 'pinMailer', + 'printLine' => 'printLine', 'shipmentMethod' => 'shipmentMethod' ]; @@ -224,6 +228,7 @@ public function isNullableSetToNull(string $property): bool 'language' => 'setLanguage', 'logoImageId' => 'setLogoImageId', 'pinMailer' => 'setPinMailer', + 'printLine' => 'setPrintLine', 'shipmentMethod' => 'setShipmentMethod' ]; @@ -246,6 +251,7 @@ public function isNullableSetToNull(string $property): bool 'language' => 'getLanguage', 'logoImageId' => 'getLogoImageId', 'pinMailer' => 'getPinMailer', + 'printLine' => 'getPrintLine', 'shipmentMethod' => 'getShipmentMethod' ]; @@ -319,6 +325,7 @@ public function __construct(?array $data = null) $this->setIfExists('language', $data ?? [], null); $this->setIfExists('logoImageId', $data ?? [], null); $this->setIfExists('pinMailer', $data ?? [], null); + $this->setIfExists('printLine', $data ?? [], null); $this->setIfExists('shipmentMethod', $data ?? [], null); } @@ -679,6 +686,30 @@ public function setPinMailer($pinMailer) return $this; } + /** + * Gets printLine + * + * @return string|null + */ + public function getPrintLine() + { + return $this->container['printLine']; + } + + /** + * Sets printLine + * + * @param string|null $printLine Print Line. Text printed on the physical card below the cardholder name. You provide the value, which can be up to 26 characters. + * + * @return self + */ + public function setPrintLine($printLine) + { + $this->container['printLine'] = $printLine; + + return $this; + } + /** * Gets shipmentMethod * diff --git a/src/Adyen/Model/BalancePlatform/Condition.php b/src/Adyen/Model/BalancePlatform/Condition.php new file mode 100644 index 000000000..84dcec492 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Condition.php @@ -0,0 +1,549 @@ + + */ +class Condition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Condition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceType' => 'string', + 'conditionType' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceType' => null, + 'conditionType' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceType' => false, + 'conditionType' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balanceType' => 'balanceType', + 'conditionType' => 'conditionType', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceType' => 'setBalanceType', + 'conditionType' => 'setConditionType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceType' => 'getBalanceType', + 'conditionType' => 'getConditionType', + 'value' => 'getValue' + ]; + + /** + * 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; + } + + public const BALANCE_TYPE_BALANCE = 'balance'; + public const BALANCE_TYPE_AVAILABLE = 'available'; + public const BALANCE_TYPE_PENDING = 'pending'; + public const BALANCE_TYPE_RESERVED = 'reserved'; + public const CONDITION_TYPE_GREATER_THAN = 'greaterThan'; + public const CONDITION_TYPE_GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual'; + public const CONDITION_TYPE_LESS_THAN = 'lessThan'; + public const CONDITION_TYPE_LESS_THAN_OR_EQUAL = 'lessThanOrEqual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBalanceTypeAllowableValues() + { + return [ + self::BALANCE_TYPE_BALANCE, + self::BALANCE_TYPE_AVAILABLE, + self::BALANCE_TYPE_PENDING, + self::BALANCE_TYPE_RESERVED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConditionTypeAllowableValues() + { + return [ + self::CONDITION_TYPE_GREATER_THAN, + self::CONDITION_TYPE_GREATER_THAN_OR_EQUAL, + self::CONDITION_TYPE_LESS_THAN, + self::CONDITION_TYPE_LESS_THAN_OR_EQUAL, + ]; + } + /** + * 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->setIfExists('balanceType', $data ?? [], null); + $this->setIfExists('conditionType', $data ?? [], null); + $this->setIfExists('value', $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 ($this->container['balanceType'] === null) { + $invalidProperties[] = "'balanceType' can't be null"; + } + $allowedValues = $this->getBalanceTypeAllowableValues(); + if (!is_null($this->container['balanceType']) && !in_array($this->container['balanceType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'balanceType', must be one of '%s'", + $this->container['balanceType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['conditionType'] === null) { + $invalidProperties[] = "'conditionType' can't be null"; + } + $allowedValues = $this->getConditionTypeAllowableValues(); + if (!is_null($this->container['conditionType']) && !in_array($this->container['conditionType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conditionType', must be one of '%s'", + $this->container['conditionType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' 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 balanceType + * + * @return string + */ + public function getBalanceType() + { + return $this->container['balanceType']; + } + + /** + * Sets balanceType + * + * @param string $balanceType Define the type of balance about which you want to get notified. Possible values: * **available**: the balance available for use. * **balance**: the sum of transactions that have already been settled. * **pending**: the sum of transactions that will be settled in the future. * **reserved**: the balance currently held in reserve. + * + * @return self + */ + public function setBalanceType($balanceType) + { + $allowedValues = $this->getBalanceTypeAllowableValues(); + if (!in_array($balanceType, $allowedValues, true)) { + error_log( + sprintf( + "balanceType: unexpected enum value '%s' - Supported values are [%s]", + $balanceType, + implode(', ', $allowedValues) + ) + ); + } + $this->container['balanceType'] = $balanceType; + + return $this; + } + + /** + * Gets conditionType + * + * @return string + */ + public function getConditionType() + { + return $this->container['conditionType']; + } + + /** + * Sets conditionType + * + * @param string $conditionType Define when you want to get notified about a balance change. Possible values: * **greaterThan**: the balance in the account(s) exceeds the specified `value`. * **greaterThanOrEqual**: the balance in the account(s) reaches or exceeds the specified `value`. * **lessThan**: the balance in the account(s) drops below the specified `value`. * **lessThanOrEqual**: the balance in the account(s) reaches to drops below the specified `value`. + * + * @return self + */ + public function setConditionType($conditionType) + { + $allowedValues = $this->getConditionTypeAllowableValues(); + if (!in_array($conditionType, $allowedValues, true)) { + error_log( + sprintf( + "conditionType: unexpected enum value '%s' - Supported values are [%s]", + $conditionType, + implode(', ', $allowedValues) + ) + ); + } + $this->container['conditionType'] = $conditionType; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The value limit in the specified balance type and currency, in minor units. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CreateRecurringTopUp.php b/src/Adyen/Model/BalancePlatform/CreateRecurringTopUp.php new file mode 100644 index 000000000..527073152 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CreateRecurringTopUp.php @@ -0,0 +1,604 @@ + + */ +class CreateRecurringTopUp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateRecurringTopUp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'counterparty' => '\Adyen\Model\BalancePlatform\TopUpCounterparty', + 'description' => 'string', + 'referenceForBeneficiary' => 'string', + 'status' => 'string', + 'topUpAmount' => '\Adyen\Model\BalancePlatform\TopUpAmount', + 'trigger' => '\Adyen\Model\BalancePlatform\Trigger' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'counterparty' => null, + 'description' => null, + 'referenceForBeneficiary' => null, + 'status' => null, + 'topUpAmount' => null, + 'trigger' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'counterparty' => false, + 'description' => false, + 'referenceForBeneficiary' => false, + 'status' => false, + 'topUpAmount' => false, + 'trigger' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'counterparty' => 'counterparty', + 'description' => 'description', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'status' => 'status', + 'topUpAmount' => 'topUpAmount', + 'trigger' => 'trigger' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'counterparty' => 'setCounterparty', + 'description' => 'setDescription', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'status' => 'setStatus', + 'topUpAmount' => 'setTopUpAmount', + 'trigger' => 'setTrigger' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'counterparty' => 'getCounterparty', + 'description' => 'getDescription', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'status' => 'getStatus', + 'topUpAmount' => 'getTopUpAmount', + 'trigger' => 'getTrigger' + ]; + + /** + * 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; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * 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->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('topUpAmount', $data ?? [], null); + $this->setIfExists('trigger', $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 ($this->container['counterparty'] === null) { + $invalidProperties[] = "'counterparty' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['topUpAmount'] === null) { + $invalidProperties[] = "'topUpAmount' can't be null"; + } + if ($this->container['trigger'] === null) { + $invalidProperties[] = "'trigger' 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 counterparty + * + * @return \Adyen\Model\BalancePlatform\TopUpCounterparty + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\TopUpCounterparty $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the recurring top-up. Maximum length is 140 characters. If you set a longer description, it will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the recurring top-up. If not provided, by default, this is set to **active**. Possible values: * **active**: the top up is enabled and funds will be pulled in. * **inactive**: the top up is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets topUpAmount + * + * @return \Adyen\Model\BalancePlatform\TopUpAmount + */ + public function getTopUpAmount() + { + return $this->container['topUpAmount']; + } + + /** + * Sets topUpAmount + * + * @param \Adyen\Model\BalancePlatform\TopUpAmount $topUpAmount topUpAmount + * + * @return self + */ + public function setTopUpAmount($topUpAmount) + { + $this->container['topUpAmount'] = $topUpAmount; + + return $this; + } + + /** + * Gets trigger + * + * @return \Adyen\Model\BalancePlatform\Trigger + */ + public function getTrigger() + { + return $this->container['trigger']; + } + + /** + * Sets trigger + * + * @param \Adyen\Model\BalancePlatform\Trigger $trigger trigger + * + * @return self + */ + public function setTrigger($trigger) + { + $this->container['trigger'] = $trigger; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ExecutionResult.php b/src/Adyen/Model/BalancePlatform/ExecutionResult.php new file mode 100644 index 000000000..c5e9a1ce5 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ExecutionResult.php @@ -0,0 +1,48 @@ + + */ +class FinishScaDeviceRegistrationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FinishScaDeviceRegistrationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sdkOutput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sdkOutput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sdkOutput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'sdkOutput' => 'sdkOutput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sdkOutput' => 'setSdkOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sdkOutput' => 'getSdkOutput' + ]; + + /** + * 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->setIfExists('sdkOutput', $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 ($this->container['sdkOutput'] === null) { + $invalidProperties[] = "'sdkOutput' 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 sdkOutput + * + * @return string + */ + public function getSdkOutput() + { + return $this->container['sdkOutput']; + } + + /** + * Sets sdkOutput + * + * @param string $sdkOutput A base64-encoded block with the data required to register the SCA device. You obtain this information by using Adyen's authentication SDK. + * + * @return self + */ + public function setSdkOutput($sdkOutput) + { + $this->container['sdkOutput'] = $sdkOutput; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php new file mode 100644 index 000000000..3016f3d48 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php @@ -0,0 +1,404 @@ + + */ +class FinishScaDeviceRegistrationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FinishScaDeviceRegistrationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaDevice' => '\Adyen\Model\BalancePlatform\ScaDevice' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaDevice' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaDevice' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'scaDevice' => 'scaDevice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaDevice' => 'setScaDevice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaDevice' => 'getScaDevice' + ]; + + /** + * 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->setIfExists('scaDevice', $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 = []; + + 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 scaDevice + * + * @return \Adyen\Model\BalancePlatform\ScaDevice|null + */ + public function getScaDevice() + { + return $this->container['scaDevice']; + } + + /** + * Sets scaDevice + * + * @param \Adyen\Model\BalancePlatform\ScaDevice|null $scaDevice scaDevice + * + * @return self + */ + public function setScaDevice($scaDevice) + { + $this->container['scaDevice'] = $scaDevice; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php index 8a25f0a14..57bd5cd0d 100644 --- a/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/IbanAccountIdentification.php @@ -41,6 +41,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'bic' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -53,6 +54,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'bic' => null, 'iban' => null, 'type' => null ]; @@ -63,6 +65,7 @@ class IbanAccountIdentification implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static $openAPINullables = [ + 'bic' => false, 'iban' => false, 'type' => false ]; @@ -153,6 +156,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'bic' => 'bic', 'iban' => 'iban', 'type' => 'type' ]; @@ -163,6 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'bic' => 'setBic', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -173,6 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'bic' => 'getBic', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -246,6 +252,7 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -307,6 +314,30 @@ public function valid() } + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + $this->container['bic'] = $bic; + + return $this; + } + /** * Gets iban * diff --git a/src/Adyen/Model/BalancePlatform/InvalidField.php b/src/Adyen/Model/BalancePlatform/InvalidField.php index 683b33982..359a4743a 100644 --- a/src/Adyen/Model/BalancePlatform/InvalidField.php +++ b/src/Adyen/Model/BalancePlatform/InvalidField.php @@ -41,9 +41,9 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'message' => 'string', 'name' => 'string', - 'value' => 'string', - 'message' => 'string' + 'value' => 'string' ]; /** @@ -54,9 +54,9 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'message' => null, 'name' => null, - 'value' => null, - 'message' => null + 'value' => null ]; /** @@ -65,9 +65,9 @@ class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static $openAPINullables = [ + 'message' => false, 'name' => false, - 'value' => false, - 'message' => false + 'value' => false ]; /** @@ -156,9 +156,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'message' => 'message', 'name' => 'name', - 'value' => 'value', - 'message' => 'message' + 'value' => 'value' ]; /** @@ -167,9 +167,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'message' => 'setMessage', 'name' => 'setName', - 'value' => 'setValue', - 'message' => 'setMessage' + 'value' => 'setValue' ]; /** @@ -178,9 +178,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'message' => 'getMessage', 'name' => 'getName', - 'value' => 'getValue', - 'message' => 'getMessage' + 'value' => 'getValue' ]; /** @@ -240,9 +240,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('message', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('message', $data ?? [], null); } /** @@ -272,15 +272,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } if ($this->container['value'] === null) { $invalidProperties[] = "'value' can't be null"; } - if ($this->container['message'] === null) { - $invalidProperties[] = "'message' can't be null"; - } return $invalidProperties; } @@ -297,73 +297,73 @@ public function valid() /** - * Gets name + * Gets message * * @return string */ - public function getName() + public function getMessage() { - return $this->container['name']; + return $this->container['message']; } /** - * Sets name + * Sets message * - * @param string $name The field that has an invalid value. + * @param string $message Description of the validation error. * * @return self */ - public function setName($name) + public function setMessage($message) { - $this->container['name'] = $name; + $this->container['message'] = $message; return $this; } /** - * Gets value + * Gets name * * @return string */ - public function getValue() + public function getName() { - return $this->container['value']; + return $this->container['name']; } /** - * Sets value + * Sets name * - * @param string $value The invalid value. + * @param string $name The field that has an invalid value. * * @return self */ - public function setValue($value) + public function setName($name) { - $this->container['value'] = $value; + $this->container['name'] = $name; return $this; } /** - * Gets message + * Gets value * * @return string */ - public function getMessage() + public function getValue() { - return $this->container['message']; + return $this->container['value']; } /** - * Sets message + * Sets value * - * @param string $message Description of the validation error. + * @param string $value The invalid value. * * @return self */ - public function setMessage($message) + public function setValue($value) { - $this->container['message'] = $message; + $this->container['value'] = $value; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php b/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php new file mode 100644 index 000000000..722ddf414 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php @@ -0,0 +1,509 @@ + + */ +class ListAssociationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListAssociationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'links' => '\Adyen\Model\BalancePlatform\Link', + 'data' => '\Adyen\Model\BalancePlatform\AssociationListing[]', + 'itemsTotal' => 'int', + 'pagesTotal' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'links' => null, + 'data' => null, + 'itemsTotal' => 'int32', + 'pagesTotal' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'links' => false, + 'data' => false, + 'itemsTotal' => true, + 'pagesTotal' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'links' => '_links', + 'data' => 'data', + 'itemsTotal' => 'itemsTotal', + 'pagesTotal' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'links' => 'setLinks', + 'data' => 'setData', + 'itemsTotal' => 'setItemsTotal', + 'pagesTotal' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'links' => 'getLinks', + 'data' => 'getData', + 'itemsTotal' => 'getItemsTotal', + 'pagesTotal' => 'getPagesTotal' + ]; + + /** + * 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->setIfExists('links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('itemsTotal', $data ?? [], null); + $this->setIfExists('pagesTotal', $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 ($this->container['links'] === null) { + $invalidProperties[] = "'links' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['itemsTotal'] === null) { + $invalidProperties[] = "'itemsTotal' can't be null"; + } + if ($this->container['pagesTotal'] === null) { + $invalidProperties[] = "'pagesTotal' 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 links + * + * @return \Adyen\Model\BalancePlatform\Link + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param \Adyen\Model\BalancePlatform\Link $links links + * + * @return self + */ + public function setLinks($links) + { + $this->container['links'] = $links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\BalancePlatform\AssociationListing[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\BalancePlatform\AssociationListing[] $data Contains a list of associations and their corresponding details. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets itemsTotal + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['itemsTotal']; + } + + /** + * Sets itemsTotal + * + * @param int $itemsTotal The total number of items available. + * + * @return self + */ + public function setItemsTotal($itemsTotal) + { + $this->container['itemsTotal'] = $itemsTotal; + + return $this; + } + + /** + * Gets pagesTotal + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pagesTotal']; + } + + /** + * Sets pagesTotal + * + * @param int $pagesTotal The total number of pages available. + * + * @return self + */ + public function setPagesTotal($pagesTotal) + { + $this->container['pagesTotal'] = $pagesTotal; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ListMandatesResponse.php b/src/Adyen/Model/BalancePlatform/ListMandatesResponse.php new file mode 100644 index 000000000..83db22021 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ListMandatesResponse.php @@ -0,0 +1,441 @@ + + */ +class ListMandatesResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListMandatesResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'link' => '\Adyen\Model\BalancePlatform\Link', + 'mandates' => '\Adyen\Model\BalancePlatform\Mandate[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'link' => null, + 'mandates' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'link' => false, + 'mandates' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'link' => 'link', + 'mandates' => 'mandates' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'link' => 'setLink', + 'mandates' => 'setMandates' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'link' => 'getLink', + 'mandates' => 'getMandates' + ]; + + /** + * 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->setIfExists('link', $data ?? [], null); + $this->setIfExists('mandates', $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 ($this->container['link'] === null) { + $invalidProperties[] = "'link' can't be null"; + } + if ($this->container['mandates'] === null) { + $invalidProperties[] = "'mandates' 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 link + * + * @return \Adyen\Model\BalancePlatform\Link + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param \Adyen\Model\BalancePlatform\Link $link link + * + * @return self + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets mandates + * + * @return \Adyen\Model\BalancePlatform\Mandate[] + */ + public function getMandates() + { + return $this->container['mandates']; + } + + /** + * Sets mandates + * + * @param \Adyen\Model\BalancePlatform\Mandate[] $mandates Contains a list of the mandates. + * + * @return self + */ + public function setMandates($mandates) + { + $this->container['mandates'] = $mandates; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/LocalTime.php b/src/Adyen/Model/BalancePlatform/LocalTime.php new file mode 100644 index 000000000..a8330a26e --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/LocalTime.php @@ -0,0 +1,497 @@ + + */ +class LocalTime implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LocalTime'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'hour' => 'int', + 'minute' => 'int', + 'nano' => 'int', + 'second' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'hour' => 'int32', + 'minute' => 'int32', + 'nano' => 'int32', + 'second' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'hour' => true, + 'minute' => true, + 'nano' => true, + 'second' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'hour' => 'hour', + 'minute' => 'minute', + 'nano' => 'nano', + 'second' => 'second' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'hour' => 'setHour', + 'minute' => 'setMinute', + 'nano' => 'setNano', + 'second' => 'setSecond' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'hour' => 'getHour', + 'minute' => 'getMinute', + 'nano' => 'getNano', + 'second' => 'getSecond' + ]; + + /** + * 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->setIfExists('hour', $data ?? [], null); + $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('nano', $data ?? [], null); + $this->setIfExists('second', $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 = []; + + 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 hour + * + * @return int|null + */ + public function getHour() + { + return $this->container['hour']; + } + + /** + * Sets hour + * + * @param int|null $hour hour + * + * @return self + */ + public function setHour($hour) + { + $this->container['hour'] = $hour; + + return $this; + } + + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute minute + * + * @return self + */ + public function setMinute($minute) + { + $this->container['minute'] = $minute; + + return $this; + } + + /** + * Gets nano + * + * @return int|null + */ + public function getNano() + { + return $this->container['nano']; + } + + /** + * Sets nano + * + * @param int|null $nano nano + * + * @return self + */ + public function setNano($nano) + { + $this->container['nano'] = $nano; + + return $this; + } + + /** + * Gets second + * + * @return int|null + */ + public function getSecond() + { + return $this->container['second']; + } + + /** + * Sets second + * + * @param int|null $second second + * + * @return self + */ + public function setSecond($second) + { + $this->container['second'] = $second; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Mandate.php b/src/Adyen/Model/BalancePlatform/Mandate.php new file mode 100644 index 000000000..a1928b70c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Mandate.php @@ -0,0 +1,621 @@ + + */ +class Mandate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Mandate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'counterparty' => '\Adyen\Model\BalancePlatform\MandateBankAccount', + 'createdAt' => '\DateTime', + 'id' => 'string', + 'paymentInstrumentId' => 'string', + 'status' => '\Adyen\Model\BalancePlatform\MandateStatus', + 'type' => '\Adyen\Model\BalancePlatform\MandateType', + 'updatedAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'counterparty' => null, + 'createdAt' => 'date-time', + 'id' => null, + 'paymentInstrumentId' => null, + 'status' => null, + 'type' => null, + 'updatedAt' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'counterparty' => false, + 'createdAt' => false, + 'id' => false, + 'paymentInstrumentId' => false, + 'status' => false, + 'type' => false, + 'updatedAt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'balanceAccountId' => 'balanceAccountId', + 'counterparty' => 'counterparty', + 'createdAt' => 'createdAt', + 'id' => 'id', + 'paymentInstrumentId' => 'paymentInstrumentId', + 'status' => 'status', + 'type' => 'type', + 'updatedAt' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'counterparty' => 'setCounterparty', + 'createdAt' => 'setCreatedAt', + 'id' => 'setId', + 'paymentInstrumentId' => 'setPaymentInstrumentId', + 'status' => 'setStatus', + 'type' => 'setType', + 'updatedAt' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'counterparty' => 'getCounterparty', + 'createdAt' => 'getCreatedAt', + 'id' => 'getId', + 'paymentInstrumentId' => 'getPaymentInstrumentId', + 'status' => 'getStatus', + 'type' => 'getType', + 'updatedAt' => 'getUpdatedAt' + ]; + + /** + * 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->setIfExists('balanceAccountId', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('updatedAt', $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 = []; + + 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 balanceAccountId + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string|null $balanceAccountId The unique identifier of the balance account linked to the payment instrument. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\BalancePlatform\MandateBankAccount|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\MandateBankAccount|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime|null $createdAt The date when the mandate was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the mandate. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId The unique identifier of the payment instrument linked to the mandate. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\MandateStatus|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\MandateStatus|null $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\MandateType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\MandateType|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime|null + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime|null $updatedAt The date when the mandate was updated. + * + * @return self + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MandateAccountIdentification.php b/src/Adyen/Model/BalancePlatform/MandateAccountIdentification.php new file mode 100644 index 000000000..8509829d6 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MandateAccountIdentification.php @@ -0,0 +1,410 @@ + + */ +class MandateAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandateAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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 ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MandateBankAccount.php b/src/Adyen/Model/BalancePlatform/MandateBankAccount.php new file mode 100644 index 000000000..f127660b6 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MandateBankAccount.php @@ -0,0 +1,441 @@ + + */ +class MandateBankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandateBankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolder' => '\Adyen\Model\BalancePlatform\MandatePartyIdentification', + 'accountIdentification' => '\Adyen\Model\BalancePlatform\MandateAccountIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolder' => null, + 'accountIdentification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolder' => false, + 'accountIdentification' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'accountHolder' => 'accountHolder', + 'accountIdentification' => 'accountIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolder' => 'setAccountHolder', + 'accountIdentification' => 'setAccountIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolder' => 'getAccountHolder', + 'accountIdentification' => 'getAccountIdentification' + ]; + + /** + * 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->setIfExists('accountHolder', $data ?? [], null); + $this->setIfExists('accountIdentification', $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 ($this->container['accountHolder'] === null) { + $invalidProperties[] = "'accountHolder' can't be null"; + } + if ($this->container['accountIdentification'] === null) { + $invalidProperties[] = "'accountIdentification' 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 accountHolder + * + * @return \Adyen\Model\BalancePlatform\MandatePartyIdentification + */ + public function getAccountHolder() + { + return $this->container['accountHolder']; + } + + /** + * Sets accountHolder + * + * @param \Adyen\Model\BalancePlatform\MandatePartyIdentification $accountHolder accountHolder + * + * @return self + */ + public function setAccountHolder($accountHolder) + { + $this->container['accountHolder'] = $accountHolder; + + return $this; + } + + /** + * Gets accountIdentification + * + * @return \Adyen\Model\BalancePlatform\MandateAccountIdentification + */ + public function getAccountIdentification() + { + return $this->container['accountIdentification']; + } + + /** + * Sets accountIdentification + * + * @param \Adyen\Model\BalancePlatform\MandateAccountIdentification $accountIdentification accountIdentification + * + * @return self + */ + public function setAccountIdentification($accountIdentification) + { + $this->container['accountIdentification'] = $accountIdentification; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MandatePartyIdentification.php b/src/Adyen/Model/BalancePlatform/MandatePartyIdentification.php new file mode 100644 index 000000000..31aaf03f4 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MandatePartyIdentification.php @@ -0,0 +1,404 @@ + + */ +class MandatePartyIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandatePartyIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fullName' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fullName' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fullName' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'fullName' => 'fullName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fullName' => 'setFullName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fullName' => 'getFullName' + ]; + + /** + * 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->setIfExists('fullName', $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 = []; + + 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 fullName + * + * @return string|null + */ + public function getFullName() + { + return $this->container['fullName']; + } + + /** + * Sets fullName + * + * @param string|null $fullName The full name of the entity that owns the bank account. Supported characters: [a-z] [A-Z] [0-9] , . ; : - — / \\ + & ! ? @ ( ) \" ' and space. + * + * @return self + */ + public function setFullName($fullName) + { + $this->container['fullName'] = $fullName; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/MandateStatus.php b/src/Adyen/Model/BalancePlatform/MandateStatus.php new file mode 100644 index 000000000..afe3bf707 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/MandateStatus.php @@ -0,0 +1,48 @@ + + */ +class MandateUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MandateUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentInstrumentId' => 'mixed' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentInstrumentId' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'paymentInstrumentId' => 'paymentInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentInstrumentId' => 'setPaymentInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentInstrumentId' => 'getPaymentInstrumentId' + ]; + + /** + * 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->setIfExists('paymentInstrumentId', $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 = []; + + 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 paymentInstrumentId + * + * @return mixed|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param mixed|null $paymentInstrumentId The unique identifier of the payment instrument linked to the mandate. + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + if (is_null($paymentInstrumentId)) { + array_push($this->openAPINullablesSetToNull, 'paymentInstrumentId'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('paymentInstrumentId', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableAmountDTO.php b/src/Adyen/Model/BalancePlatform/PatchableAmountDTO.php new file mode 100644 index 000000000..e2b418de3 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableAmountDTO.php @@ -0,0 +1,435 @@ + + */ +class PatchableAmountDTO implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableAmountDTO'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * 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->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $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 = []; + + 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 currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableCreateRecurringTopUp.php b/src/Adyen/Model/BalancePlatform/PatchableCreateRecurringTopUp.php new file mode 100644 index 000000000..10682795b --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableCreateRecurringTopUp.php @@ -0,0 +1,571 @@ + + */ +class PatchableCreateRecurringTopUp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableCreateRecurringTopUp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'referenceForBeneficiary' => 'mixed', + 'status' => 'string', + 'topUpAmount' => '\Adyen\Model\BalancePlatform\PatchableTopUpAmount', + 'trigger' => '\Adyen\Model\BalancePlatform\PatchableTrigger' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'referenceForBeneficiary' => null, + 'status' => null, + 'topUpAmount' => null, + 'trigger' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'referenceForBeneficiary' => true, + 'status' => false, + 'topUpAmount' => false, + 'trigger' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'description' => 'description', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'status' => 'status', + 'topUpAmount' => 'topUpAmount', + 'trigger' => 'trigger' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'status' => 'setStatus', + 'topUpAmount' => 'setTopUpAmount', + 'trigger' => 'setTrigger' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'status' => 'getStatus', + 'topUpAmount' => 'getTopUpAmount', + 'trigger' => 'getTrigger' + ]; + + /** + * 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; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * 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->setIfExists('description', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('topUpAmount', $data ?? [], null); + $this->setIfExists('trigger', $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 = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + 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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Your description for the recurring top-up. Maximum length is 140 characters. If you set a longer description, it will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return mixed|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param mixed|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + if (is_null($referenceForBeneficiary)) { + array_push($this->openAPINullablesSetToNull, 'referenceForBeneficiary'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('referenceForBeneficiary', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the recurring top-up. If not provided, by default, this is set to **active**. Possible values: * **active**: the top up is enabled and funds will be pulled in. * **inactive**: the top up is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets topUpAmount + * + * @return \Adyen\Model\BalancePlatform\PatchableTopUpAmount|null + */ + public function getTopUpAmount() + { + return $this->container['topUpAmount']; + } + + /** + * Sets topUpAmount + * + * @param \Adyen\Model\BalancePlatform\PatchableTopUpAmount|null $topUpAmount topUpAmount + * + * @return self + */ + public function setTopUpAmount($topUpAmount) + { + $this->container['topUpAmount'] = $topUpAmount; + + return $this; + } + + /** + * Gets trigger + * + * @return \Adyen\Model\BalancePlatform\PatchableTrigger|null + */ + public function getTrigger() + { + return $this->container['trigger']; + } + + /** + * Sets trigger + * + * @param \Adyen\Model\BalancePlatform\PatchableTrigger|null $trigger trigger + * + * @return self + */ + public function setTrigger($trigger) + { + $this->container['trigger'] = $trigger; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableSchedule.php b/src/Adyen/Model/BalancePlatform/PatchableSchedule.php new file mode 100644 index 000000000..8b9661522 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableSchedule.php @@ -0,0 +1,404 @@ + + */ +class PatchableSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableSchedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Adyen\Model\BalancePlatform\ScheduleType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('type', $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 = []; + + 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 type + * + * @return \Adyen\Model\BalancePlatform\ScheduleType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScheduleType|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableTopUpAmount.php b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmount.php new file mode 100644 index 000000000..f41f6408c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmount.php @@ -0,0 +1,435 @@ + + */ +class PatchableTopUpAmount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableTopUpAmount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fixed' => '\Adyen\Model\BalancePlatform\PatchableTopUpAmountFixed', + 'target' => '\Adyen\Model\BalancePlatform\PatchableTopUpAmountTarget' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fixed' => null, + 'target' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fixed' => false, + 'target' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'fixed' => 'fixed', + 'target' => 'target' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fixed' => 'setFixed', + 'target' => 'setTarget' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fixed' => 'getFixed', + 'target' => 'getTarget' + ]; + + /** + * 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->setIfExists('fixed', $data ?? [], null); + $this->setIfExists('target', $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 = []; + + 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 fixed + * + * @return \Adyen\Model\BalancePlatform\PatchableTopUpAmountFixed|null + */ + public function getFixed() + { + return $this->container['fixed']; + } + + /** + * Sets fixed + * + * @param \Adyen\Model\BalancePlatform\PatchableTopUpAmountFixed|null $fixed fixed + * + * @return self + */ + public function setFixed($fixed) + { + $this->container['fixed'] = $fixed; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\PatchableTopUpAmountTarget|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\PatchableTopUpAmountTarget|null $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountFixed.php b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountFixed.php new file mode 100644 index 000000000..af91e7314 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountFixed.php @@ -0,0 +1,436 @@ + + */ +class PatchableTopUpAmountFixed implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableTopUpAmount_fixed'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * 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->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $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 = []; + + 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 currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountTarget.php b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountTarget.php new file mode 100644 index 000000000..d13a939e2 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableTopUpAmountTarget.php @@ -0,0 +1,436 @@ + + */ +class PatchableTopUpAmountTarget implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableTopUpAmount_target'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'currency' => 'currency', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'value' => 'getValue' + ]; + + /** + * 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->setIfExists('currency', $data ?? [], null); + $this->setIfExists('value', $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 = []; + + 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 currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets value + * + * @return int|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int|null $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableTrigger.php b/src/Adyen/Model/BalancePlatform/PatchableTrigger.php new file mode 100644 index 000000000..d40987bb0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableTrigger.php @@ -0,0 +1,435 @@ + + */ +class PatchableTrigger implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableTrigger'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'schedule' => '\Adyen\Model\BalancePlatform\PatchableTriggerSchedule', + 'threshold' => '\Adyen\Model\BalancePlatform\PatchableAmountDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'schedule' => null, + 'threshold' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'schedule' => false, + 'threshold' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'schedule' => 'schedule', + 'threshold' => 'threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'schedule' => 'setSchedule', + 'threshold' => 'setThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'schedule' => 'getSchedule', + 'threshold' => 'getThreshold' + ]; + + /** + * 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->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('threshold', $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 = []; + + 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 schedule + * + * @return \Adyen\Model\BalancePlatform\PatchableTriggerSchedule|null + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\BalancePlatform\PatchableTriggerSchedule|null $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets threshold + * + * @return \Adyen\Model\BalancePlatform\PatchableAmountDTO|null + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param \Adyen\Model\BalancePlatform\PatchableAmountDTO|null $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + $this->container['threshold'] = $threshold; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PatchableTriggerSchedule.php b/src/Adyen/Model/BalancePlatform/PatchableTriggerSchedule.php new file mode 100644 index 000000000..97e2369bc --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PatchableTriggerSchedule.php @@ -0,0 +1,405 @@ + + */ +class PatchableTriggerSchedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PatchableTrigger_schedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Adyen\Model\BalancePlatform\ScheduleType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('type', $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 = []; + + 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 type + * + * @return \Adyen\Model\BalancePlatform\ScheduleType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScheduleType|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php index e5818e088..7b9ae6053 100644 --- a/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentAdditionalBankAccountIdentificationsInner.php @@ -26,7 +26,7 @@ */ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -41,6 +41,7 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var string[] */ protected static $openAPITypes = [ + 'bic' => 'string', 'iban' => 'string', 'type' => 'string' ]; @@ -53,6 +54,7 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @psalm-var array */ protected static $openAPIFormats = [ + 'bic' => null, 'iban' => null, 'type' => null ]; @@ -63,6 +65,7 @@ class PaymentInstrumentAdditionalBankAccountIdentificationsInner implements Mode * @var boolean[] */ protected static $openAPINullables = [ + 'bic' => false, 'iban' => false, 'type' => false ]; @@ -153,6 +156,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'bic' => 'bic', 'iban' => 'iban', 'type' => 'type' ]; @@ -163,6 +167,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'bic' => 'setBic', 'iban' => 'setIban', 'type' => 'setType' ]; @@ -173,6 +178,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'bic' => 'getBic', 'iban' => 'getIban', 'type' => 'getType' ]; @@ -233,8 +239,12 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('bic', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -286,6 +296,30 @@ public function valid() } + /** + * Gets bic + * + * @return string|null + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string|null $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + $this->container['bic'] = $bic; + + return $this; + } + /** * Gets iban * diff --git a/src/Adyen/Model/BalancePlatform/PayoutScheduleExecution.php b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecution.php new file mode 100644 index 000000000..5d0fcb57c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecution.php @@ -0,0 +1,497 @@ + + */ +class PayoutScheduleExecution implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutScheduleExecution'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'result' => '\Adyen\Model\BalancePlatform\ExecutionResult', + 'resultDetails' => '\Adyen\Model\BalancePlatform\PayoutScheduleExecutionDetails', + 'triggeredAt' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'result' => null, + 'resultDetails' => null, + 'triggeredAt' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'result' => false, + 'resultDetails' => false, + 'triggeredAt' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'id' => 'id', + 'result' => 'result', + 'resultDetails' => 'resultDetails', + 'triggeredAt' => 'triggeredAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'result' => 'setResult', + 'resultDetails' => 'setResultDetails', + 'triggeredAt' => 'setTriggeredAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'result' => 'getResult', + 'resultDetails' => 'getResultDetails', + 'triggeredAt' => 'getTriggeredAt' + ]; + + /** + * 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->setIfExists('id', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('resultDetails', $data ?? [], null); + $this->setIfExists('triggeredAt', $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 = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the payout execution. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets result + * + * @return \Adyen\Model\BalancePlatform\ExecutionResult|null + */ + public function getResult() + { + return $this->container['result']; + } + + /** + * Sets result + * + * @param \Adyen\Model\BalancePlatform\ExecutionResult|null $result result + * + * @return self + */ + public function setResult($result) + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Gets resultDetails + * + * @return \Adyen\Model\BalancePlatform\PayoutScheduleExecutionDetails|null + */ + public function getResultDetails() + { + return $this->container['resultDetails']; + } + + /** + * Sets resultDetails + * + * @param \Adyen\Model\BalancePlatform\PayoutScheduleExecutionDetails|null $resultDetails resultDetails + * + * @return self + */ + public function setResultDetails($resultDetails) + { + $this->container['resultDetails'] = $resultDetails; + + return $this; + } + + /** + * Gets triggeredAt + * + * @return \DateTime|null + */ + public function getTriggeredAt() + { + return $this->container['triggeredAt']; + } + + /** + * Sets triggeredAt + * + * @param \DateTime|null $triggeredAt The date and time when the payout execution was initiated. + * + * @return self + */ + public function setTriggeredAt($triggeredAt) + { + $this->container['triggeredAt'] = $triggeredAt; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutionDetails.php b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutionDetails.php new file mode 100644 index 000000000..7abe44fe7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutionDetails.php @@ -0,0 +1,466 @@ + + */ +class PayoutScheduleExecutionDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutScheduleExecutionDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reason' => 'string', + 'reasonCode' => 'string', + 'transferId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reason' => null, + 'reasonCode' => null, + 'transferId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'reason' => false, + 'reasonCode' => false, + 'transferId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'reason' => 'reason', + 'reasonCode' => 'reasonCode', + 'transferId' => 'transferId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reason' => 'setReason', + 'reasonCode' => 'setReasonCode', + 'transferId' => 'setTransferId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reason' => 'getReason', + 'reasonCode' => 'getReasonCode', + 'transferId' => 'getTransferId' + ]; + + /** + * 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->setIfExists('reason', $data ?? [], null); + $this->setIfExists('reasonCode', $data ?? [], null); + $this->setIfExists('transferId', $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 = []; + + 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 reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason Human readable reason for why execution was not successful if applicable. + * + * @return self + */ + public function setReason($reason) + { + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets reasonCode + * + * @return string|null + */ + public function getReasonCode() + { + return $this->container['reasonCode']; + } + + /** + * Sets reasonCode + * + * @param string|null $reasonCode Reason Code for why execution was not successful if applicable. + * + * @return self + */ + public function setReasonCode($reasonCode) + { + $this->container['reasonCode'] = $reasonCode; + + return $this; + } + + /** + * Gets transferId + * + * @return string|null + */ + public function getTransferId() + { + return $this->container['transferId']; + } + + /** + * Sets transferId + * + * @param string|null $transferId The id of the transfer from executing the payout. + * + * @return self + */ + public function setTransferId($transferId) + { + $this->container['transferId'] = $transferId; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutions.php b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutions.php new file mode 100644 index 000000000..9743ff8ea --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PayoutScheduleExecutions.php @@ -0,0 +1,407 @@ + + */ +class PayoutScheduleExecutions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PayoutScheduleExecutions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'payoutScheduleExecutions' => '\Adyen\Model\BalancePlatform\PayoutScheduleExecution[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'payoutScheduleExecutions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'payoutScheduleExecutions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'payoutScheduleExecutions' => 'payoutScheduleExecutions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'payoutScheduleExecutions' => 'setPayoutScheduleExecutions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'payoutScheduleExecutions' => 'getPayoutScheduleExecutions' + ]; + + /** + * 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->setIfExists('payoutScheduleExecutions', $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 ($this->container['payoutScheduleExecutions'] === null) { + $invalidProperties[] = "'payoutScheduleExecutions' 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 payoutScheduleExecutions + * + * @return \Adyen\Model\BalancePlatform\PayoutScheduleExecution[] + */ + public function getPayoutScheduleExecutions() + { + return $this->container['payoutScheduleExecutions']; + } + + /** + * Sets payoutScheduleExecutions + * + * @param \Adyen\Model\BalancePlatform\PayoutScheduleExecution[] $payoutScheduleExecutions Contains a list of executions of the payout schedule. + * + * @return self + */ + public function setPayoutScheduleExecutions($payoutScheduleExecutions) + { + $this->container['payoutScheduleExecutions'] = $payoutScheduleExecutions; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php index 2c1377c14..f16b1a28f 100644 --- a/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/PlatformPaymentConfiguration.php @@ -317,7 +317,7 @@ public function getSettlementDelayDays() /** * Sets settlementDelayDays * - * @param int|null $settlementDelayDays Specifies after how many business days the funds in a settlement batch are made available in this balance account. Possible values: **1** to **20**, or **null**. Default value: **null**. + * @param int|null $settlementDelayDays Specifies after how many business days the funds in a settlement batch are made available in this balance account. Requires Custom Sales Day Payout to be enabled for your balance account. Contact your account manager or implementation manager to enable this. Possible values: **1** to **20**, or **null**. Default value: **null**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/RecurringTopUp.php b/src/Adyen/Model/BalancePlatform/RecurringTopUp.php new file mode 100644 index 000000000..e054ffa65 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RecurringTopUp.php @@ -0,0 +1,638 @@ + + */ +class RecurringTopUp implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecurringTopUp'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'counterparty' => '\Adyen\Model\BalancePlatform\TopUpCounterparty', + 'description' => 'string', + 'id' => 'string', + 'referenceForBeneficiary' => 'string', + 'status' => 'string', + 'topUpAmount' => '\Adyen\Model\BalancePlatform\TopUpAmount', + 'trigger' => '\Adyen\Model\BalancePlatform\Trigger' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'counterparty' => null, + 'description' => null, + 'id' => null, + 'referenceForBeneficiary' => null, + 'status' => null, + 'topUpAmount' => null, + 'trigger' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'counterparty' => false, + 'description' => false, + 'id' => false, + 'referenceForBeneficiary' => false, + 'status' => false, + 'topUpAmount' => false, + 'trigger' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'counterparty' => 'counterparty', + 'description' => 'description', + 'id' => 'id', + 'referenceForBeneficiary' => 'referenceForBeneficiary', + 'status' => 'status', + 'topUpAmount' => 'topUpAmount', + 'trigger' => 'trigger' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'counterparty' => 'setCounterparty', + 'description' => 'setDescription', + 'id' => 'setId', + 'referenceForBeneficiary' => 'setReferenceForBeneficiary', + 'status' => 'setStatus', + 'topUpAmount' => 'setTopUpAmount', + 'trigger' => 'setTrigger' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'counterparty' => 'getCounterparty', + 'description' => 'getDescription', + 'id' => 'getId', + 'referenceForBeneficiary' => 'getReferenceForBeneficiary', + 'status' => 'getStatus', + 'topUpAmount' => 'getTopUpAmount', + 'trigger' => 'getTrigger' + ]; + + /** + * 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; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * 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->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('referenceForBeneficiary', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('topUpAmount', $data ?? [], null); + $this->setIfExists('trigger', $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 ($this->container['counterparty'] === null) { + $invalidProperties[] = "'counterparty' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['topUpAmount'] === null) { + $invalidProperties[] = "'topUpAmount' can't be null"; + } + if ($this->container['trigger'] === null) { + $invalidProperties[] = "'trigger' 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 counterparty + * + * @return \Adyen\Model\BalancePlatform\TopUpCounterparty + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\TopUpCounterparty $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description Your description for the recurring top-up. Maximum length is 140 characters. If you set a longer description, it will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the top up. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets referenceForBeneficiary + * + * @return string|null + */ + public function getReferenceForBeneficiary() + { + return $this->container['referenceForBeneficiary']; + } + + /** + * Sets referenceForBeneficiary + * + * @param string|null $referenceForBeneficiary A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both parties involved in the funds movement. Supported characters: **a-z**, **A-Z**, **0-9**. + * + * @return self + */ + public function setReferenceForBeneficiary($referenceForBeneficiary) + { + $this->container['referenceForBeneficiary'] = $referenceForBeneficiary; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the recurring top-up. If not provided, by default, this is set to **active**. Possible values: * **active**: the top up is enabled and funds will be pulled in. * **inactive**: the top up is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets topUpAmount + * + * @return \Adyen\Model\BalancePlatform\TopUpAmount + */ + public function getTopUpAmount() + { + return $this->container['topUpAmount']; + } + + /** + * Sets topUpAmount + * + * @param \Adyen\Model\BalancePlatform\TopUpAmount $topUpAmount topUpAmount + * + * @return self + */ + public function setTopUpAmount($topUpAmount) + { + $this->container['topUpAmount'] = $topUpAmount; + + return $this; + } + + /** + * Gets trigger + * + * @return \Adyen\Model\BalancePlatform\Trigger + */ + public function getTrigger() + { + return $this->container['trigger']; + } + + /** + * Sets trigger + * + * @param \Adyen\Model\BalancePlatform\Trigger $trigger trigger + * + * @return self + */ + public function setTrigger($trigger) + { + $this->container['trigger'] = $trigger; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/RecurringTopUpsResult.php b/src/Adyen/Model/BalancePlatform/RecurringTopUpsResult.php new file mode 100644 index 000000000..276ac9b1f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RecurringTopUpsResult.php @@ -0,0 +1,441 @@ + + */ +class RecurringTopUpsResult implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RecurringTopUpsResult'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'link' => '\Adyen\Model\BalancePlatform\Link', + 'recurringTopUps' => '\Adyen\Model\BalancePlatform\RecurringTopUp[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'link' => null, + 'recurringTopUps' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'link' => false, + 'recurringTopUps' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'link' => 'link', + 'recurringTopUps' => 'recurringTopUps' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'link' => 'setLink', + 'recurringTopUps' => 'setRecurringTopUps' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'link' => 'getLink', + 'recurringTopUps' => 'getRecurringTopUps' + ]; + + /** + * 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->setIfExists('link', $data ?? [], null); + $this->setIfExists('recurringTopUps', $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 ($this->container['link'] === null) { + $invalidProperties[] = "'link' can't be null"; + } + if ($this->container['recurringTopUps'] === null) { + $invalidProperties[] = "'recurringTopUps' 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 link + * + * @return \Adyen\Model\BalancePlatform\Link + */ + public function getLink() + { + return $this->container['link']; + } + + /** + * Sets link + * + * @param \Adyen\Model\BalancePlatform\Link $link link + * + * @return self + */ + public function setLink($link) + { + $this->container['link'] = $link; + + return $this; + } + + /** + * Gets recurringTopUps + * + * @return \Adyen\Model\BalancePlatform\RecurringTopUp[] + */ + public function getRecurringTopUps() + { + return $this->container['recurringTopUps']; + } + + /** + * Sets recurringTopUps + * + * @param \Adyen\Model\BalancePlatform\RecurringTopUp[] $recurringTopUps recurringTopUps + * + * @return self + */ + public function setRecurringTopUps($recurringTopUps) + { + $this->container['recurringTopUps'] = $recurringTopUps; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php b/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php new file mode 100644 index 000000000..e51d7e03f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php @@ -0,0 +1,475 @@ + + */ +class RemoveAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RemoveAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceIds' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceIds' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceIds' => 'scaDeviceIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceIds' => 'setScaDeviceIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceIds' => 'getScaDeviceIds' + ]; + + /** + * 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->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceIds', $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 ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceIds'] === null) { + $invalidProperties[] = "'scaDeviceIds' 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 entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceIds + * + * @return string[] + */ + public function getScaDeviceIds() + { + return $this->container['scaDeviceIds']; + } + + /** + * Sets scaDeviceIds + * + * @param string[] $scaDeviceIds A list of device ids associated with the entity that should be removed. + * + * @return self + */ + public function setScaDeviceIds($scaDeviceIds) + { + $this->container['scaDeviceIds'] = $scaDeviceIds; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaDevice.php b/src/Adyen/Model/BalancePlatform/ScaDevice.php new file mode 100644 index 000000000..ebf3fc1d2 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaDevice.php @@ -0,0 +1,477 @@ + + */ +class ScaDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScaDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'type' => '\Adyen\Model\BalancePlatform\ScaDeviceType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'id' => 'id', + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $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 ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the SCA device you are registering. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the SCA device that you are registering. You can use it to help your users identify the device. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\ScaDeviceType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScaDeviceType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaDeviceType.php b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php new file mode 100644 index 000000000..f61fdfb66 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php @@ -0,0 +1,48 @@ + + */ +class ScaEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScaEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => '\Adyen\Model\BalancePlatform\ScaEntityType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $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 ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the entity. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaEntityType.php b/src/Adyen/Model/BalancePlatform/ScaEntityType.php new file mode 100644 index 000000000..753d56eca --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaEntityType.php @@ -0,0 +1,48 @@ + + */ +class Schedule implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Schedule'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Adyen\Model\BalancePlatform\ScheduleType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('type', $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 ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 type + * + * @return \Adyen\Model\BalancePlatform\ScheduleType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScheduleType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScheduleType.php b/src/Adyen/Model/BalancePlatform/ScheduleType.php new file mode 100644 index 000000000..c49d6f8ab --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScheduleType.php @@ -0,0 +1,48 @@ + + */ +class SubmitScaAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitScaAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entities' => '\Adyen\Model\BalancePlatform\ScaEntity[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entities' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entities' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'entities' => 'entities' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entities' => 'setEntities' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entities' => 'getEntities' + ]; + + /** + * 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->setIfExists('entities', $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 ($this->container['entities'] === null) { + $invalidProperties[] = "'entities' 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 entities + * + * @return \Adyen\Model\BalancePlatform\ScaEntity[] + */ + public function getEntities() + { + return $this->container['entities']; + } + + /** + * Sets entities + * + * @param \Adyen\Model\BalancePlatform\ScaEntity[] $entities The list of entities to be associated. + * + * @return self + */ + public function setEntities($entities) + { + $this->container['entities'] = $entities; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php b/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php new file mode 100644 index 000000000..6879a4b0c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php @@ -0,0 +1,407 @@ + + */ +class SubmitScaAssociationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitScaAssociationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaAssociations' => '\Adyen\Model\BalancePlatform\Association[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaAssociations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaAssociations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'scaAssociations' => 'scaAssociations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaAssociations' => 'setScaAssociations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaAssociations' => 'getScaAssociations' + ]; + + /** + * 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->setIfExists('scaAssociations', $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 ($this->container['scaAssociations'] === null) { + $invalidProperties[] = "'scaAssociations' 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 scaAssociations + * + * @return \Adyen\Model\BalancePlatform\Association[] + */ + public function getScaAssociations() + { + return $this->container['scaAssociations']; + } + + /** + * Sets scaAssociations + * + * @param \Adyen\Model\BalancePlatform\Association[] $scaAssociations List of associations created to the entities and their statuses. + * + * @return self + */ + public function setScaAssociations($scaAssociations) + { + $this->container['scaAssociations'] = $scaAssociations; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Summary.php b/src/Adyen/Model/BalancePlatform/Summary.php new file mode 100644 index 000000000..e5bb155ae --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Summary.php @@ -0,0 +1,441 @@ + + */ +class Summary implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Summary'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'legalEntityId' => 'string', + 'taxYears' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'legalEntityId' => null, + 'taxYears' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'legalEntityId' => false, + 'taxYears' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'legalEntityId' => 'legalEntityId', + 'taxYears' => 'taxYears' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'legalEntityId' => 'setLegalEntityId', + 'taxYears' => 'setTaxYears' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'legalEntityId' => 'getLegalEntityId', + 'taxYears' => 'getTaxYears' + ]; + + /** + * 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->setIfExists('legalEntityId', $data ?? [], null); + $this->setIfExists('taxYears', $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 ($this->container['legalEntityId'] === null) { + $invalidProperties[] = "'legalEntityId' can't be null"; + } + if ($this->container['taxYears'] === null) { + $invalidProperties[] = "'taxYears' 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 legalEntityId + * + * @return string + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string $legalEntityId The unique identifier of the legal entity. + * + * @return self + */ + public function setLegalEntityId($legalEntityId) + { + $this->container['legalEntityId'] = $legalEntityId; + + return $this; + } + + /** + * Gets taxYears + * + * @return int[] + */ + public function getTaxYears() + { + return $this->container['taxYears']; + } + + /** + * Sets taxYears + * + * @param int[] $taxYears The tax years for which the legal entity has a tax form. + * + * @return self + */ + public function setTaxYears($taxYears) + { + $this->container['taxYears'] = $taxYears; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Target.php b/src/Adyen/Model/BalancePlatform/Target.php new file mode 100644 index 000000000..c3bb38d86 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Target.php @@ -0,0 +1,476 @@ + + */ +class Target implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Target'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const TYPE_BALANCE_ACCOUNT = 'balanceAccount'; + public const TYPE_ACCOUNT_HOLDER = 'accountHolder'; + public const TYPE_BALANCE_PLATFORM = 'balancePlatform'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_ACCOUNT_HOLDER, + self::TYPE_BALANCE_PLATFORM, + ]; + } + /** + * 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->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $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 ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the `target.type`. This can be the ID of your: * balance platform * account holder * account holder's balance account + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The resource for which you want to receive notifications. Possible values: * **balancePlatform**: receive notifications about balance changes in your entire balance platform. * **accountHolder**: receive notifications about balance changes of a specific user. * **balanceAccount**: receive notifications about balance changes in a specific balance account. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TargetUpdate.php b/src/Adyen/Model/BalancePlatform/TargetUpdate.php new file mode 100644 index 000000000..489cae856 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TargetUpdate.php @@ -0,0 +1,470 @@ + + */ +class TargetUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TargetUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * 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; + } + + public const TYPE_BALANCE_ACCOUNT = 'balanceAccount'; + public const TYPE_ACCOUNT_HOLDER = 'accountHolder'; + public const TYPE_BALANCE_PLATFORM = 'balancePlatform'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_ACCOUNT_HOLDER, + self::TYPE_BALANCE_PLATFORM, + ]; + } + /** + * 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->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $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 = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the `target.type`. This can be the ID of your: * balance platform * account holder * account holder's balance account + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The resource for which you want to receive notifications. Possible values: * **balancePlatform**: receive notifications about balance changes in your entire balance platform. * **accountHolder**: receive notifications about balance changes of a specific user. * **balanceAccount**: receive notifications about balance changes in a specific balance account. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TaxFormSummaryResponse.php b/src/Adyen/Model/BalancePlatform/TaxFormSummaryResponse.php new file mode 100644 index 000000000..319f90260 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TaxFormSummaryResponse.php @@ -0,0 +1,407 @@ + + */ +class TaxFormSummaryResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TaxFormSummaryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'data' => '\Adyen\Model\BalancePlatform\Summary[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'data' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'data' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'data' => 'data' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'data' => 'setData' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'data' => 'getData' + ]; + + /** + * 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->setIfExists('data', $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 ($this->container['data'] === null) { + $invalidProperties[] = "'data' 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 data + * + * @return \Adyen\Model\BalancePlatform\Summary[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\BalancePlatform\Summary[] $data A list of tax form summaries, where each summary consists of the legal entity and the tax years in which the legal entity has a tax form. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TopUpAmount.php b/src/Adyen/Model/BalancePlatform/TopUpAmount.php new file mode 100644 index 000000000..02c9e6427 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TopUpAmount.php @@ -0,0 +1,435 @@ + + */ +class TopUpAmount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TopUpAmount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'fixed' => '\Adyen\Model\BalancePlatform\AmountDTO', + 'target' => '\Adyen\Model\BalancePlatform\AmountDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'fixed' => null, + 'target' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'fixed' => false, + 'target' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'fixed' => 'fixed', + 'target' => 'target' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'fixed' => 'setFixed', + 'target' => 'setTarget' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'fixed' => 'getFixed', + 'target' => 'getTarget' + ]; + + /** + * 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->setIfExists('fixed', $data ?? [], null); + $this->setIfExists('target', $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 = []; + + 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 fixed + * + * @return \Adyen\Model\BalancePlatform\AmountDTO|null + */ + public function getFixed() + { + return $this->container['fixed']; + } + + /** + * Sets fixed + * + * @param \Adyen\Model\BalancePlatform\AmountDTO|null $fixed fixed + * + * @return self + */ + public function setFixed($fixed) + { + $this->container['fixed'] = $fixed; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\AmountDTO|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\AmountDTO|null $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TopUpCounterparty.php b/src/Adyen/Model/BalancePlatform/TopUpCounterparty.php new file mode 100644 index 000000000..9faf7073c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TopUpCounterparty.php @@ -0,0 +1,407 @@ + + */ +class TopUpCounterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TopUpCounterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transferInstrumentId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transferInstrumentId' => 'getTransferInstrumentId' + ]; + + /** + * 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->setIfExists('transferInstrumentId', $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 ($this->container['transferInstrumentId'] === null) { + $invalidProperties[] = "'transferInstrumentId' 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 transferInstrumentId + * + * @return string + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string $transferInstrumentId The unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) that is funding the top-up. + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + $this->container['transferInstrumentId'] = $transferInstrumentId; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 84c17a90d..0e9bca139 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -48,6 +48,8 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => 'string', 'interval' => '\Adyen\Model\BalancePlatform\TransactionRuleInterval', 'outcomeType' => 'string', + 'overridesRule' => 'string', + 'purpose' => 'string', 'reference' => 'string', 'requestType' => 'string', 'ruleRestrictions' => '\Adyen\Model\BalancePlatform\TransactionRuleRestrictions', @@ -72,6 +74,8 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => null, 'interval' => null, 'outcomeType' => null, + 'overridesRule' => null, + 'purpose' => null, 'reference' => null, 'requestType' => null, 'ruleRestrictions' => null, @@ -94,6 +98,8 @@ class TransactionRule implements ModelInterface, ArrayAccess, \JsonSerializable 'id' => false, 'interval' => false, 'outcomeType' => false, + 'overridesRule' => false, + 'purpose' => false, 'reference' => false, 'requestType' => false, 'ruleRestrictions' => false, @@ -196,6 +202,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'id', 'interval' => 'interval', 'outcomeType' => 'outcomeType', + 'overridesRule' => 'overridesRule', + 'purpose' => 'purpose', 'reference' => 'reference', 'requestType' => 'requestType', 'ruleRestrictions' => 'ruleRestrictions', @@ -218,6 +226,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'setId', 'interval' => 'setInterval', 'outcomeType' => 'setOutcomeType', + 'overridesRule' => 'setOverridesRule', + 'purpose' => 'setPurpose', 'reference' => 'setReference', 'requestType' => 'setRequestType', 'ruleRestrictions' => 'setRuleRestrictions', @@ -240,6 +250,8 @@ public function isNullableSetToNull(string $property): bool 'id' => 'getId', 'interval' => 'getInterval', 'outcomeType' => 'getOutcomeType', + 'overridesRule' => 'getOverridesRule', + 'purpose' => 'getPurpose', 'reference' => 'getReference', 'requestType' => 'getRequestType', 'ruleRestrictions' => 'getRuleRestrictions', @@ -294,6 +306,11 @@ public function getModelName() public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; public const OUTCOME_TYPE_TIMED_BLOCK = 'timedBlock'; + public const PURPOSE_COMPLIANCE = 'compliance'; + public const PURPOSE_FRAUD = 'fraud'; + public const PURPOSE_INTERNAL_POLICY = 'internalPolicy'; + public const PURPOSE_POLICY = 'policy'; + public const PURPOSE_SYSTEM = 'system'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; @@ -302,6 +319,7 @@ public function getModelName() public const STATUS_INACTIVE = 'inactive'; public const TYPE_ALLOW_LIST = 'allowList'; public const TYPE_BLOCK_LIST = 'blockList'; + public const TYPE_BYPASS = 'bypass'; public const TYPE_MAX_USAGE = 'maxUsage'; public const TYPE_VELOCITY = 'velocity'; @@ -319,6 +337,21 @@ public function getOutcomeTypeAllowableValues() self::OUTCOME_TYPE_TIMED_BLOCK, ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPurposeAllowableValues() + { + return [ + self::PURPOSE_COMPLIANCE, + self::PURPOSE_FRAUD, + self::PURPOSE_INTERNAL_POLICY, + self::PURPOSE_POLICY, + self::PURPOSE_SYSTEM, + ]; + } /** * Gets allowable values of the enum * @@ -355,6 +388,7 @@ public function getTypeAllowableValues() return [ self::TYPE_ALLOW_LIST, self::TYPE_BLOCK_LIST, + self::TYPE_BYPASS, self::TYPE_MAX_USAGE, self::TYPE_VELOCITY, ]; @@ -381,6 +415,8 @@ public function __construct(?array $data = null) $this->setIfExists('id', $data ?? [], null); $this->setIfExists('interval', $data ?? [], null); $this->setIfExists('outcomeType', $data ?? [], null); + $this->setIfExists('overridesRule', $data ?? [], null); + $this->setIfExists('purpose', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('requestType', $data ?? [], null); $this->setIfExists('ruleRestrictions', $data ?? [], null); @@ -435,6 +471,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getPurposeAllowableValues(); + if (!is_null($this->container['purpose']) && !in_array($this->container['purpose'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'purpose', must be one of '%s'", + $this->container['purpose'], + implode("', '", $allowedValues) + ); + } + if ($this->container['reference'] === null) { $invalidProperties[] = "'reference' can't be null"; } @@ -664,6 +709,64 @@ public function setOutcomeType($outcomeType) return $this; } + /** + * Gets overridesRule + * + * @return string|null + */ + public function getOverridesRule() + { + return $this->container['overridesRule']; + } + + /** + * Sets overridesRule + * + * @param string|null $overridesRule The `id` of the transaction rule you want to override or skip for the specified `entityKey`. + * + * @return self + */ + public function setOverridesRule($overridesRule) + { + $this->container['overridesRule'] = $overridesRule; + + return $this; + } + + /** + * Gets purpose + * + * @return string|null + */ + public function getPurpose() + { + return $this->container['purpose']; + } + + /** + * Sets purpose + * + * @param string|null $purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created to regulate fraudulent activity. * **policy**: the rule is created to ensure that the transaction adheres to your business' policies. For example, if your business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to block transactions that have specific MCCs. + * + * @return self + */ + public function setPurpose($purpose) + { + $allowedValues = $this->getPurposeAllowableValues(); + if (!in_array($purpose, $allowedValues, true)) { + error_log( + sprintf( + "purpose: unexpected enum value '%s' - Supported values are [%s]", + $purpose, + implode(', ', $allowedValues) + ) + ); + } + $this->container['purpose'] = $purpose; + + return $this; + } + /** * Gets reference * @@ -841,7 +944,7 @@ public function getType() /** * Sets type * - * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. * **bypass**: bypass or skip a rule for the specified `entityKey`. Transactions processed to that entity are no longer evaluated by the bypassed rule. You must provide the `id` of the rule to bypass in `overridesRule` and leave the `ruleRestrictions` object empty. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 75ee5deae..247a94fd6 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -47,6 +47,8 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa 'entityKey' => '\Adyen\Model\BalancePlatform\TransactionRuleEntityKey', 'interval' => '\Adyen\Model\BalancePlatform\TransactionRuleInterval', 'outcomeType' => 'string', + 'overridesRule' => 'string', + 'purpose' => 'string', 'reference' => 'string', 'requestType' => 'string', 'ruleRestrictions' => '\Adyen\Model\BalancePlatform\TransactionRuleRestrictions', @@ -70,6 +72,8 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa 'entityKey' => null, 'interval' => null, 'outcomeType' => null, + 'overridesRule' => null, + 'purpose' => null, 'reference' => null, 'requestType' => null, 'ruleRestrictions' => null, @@ -91,6 +95,8 @@ class TransactionRuleInfo implements ModelInterface, ArrayAccess, \JsonSerializa 'entityKey' => false, 'interval' => false, 'outcomeType' => false, + 'overridesRule' => false, + 'purpose' => false, 'reference' => false, 'requestType' => false, 'ruleRestrictions' => false, @@ -192,6 +198,8 @@ public function isNullableSetToNull(string $property): bool 'entityKey' => 'entityKey', 'interval' => 'interval', 'outcomeType' => 'outcomeType', + 'overridesRule' => 'overridesRule', + 'purpose' => 'purpose', 'reference' => 'reference', 'requestType' => 'requestType', 'ruleRestrictions' => 'ruleRestrictions', @@ -213,6 +221,8 @@ public function isNullableSetToNull(string $property): bool 'entityKey' => 'setEntityKey', 'interval' => 'setInterval', 'outcomeType' => 'setOutcomeType', + 'overridesRule' => 'setOverridesRule', + 'purpose' => 'setPurpose', 'reference' => 'setReference', 'requestType' => 'setRequestType', 'ruleRestrictions' => 'setRuleRestrictions', @@ -234,6 +244,8 @@ public function isNullableSetToNull(string $property): bool 'entityKey' => 'getEntityKey', 'interval' => 'getInterval', 'outcomeType' => 'getOutcomeType', + 'overridesRule' => 'getOverridesRule', + 'purpose' => 'getPurpose', 'reference' => 'getReference', 'requestType' => 'getRequestType', 'ruleRestrictions' => 'getRuleRestrictions', @@ -288,6 +300,11 @@ public function getModelName() public const OUTCOME_TYPE_HARD_BLOCK = 'hardBlock'; public const OUTCOME_TYPE_SCORE_BASED = 'scoreBased'; public const OUTCOME_TYPE_TIMED_BLOCK = 'timedBlock'; + public const PURPOSE_COMPLIANCE = 'compliance'; + public const PURPOSE_FRAUD = 'fraud'; + public const PURPOSE_INTERNAL_POLICY = 'internalPolicy'; + public const PURPOSE_POLICY = 'policy'; + public const PURPOSE_SYSTEM = 'system'; public const REQUEST_TYPE_AUTHENTICATION = 'authentication'; public const REQUEST_TYPE_AUTHORIZATION = 'authorization'; public const REQUEST_TYPE_BANK_TRANSFER = 'bankTransfer'; @@ -296,6 +313,7 @@ public function getModelName() public const STATUS_INACTIVE = 'inactive'; public const TYPE_ALLOW_LIST = 'allowList'; public const TYPE_BLOCK_LIST = 'blockList'; + public const TYPE_BYPASS = 'bypass'; public const TYPE_MAX_USAGE = 'maxUsage'; public const TYPE_VELOCITY = 'velocity'; @@ -313,6 +331,21 @@ public function getOutcomeTypeAllowableValues() self::OUTCOME_TYPE_TIMED_BLOCK, ]; } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPurposeAllowableValues() + { + return [ + self::PURPOSE_COMPLIANCE, + self::PURPOSE_FRAUD, + self::PURPOSE_INTERNAL_POLICY, + self::PURPOSE_POLICY, + self::PURPOSE_SYSTEM, + ]; + } /** * Gets allowable values of the enum * @@ -349,6 +382,7 @@ public function getTypeAllowableValues() return [ self::TYPE_ALLOW_LIST, self::TYPE_BLOCK_LIST, + self::TYPE_BYPASS, self::TYPE_MAX_USAGE, self::TYPE_VELOCITY, ]; @@ -374,6 +408,8 @@ public function __construct(?array $data = null) $this->setIfExists('entityKey', $data ?? [], null); $this->setIfExists('interval', $data ?? [], null); $this->setIfExists('outcomeType', $data ?? [], null); + $this->setIfExists('overridesRule', $data ?? [], null); + $this->setIfExists('purpose', $data ?? [], null); $this->setIfExists('reference', $data ?? [], null); $this->setIfExists('requestType', $data ?? [], null); $this->setIfExists('ruleRestrictions', $data ?? [], null); @@ -428,6 +464,15 @@ public function listInvalidProperties() ); } + $allowedValues = $this->getPurposeAllowableValues(); + if (!is_null($this->container['purpose']) && !in_array($this->container['purpose'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'purpose', must be one of '%s'", + $this->container['purpose'], + implode("', '", $allowedValues) + ); + } + if ($this->container['reference'] === null) { $invalidProperties[] = "'reference' can't be null"; } @@ -633,6 +678,64 @@ public function setOutcomeType($outcomeType) return $this; } + /** + * Gets overridesRule + * + * @return string|null + */ + public function getOverridesRule() + { + return $this->container['overridesRule']; + } + + /** + * Sets overridesRule + * + * @param string|null $overridesRule The `id` of the transaction rule you want to override or skip for the specified `entityKey`. + * + * @return self + */ + public function setOverridesRule($overridesRule) + { + $this->container['overridesRule'] = $overridesRule; + + return $this; + } + + /** + * Gets purpose + * + * @return string|null + */ + public function getPurpose() + { + return $this->container['purpose']; + } + + /** + * Sets purpose + * + * @param string|null $purpose Specifies the reason for creating the rule. Possible values: * **fraud**: the rule is created to regulate fraudulent activity. * **policy**: the rule is created to ensure that the transaction adheres to your business' policies. For example, if your business has policies about the Merchant Category Codes (MCCs) allowed on a transaction, you can create a rule to block transactions that have specific MCCs. + * + * @return self + */ + public function setPurpose($purpose) + { + $allowedValues = $this->getPurposeAllowableValues(); + if (!in_array($purpose, $allowedValues, true)) { + error_log( + sprintf( + "purpose: unexpected enum value '%s' - Supported values are [%s]", + $purpose, + implode(', ', $allowedValues) + ) + ); + } + $this->container['purpose'] = $purpose; + + return $this; + } + /** * Gets reference * @@ -810,7 +913,7 @@ public function getType() /** * Sets type * - * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + * @param string $type The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which defines if a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. * **bypass**: bypass or skip a rule for the specified `entityKey`. Transactions processed to that entity are no longer evaluated by the bypassed rule. You must provide the `id` of the rule to bypass in `overridesRule` and leave the `ruleRestrictions` object empty. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php index 1d75c5de3..eb1153d8e 100644 --- a/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php +++ b/src/Adyen/Model/BalancePlatform/TransferRouteRequirementsInner.php @@ -26,7 +26,7 @@ */ class TransferRouteRequirementsInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -305,6 +305,9 @@ public function __construct(?array $data = null) $this->setIfExists('issuingCountryCodes', $data ?? [], null); $this->setIfExists('onlyForCrossBalancePlatform', $data ?? [], null); $this->setIfExists('paymentInstrumentType', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** diff --git a/src/Adyen/Model/BalancePlatform/Trigger.php b/src/Adyen/Model/BalancePlatform/Trigger.php new file mode 100644 index 000000000..691c2d343 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Trigger.php @@ -0,0 +1,438 @@ + + */ +class Trigger implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Trigger'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'schedule' => '\Adyen\Model\BalancePlatform\Schedule', + 'threshold' => '\Adyen\Model\BalancePlatform\AmountDTO' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'schedule' => null, + 'threshold' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'schedule' => false, + 'threshold' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'schedule' => 'schedule', + 'threshold' => 'threshold' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'schedule' => 'setSchedule', + 'threshold' => 'setThreshold' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'schedule' => 'getSchedule', + 'threshold' => 'getThreshold' + ]; + + /** + * 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->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('threshold', $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 ($this->container['threshold'] === null) { + $invalidProperties[] = "'threshold' 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 schedule + * + * @return \Adyen\Model\BalancePlatform\Schedule|null + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\BalancePlatform\Schedule|null $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets threshold + * + * @return \Adyen\Model\BalancePlatform\AmountDTO + */ + public function getThreshold() + { + return $this->container['threshold']; + } + + /** + * Sets threshold + * + * @param \Adyen\Model\BalancePlatform\AmountDTO $threshold threshold + * + * @return self + */ + public function setThreshold($threshold) + { + $this->container['threshold'] = $threshold; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentification.php b/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentification.php new file mode 100644 index 000000000..79a5a2ca5 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentification.php @@ -0,0 +1,470 @@ + + */ +class UKLocalMandateAccountIdentification extends MandateAccountIdentification +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UKLocalMandateAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'sortCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'sortCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'sortCode' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::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 = [ + 'accountNumber' => 'accountNumber', + 'sortCode' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'sortCode' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'sortCode' => 'getSortCode', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('type', $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 = parent::listInvalidProperties(); + + if ($this->container['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['sortCode'] === null) { + $invalidProperties[] = "'sortCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 8-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **ukLocal** + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentificationAllOf.php b/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentificationAllOf.php new file mode 100644 index 000000000..b78f1a295 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/UKLocalMandateAccountIdentificationAllOf.php @@ -0,0 +1,466 @@ + + */ +class UKLocalMandateAccountIdentificationAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UKLocalMandateAccountIdentification_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'sortCode' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'sortCode' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'sortCode' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'accountNumber' => 'accountNumber', + 'sortCode' => 'sortCode', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'sortCode' => 'setSortCode', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'sortCode' => 'getSortCode', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('accountNumber', $data ?? [], null); + $this->setIfExists('sortCode', $data ?? [], null); + $this->setIfExists('type', $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 = []; + + 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 accountNumber + * + * @return string|null + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string|null $accountNumber The 8-digit bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets sortCode + * + * @return string|null + */ + public function getSortCode() + { + return $this->container['sortCode']; + } + + /** + * Sets sortCode + * + * @param string|null $sortCode The 6-digit [sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or whitespace. + * + * @return self + */ + public function setSortCode($sortCode) + { + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type **ukLocal** + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/WebhookSetting.php b/src/Adyen/Model/BalancePlatform/WebhookSetting.php new file mode 100644 index 000000000..b31cb5f78 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/WebhookSetting.php @@ -0,0 +1,546 @@ + + */ +class WebhookSetting implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WebhookSetting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'id' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\Target', + 'type' => '\Adyen\Model\BalancePlatform\SettingType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'id' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'id' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'currency' => 'currency', + 'id' => 'id', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'id' => 'setId', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'id' => 'getId', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * 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->setIfExists('currency', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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 ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' 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 currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the webhook setting. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\Target + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\Target $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\SettingType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\SettingType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/WebhookSettings.php b/src/Adyen/Model/BalancePlatform/WebhookSettings.php new file mode 100644 index 000000000..ec0a9f834 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/WebhookSettings.php @@ -0,0 +1,404 @@ + + */ +class WebhookSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WebhookSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'webhookSettings' => '\Adyen\Model\BalancePlatform\WebhookSetting[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'webhookSettings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'webhookSettings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $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 = [ + 'webhookSettings' => 'webhookSettings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'webhookSettings' => 'setWebhookSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'webhookSettings' => 'getWebhookSettings' + ]; + + /** + * 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->setIfExists('webhookSettings', $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 = []; + + 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 webhookSettings + * + * @return \Adyen\Model\BalancePlatform\WebhookSetting[]|null + */ + public function getWebhookSettings() + { + return $this->container['webhookSettings']; + } + + /** + * Sets webhookSettings + * + * @param \Adyen\Model\BalancePlatform\WebhookSetting[]|null $webhookSettings The list of webhook settings. + * + * @return self + */ + public function setWebhookSettings($webhookSettings) + { + $this->container['webhookSettings'] = $webhookSettings; + + 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); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php index bc952856e..26538fb0f 100644 --- a/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php +++ b/src/Adyen/Service/BalancePlatform/AccountHoldersApi.php @@ -114,6 +114,21 @@ public function getTaxForm(string $id, ?array $requestOptions = null): \Adyen\Mo return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\GetTaxFormResponse::class); } + /** + * Get summary of tax forms for an account holder + * + * @param string $id + * @param array|null $requestOptions ['queryParams' => ['formType'=> string]] + * @return \Adyen\Model\BalancePlatform\TaxFormSummaryResponse + * @throws AdyenException + */ + public function getTaxFormSummary(string $id, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\TaxFormSummaryResponse + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/accountHolders/{id}/taxFormSummary"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TaxFormSummaryResponse::class); + } + /** * Update an account holder * diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 1f043d320..3e8e1830a 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -54,52 +54,6 @@ public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccount return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccount::class); } - /** - * Create a sweep - * - * @param string $balanceAccountId - * @param \Adyen\Model\BalancePlatform\CreateSweepConfigurationV2 $createSweepConfigurationV2 - * @param array|null $requestOptions - * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 - * @throws AdyenException - */ - public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatform\CreateSweepConfigurationV2 $createSweepConfigurationV2, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 - { - $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); - $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createSweepConfigurationV2->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); - } - - /** - * Delete a sweep - * - * @param string $balanceAccountId - * @param string $sweepId - * @param array|null $requestOptions - - * @throws AdyenException - */ - public function deleteSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null) - { - $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); - $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } - - /** - * Get all sweeps for a balance account - * - * @param string $balanceAccountId - * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] - * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse - * @throws AdyenException - */ - public function getAllSweepsForBalanceAccount(string $balanceAccountId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse - { - $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); - $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse::class); - } - /** * Get all transaction rules for a balance account * @@ -145,22 +99,6 @@ public function getPaymentInstrumentsLinkedToBalanceAccount(string $id, ?array $ return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PaginatedPaymentInstrumentsResponse::class); } - /** - * Get a sweep - * - * @param string $balanceAccountId - * @param string $sweepId - * @param array|null $requestOptions - * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 - * @throws AdyenException - */ - public function getSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 - { - $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); - $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); - } - /** * Update a balance account * @@ -176,21 +114,4 @@ public function updateBalanceAccount(string $id, \Adyen\Model\BalancePlatform\Ba $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $balanceAccountUpdateRequest->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccount::class); } - - /** - * Update a sweep - * - * @param string $balanceAccountId - * @param string $sweepId - * @param \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2 - * @param array|null $requestOptions - * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 - * @throws AdyenException - */ - public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 - { - $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); - $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSweepConfigurationV2->jsonSerialize(), $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); - } } diff --git a/src/Adyen/Service/BalancePlatform/BalancesApi.php b/src/Adyen/Service/BalancePlatform/BalancesApi.php new file mode 100644 index 000000000..04f9415ca --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/BalancesApi.php @@ -0,0 +1,125 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Create a balance webhook setting + * + * @param string $balancePlatformId + * @param string $webhookId + * @param \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfo $balanceWebhookSettingInfo + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function createWebhookSetting(string $balancePlatformId, string $webhookId, \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfo $balanceWebhookSettingInfo, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}'], [$balancePlatformId, $webhookId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $balanceWebhookSettingInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } + + /** + * Delete a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get all balance webhook settings + * + * @param string $balancePlatformId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSettings + * @throws AdyenException + */ + public function getAllWebhookSettings(string $balancePlatformId, string $webhookId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSettings + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}'], [$balancePlatformId, $webhookId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSettings::class); + } + + /** + * Get a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function getWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } + + /** + * Update a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfoUpdate $balanceWebhookSettingInfoUpdate + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function updateWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfoUpdate $balanceWebhookSettingInfoUpdate, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $balanceWebhookSettingInfoUpdate->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/CustomPayoutSchedulesSweepsApi.php b/src/Adyen/Service/BalancePlatform/CustomPayoutSchedulesSweepsApi.php new file mode 100644 index 000000000..97501cf48 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/CustomPayoutSchedulesSweepsApi.php @@ -0,0 +1,120 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Create a sweep + * + * @param string $balanceAccountId + * @param \Adyen\Model\BalancePlatform\CreateSweepConfigurationV2 $createSweepConfigurationV2 + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatform\CreateSweepConfigurationV2 $createSweepConfigurationV2, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createSweepConfigurationV2->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } + + /** + * Delete a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get all sweeps for a balance account + * + * @param string $balanceAccountId + * @param array|null $requestOptions ['queryParams' => ['offset'=> int, 'limit'=> int]] + * @return \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse + * @throws AdyenException + */ + public function getAllSweepsForBalanceAccount(string $balanceAccountId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/sweeps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceSweepConfigurationsResponse::class); + } + + /** + * Get a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function getSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } + + /** + * Update a sweep + * + * @param string $balanceAccountId + * @param string $sweepId + * @param \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2 + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\SweepConfigurationV2 + * @throws AdyenException + */ + public function updateSweep(string $balanceAccountId, string $sweepId, \Adyen\Model\BalancePlatform\UpdateSweepConfigurationV2 $updateSweepConfigurationV2, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateSweepConfigurationV2->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/DirectDebitMandatesApi.php b/src/Adyen/Service/BalancePlatform/DirectDebitMandatesApi.php new file mode 100644 index 000000000..c8b71b107 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/DirectDebitMandatesApi.php @@ -0,0 +1,99 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Cancel a mandate + * + * @param string $mandateId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function cancelMandate(string $mandateId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{mandateId}'], [$mandateId], "/mandates/{mandateId}/cancel"); + $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + } + + /** + * Get a list of mandates + * + * @param array|null $requestOptions ['queryParams' => ['balanceAccountId'=> string, 'paymentInstrumentId'=> string, 'cursor'=> string]] + * @return \Adyen\Model\BalancePlatform\ListMandatesResponse + * @throws AdyenException + */ + public function getListOfMandates(?array $requestOptions = null): \Adyen\Model\BalancePlatform\ListMandatesResponse + { + $endpoint = $this->baseURL . "/mandates"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ListMandatesResponse::class); + } + + /** + * Get a specific mandate + * + * @param string $mandateId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\Mandate + * @throws AdyenException + */ + public function getMandateById(string $mandateId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\Mandate + { + $endpoint = $this->baseURL . str_replace(['{mandateId}'], [$mandateId], "/mandates/{mandateId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\Mandate::class); + } + + /** + * Amend a mandate + * + * @param string $mandateId + * @param \Adyen\Model\BalancePlatform\MandateUpdate $mandateUpdate + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function updateMandate(string $mandateId, \Adyen\Model\BalancePlatform\MandateUpdate $mandateUpdate, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{mandateId}'], [$mandateId], "/mandates/{mandateId}"); + $this->requestHttp($endpoint, strtolower('PATCH'), (array) $mandateUpdate->jsonSerialize(), $requestOptions); + } +} diff --git a/src/Adyen/Service/BalancePlatform/ManagedPayoutSchedulesApi.php b/src/Adyen/Service/BalancePlatform/ManagedPayoutSchedulesApi.php new file mode 100644 index 000000000..89e574cd0 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/ManagedPayoutSchedulesApi.php @@ -0,0 +1,167 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Apply a managed payout schedule to a balance account + * + * @param string $balanceAccountId + * @param \Adyen\Model\BalancePlatform\BalanceAccountConfigurationRequest $balanceAccountConfigurationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + * @throws AdyenException + */ + public function applyManagedSchedule(string $balanceAccountId, \Adyen\Model\BalancePlatform\BalanceAccountConfigurationRequest $balanceAccountConfigurationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/payoutSchedules"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $balanceAccountConfigurationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccountConfiguration::class); + } + + /** + * Delete a managed payout schedule on a balance account + * + * @param string $balanceAccountId + * @param string $id + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteBalanceAccountManagedSchedule(string $balanceAccountId, string $id, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{id}'], [$balanceAccountId, $id], "/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get a specific managed payout schedule on a balance account + * + * @param string $balanceAccountId + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + * @throws AdyenException + */ + public function getBalanceAccountManagedScheduleById(string $balanceAccountId, string $id, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{id}'], [$balanceAccountId, $id], "/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccountConfiguration::class); + } + + /** + * Get all managed payout schedules on a balance account + * + * @param string $balanceAccountId + * @param array|null $requestOptions ['queryParams' => ['currency'=> string, 'cursor'=> string, 'limit'=> int]] + * @return \Adyen\Model\BalancePlatform\BalanceAccountConfigurations + * @throws AdyenException + */ + public function getBalanceAccountManagedSchedules(string $balanceAccountId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccountConfigurations + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/payoutSchedules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccountConfigurations::class); + } + + /** + * Get a specific managed payout schedule on your balance platform + * + * @param string $balancePlatformId + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BalancePlatformConfiguration + * @throws AdyenException + */ + public function getBalancePlatformManagedScheduleById(string $balancePlatformId, string $id, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalancePlatformConfiguration + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{id}'], [$balancePlatformId, $id], "/balancePlatforms/{balancePlatformId}/payoutSchedules/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalancePlatformConfiguration::class); + } + + /** + * Get all managed payout schedules on your balance platform + * + * @param string $balancePlatformId + * @param array|null $requestOptions ['queryParams' => ['countryCode'=> string, 'currency'=> string]] + * @return \Adyen\Model\BalancePlatform\BalancePlatformConfigurations + * @throws AdyenException + */ + public function getBalancePlatformManagedSchedules(string $balancePlatformId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalancePlatformConfigurations + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}'], [$balancePlatformId], "/balancePlatforms/{balancePlatformId}/payoutSchedules"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalancePlatformConfigurations::class); + } + + /** + * View executions of a managed payout schedule + * + * @param string $balanceAccountId + * @param string $id + * @param array|null $requestOptions ['queryParams' => ['results'=> \Adyen\Model\BalancePlatform\ExecutionResult[], 'limit'=> int, 'offset'=> int]] + * @return \Adyen\Model\BalancePlatform\PayoutScheduleExecutions + * @throws AdyenException + */ + public function getPayoutScheduleExecutions(string $balanceAccountId, string $id, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\PayoutScheduleExecutions + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{id}'], [$balanceAccountId, $id], "/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}/executions"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\PayoutScheduleExecutions::class); + } + + /** + * Update a managed payout schedule on a balance account + * + * @param string $balanceAccountId + * @param string $id + * @param \Adyen\Model\BalancePlatform\BalanceAccountConfigurationUpdate $balanceAccountConfigurationUpdate + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + * @throws AdyenException + */ + public function updateBalanceAccountManagedSchedule(string $balanceAccountId, string $id, \Adyen\Model\BalancePlatform\BalanceAccountConfigurationUpdate $balanceAccountConfigurationUpdate, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BalanceAccountConfiguration + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{id}'], [$balanceAccountId, $id], "/balanceAccounts/{balanceAccountId}/payoutSchedules/{id}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $balanceAccountConfigurationUpdate->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BalanceAccountConfiguration::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/RecurringTopUpsApi.php b/src/Adyen/Service/BalancePlatform/RecurringTopUpsApi.php new file mode 100644 index 000000000..8fb8ad99e --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/RecurringTopUpsApi.php @@ -0,0 +1,104 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Create recurring top up + * + * @param string $balanceAccountId + * @param \Adyen\Model\BalancePlatform\CreateRecurringTopUp $createRecurringTopUp + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\RecurringTopUp + * @throws AdyenException + */ + public function createRecurringTopUp(string $balanceAccountId, \Adyen\Model\BalancePlatform\CreateRecurringTopUp $createRecurringTopUp, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\RecurringTopUp + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/recurringTopUps"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createRecurringTopUp->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RecurringTopUp::class); + } + + /** + * Delete a recurring top up + * + * @param string $balanceAccountId + * @param string $topUpId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteRecurringTopUp(string $balanceAccountId, string $topUpId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{topUpId}'], [$balanceAccountId, $topUpId], "/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Get recurring top ups for a specific balanceAccountId + * + * @param string $balanceAccountId + * @param array|null $requestOptions ['queryParams' => ['limit'=> int, 'cursor'=> string]] + * @return \Adyen\Model\BalancePlatform\RecurringTopUpsResult + * @throws AdyenException + */ + public function getRecurringTopUps(string $balanceAccountId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\RecurringTopUpsResult + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}'], [$balanceAccountId], "/balanceAccounts/{balanceAccountId}/recurringTopUps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RecurringTopUpsResult::class); + } + + /** + * Update a RecurringTopUp + * + * @param string $balanceAccountId + * @param string $topUpId + * @param \Adyen\Model\BalancePlatform\PatchableCreateRecurringTopUp $patchableCreateRecurringTopUp + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\RecurringTopUp + * @throws AdyenException + */ + public function updateRecurringTopUps(string $balanceAccountId, string $topUpId, \Adyen\Model\BalancePlatform\PatchableCreateRecurringTopUp $patchableCreateRecurringTopUp, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\RecurringTopUp + { + $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{topUpId}'], [$balanceAccountId, $topUpId], "/balanceAccounts/{balanceAccountId}/recurringTopUps/{topUpId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $patchableCreateRecurringTopUp->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\RecurringTopUp::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php new file mode 100644 index 000000000..d84445a5d --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php @@ -0,0 +1,84 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Approve a pending approval association + * + * @param \Adyen\Model\BalancePlatform\ApproveAssociationRequest $approveAssociationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\ApproveAssociationResponse + * @throws AdyenException + */ + public function approveAssociation(\Adyen\Model\BalancePlatform\ApproveAssociationRequest $approveAssociationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\ApproveAssociationResponse + { + $endpoint = $this->baseURL . "/scaAssociations"; + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $approveAssociationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ApproveAssociationResponse::class); + } + + /** + * Get a list of devices associated with an entity + * + * @param array|null $requestOptions ['queryParams' => ['entityType'=> ScaEntityType, 'entityId'=> string, 'pageSize'=> int, 'pageNumber'=> int]] + * @return \Adyen\Model\BalancePlatform\ListAssociationsResponse + * @throws AdyenException + */ + public function listAssociations(?array $requestOptions = null): \Adyen\Model\BalancePlatform\ListAssociationsResponse + { + $endpoint = $this->baseURL . "/scaAssociations"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ListAssociationsResponse::class); + } + + /** + * Delete association to devices + * + * @param \Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function removeAssociation(\Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . "/scaAssociations"; + $this->requestHttp($endpoint, strtolower('DELETE'), (array) $removeAssociationRequest->jsonSerialize(), $requestOptions); + } +} diff --git a/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php b/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php new file mode 100644 index 000000000..0f1335ae8 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php @@ -0,0 +1,102 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Begin SCA device registration + * + * @param \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationRequest $beginScaDeviceRegistrationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse + * @throws AdyenException + */ + public function beginScaDeviceRegistration(\Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationRequest $beginScaDeviceRegistrationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse + { + $endpoint = $this->baseURL . "/scaDevices"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $beginScaDeviceRegistrationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse::class); + } + + /** + * Delete an SCA device + * + * @param string $deviceId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteScaDevice(string $deviceId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{deviceId}'], [$deviceId], "/scaDevices/{deviceId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } + + /** + * Finish registration process for a SCA device + * + * @param string $deviceId + * @param \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationRequest $finishScaDeviceRegistrationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse + * @throws AdyenException + */ + public function finishScaDeviceRegistration(string $deviceId, \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationRequest $finishScaDeviceRegistrationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse + { + $endpoint = $this->baseURL . str_replace(['{deviceId}'], [$deviceId], "/scaDevices/{deviceId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $finishScaDeviceRegistrationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse::class); + } + + /** + * Create a new SCA association for a device + * + * @param string $deviceId + * @param \Adyen\Model\BalancePlatform\SubmitScaAssociationRequest $submitScaAssociationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse + * @throws AdyenException + */ + public function submitScaAssociation(string $deviceId, \Adyen\Model\BalancePlatform\SubmitScaAssociationRequest $submitScaAssociationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse + { + $endpoint = $this->baseURL . str_replace(['{deviceId}'], [$deviceId], "/scaDevices/{deviceId}/scaAssociations"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $submitScaAssociationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse::class); + } +}