diff --git a/src/Adyen/Model/BalancePlatform/AddressRequirement.php b/src/Adyen/Model/BalancePlatform/AddressRequirement.php new file mode 100644 index 000000000..adcbb63b0 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AddressRequirement.php @@ -0,0 +1,486 @@ + + */ +class AddressRequirement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AddressRequirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'requiredAddressFields' => 'string[]', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'requiredAddressFields' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'requiredAddressFields' => 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 = [ + 'description' => 'description', + 'requiredAddressFields' => 'requiredAddressFields', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'requiredAddressFields' => 'setRequiredAddressFields', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'requiredAddressFields' => 'getRequiredAddressFields', + '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_ADDRESS_REQUIREMENT = 'addressRequirement'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_ADDRESS_REQUIREMENT, + ]; + } + /** + * 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('requiredAddressFields', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'addressRequirement'); + } + + /** + * 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"; + } + $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the required address related fields for a particular route. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets requiredAddressFields + * + * @return string[]|null + */ + public function getRequiredAddressFields() + { + return $this->container['requiredAddressFields']; + } + + /** + * Sets requiredAddressFields + * + * @param string[]|null $requiredAddressFields List of address fields. + * + * @return self + */ + public function setRequiredAddressFields($requiredAddressFields) + { + if (is_null($requiredAddressFields)) { + throw new \InvalidArgumentException('non-nullable requiredAddressFields cannot be null'); + } + $this->container['requiredAddressFields'] = $requiredAddressFields; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **addressRequirement** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/AmountMinMaxRequirement.php b/src/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.php new file mode 100644 index 000000000..5f3d37123 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AmountMinMaxRequirement.php @@ -0,0 +1,520 @@ + + */ +class AmountMinMaxRequirement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AmountMinMaxRequirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'max' => 'int', + 'min' => 'int', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'max' => 'int64', + 'min' => 'int64', + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'max' => false, + 'min' => 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 = [ + 'description' => 'description', + 'max' => 'max', + 'min' => 'min', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'max' => 'setMax', + 'min' => 'setMin', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'max' => 'getMax', + 'min' => 'getMin', + '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_AMOUNT_MIN_MAX_REQUIREMENT = 'amountMinMaxRequirement'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_AMOUNT_MIN_MAX_REQUIREMENT, + ]; + } + /** + * 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('max', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'amountMinMaxRequirement'); + } + + /** + * 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"; + } + $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the eligible amounts for a particular route. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param int|null $max Maximum amount. + * + * @return self + */ + public function setMax($max) + { + if (is_null($max)) { + throw new \InvalidArgumentException('non-nullable max cannot be null'); + } + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param int|null $min Minimum amount. + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **amountMinMaxRequirement** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/BankAccount.php b/src/Adyen/Model/BalancePlatform/BankAccount.php new file mode 100644 index 000000000..5327d092f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccount.php @@ -0,0 +1,387 @@ + + */ +class BankAccount implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccount'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountIdentification' => '\Adyen\Model\BalancePlatform\BankAccountAccountIdentification' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountIdentification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + '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 = [ + 'accountIdentification' => 'accountIdentification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountIdentification' => 'setAccountIdentification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + '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('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['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 accountIdentification + * + * @return \Adyen\Model\BalancePlatform\BankAccountAccountIdentification + */ + public function getAccountIdentification() + { + return $this->container['accountIdentification']; + } + + /** + * Sets accountIdentification + * + * @param \Adyen\Model\BalancePlatform\BankAccountAccountIdentification $accountIdentification accountIdentification + * + * @return self + */ + public function setAccountIdentification($accountIdentification) + { + if (is_null($accountIdentification)) { + throw new \InvalidArgumentException('non-nullable accountIdentification cannot be null'); + } + $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); + } + + /** + * 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 new file mode 100644 index 000000000..df53ff3db --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccountAccountIdentification.php @@ -0,0 +1,938 @@ + + */ +class BankAccountAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccount_accountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => 'string', + 'bsbCode' => 'string', + 'type' => 'string', + 'bankCode' => 'string', + 'branchNumber' => 'string', + 'accountType' => 'string', + 'institutionNumber' => 'string', + 'transitNumber' => 'string', + 'clearingCode' => 'string', + 'iban' => 'string', + 'accountSuffix' => 'string', + 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', + 'bic' => 'string', + 'clearingNumber' => 'string', + 'sortCode' => 'string', + 'routingNumber' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountNumber' => null, + 'bsbCode' => null, + 'type' => null, + 'bankCode' => null, + 'branchNumber' => null, + 'accountType' => null, + 'institutionNumber' => null, + 'transitNumber' => null, + 'clearingCode' => null, + 'iban' => null, + 'accountSuffix' => null, + 'additionalBankIdentification' => null, + 'bic' => null, + 'clearingNumber' => null, + 'sortCode' => null, + 'routingNumber' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => false, + 'bsbCode' => false, + 'type' => false, + 'bankCode' => false, + 'branchNumber' => false, + 'accountType' => false, + 'institutionNumber' => false, + 'transitNumber' => false, + 'clearingCode' => false, + 'iban' => false, + 'accountSuffix' => false, + 'additionalBankIdentification' => false, + 'bic' => false, + 'clearingNumber' => false, + 'sortCode' => false, + 'routingNumber' => 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', + 'bsbCode' => 'bsbCode', + 'type' => 'type', + 'bankCode' => 'bankCode', + 'branchNumber' => 'branchNumber', + 'accountType' => 'accountType', + 'institutionNumber' => 'institutionNumber', + 'transitNumber' => 'transitNumber', + 'clearingCode' => 'clearingCode', + 'iban' => 'iban', + 'accountSuffix' => 'accountSuffix', + 'additionalBankIdentification' => 'additionalBankIdentification', + 'bic' => 'bic', + 'clearingNumber' => 'clearingNumber', + 'sortCode' => 'sortCode', + 'routingNumber' => 'routingNumber' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'bsbCode' => 'setBsbCode', + 'type' => 'setType', + 'bankCode' => 'setBankCode', + 'branchNumber' => 'setBranchNumber', + 'accountType' => 'setAccountType', + 'institutionNumber' => 'setInstitutionNumber', + 'transitNumber' => 'setTransitNumber', + 'clearingCode' => 'setClearingCode', + 'iban' => 'setIban', + 'accountSuffix' => 'setAccountSuffix', + 'additionalBankIdentification' => 'setAdditionalBankIdentification', + 'bic' => 'setBic', + 'clearingNumber' => 'setClearingNumber', + 'sortCode' => 'setSortCode', + 'routingNumber' => 'setRoutingNumber' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + 'bsbCode' => 'getBsbCode', + 'type' => 'getType', + 'bankCode' => 'getBankCode', + 'branchNumber' => 'getBranchNumber', + 'accountType' => 'getAccountType', + 'institutionNumber' => 'getInstitutionNumber', + 'transitNumber' => 'getTransitNumber', + 'clearingCode' => 'getClearingCode', + 'iban' => 'getIban', + 'accountSuffix' => 'getAccountSuffix', + 'additionalBankIdentification' => 'getAdditionalBankIdentification', + 'bic' => 'getBic', + 'clearingNumber' => 'getClearingNumber', + 'sortCode' => 'getSortCode', + 'routingNumber' => 'getRoutingNumber' + ]; + + /** + * 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('bsbCode', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'usLocal'); + $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('branchNumber', $data ?? [], null); + $this->setIfExists('accountType', $data ?? [], 'checking'); + $this->setIfExists('institutionNumber', $data ?? [], null); + $this->setIfExists('transitNumber', $data ?? [], null); + $this->setIfExists('clearingCode', $data ?? [], null); + $this->setIfExists('iban', $data ?? [], null); + $this->setIfExists('accountSuffix', $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); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' can't be null"; + } + if ($this->container['bsbCode'] === null) { + $invalidProperties[] = "'bsbCode' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + + if ($this->container['bankCode'] === null) { + $invalidProperties[] = "'bankCode' can't be null"; + } + if ($this->container['branchNumber'] === null) { + $invalidProperties[] = "'branchNumber' can't be null"; + } + + if ($this->container['institutionNumber'] === null) { + $invalidProperties[] = "'institutionNumber' can't be null"; + } + if ($this->container['transitNumber'] === null) { + $invalidProperties[] = "'transitNumber' can't be null"; + } + 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['accountSuffix'] === null) { + $invalidProperties[] = "'accountSuffix' can't be null"; + } + if ($this->container['bic'] === null) { + $invalidProperties[] = "'bic' can't be null"; + } + if ($this->container['clearingNumber'] === null) { + $invalidProperties[] = "'clearingNumber' can't be null"; + } + if ($this->container['sortCode'] === null) { + $invalidProperties[] = "'sortCode' can't be null"; + } + if ($this->container['routingNumber'] === null) { + $invalidProperties[] = "'routingNumber' 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 bank account number, without separators or whitespace. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets bsbCode + * + * @return string + */ + public function getBsbCode() + { + return $this->container['bsbCode']; + } + + /** + * Sets bsbCode + * + * @param string $bsbCode The 6-digit [Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or whitespace. + * + * @return self + */ + public function setBsbCode($bsbCode) + { + if (is_null($bsbCode)) { + throw new \InvalidArgumentException('non-nullable bsbCode cannot be null'); + } + $this->container['bsbCode'] = $bsbCode; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **usLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets bankCode + * + * @return string + */ + public function getBankCode() + { + return $this->container['bankCode']; + } + + /** + * Sets bankCode + * + * @param string $bankCode The 6-digit bank code including the 2-digit bank code and 4-digit branch code, without separators or whitespace. + * + * @return self + */ + public function setBankCode($bankCode) + { + if (is_null($bankCode)) { + throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + } + $this->container['bankCode'] = $bankCode; + + return $this; + } + + /** + * Gets branchNumber + * + * @return string + */ + public function getBranchNumber() + { + return $this->container['branchNumber']; + } + + /** + * Sets branchNumber + * + * @param string $branchNumber The bank account branch number, without separators or whitespace. + * + * @return self + */ + public function setBranchNumber($branchNumber) + { + if (is_null($branchNumber)) { + throw new \InvalidArgumentException('non-nullable branchNumber cannot be null'); + } + $this->container['branchNumber'] = $branchNumber; + + return $this; + } + + /** + * Gets accountType + * + * @return string|null + */ + public function getAccountType() + { + return $this->container['accountType']; + } + + /** + * Sets accountType + * + * @param string|null $accountType The bank account type. Possible values: **checking** or **savings**. Defaults to **checking**. + * + * @return self + */ + public function setAccountType($accountType) + { + if (is_null($accountType)) { + throw new \InvalidArgumentException('non-nullable accountType cannot be null'); + } + $this->container['accountType'] = $accountType; + + return $this; + } + + /** + * Gets institutionNumber + * + * @return string + */ + public function getInstitutionNumber() + { + return $this->container['institutionNumber']; + } + + /** + * Sets institutionNumber + * + * @param string $institutionNumber The 3-digit institution number, without separators or whitespace. + * + * @return self + */ + public function setInstitutionNumber($institutionNumber) + { + if (is_null($institutionNumber)) { + throw new \InvalidArgumentException('non-nullable institutionNumber cannot be null'); + } + $this->container['institutionNumber'] = $institutionNumber; + + return $this; + } + + /** + * Gets transitNumber + * + * @return string + */ + public function getTransitNumber() + { + return $this->container['transitNumber']; + } + + /** + * Sets transitNumber + * + * @param string $transitNumber The 5-digit transit number, without separators or whitespace. + * + * @return self + */ + public function setTransitNumber($transitNumber) + { + if (is_null($transitNumber)) { + throw new \InvalidArgumentException('non-nullable transitNumber cannot be null'); + } + $this->container['transitNumber'] = $transitNumber; + + return $this; + } + + /** + * Gets clearingCode + * + * @return string + */ + public function getClearingCode() + { + return $this->container['clearingCode']; + } + + /** + * Sets clearingCode + * + * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. + * + * @return self + */ + public function setClearingCode($clearingCode) + { + if (is_null($clearingCode)) { + throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); + } + $this->container['clearingCode'] = $clearingCode; + + return $this; + } + + /** + * Gets iban + * + * @return string + */ + public function getIban() + { + return $this->container['iban']; + } + + /** + * Sets iban + * + * @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 setIban($iban) + { + if (is_null($iban)) { + throw new \InvalidArgumentException('non-nullable iban cannot be null'); + } + $this->container['iban'] = $iban; + + return $this; + } + + /** + * Gets accountSuffix + * + * @return string + */ + public function getAccountSuffix() + { + return $this->container['accountSuffix']; + } + + /** + * Sets accountSuffix + * + * @param string $accountSuffix The 2- to 3-digit account suffix, without separators or whitespace. + * + * @return self + */ + public function setAccountSuffix($accountSuffix) + { + if (is_null($accountSuffix)) { + throw new \InvalidArgumentException('non-nullable accountSuffix cannot be null'); + } + $this->container['accountSuffix'] = $accountSuffix; + + return $this; + } + + /** + * Gets additionalBankIdentification + * + * @return \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null + */ + public function getAdditionalBankIdentification() + { + return $this->container['additionalBankIdentification']; + } + + /** + * Sets additionalBankIdentification + * + * @param \Adyen\Model\BalancePlatform\AdditionalBankIdentification|null $additionalBankIdentification additionalBankIdentification + * + * @return self + */ + public function setAdditionalBankIdentification($additionalBankIdentification) + { + if (is_null($additionalBankIdentification)) { + throw new \InvalidArgumentException('non-nullable additionalBankIdentification cannot be null'); + } + $this->container['additionalBankIdentification'] = $additionalBankIdentification; + + return $this; + } + + /** + * Gets bic + * + * @return string + */ + public function getBic() + { + return $this->container['bic']; + } + + /** + * Sets bic + * + * @param string $bic The bank's 8- or 11-character BIC or SWIFT code. + * + * @return self + */ + public function setBic($bic) + { + if (is_null($bic)) { + throw new \InvalidArgumentException('non-nullable bic cannot be null'); + } + $this->container['bic'] = $bic; + + return $this; + } + + /** + * Gets clearingNumber + * + * @return string + */ + public function getClearingNumber() + { + return $this->container['clearingNumber']; + } + + /** + * Sets clearingNumber + * + * @param string $clearingNumber The 4- to 5-digit clearing number ([Clearingnummer](https://sv.wikipedia.org/wiki/Clearingnummer)), without separators or whitespace. + * + * @return self + */ + public function setClearingNumber($clearingNumber) + { + if (is_null($clearingNumber)) { + throw new \InvalidArgumentException('non-nullable clearingNumber cannot be null'); + } + $this->container['clearingNumber'] = $clearingNumber; + + 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) + { + if (is_null($sortCode)) { + throw new \InvalidArgumentException('non-nullable sortCode cannot be null'); + } + $this->container['sortCode'] = $sortCode; + + return $this; + } + + /** + * Gets routingNumber + * + * @return string + */ + public function getRoutingNumber() + { + return $this->container['routingNumber']; + } + + /** + * Sets routingNumber + * + * @param string $routingNumber The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or whitespace. + * + * @return self + */ + public function setRoutingNumber($routingNumber) + { + if (is_null($routingNumber)) { + throw new \InvalidArgumentException('non-nullable routingNumber cannot be null'); + } + $this->container['routingNumber'] = $routingNumber; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php new file mode 100644 index 000000000..fc9f66de7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationTypeRequirement.php @@ -0,0 +1,539 @@ + + */ +class BankAccountIdentificationTypeRequirement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BankAccountIdentificationTypeRequirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bankAccountIdentificationTypes' => 'string[]', + 'description' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bankAccountIdentificationTypes' => null, + 'description' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bankAccountIdentificationTypes' => false, + 'description' => 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 = [ + 'bankAccountIdentificationTypes' => 'bankAccountIdentificationTypes', + 'description' => 'description', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bankAccountIdentificationTypes' => 'setBankAccountIdentificationTypes', + 'description' => 'setDescription', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bankAccountIdentificationTypes' => 'getBankAccountIdentificationTypes', + 'description' => 'getDescription', + '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 BANK_ACCOUNT_IDENTIFICATION_TYPES_AU_LOCAL = 'auLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_BR_LOCAL = 'brLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_CA_LOCAL = 'caLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_CZ_LOCAL = 'czLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_DK_LOCAL = 'dkLocal'; + 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_LEGACY = 'legacy'; + 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'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_PL_LOCAL = 'plLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_SE_LOCAL = 'seLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_SG_LOCAL = 'sgLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_UK_LOCAL = 'ukLocal'; + public const BANK_ACCOUNT_IDENTIFICATION_TYPES_US_LOCAL = 'usLocal'; + public const TYPE_BANK_ACCOUNT_IDENTIFICATION_TYPE_REQUIREMENT = 'bankAccountIdentificationTypeRequirement'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBankAccountIdentificationTypesAllowableValues() + { + return [ + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_AU_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_BR_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_CA_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_CZ_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_DK_LOCAL, + 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_LEGACY, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NO_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NUMBER_AND_BIC, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_NZ_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_PL_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_SE_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_SG_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_UK_LOCAL, + self::BANK_ACCOUNT_IDENTIFICATION_TYPES_US_LOCAL, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BANK_ACCOUNT_IDENTIFICATION_TYPE_REQUIREMENT, + ]; + } + /** + * 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('bankAccountIdentificationTypes', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'bankAccountIdentificationTypeRequirement'); + } + + /** + * 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"; + } + $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 bankAccountIdentificationTypes + * + * @return string[]|null + */ + public function getBankAccountIdentificationTypes() + { + return $this->container['bankAccountIdentificationTypes']; + } + + /** + * Sets bankAccountIdentificationTypes + * + * @param string[]|null $bankAccountIdentificationTypes List of bank account identification types: eg.; [iban , numberAndBic] + * + * @return self + */ + public function setBankAccountIdentificationTypes($bankAccountIdentificationTypes) + { + if (is_null($bankAccountIdentificationTypes)) { + throw new \InvalidArgumentException('non-nullable bankAccountIdentificationTypes cannot be null'); + } + $allowedValues = $this->getBankAccountIdentificationTypesAllowableValues(); + if (array_diff($bankAccountIdentificationTypes, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'bankAccountIdentificationTypes', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['bankAccountIdentificationTypes'] = $bankAccountIdentificationTypes; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the bank account details for a particular route per required field in this object depending on the country of the bank account and the currency of the transfer. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **bankAccountIdentificationTypeRequirement** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/BankAccountIdentificationValidationRequestAccountIdentification.php b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php index caa0377e6..6fc6e0d3f 100644 --- a/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/BankAccountIdentificationValidationRequestAccountIdentification.php @@ -53,6 +53,7 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountType' => 'string', 'institutionNumber' => 'string', 'transitNumber' => 'string', + 'clearingCode' => 'string', 'iban' => 'string', 'accountSuffix' => 'string', 'additionalBankIdentification' => '\Adyen\Model\BalancePlatform\AdditionalBankIdentification', @@ -78,6 +79,7 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountType' => null, 'institutionNumber' => null, 'transitNumber' => null, + 'clearingCode' => null, 'iban' => null, 'accountSuffix' => null, 'additionalBankIdentification' => null, @@ -101,6 +103,7 @@ class BankAccountIdentificationValidationRequestAccountIdentification implements 'accountType' => false, 'institutionNumber' => false, 'transitNumber' => false, + 'clearingCode' => false, 'iban' => false, 'accountSuffix' => false, 'additionalBankIdentification' => false, @@ -204,6 +207,7 @@ public function isNullableSetToNull(string $property): bool 'accountType' => 'accountType', 'institutionNumber' => 'institutionNumber', 'transitNumber' => 'transitNumber', + 'clearingCode' => 'clearingCode', 'iban' => 'iban', 'accountSuffix' => 'accountSuffix', 'additionalBankIdentification' => 'additionalBankIdentification', @@ -227,6 +231,7 @@ public function isNullableSetToNull(string $property): bool 'accountType' => 'setAccountType', 'institutionNumber' => 'setInstitutionNumber', 'transitNumber' => 'setTransitNumber', + 'clearingCode' => 'setClearingCode', 'iban' => 'setIban', 'accountSuffix' => 'setAccountSuffix', 'additionalBankIdentification' => 'setAdditionalBankIdentification', @@ -250,6 +255,7 @@ public function isNullableSetToNull(string $property): bool 'accountType' => 'getAccountType', 'institutionNumber' => 'getInstitutionNumber', 'transitNumber' => 'getTransitNumber', + 'clearingCode' => 'getClearingCode', 'iban' => 'getIban', 'accountSuffix' => 'getAccountSuffix', 'additionalBankIdentification' => 'getAdditionalBankIdentification', @@ -323,6 +329,7 @@ public function __construct(array $data = null) $this->setIfExists('accountType', $data ?? [], 'checking'); $this->setIfExists('institutionNumber', $data ?? [], null); $this->setIfExists('transitNumber', $data ?? [], null); + $this->setIfExists('clearingCode', $data ?? [], null); $this->setIfExists('iban', $data ?? [], null); $this->setIfExists('accountSuffix', $data ?? [], null); $this->setIfExists('additionalBankIdentification', $data ?? [], null); @@ -382,6 +389,9 @@ public function listInvalidProperties() if ($this->container['transitNumber'] === null) { $invalidProperties[] = "'transitNumber' can't be null"; } + if ($this->container['clearingCode'] === null) { + $invalidProperties[] = "'clearingCode' can't be null"; + } if ($this->container['iban'] === null) { $invalidProperties[] = "'iban' can't be null"; } @@ -631,6 +641,33 @@ public function setTransitNumber($transitNumber) return $this; } + /** + * Gets clearingCode + * + * @return string + */ + public function getClearingCode() + { + return $this->container['clearingCode']; + } + + /** + * Sets clearingCode + * + * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. + * + * @return self + */ + public function setClearingCode($clearingCode) + { + if (is_null($clearingCode)) { + throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); + } + $this->container['clearingCode'] = $clearingCode; + + return $this; + } + /** * Gets iban * diff --git a/src/Adyen/Model/BalancePlatform/Counterparty.php b/src/Adyen/Model/BalancePlatform/Counterparty.php new file mode 100644 index 000000000..aad3b7832 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Counterparty.php @@ -0,0 +1,418 @@ + + */ +class Counterparty implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Counterparty'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'bankAccount' => '\Adyen\Model\BalancePlatform\BankAccount', + 'transferInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'bankAccount' => null, + 'transferInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'bankAccount' => 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 = [ + 'bankAccount' => 'bankAccount', + 'transferInstrumentId' => 'transferInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'bankAccount' => 'setBankAccount', + 'transferInstrumentId' => 'setTransferInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'bankAccount' => 'getBankAccount', + '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('bankAccount', $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 = []; + + 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 bankAccount + * + * @return \Adyen\Model\BalancePlatform\BankAccount|null + */ + public function getBankAccount() + { + return $this->container['bankAccount']; + } + + /** + * Sets bankAccount + * + * @param \Adyen\Model\BalancePlatform\BankAccount|null $bankAccount bankAccount + * + * @return self + */ + public function setBankAccount($bankAccount) + { + if (is_null($bankAccount)) { + throw new \InvalidArgumentException('non-nullable bankAccount cannot be null'); + } + $this->container['bankAccount'] = $bankAccount; + + return $this; + } + + /** + * Gets transferInstrumentId + * + * @return string|null + */ + public function getTransferInstrumentId() + { + return $this->container['transferInstrumentId']; + } + + /** + * Sets transferInstrumentId + * + * @param string|null $transferInstrumentId Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * + * @return self + */ + public function setTransferInstrumentId($transferInstrumentId) + { + if (is_null($transferInstrumentId)) { + throw new \InvalidArgumentException('non-nullable transferInstrumentId cannot be null'); + } + $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); + } + + /** + * 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/CreateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php new file mode 100644 index 000000000..9a0404822 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php @@ -0,0 +1,956 @@ + + */ +class CreateSweepConfigurationV2 implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateSweepConfigurationV2'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'category' => 'string', + 'counterparty' => '\Adyen\Model\BalancePlatform\SweepCounterparty', + 'currency' => 'string', + 'description' => 'string', + 'priorities' => 'string[]', + 'reason' => 'string', + 'schedule' => '\Adyen\Model\BalancePlatform\SweepSchedule', + 'status' => 'string', + 'sweepAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'targetAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'triggerAmount' => '\Adyen\Model\BalancePlatform\Amount', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'category' => null, + 'counterparty' => null, + 'currency' => null, + 'description' => null, + 'priorities' => null, + 'reason' => null, + 'schedule' => null, + 'status' => null, + 'sweepAmount' => null, + 'targetAmount' => null, + 'triggerAmount' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'category' => false, + 'counterparty' => false, + 'currency' => false, + 'description' => false, + 'priorities' => false, + 'reason' => false, + 'schedule' => false, + 'status' => false, + 'sweepAmount' => false, + 'targetAmount' => false, + 'triggerAmount' => 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 = [ + 'category' => 'category', + 'counterparty' => 'counterparty', + 'currency' => 'currency', + 'description' => 'description', + 'priorities' => 'priorities', + 'reason' => 'reason', + 'schedule' => 'schedule', + 'status' => 'status', + 'sweepAmount' => 'sweepAmount', + 'targetAmount' => 'targetAmount', + 'triggerAmount' => 'triggerAmount', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'category' => 'setCategory', + 'counterparty' => 'setCounterparty', + 'currency' => 'setCurrency', + 'description' => 'setDescription', + 'priorities' => 'setPriorities', + 'reason' => 'setReason', + 'schedule' => 'setSchedule', + 'status' => 'setStatus', + 'sweepAmount' => 'setSweepAmount', + 'targetAmount' => 'setTargetAmount', + 'triggerAmount' => 'setTriggerAmount', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'category' => 'getCategory', + 'counterparty' => 'getCounterparty', + 'currency' => 'getCurrency', + 'description' => 'getDescription', + 'priorities' => 'getPriorities', + 'reason' => 'getReason', + 'schedule' => 'getSchedule', + 'status' => 'getStatus', + 'sweepAmount' => 'getSweepAmount', + 'targetAmount' => 'getTargetAmount', + 'triggerAmount' => 'getTriggerAmount', + '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 CATEGORY_BANK = 'bank'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const PRIORITIES_CROSS_BORDER = 'crossBorder'; + public const PRIORITIES_DIRECT_DEBIT = 'directDebit'; + public const PRIORITIES_FAST = 'fast'; + public const PRIORITIES_INSTANT = 'instant'; + public const PRIORITIES_INTERNAL = 'internal'; + public const PRIORITIES_REGULAR = 'regular'; + public const PRIORITIES_WIRE = 'wire'; + public const REASON_AMOUNT_LIMIT_EXCEEDED = 'amountLimitExceeded'; + public const REASON_APPROVED = 'approved'; + public const REASON_COUNTERPARTY_ACCOUNT_BLOCKED = 'counterpartyAccountBlocked'; + public const REASON_COUNTERPARTY_ACCOUNT_CLOSED = 'counterpartyAccountClosed'; + public const REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND = 'counterpartyAccountNotFound'; + public const REASON_COUNTERPARTY_ADDRESS_REQUIRED = 'counterpartyAddressRequired'; + public const REASON_COUNTERPARTY_BANK_TIMED_OUT = 'counterpartyBankTimedOut'; + public const REASON_COUNTERPARTY_BANK_UNAVAILABLE = 'counterpartyBankUnavailable'; + public const REASON_ERROR = 'error'; + public const REASON_NOT_ENOUGH_BALANCE = 'notEnoughBalance'; + public const REASON_REFUSED_BY_COUNTERPARTY_BANK = 'refusedByCounterpartyBank'; + public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; + public const REASON_UNKNOWN = 'unknown'; + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_PULL = 'pull'; + public const TYPE_PUSH = 'push'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_INTERNAL, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPrioritiesAllowableValues() + { + return [ + self::PRIORITIES_CROSS_BORDER, + self::PRIORITIES_DIRECT_DEBIT, + self::PRIORITIES_FAST, + self::PRIORITIES_INSTANT, + self::PRIORITIES_INTERNAL, + self::PRIORITIES_REGULAR, + self::PRIORITIES_WIRE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getReasonAllowableValues() + { + return [ + self::REASON_AMOUNT_LIMIT_EXCEEDED, + self::REASON_APPROVED, + self::REASON_COUNTERPARTY_ACCOUNT_BLOCKED, + self::REASON_COUNTERPARTY_ACCOUNT_CLOSED, + self::REASON_COUNTERPARTY_ACCOUNT_NOT_FOUND, + self::REASON_COUNTERPARTY_ADDRESS_REQUIRED, + self::REASON_COUNTERPARTY_BANK_TIMED_OUT, + self::REASON_COUNTERPARTY_BANK_UNAVAILABLE, + self::REASON_ERROR, + self::REASON_NOT_ENOUGH_BALANCE, + self::REASON_REFUSED_BY_COUNTERPARTY_BANK, + self::REASON_ROUTE_NOT_FOUND, + self::REASON_UNKNOWN, + ]; + } + /** + * 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_PULL, + self::TYPE_PUSH, + ]; + } + /** + * 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('category', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('priorities', $data ?? [], null); + $this->setIfExists('reason', $data ?? [], null); + $this->setIfExists('schedule', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sweepAmount', $data ?? [], null); + $this->setIfExists('targetAmount', $data ?? [], null); + $this->setIfExists('triggerAmount', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'push'); + } + + /** + * 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->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['counterparty'] === null) { + $invalidProperties[] = "'counterparty' can't be null"; + } + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + $allowedValues = $this->getReasonAllowableValues(); + if (!is_null($this->container['reason']) && !in_array($this->container['reason'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'reason', must be one of '%s'", + $this->container['reason'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['schedule'] === null) { + $invalidProperties[] = "'schedule' 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) + ); + } + + $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 category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The type of transfer that results from the sweep. Possible values: - **bank**: Sweep to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. Required when setting `priorities`. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\BalancePlatform\SweepCounterparty + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\SweepCounterparty $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + 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) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $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 message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets priorities + * + * @return string[]|null + */ + public function getPriorities() + { + return $this->container['priorities']; + } + + /** + * Sets priorities + * + * @param string[]|null $priorities The list of priorities for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. You can provide multiple priorities. Adyen will try to pay out using the priority listed first, and if that's not possible, it moves on to the next option in the order of provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see [optional priorities setup](https://docs.adyen.com/marketplaces-and-platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * + * @return self + */ + public function setPriorities($priorities) + { + if (is_null($priorities)) { + throw new \InvalidArgumentException('non-nullable priorities cannot be null'); + } + $allowedValues = $this->getPrioritiesAllowableValues(); + if (array_diff($priorities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'priorities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['priorities'] = $priorities; + + return $this; + } + + /** + * Gets reason + * + * @return string|null + */ + public function getReason() + { + return $this->container['reason']; + } + + /** + * Sets reason + * + * @param string|null $reason The reason for disabling the sweep. + * + * @return self + */ + public function setReason($reason) + { + if (is_null($reason)) { + throw new \InvalidArgumentException('non-nullable reason cannot be null'); + } + $allowedValues = $this->getReasonAllowableValues(); + if (!in_array($reason, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reason', must be one of '%s'", + $reason, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reason'] = $reason; + + return $this; + } + + /** + * Gets schedule + * + * @return \Adyen\Model\BalancePlatform\SweepSchedule + */ + public function getSchedule() + { + return $this->container['schedule']; + } + + /** + * Sets schedule + * + * @param \Adyen\Model\BalancePlatform\SweepSchedule $schedule schedule + * + * @return self + */ + public function setSchedule($schedule) + { + if (is_null($schedule)) { + throw new \InvalidArgumentException('non-nullable schedule cannot be null'); + } + $this->container['schedule'] = $schedule; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets sweepAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getSweepAmount() + { + return $this->container['sweepAmount']; + } + + /** + * Sets sweepAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $sweepAmount sweepAmount + * + * @return self + */ + public function setSweepAmount($sweepAmount) + { + if (is_null($sweepAmount)) { + throw new \InvalidArgumentException('non-nullable sweepAmount cannot be null'); + } + $this->container['sweepAmount'] = $sweepAmount; + + return $this; + } + + /** + * Gets targetAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTargetAmount() + { + return $this->container['targetAmount']; + } + + /** + * Sets targetAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $targetAmount targetAmount + * + * @return self + */ + public function setTargetAmount($targetAmount) + { + if (is_null($targetAmount)) { + throw new \InvalidArgumentException('non-nullable targetAmount cannot be null'); + } + $this->container['targetAmount'] = $targetAmount; + + return $this; + } + + /** + * Gets triggerAmount + * + * @return \Adyen\Model\BalancePlatform\Amount|null + */ + public function getTriggerAmount() + { + return $this->container['triggerAmount']; + } + + /** + * Sets triggerAmount + * + * @param \Adyen\Model\BalancePlatform\Amount|null $triggerAmount triggerAmount + * + * @return self + */ + public function setTriggerAmount($triggerAmount) + { + if (is_null($triggerAmount)) { + throw new \InvalidArgumentException('non-nullable triggerAmount cannot be null'); + } + $this->container['triggerAmount'] = $triggerAmount; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/DeliveryAddress.php b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php index 623dfa472..197ad467f 100644 --- a/src/Adyen/Model/BalancePlatform/DeliveryAddress.php +++ b/src/Adyen/Model/BalancePlatform/DeliveryAddress.php @@ -388,7 +388,7 @@ public function getLine1() /** * Sets line1 * - * @param string|null $line1 First line of the address. + * @param string|null $line1 The street name. For example, if the address is \"Rokin 49\", provide \"Rokin\". * * @return self */ @@ -415,7 +415,7 @@ public function getLine2() /** * Sets line2 * - * @param string|null $line2 Second line of the address. + * @param string|null $line2 The house number or name. For example, if the address is \"Rokin 49\", provide \"49\". * * @return self */ @@ -442,7 +442,7 @@ public function getLine3() /** * Sets line3 * - * @param string|null $line3 Third line of the address. + * @param string|null $line3 Optional information about the address. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php index b36fadcbe..561d32201 100644 --- a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php @@ -45,7 +45,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'accountNumber' => 'string', - 'bankCode' => 'string', + 'clearingCode' => 'string', 'type' => 'string' ]; @@ -58,7 +58,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'accountNumber' => null, - 'bankCode' => null, + 'clearingCode' => null, 'type' => null ]; @@ -69,7 +69,7 @@ class HKLocalAccountIdentification implements ModelInterface, ArrayAccess, \Json */ protected static $openAPINullables = [ 'accountNumber' => false, - 'bankCode' => false, + 'clearingCode' => false, 'type' => false ]; @@ -160,7 +160,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountNumber' => 'accountNumber', - 'bankCode' => 'bankCode', + 'clearingCode' => 'clearingCode', 'type' => 'type' ]; @@ -171,7 +171,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountNumber' => 'setAccountNumber', - 'bankCode' => 'setBankCode', + 'clearingCode' => 'setClearingCode', 'type' => 'setType' ]; @@ -182,7 +182,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountNumber' => 'getAccountNumber', - 'bankCode' => 'getBankCode', + 'clearingCode' => 'getClearingCode', 'type' => 'getType' ]; @@ -256,7 +256,7 @@ public function getTypeAllowableValues() public function __construct(array $data = null) { $this->setIfExists('accountNumber', $data ?? [], null); - $this->setIfExists('bankCode', $data ?? [], null); + $this->setIfExists('clearingCode', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'hkLocal'); } @@ -290,8 +290,8 @@ public function listInvalidProperties() if ($this->container['accountNumber'] === null) { $invalidProperties[] = "'accountNumber' can't be null"; } - if ($this->container['bankCode'] === null) { - $invalidProperties[] = "'bankCode' can't be null"; + if ($this->container['clearingCode'] === null) { + $invalidProperties[] = "'clearingCode' can't be null"; } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; @@ -333,7 +333,7 @@ public function getAccountNumber() /** * Sets accountNumber * - * @param string $accountNumber The 6- to 19-character bank account number (alphanumeric), without separators or whitespace. + * @param string $accountNumber The 9- to 12-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. * * @return self */ @@ -348,28 +348,28 @@ public function setAccountNumber($accountNumber) } /** - * Gets bankCode + * Gets clearingCode * * @return string */ - public function getBankCode() + public function getClearingCode() { - return $this->container['bankCode']; + return $this->container['clearingCode']; } /** - * Sets bankCode + * Sets clearingCode * - * @param string $bankCode The 6-digit bank code including the 3-digit bank code and 3-digit branch code, without separators or whitespace. + * @param string $clearingCode The 3-digit clearing code, without separators or whitespace. * * @return self */ - public function setBankCode($bankCode) + public function setClearingCode($clearingCode) { - if (is_null($bankCode)) { - throw new \InvalidArgumentException('non-nullable bankCode cannot be null'); + if (is_null($clearingCode)) { + throw new \InvalidArgumentException('non-nullable clearingCode cannot be null'); } - $this->container['bankCode'] = $bankCode; + $this->container['clearingCode'] = $clearingCode; return $this; } diff --git a/src/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.php b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.php new file mode 100644 index 000000000..83d3719c2 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/PaymentInstrumentRequirement.php @@ -0,0 +1,553 @@ + + */ +class PaymentInstrumentRequirement implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentRequirement'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'issuingCountryCode' => 'string', + 'paymentInstrumentType' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'issuingCountryCode' => null, + 'paymentInstrumentType' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'issuingCountryCode' => false, + 'paymentInstrumentType' => 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 = [ + 'description' => 'description', + 'issuingCountryCode' => 'issuingCountryCode', + 'paymentInstrumentType' => 'paymentInstrumentType', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'issuingCountryCode' => 'setIssuingCountryCode', + 'paymentInstrumentType' => 'setPaymentInstrumentType', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'issuingCountryCode' => 'getIssuingCountryCode', + 'paymentInstrumentType' => 'getPaymentInstrumentType', + '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 PAYMENT_INSTRUMENT_TYPE_BANK_ACCOUNT = 'BankAccount'; + public const PAYMENT_INSTRUMENT_TYPE_CARD = 'Card'; + public const TYPE_PAYMENT_INSTRUMENT_REQUIREMENT = 'paymentInstrumentRequirement'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPaymentInstrumentTypeAllowableValues() + { + return [ + self::PAYMENT_INSTRUMENT_TYPE_BANK_ACCOUNT, + self::PAYMENT_INSTRUMENT_TYPE_CARD, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_PAYMENT_INSTRUMENT_REQUIREMENT, + ]; + } + /** + * 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('issuingCountryCode', $data ?? [], null); + $this->setIfExists('paymentInstrumentType', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'paymentInstrumentRequirement'); + } + + /** + * 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->getPaymentInstrumentTypeAllowableValues(); + if (!is_null($this->container['paymentInstrumentType']) && !in_array($this->container['paymentInstrumentType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'paymentInstrumentType', must be one of '%s'", + $this->container['paymentInstrumentType'], + implode("', '", $allowedValues) + ); + } + + 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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets issuingCountryCode + * + * @return string|null + */ + public function getIssuingCountryCode() + { + return $this->container['issuingCountryCode']; + } + + /** + * Sets issuingCountryCode + * + * @param string|null $issuingCountryCode The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + * + * @return self + */ + public function setIssuingCountryCode($issuingCountryCode) + { + if (is_null($issuingCountryCode)) { + throw new \InvalidArgumentException('non-nullable issuingCountryCode cannot be null'); + } + $this->container['issuingCountryCode'] = $issuingCountryCode; + + return $this; + } + + /** + * Gets paymentInstrumentType + * + * @return string|null + */ + public function getPaymentInstrumentType() + { + return $this->container['paymentInstrumentType']; + } + + /** + * Sets paymentInstrumentType + * + * @param string|null $paymentInstrumentType The type of the payment instrument. For example, \"BankAccount\" or \"Card\". + * + * @return self + */ + public function setPaymentInstrumentType($paymentInstrumentType) + { + if (is_null($paymentInstrumentType)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentType cannot be null'); + } + $allowedValues = $this->getPaymentInstrumentTypeAllowableValues(); + if (!in_array($paymentInstrumentType, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'paymentInstrumentType', must be one of '%s'", + $paymentInstrumentType, + implode("', '", $allowedValues) + ) + ); + } + $this->container['paymentInstrumentType'] = $paymentInstrumentType; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **paymentInstrumentRequirement** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/SweepCounterparty.php b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php index 729e96509..3c4ab9b41 100644 --- a/src/Adyen/Model/BalancePlatform/SweepCounterparty.php +++ b/src/Adyen/Model/BalancePlatform/SweepCounterparty.php @@ -330,7 +330,7 @@ public function getMerchantAccount() /** * Sets merchantAccount * - * @param string|null $merchantAccount The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + * @param string|null $merchantAccount The merchant account that will be the source of funds. You can only use this parameter with sweeps of `type` **pull** and `schedule.type` **balance**, and if you are processing payments with Adyen. * * @return self */ @@ -357,7 +357,7 @@ public function getTransferInstrumentId() /** * Sets transferInstrumentId * - * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * @param string|null $transferInstrumentId The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) depending on the sweep `type` . To [set up automated top-up sweeps to balance accounts](https://docs.adyen.com/marketplaces-and-platforms/top-up-balance-account/#before-you-begin), use this parameter in combination with a `merchantAccount` and a sweep `type` of **pull**. Top-up sweeps start a direct debit request from the source transfer instrument. Contact Adyen Support to enable this feature. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 83dff753e..e43fd3b94 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -726,7 +726,7 @@ public function getRequestType() /** * Sets requestType * - * @param string|null $requestType Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * @param string|null $requestType Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 7ad186980..6d9c1702a 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -692,7 +692,7 @@ public function getRequestType() /** * Sets requestType * - * @param string|null $requestType Indicates the type of request to which the rule applies. Possible values: **authorization**, **authentication**, **tokenization**. + * @param string|null $requestType Indicates the type of request to which the rule applies. If not provided, by default, this is set to **authorization**. Possible values: **authorization**, **authentication**, **tokenization**, **bankTransfer**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferRoute.php b/src/Adyen/Model/BalancePlatform/TransferRoute.php new file mode 100644 index 000000000..0d7c123c7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransferRoute.php @@ -0,0 +1,638 @@ + + */ +class TransferRoute implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferRoute'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balancePlatform' => 'string', + 'category' => 'string', + 'country' => 'string', + 'currency' => 'string', + 'priority' => 'string', + 'requirements' => '\Adyen\Model\BalancePlatform\TransferRouteRequirements' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balancePlatform' => null, + 'category' => null, + 'country' => null, + 'currency' => null, + 'priority' => null, + 'requirements' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balancePlatform' => false, + 'category' => false, + 'country' => false, + 'currency' => false, + 'priority' => false, + 'requirements' => 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 = [ + 'balancePlatform' => 'balancePlatform', + 'category' => 'category', + 'country' => 'country', + 'currency' => 'currency', + 'priority' => 'priority', + 'requirements' => 'requirements' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balancePlatform' => 'setBalancePlatform', + 'category' => 'setCategory', + 'country' => 'setCountry', + 'currency' => 'setCurrency', + 'priority' => 'setPriority', + 'requirements' => 'setRequirements' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balancePlatform' => 'getBalancePlatform', + 'category' => 'getCategory', + 'country' => 'getCountry', + 'currency' => 'getCurrency', + 'priority' => 'getPriority', + 'requirements' => 'getRequirements' + ]; + + /** + * 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 CATEGORY_BANK = 'bank'; + public const CATEGORY_CARD = 'card'; + public const CATEGORY_GRANTS = 'grants'; + public const CATEGORY_INTERNAL = 'internal'; + public const CATEGORY_ISSUED_CARD = 'issuedCard'; + public const CATEGORY_MIGRATION = 'migration'; + public const CATEGORY_PLATFORM_PAYMENT = 'platformPayment'; + public const PRIORITY_CROSS_BORDER = 'crossBorder'; + public const PRIORITY_FAST = 'fast'; + public const PRIORITY_INSTANT = 'instant'; + public const PRIORITY_INTERNAL = 'internal'; + public const PRIORITY_REGULAR = 'regular'; + public const PRIORITY_WIRE = 'wire'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + self::CATEGORY_CARD, + self::CATEGORY_GRANTS, + self::CATEGORY_INTERNAL, + self::CATEGORY_ISSUED_CARD, + self::CATEGORY_MIGRATION, + self::CATEGORY_PLATFORM_PAYMENT, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPriorityAllowableValues() + { + return [ + self::PRIORITY_CROSS_BORDER, + self::PRIORITY_FAST, + self::PRIORITY_INSTANT, + self::PRIORITY_INTERNAL, + self::PRIORITY_REGULAR, + self::PRIORITY_WIRE, + ]; + } + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('requirements', $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->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getPriorityAllowableValues(); + if (!is_null($this->container['priority']) && !in_array($this->container['priority'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'priority', must be one of '%s'", + $this->container['priority'], + 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 balancePlatform + * + * @return string|null + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string|null $balancePlatform The unique identifier assigned to the balance platform associated with the account holder. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + 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 of transfer. For example, **USD** or **EUR**. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + throw new \InvalidArgumentException('non-nullable priority cannot be null'); + } + $allowedValues = $this->getPriorityAllowableValues(); + if (!in_array($priority, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'priority', must be one of '%s'", + $priority, + implode("', '", $allowedValues) + ) + ); + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets requirements + * + * @return \Adyen\Model\BalancePlatform\TransferRouteRequirements|null + */ + public function getRequirements() + { + return $this->container['requirements']; + } + + /** + * Sets requirements + * + * @param \Adyen\Model\BalancePlatform\TransferRouteRequirements|null $requirements requirements + * + * @return self + */ + public function setRequirements($requirements) + { + if (is_null($requirements)) { + throw new \InvalidArgumentException('non-nullable requirements cannot be null'); + } + $this->container['requirements'] = $requirements; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php new file mode 100644 index 000000000..d16303a25 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php @@ -0,0 +1,659 @@ + + */ +class TransferRouteRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferRouteRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string', + 'balancePlatform' => 'string', + 'category' => 'string', + 'counterparty' => '\Adyen\Model\BalancePlatform\Counterparty', + 'country' => 'string', + 'currency' => 'string', + 'priorities' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null, + 'balancePlatform' => null, + 'category' => null, + 'counterparty' => null, + 'country' => null, + 'currency' => null, + 'priorities' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false, + 'balancePlatform' => false, + 'category' => false, + 'counterparty' => false, + 'country' => false, + 'currency' => false, + 'priorities' => 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', + 'balancePlatform' => 'balancePlatform', + 'category' => 'category', + 'counterparty' => 'counterparty', + 'country' => 'country', + 'currency' => 'currency', + 'priorities' => 'priorities' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId', + 'balancePlatform' => 'setBalancePlatform', + 'category' => 'setCategory', + 'counterparty' => 'setCounterparty', + 'country' => 'setCountry', + 'currency' => 'setCurrency', + 'priorities' => 'setPriorities' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId', + 'balancePlatform' => 'getBalancePlatform', + 'category' => 'getCategory', + 'counterparty' => 'getCounterparty', + 'country' => 'getCountry', + 'currency' => 'getCurrency', + 'priorities' => 'getPriorities' + ]; + + /** + * 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 CATEGORY_BANK = 'bank'; + public const PRIORITIES_CROSS_BORDER = 'crossBorder'; + public const PRIORITIES_FAST = 'fast'; + public const PRIORITIES_INSTANT = 'instant'; + public const PRIORITIES_INTERNAL = 'internal'; + public const PRIORITIES_REGULAR = 'regular'; + public const PRIORITIES_WIRE = 'wire'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCategoryAllowableValues() + { + return [ + self::CATEGORY_BANK, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getPrioritiesAllowableValues() + { + return [ + self::PRIORITIES_CROSS_BORDER, + self::PRIORITIES_FAST, + self::PRIORITIES_INSTANT, + self::PRIORITIES_INTERNAL, + self::PRIORITIES_REGULAR, + self::PRIORITIES_WIRE, + ]; + } + /** + * 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('balancePlatform', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('counterparty', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('priorities', $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['balancePlatform'] === null) { + $invalidProperties[] = "'balancePlatform' can't be null"; + } + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!is_null($this->container['category']) && !in_array($this->container['category'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'category', must be one of '%s'", + $this->container['category'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' 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|null + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string|null $balanceAccountId The unique identifier of the source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). Required if `counterparty` is **transferInstrumentId**. + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + if (is_null($balanceAccountId)) { + throw new \InvalidArgumentException('non-nullable balanceAccountId cannot be null'); + } + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + + /** + * Gets balancePlatform + * + * @return string + */ + public function getBalancePlatform() + { + return $this->container['balancePlatform']; + } + + /** + * Sets balancePlatform + * + * @param string $balancePlatform The unique identifier assigned to the balance platform associated with the account holder. + * + * @return self + */ + public function setBalancePlatform($balancePlatform) + { + if (is_null($balancePlatform)) { + throw new \InvalidArgumentException('non-nullable balancePlatform cannot be null'); + } + $this->container['balancePlatform'] = $balancePlatform; + + return $this; + } + + /** + * Gets category + * + * @return string + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string $category The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); + } + $allowedValues = $this->getCategoryAllowableValues(); + if (!in_array($category, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'category', must be one of '%s'", + $category, + implode("', '", $allowedValues) + ) + ); + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets counterparty + * + * @return \Adyen\Model\BalancePlatform\Counterparty|null + */ + public function getCounterparty() + { + return $this->container['counterparty']; + } + + /** + * Sets counterparty + * + * @param \Adyen\Model\BalancePlatform\Counterparty|null $counterparty counterparty + * + * @return self + */ + public function setCounterparty($counterparty) + { + if (is_null($counterparty)) { + throw new \InvalidArgumentException('non-nullable counterparty cannot be null'); + } + $this->container['counterparty'] = $counterparty; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. > Either `counterparty` or `country` field must be provided in a transfer route request. + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + throw new \InvalidArgumentException('non-nullable country cannot be null'); + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character ISO currency code of transfer. For example, **USD** or **EUR**. + * + * @return self + */ + public function setCurrency($currency) + { + if (is_null($currency)) { + throw new \InvalidArgumentException('non-nullable currency cannot be null'); + } + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets priorities + * + * @return string[]|null + */ + public function getPriorities() + { + return $this->container['priorities']; + } + + /** + * Sets priorities + * + * @param string[]|null $priorities The list of priorities for the bank transfer. Priorities set the speed at which the transfer is sent and the fees that you have to pay. Multiple values can be provided. Possible values: * **regular**: For normal, low-value transactions. * **fast**: Faster way to transfer funds but has higher fees. Recommended for high-priority, low-value transactions. * **wire**: Fastest way to transfer funds but has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: Instant way to transfer funds in [SEPA countries](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: High-value transfer to a recipient in a different country. * **internal**: Transfer to an Adyen-issued business bank account (by bank account number/IBAN). + * + * @return self + */ + public function setPriorities($priorities) + { + if (is_null($priorities)) { + throw new \InvalidArgumentException('non-nullable priorities cannot be null'); + } + $allowedValues = $this->getPrioritiesAllowableValues(); + if (array_diff($priorities, $allowedValues)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'priorities', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['priorities'] = $priorities; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php new file mode 100644 index 000000000..6039b0908 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransferRouteRequirements.php @@ -0,0 +1,627 @@ + + */ +class TransferRouteRequirements implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferRoute_requirements'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'description' => 'string', + 'requiredAddressFields' => 'string[]', + 'type' => 'string', + 'max' => 'int', + 'min' => 'int', + 'bankAccountIdentificationTypes' => 'string[]', + 'issuingCountryCode' => 'string', + 'paymentInstrumentType' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'description' => null, + 'requiredAddressFields' => null, + 'type' => null, + 'max' => 'int64', + 'min' => 'int64', + 'bankAccountIdentificationTypes' => null, + 'issuingCountryCode' => null, + 'paymentInstrumentType' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'description' => false, + 'requiredAddressFields' => false, + 'type' => false, + 'max' => false, + 'min' => false, + 'bankAccountIdentificationTypes' => false, + 'issuingCountryCode' => false, + 'paymentInstrumentType' => 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', + 'requiredAddressFields' => 'requiredAddressFields', + 'type' => 'type', + 'max' => 'max', + 'min' => 'min', + 'bankAccountIdentificationTypes' => 'bankAccountIdentificationTypes', + 'issuingCountryCode' => 'issuingCountryCode', + 'paymentInstrumentType' => 'paymentInstrumentType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'description' => 'setDescription', + 'requiredAddressFields' => 'setRequiredAddressFields', + 'type' => 'setType', + 'max' => 'setMax', + 'min' => 'setMin', + 'bankAccountIdentificationTypes' => 'setBankAccountIdentificationTypes', + 'issuingCountryCode' => 'setIssuingCountryCode', + 'paymentInstrumentType' => 'setPaymentInstrumentType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'description' => 'getDescription', + 'requiredAddressFields' => 'getRequiredAddressFields', + 'type' => 'getType', + 'max' => 'getMax', + 'min' => 'getMin', + 'bankAccountIdentificationTypes' => 'getBankAccountIdentificationTypes', + 'issuingCountryCode' => 'getIssuingCountryCode', + 'paymentInstrumentType' => 'getPaymentInstrumentType' + ]; + + /** + * 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('description', $data ?? [], null); + $this->setIfExists('requiredAddressFields', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'paymentInstrumentRequirement'); + $this->setIfExists('max', $data ?? [], null); + $this->setIfExists('min', $data ?? [], null); + $this->setIfExists('bankAccountIdentificationTypes', $data ?? [], null); + $this->setIfExists('issuingCountryCode', $data ?? [], null); + $this->setIfExists('paymentInstrumentType', $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 description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Specifies the requirements for the payment instrument that need to be included in the request for a particular route. + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets requiredAddressFields + * + * @return string[]|null + */ + public function getRequiredAddressFields() + { + return $this->container['requiredAddressFields']; + } + + /** + * Sets requiredAddressFields + * + * @param string[]|null $requiredAddressFields List of address fields. + * + * @return self + */ + public function setRequiredAddressFields($requiredAddressFields) + { + if (is_null($requiredAddressFields)) { + throw new \InvalidArgumentException('non-nullable requiredAddressFields cannot be null'); + } + $this->container['requiredAddressFields'] = $requiredAddressFields; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **paymentInstrumentRequirement** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets max + * + * @return int|null + */ + public function getMax() + { + return $this->container['max']; + } + + /** + * Sets max + * + * @param int|null $max Maximum amount. + * + * @return self + */ + public function setMax($max) + { + if (is_null($max)) { + throw new \InvalidArgumentException('non-nullable max cannot be null'); + } + $this->container['max'] = $max; + + return $this; + } + + /** + * Gets min + * + * @return int|null + */ + public function getMin() + { + return $this->container['min']; + } + + /** + * Sets min + * + * @param int|null $min Minimum amount. + * + * @return self + */ + public function setMin($min) + { + if (is_null($min)) { + throw new \InvalidArgumentException('non-nullable min cannot be null'); + } + $this->container['min'] = $min; + + return $this; + } + + /** + * Gets bankAccountIdentificationTypes + * + * @return string[]|null + */ + public function getBankAccountIdentificationTypes() + { + return $this->container['bankAccountIdentificationTypes']; + } + + /** + * Sets bankAccountIdentificationTypes + * + * @param string[]|null $bankAccountIdentificationTypes List of bank account identification types: eg.; [iban , numberAndBic] + * + * @return self + */ + public function setBankAccountIdentificationTypes($bankAccountIdentificationTypes) + { + if (is_null($bankAccountIdentificationTypes)) { + throw new \InvalidArgumentException('non-nullable bankAccountIdentificationTypes cannot be null'); + } + $this->container['bankAccountIdentificationTypes'] = $bankAccountIdentificationTypes; + + return $this; + } + + /** + * Gets issuingCountryCode + * + * @return string|null + */ + public function getIssuingCountryCode() + { + return $this->container['issuingCountryCode']; + } + + /** + * Sets issuingCountryCode + * + * @param string|null $issuingCountryCode The two-character ISO-3166-1 alpha-2 country code of the counterparty. For example, **US** or **NL**. + * + * @return self + */ + public function setIssuingCountryCode($issuingCountryCode) + { + if (is_null($issuingCountryCode)) { + throw new \InvalidArgumentException('non-nullable issuingCountryCode cannot be null'); + } + $this->container['issuingCountryCode'] = $issuingCountryCode; + + return $this; + } + + /** + * Gets paymentInstrumentType + * + * @return string|null + */ + public function getPaymentInstrumentType() + { + return $this->container['paymentInstrumentType']; + } + + /** + * Sets paymentInstrumentType + * + * @param string|null $paymentInstrumentType The type of the payment instrument. For example, \"BankAccount\" or \"Card\". + * + * @return self + */ + public function setPaymentInstrumentType($paymentInstrumentType) + { + if (is_null($paymentInstrumentType)) { + throw new \InvalidArgumentException('non-nullable paymentInstrumentType cannot be null'); + } + $this->container['paymentInstrumentType'] = $paymentInstrumentType; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteResponse.php b/src/Adyen/Model/BalancePlatform/TransferRouteResponse.php new file mode 100644 index 000000000..b26b034a1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TransferRouteResponse.php @@ -0,0 +1,384 @@ + + */ +class TransferRouteResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TransferRouteResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'transferRoutes' => '\Adyen\Model\BalancePlatform\TransferRoute[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'transferRoutes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'transferRoutes' => 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 = [ + 'transferRoutes' => 'transferRoutes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'transferRoutes' => 'setTransferRoutes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'transferRoutes' => 'getTransferRoutes' + ]; + + /** + * 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('transferRoutes', $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 transferRoutes + * + * @return \Adyen\Model\BalancePlatform\TransferRoute[]|null + */ + public function getTransferRoutes() + { + return $this->container['transferRoutes']; + } + + /** + * Sets transferRoutes + * + * @param \Adyen\Model\BalancePlatform\TransferRoute[]|null $transferRoutes List of available priorities for a transfer, along with requirements. Use this information to initiate a transfer. + * + * @return self + */ + public function setTransferRoutes($transferRoutes) + { + if (is_null($transferRoutes)) { + throw new \InvalidArgumentException('non-nullable transferRoutes cannot be null'); + } + $this->container['transferRoutes'] = $transferRoutes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php index 1cf176b29..0c27341fe 100644 --- a/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/AcceptTermsOfServiceRequest.php @@ -299,7 +299,7 @@ public function getAcceptedBy() /** * Sets acceptedBy * - * @param string $acceptedBy The individual legal entity ID of the user accepting the Terms of Service. This can also be the legal entity ID of the signatory for an organization. + * @param string $acceptedBy The legal entity ID of the user accepting the Terms of Service. For organizations, this must be the individual legal entity ID of an authorized signatory for the organization. For sole proprietorships, this must be the individual legal entity ID of the owner. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php index 77b637fd6..571557ec0 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php @@ -46,6 +46,7 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPITypes = [ 'accountIdentification' => '\Adyen\Model\LegalEntityManagement\BankAccount', 'accountType' => 'string', + 'bankName' => 'string', 'countryCode' => 'string', 'trustedSource' => 'bool' ]; @@ -60,6 +61,7 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPIFormats = [ 'accountIdentification' => null, 'accountType' => null, + 'bankName' => null, 'countryCode' => null, 'trustedSource' => null ]; @@ -72,6 +74,7 @@ class BankAccountInfo implements ModelInterface, ArrayAccess, \JsonSerializable protected static $openAPINullables = [ 'accountIdentification' => false, 'accountType' => false, + 'bankName' => false, 'countryCode' => false, 'trustedSource' => false ]; @@ -164,6 +167,7 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'accountIdentification' => 'accountIdentification', 'accountType' => 'accountType', + 'bankName' => 'bankName', 'countryCode' => 'countryCode', 'trustedSource' => 'trustedSource' ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'accountIdentification' => 'setAccountIdentification', 'accountType' => 'setAccountType', + 'bankName' => 'setBankName', 'countryCode' => 'setCountryCode', 'trustedSource' => 'setTrustedSource' ]; @@ -188,6 +193,7 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'accountIdentification' => 'getAccountIdentification', 'accountType' => 'getAccountType', + 'bankName' => 'getBankName', 'countryCode' => 'getCountryCode', 'trustedSource' => 'getTrustedSource' ]; @@ -251,6 +257,7 @@ public function __construct(array $data = null) { $this->setIfExists('accountIdentification', $data ?? [], null); $this->setIfExists('accountType', $data ?? [], null); + $this->setIfExists('bankName', $data ?? [], null); $this->setIfExists('countryCode', $data ?? [], null); $this->setIfExists('trustedSource', $data ?? [], null); } @@ -353,6 +360,33 @@ public function setAccountType($accountType) return $this; } + /** + * Gets bankName + * + * @return string|null + */ + public function getBankName() + { + return $this->container['bankName']; + } + + /** + * Sets bankName + * + * @param string|null $bankName The name of the banking institution where the bank account is held. + * + * @return self + */ + public function setBankName($bankName) + { + if (is_null($bankName)) { + throw new \InvalidArgumentException('non-nullable bankName cannot be null'); + } + $this->container['bankName'] = $bankName; + + return $this; + } + /** * Gets countryCode * diff --git a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php index 696d6722b..9fd144c1f 100644 --- a/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php +++ b/src/Adyen/Model/LegalEntityManagement/GetTermsOfServiceDocumentRequest.php @@ -292,6 +292,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['language'] === null) { + $invalidProperties[] = "'language' 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( @@ -319,7 +325,7 @@ public function valid() /** * Gets language * - * @return string|null + * @return string */ public function getLanguage() { @@ -329,7 +335,7 @@ public function getLanguage() /** * Sets language * - * @param string|null $language The language to be used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. + * @param string $language The language to be used for the Terms of Service document, specified by the two letter [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code. For example, **nl** for Dutch. * * @return self */ @@ -346,7 +352,7 @@ public function setLanguage($language) /** * Gets type * - * @return string|null + * @return string */ public function getType() { @@ -356,7 +362,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of Terms of Service. + * @param string $type The type of Terms of Service. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index 8791221cb..b9c79e7af 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -251,20 +251,7 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_BANK_STATEMENT = 'bankStatement'; - public const TYPE_DRIVERS_LICENSE = 'driversLicense'; - public const TYPE_IDENTITY_CARD = 'identityCard'; - public const TYPE_NATIONAL_ID_NUMBER = 'nationalIdNumber'; - public const TYPE_PASSPORT = 'passport'; - public const TYPE_PROOF_OF_ADDRESS = 'proofOfAddress'; public const TYPE_PROOF_OF_NATIONAL_ID_NUMBER = 'proofOfNationalIdNumber'; - public const TYPE_PROOF_OF_RESIDENCY = 'proofOfResidency'; - public const TYPE_REGISTRATION_DOCUMENT = 'registrationDocument'; - public const TYPE_VAT_DOCUMENT = 'vatDocument'; - public const TYPE_PROOF_OF_ORGANIZATION_TAX_INFO = 'proofOfOrganizationTaxInfo'; - public const TYPE_PROOF_OF_INDUSTRY = 'proofOfIndustry'; - public const TYPE_CONSTITUTIONAL_DOCUMENT = 'constitutionalDocument'; - public const TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE = 'proofOfFundingOrWealthSource'; /** * Gets allowable values of the enum @@ -274,20 +261,7 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_BANK_STATEMENT, - self::TYPE_DRIVERS_LICENSE, - self::TYPE_IDENTITY_CARD, - self::TYPE_NATIONAL_ID_NUMBER, - self::TYPE_PASSPORT, - self::TYPE_PROOF_OF_ADDRESS, self::TYPE_PROOF_OF_NATIONAL_ID_NUMBER, - self::TYPE_PROOF_OF_RESIDENCY, - self::TYPE_REGISTRATION_DOCUMENT, - self::TYPE_VAT_DOCUMENT, - self::TYPE_PROOF_OF_ORGANIZATION_TAX_INFO, - self::TYPE_PROOF_OF_INDUSTRY, - self::TYPE_CONSTITUTIONAL_DOCUMENT, - self::TYPE_PROOF_OF_FUNDING_OR_WEALTH_SOURCE, ]; } /** @@ -547,7 +521,7 @@ public function getType() /** * Sets type * - * @param string $type Type of document, used when providing an ID number or uploading a document. The possible values depend on the legal entity type. * For **organization**, the `type` values can be **proofOfAddress**, **registrationDocument**, **vatDocument**, **proofOfOrganizationTaxInfo**, **proofOfOwnership**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * For **soleProprietorship**, the `type` values can be **constitutionalDocument**, **proofOfAddress**, or **proofOfIndustry**. * Use **bankStatement** to upload documents for a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @param string $type Type of identity data. For **individual**, the `type` value is **nationalIdNumber**. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.php b/src/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.php new file mode 100644 index 000000000..337ee1585 --- /dev/null +++ b/src/Adyen/Model/LegalEntityManagement/NZLocalAccountIdentification.php @@ -0,0 +1,455 @@ + + */ +class NZLocalAccountIdentification implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'NZLocalAccountIdentification'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountNumber' => '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, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountNumber' => 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', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountNumber' => 'setAccountNumber', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountNumber' => 'getAccountNumber', + '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_NZ_LOCAL = 'nzLocal'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_NZ_LOCAL, + ]; + } + /** + * 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('type', $data ?? [], 'nzLocal'); + } + + /** + * 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['accountNumber'] === null) { + $invalidProperties[] = "'accountNumber' 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 accountNumber + * + * @return string + */ + public function getAccountNumber() + { + return $this->container['accountNumber']; + } + + /** + * Sets accountNumber + * + * @param string $accountNumber The 15-16 digit bank account number. The first 2 digits are the bank number, the next 4 digits are the branch number, the next 7 digits are the account number, and the final 2-3 digits are the suffix. + * + * @return self + */ + public function setAccountNumber($accountNumber) + { + if (is_null($accountNumber)) { + throw new \InvalidArgumentException('non-nullable accountNumber cannot be null'); + } + $this->container['accountNumber'] = $accountNumber; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type **nzLocal** + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%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); + } + + /** + * 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/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 3f39a1d2e..0ae12cde8 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -167,15 +167,15 @@ public function createBalanceAccount(\Adyen\Model\BalancePlatform\BalanceAccount * Create a sweep * * @param string $balanceAccountId - * @param \Adyen\Model\BalancePlatform\SweepConfigurationV2 $sweepConfigurationV2 + * @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\SweepConfigurationV2 $sweepConfigurationV2, array $requestOptions = null): \Adyen\Model\BalancePlatform\SweepConfigurationV2 + 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) $sweepConfigurationV2->jsonSerialize(), $requestOptions); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $createSweepConfigurationV2->jsonSerialize(), $requestOptions); return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SweepConfigurationV2::class); } } diff --git a/src/Adyen/Service/BalancePlatform/TransferRoutesApi.php b/src/Adyen/Service/BalancePlatform/TransferRoutesApi.php new file mode 100644 index 000000000..7c592f27b --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/TransferRoutesApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Calculate transfer routes + * + * @param \Adyen\Model\BalancePlatform\TransferRouteRequest $transferRouteRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\TransferRouteResponse + * @throws AdyenException + */ + public function calculateTransferRoutes(\Adyen\Model\BalancePlatform\TransferRouteRequest $transferRouteRequest, array $requestOptions = null): \Adyen\Model\BalancePlatform\TransferRouteResponse + { + $endpoint = $this->baseURL . "/transferRoutes/calculate"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $transferRouteRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\TransferRouteResponse::class); + } +} diff --git a/src/Adyen/Service/Checkout/RecurringApi.php b/src/Adyen/Service/Checkout/RecurringApi.php index 2c9bb58c3..652995197 100644 --- a/src/Adyen/Service/Checkout/RecurringApi.php +++ b/src/Adyen/Service/Checkout/RecurringApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param string $storedPaymentMethodId * @param array|null $requestOptions ['queryParams' => ['shopperReference'=> string, 'merchantAccount'=> string]] - * @return \Adyen\Model\Checkout\StoredPaymentMethodResource + * @throws AdyenException */ - public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null): \Adyen\Model\Checkout\StoredPaymentMethodResource + public function deleteTokenForStoredPaymentDetails(string $storedPaymentMethodId, array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{storedPaymentMethodId}'], [$storedPaymentMethodId], "/storedPaymentMethods/{storedPaymentMethodId}"); - $response = $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Checkout\StoredPaymentMethodResource::class); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); } /** diff --git a/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php b/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php new file mode 100644 index 000000000..c91d543a5 --- /dev/null +++ b/src/Adyen/Service/Management/AndroidFilesCompanyLevelApi.php @@ -0,0 +1,87 @@ +baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); + } + + /** + * Get a list of Android apps + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'packageName'=> string, 'versionCode'=> int]] + * @return \Adyen\Model\Management\AndroidAppsResponse + * @throws AdyenException + */ + public function listAndroidApps(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidAppsResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidApps"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidAppsResponse::class); + } + + /** + * Get Android app + * + * @param string $companyId + * @param string $id + * @param array|null $requestOptions + * @return \Adyen\Model\Management\AndroidApp + * @throws AdyenException + */ + public function getAndroidApp(string $companyId, string $id, array $requestOptions = null): \Adyen\Model\Management\AndroidApp + { + $endpoint = $this->baseURL . str_replace(['{companyId}', '{id}'], [$companyId, $id], "/companies/{companyId}/androidApps/{id}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidApp::class); + } + + /** + * Get a list of Android certificates + * + * @param string $companyId + * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'certificateName'=> string]] + * @return \Adyen\Model\Management\AndroidCertificatesResponse + * @throws AdyenException + */ + public function listAndroidCertificates(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidCertificatesResponse + { + $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidCertificates"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidCertificatesResponse::class); + } +} diff --git a/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php index b3a6104f5..346ad3e75 100644 --- a/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php +++ b/src/Adyen/Service/Management/TerminalActionsCompanyLevelApi.php @@ -39,36 +39,6 @@ public function __construct(Client $client) $this->baseURL = $this->createBaseUrl("https://management-test.adyen.com/v1"); } - /** - * Get a list of Android apps - * - * @param string $companyId - * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'packageName'=> string, 'versionCode'=> int]] - * @return \Adyen\Model\Management\AndroidAppsResponse - * @throws AdyenException - */ - public function listAndroidApps(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidAppsResponse - { - $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidApps"); - $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidAppsResponse::class); - } - - /** - * Get a list of Android certificates - * - * @param string $companyId - * @param array|null $requestOptions ['queryParams' => ['pageNumber'=> int, 'pageSize'=> int, 'certificateName'=> string]] - * @return \Adyen\Model\Management\AndroidCertificatesResponse - * @throws AdyenException - */ - public function listAndroidCertificates(string $companyId, array $requestOptions = null): \Adyen\Model\Management\AndroidCertificatesResponse - { - $endpoint = $this->baseURL . str_replace(['{companyId}'], [$companyId], "/companies/{companyId}/androidCertificates"); - $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); - return ObjectSerializer::deserialize($response, \Adyen\Model\Management\AndroidCertificatesResponse::class); - } - /** * Get a list of terminal actions * diff --git a/src/Adyen/Service/Payments/GeneralApi.php b/src/Adyen/Service/Payments/PaymentsApi.php similarity index 98% rename from src/Adyen/Service/Payments/GeneralApi.php rename to src/Adyen/Service/Payments/PaymentsApi.php index b72bfc5d2..dcc42cf29 100644 --- a/src/Adyen/Service/Payments/GeneralApi.php +++ b/src/Adyen/Service/Payments/PaymentsApi.php @@ -18,7 +18,7 @@ use Adyen\Service; use Adyen\Model\Payments\ObjectSerializer; -class GeneralApi extends Service +class PaymentsApi extends Service { /** * @var array|string|string[] @@ -26,7 +26,7 @@ class GeneralApi extends Service private $baseURL; /** - * GeneralApi constructor. + * PaymentsApi constructor. * * @param \Adyen\Client $client * @throws AdyenException