From cc0d0e395ea0d6a383f307d6fb7eed03d3a1eda3 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Wed, 19 Nov 2025 10:47:01 +0000 Subject: [PATCH 1/2] [adyen-sdk-automation] automated changes --- src/Adyen/Model/BalancePlatform/Amount.php | 4 +- .../ApproveAssociationRequest.php | 509 ++++++++++++++ .../ApproveAssociationResponse.php | 407 ++++++++++++ .../Model/BalancePlatform/Association.php | 509 ++++++++++++++ .../BalancePlatform/AssociationListing.php | 608 +++++++++++++++++ .../BalancePlatform/AssociationStatus.php | 45 ++ .../BalancePlatform/BalanceWebhookSetting.php | 398 +++++++++++ .../BalanceWebhookSettingAllOf.php | 404 ++++++++++++ .../BalanceWebhookSettingInfo.php | 604 +++++++++++++++++ .../BalanceWebhookSettingInfoUpdate.php | 592 +++++++++++++++++ .../BeginScaDeviceRegistrationRequest.php | 441 +++++++++++++ .../BeginScaDeviceRegistrationResponse.php | 435 ++++++++++++ .../Model/BalancePlatform/BulkAddress.php | 124 ++++ .../BalancePlatform/CapabilitySettings.php | 8 +- src/Adyen/Model/BalancePlatform/Card.php | 7 +- .../BalancePlatform/CardConfiguration.php | 22 +- src/Adyen/Model/BalancePlatform/Condition.php | 549 +++++++++++++++ .../CreateSweepConfigurationV2.php | 4 +- .../DefaultErrorResponseEntity.php | 623 ++++++++++++++++++ .../FinishScaDeviceRegistrationRequest.php | 407 ++++++++++++ .../FinishScaDeviceRegistrationResponse.php | 404 ++++++++++++ .../HKLocalAccountIdentification.php | 2 +- .../Model/BalancePlatform/LimitStatus.php | 2 +- .../ListAssociationsResponse.php | 509 ++++++++++++++ .../BalancePlatform/ObjectSerializer.php | 6 +- .../RemoveAssociationRequest.php | 475 +++++++++++++ src/Adyen/Model/BalancePlatform/ScaDevice.php | 477 ++++++++++++++ .../Model/BalancePlatform/ScaDeviceType.php | 48 ++ src/Adyen/Model/BalancePlatform/ScaEntity.php | 441 +++++++++++++ .../Model/BalancePlatform/ScaEntityType.php | 45 ++ .../Model/BalancePlatform/ScaExemption.php | 2 +- src/Adyen/Model/BalancePlatform/ScaStatus.php | 2 +- src/Adyen/Model/BalancePlatform/Scope.php | 2 +- .../Model/BalancePlatform/SettingType.php | 42 ++ .../SubmitScaAssociationRequest.php | 407 ++++++++++++ .../SubmitScaAssociationResponse.php | 407 ++++++++++++ .../BalancePlatform/SweepConfigurationV2.php | 4 +- src/Adyen/Model/BalancePlatform/Target.php | 476 +++++++++++++ .../Model/BalancePlatform/TargetUpdate.php | 470 +++++++++++++ .../Model/BalancePlatform/TransactionRule.php | 2 +- .../BalancePlatform/TransactionRuleInfo.php | 2 +- .../Model/BalancePlatform/TransferRoute.php | 2 +- .../BalancePlatform/TransferRouteRequest.php | 2 +- .../Model/BalancePlatform/TransferType.php | 2 +- .../UpdateSweepConfigurationV2.php | 4 +- .../BalancePlatform/VerificationError.php | 4 +- .../VerificationErrorRecursive.php | 4 +- .../Model/BalancePlatform/WebhookSetting.php | 546 +++++++++++++++ .../Model/BalancePlatform/WebhookSettings.php | 404 ++++++++++++ .../Model/DataProtection/ObjectSerializer.php | 6 +- .../Model/DataProtection/ServiceError.php | 4 +- .../SubjectErasureByPspReferenceRequest.php | 4 +- .../DataProtection/SubjectErasureResponse.php | 10 +- .../LegalEntityManagement/Attachment.php | 8 +- .../LegalEntityManagement/BankAccountInfo.php | 4 +- .../Model/LegalEntityManagement/Document.php | 12 +- .../LegalEntityManagement/FinancialReport.php | 7 +- .../IdentificationData.php | 4 +- .../ObjectSerializer.php | 6 +- .../AccountHolderResource.php | 401 +++++++++++ .../AccountHolderResourceAllOf.php | 404 ++++++++++++ .../AuthenticationSessionRequest.php | 475 +++++++++++++ .../AuthenticationSessionResponse.php | 435 ++++++++++++ .../BalanceAccountResource.php | 401 +++++++++++ .../BalanceAccountResourceAllOf.php | 404 ++++++++++++ .../DefaultErrorResponseEntity.php | 623 ++++++++++++++++++ .../SessionAuthentication/InvalidField.php | 475 +++++++++++++ .../LegalEntityResource.php | 401 +++++++++++ .../LegalEntityResourceAllOf.php | 404 ++++++++++++ .../MerchantAccountResource.php | 398 +++++++++++ .../MerchantAccountResourceAllOf.php | 404 ++++++++++++ .../SessionAuthentication/ModelInterface.php | 92 +++ .../ObjectSerializer.php | 292 ++++++++ .../PaymentInstrumentResource.php | 401 +++++++++++ .../PaymentInstrumentResourceAllOf.php | 404 ++++++++++++ .../Model/SessionAuthentication/Policy.php | 435 ++++++++++++ .../SessionAuthentication/ProductType.php | 48 ++ .../Model/SessionAuthentication/Resource.php | 407 ++++++++++++ .../SessionAuthentication/ResourceType.php | 54 ++ src/Adyen/Model/Transfers/Amount.php | 4 +- src/Adyen/Model/Transfers/BankAccountV3.php | 43 +- .../Model/Transfers/BankCategoryData.php | 2 +- .../Transfers/ConfirmationTrackingData.php | 4 +- .../HKLocalAccountIdentification.php | 2 +- .../Model/Transfers/ObjectSerializer.php | 6 +- src/Adyen/Model/Transfers/PlatformPayment.php | 2 +- src/Adyen/Model/Transfers/RoutingDetails.php | 2 +- src/Adyen/Model/Transfers/Transfer.php | 6 +- .../Model/Transfers/TransferCategoryData.php | 4 +- src/Adyen/Model/Transfers/TransferData.php | 6 +- src/Adyen/Model/Transfers/TransferEvent.php | 2 + src/Adyen/Model/Transfers/TransferInfo.php | 6 +- .../AuthorizedCardUsersApi.php | 9 +- .../BalancePlatform/BalanceAccountsApi.php | 3 +- .../Service/BalancePlatform/BalancesApi.php | 126 ++++ .../BankAccountValidationApi.php | 3 +- .../BalancePlatform/ManageSCADevicesApi.php | 3 +- .../BalancePlatform/NetworkTokensApi.php | 3 +- .../SCAAssociationManagementApi.php | 85 +++ .../SCADeviceManagementApi.php | 88 +++ .../TransferLimitsBalanceAccountLevelApi.php | 6 +- .../TransferLimitsBalancePlatformLevelApi.php | 3 +- .../BusinessLinesApi.php | 3 +- .../LegalEntityManagement/DocumentsApi.php | 3 +- .../LegalEntitiesApi.php | 15 + .../TaxEDeliveryConsentApi.php | 3 +- .../TransferInstrumentsApi.php | 3 +- .../SessionAuthenticationApi.php | 56 ++ src/Adyen/Service/Transfers/TransfersApi.php | 6 +- 109 files changed, 19704 insertions(+), 119 deletions(-) create mode 100644 src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/Association.php create mode 100644 src/Adyen/Model/BalancePlatform/AssociationListing.php create mode 100644 src/Adyen/Model/BalancePlatform/AssociationStatus.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php create mode 100644 src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php create mode 100644 src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/Condition.php create mode 100644 src/Adyen/Model/BalancePlatform/DefaultErrorResponseEntity.php create mode 100644 src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/ScaDevice.php create mode 100644 src/Adyen/Model/BalancePlatform/ScaDeviceType.php create mode 100644 src/Adyen/Model/BalancePlatform/ScaEntity.php create mode 100644 src/Adyen/Model/BalancePlatform/ScaEntityType.php create mode 100644 src/Adyen/Model/BalancePlatform/SettingType.php create mode 100644 src/Adyen/Model/BalancePlatform/SubmitScaAssociationRequest.php create mode 100644 src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php create mode 100644 src/Adyen/Model/BalancePlatform/Target.php create mode 100644 src/Adyen/Model/BalancePlatform/TargetUpdate.php create mode 100644 src/Adyen/Model/BalancePlatform/WebhookSetting.php create mode 100644 src/Adyen/Model/BalancePlatform/WebhookSettings.php create mode 100644 src/Adyen/Model/SessionAuthentication/AccountHolderResource.php create mode 100644 src/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.php create mode 100644 src/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.php create mode 100644 src/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.php create mode 100644 src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php create mode 100644 src/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.php create mode 100644 src/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.php create mode 100644 src/Adyen/Model/SessionAuthentication/InvalidField.php create mode 100644 src/Adyen/Model/SessionAuthentication/LegalEntityResource.php create mode 100644 src/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.php create mode 100644 src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php create mode 100644 src/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.php create mode 100644 src/Adyen/Model/SessionAuthentication/ModelInterface.php create mode 100644 src/Adyen/Model/SessionAuthentication/ObjectSerializer.php create mode 100644 src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php create mode 100644 src/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.php create mode 100644 src/Adyen/Model/SessionAuthentication/Policy.php create mode 100644 src/Adyen/Model/SessionAuthentication/ProductType.php create mode 100644 src/Adyen/Model/SessionAuthentication/Resource.php create mode 100644 src/Adyen/Model/SessionAuthentication/ResourceType.php create mode 100644 src/Adyen/Service/BalancePlatform/BalancesApi.php create mode 100644 src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php create mode 100644 src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php create mode 100644 src/Adyen/Service/SessionAuthentication/SessionAuthenticationApi.php diff --git a/src/Adyen/Model/BalancePlatform/Amount.php b/src/Adyen/Model/BalancePlatform/Amount.php index b35f114f7..73c00a9a1 100644 --- a/src/Adyen/Model/BalancePlatform/Amount.php +++ b/src/Adyen/Model/BalancePlatform/Amount.php @@ -299,7 +299,7 @@ public function getCurrency() /** * Sets currency * - * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the amount. * * @return self */ @@ -323,7 +323,7 @@ public function getValue() /** * Sets value * - * @param int $value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). + * @param int $value The numeric value of the amount, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php b/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php new file mode 100644 index 000000000..7f5e794b1 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ApproveAssociationRequest.php @@ -0,0 +1,509 @@ + + */ +class ApproveAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApproveAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceIds' => 'string[]', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceIds' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceIds' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceIds' => 'scaDeviceIds', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceIds' => 'setScaDeviceIds', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceIds' => 'getScaDeviceIds', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceIds', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceIds'] === null) { + $invalidProperties[] = "'scaDeviceIds' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceIds + * + * @return string[] + */ + public function getScaDeviceIds() + { + return $this->container['scaDeviceIds']; + } + + /** + * Sets scaDeviceIds + * + * @param string[] $scaDeviceIds List of device ids associated to the entity that will be approved. + * + * @return self + */ + public function setScaDeviceIds($scaDeviceIds) + { + $this->container['scaDeviceIds'] = $scaDeviceIds; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php b/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php new file mode 100644 index 000000000..c91c8e027 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ApproveAssociationResponse.php @@ -0,0 +1,407 @@ + + */ +class ApproveAssociationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApproveAssociationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaAssociations' => '\Adyen\Model\BalancePlatform\Association[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaAssociations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaAssociations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'scaAssociations' => 'scaAssociations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaAssociations' => 'setScaAssociations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaAssociations' => 'getScaAssociations' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('scaAssociations', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['scaAssociations'] === null) { + $invalidProperties[] = "'scaAssociations' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets scaAssociations + * + * @return \Adyen\Model\BalancePlatform\Association[] + */ + public function getScaAssociations() + { + return $this->container['scaAssociations']; + } + + /** + * Sets scaAssociations + * + * @param \Adyen\Model\BalancePlatform\Association[] $scaAssociations The list of associations. + * + * @return self + */ + public function setScaAssociations($scaAssociations) + { + $this->container['scaAssociations'] = $scaAssociations; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/Association.php b/src/Adyen/Model/BalancePlatform/Association.php new file mode 100644 index 000000000..a67c041b4 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Association.php @@ -0,0 +1,509 @@ + + */ +class Association implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Association'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceId' => 'string', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceId' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceId' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceId' => 'scaDeviceId', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceId' => 'setScaDeviceId', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceId' => 'getScaDeviceId', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceId'] === null) { + $invalidProperties[] = "'scaDeviceId' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceId + * + * @return string + */ + public function getScaDeviceId() + { + return $this->container['scaDeviceId']; + } + + /** + * Sets scaDeviceId + * + * @param string $scaDeviceId The unique identifier for the SCA device. + * + * @return self + */ + public function setScaDeviceId($scaDeviceId) + { + $this->container['scaDeviceId'] = $scaDeviceId; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AssociationListing.php b/src/Adyen/Model/BalancePlatform/AssociationListing.php new file mode 100644 index 000000000..5ffdbfb64 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AssociationListing.php @@ -0,0 +1,608 @@ + + */ +class AssociationListing implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AssociationListing'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'createdAt' => '\DateTime', + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceId' => 'string', + 'scaDeviceName' => 'string', + 'scaDeviceType' => '\Adyen\Model\BalancePlatform\ScaDeviceType', + 'status' => '\Adyen\Model\BalancePlatform\AssociationStatus' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'createdAt' => 'date-time', + 'entityId' => null, + 'entityType' => null, + 'scaDeviceId' => null, + 'scaDeviceName' => null, + 'scaDeviceType' => null, + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'createdAt' => false, + 'entityId' => false, + 'entityType' => false, + 'scaDeviceId' => false, + 'scaDeviceName' => false, + 'scaDeviceType' => false, + 'status' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'createdAt' => 'createdAt', + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceId' => 'scaDeviceId', + 'scaDeviceName' => 'scaDeviceName', + 'scaDeviceType' => 'scaDeviceType', + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'createdAt' => 'setCreatedAt', + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceId' => 'setScaDeviceId', + 'scaDeviceName' => 'setScaDeviceName', + 'scaDeviceType' => 'setScaDeviceType', + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'createdAt' => 'getCreatedAt', + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceId' => 'getScaDeviceId', + 'scaDeviceName' => 'getScaDeviceName', + 'scaDeviceType' => 'getScaDeviceType', + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('createdAt', $data ?? [], null); + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceId', $data ?? [], null); + $this->setIfExists('scaDeviceName', $data ?? [], null); + $this->setIfExists('scaDeviceType', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceId'] === null) { + $invalidProperties[] = "'scaDeviceId' can't be null"; + } + if ($this->container['scaDeviceType'] === null) { + $invalidProperties[] = "'scaDeviceType' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt The date and time when the association was created. + * + * @return self + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceId + * + * @return string + */ + public function getScaDeviceId() + { + return $this->container['scaDeviceId']; + } + + /** + * Sets scaDeviceId + * + * @param string $scaDeviceId The unique identifier of the SCA device. + * + * @return self + */ + public function setScaDeviceId($scaDeviceId) + { + $this->container['scaDeviceId'] = $scaDeviceId; + + return $this; + } + + /** + * Gets scaDeviceName + * + * @return string|null + */ + public function getScaDeviceName() + { + return $this->container['scaDeviceName']; + } + + /** + * Sets scaDeviceName + * + * @param string|null $scaDeviceName The human-readable name for the SCA device that was registered. + * + * @return self + */ + public function setScaDeviceName($scaDeviceName) + { + $this->container['scaDeviceName'] = $scaDeviceName; + + return $this; + } + + /** + * Gets scaDeviceType + * + * @return \Adyen\Model\BalancePlatform\ScaDeviceType + */ + public function getScaDeviceType() + { + return $this->container['scaDeviceType']; + } + + /** + * Sets scaDeviceType + * + * @param \Adyen\Model\BalancePlatform\ScaDeviceType $scaDeviceType scaDeviceType + * + * @return self + */ + public function setScaDeviceType($scaDeviceType) + { + $this->container['scaDeviceType'] = $scaDeviceType; + + return $this; + } + + /** + * Gets status + * + * @return \Adyen\Model\BalancePlatform\AssociationStatus + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param \Adyen\Model\BalancePlatform\AssociationStatus $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/AssociationStatus.php b/src/Adyen/Model/BalancePlatform/AssociationStatus.php new file mode 100644 index 000000000..f0b5e52b8 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/AssociationStatus.php @@ -0,0 +1,45 @@ + + */ +class BalanceWebhookSetting extends WebhookSetting +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSetting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('conditions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated). + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php new file mode 100644 index 000000000..d6b4d70f7 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingAllOf.php @@ -0,0 +1,404 @@ + + */ +class BalanceWebhookSettingAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSetting_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('conditions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated). + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php new file mode 100644 index 000000000..3515fc886 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfo.php @@ -0,0 +1,604 @@ + + */ +class BalanceWebhookSettingInfo implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSettingInfo'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]', + 'currency' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\Target', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null, + 'currency' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false, + 'currency' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'currency' => 'currency', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'currency' => 'setCurrency', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'currency' => 'getCurrency', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_BALANCE = 'balance'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The array of conditions a balance change must meet for Adyen to send the webhook. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\Target + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\Target $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The type of the webhook you are configuring. Set to **balance**. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php new file mode 100644 index 000000000..23e452248 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSettingInfoUpdate.php @@ -0,0 +1,592 @@ + + */ +class BalanceWebhookSettingInfoUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceWebhookSettingInfoUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conditions' => '\Adyen\Model\BalancePlatform\Condition[]', + 'currency' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\TargetUpdate', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conditions' => null, + 'currency' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'conditions' => false, + 'currency' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'conditions' => 'conditions', + 'currency' => 'currency', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conditions' => 'setConditions', + 'currency' => 'setCurrency', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conditions' => 'getConditions', + 'currency' => 'getCurrency', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const STATUS_ACTIVE = 'active'; + public const STATUS_INACTIVE = 'inactive'; + public const TYPE_BALANCE = 'balance'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_ACTIVE, + self::STATUS_INACTIVE, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets conditions + * + * @return \Adyen\Model\BalancePlatform\Condition[]|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param \Adyen\Model\BalancePlatform\Condition[]|null $conditions The array of conditions a balance change must meet for Adyen to send the webhook. + * + * @return self + */ + public function setConditions($conditions) + { + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets currency + * + * @return string|null + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string|null $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. + * + * @return self + */ + public function setStatus($status) + { + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + error_log( + sprintf( + "status: unexpected enum value '%s' - Supported values are [%s]", + $status, + implode(', ', $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\TargetUpdate|null + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\TargetUpdate|null $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The type of the webhook you are configuring. Set to **balance**. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php new file mode 100644 index 000000000..c948966bd --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationRequest.php @@ -0,0 +1,441 @@ + + */ +class BeginScaDeviceRegistrationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BeginScaDeviceRegistrationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'sdkOutput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'sdkOutput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'sdkOutput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'sdkOutput' => 'sdkOutput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'sdkOutput' => 'setSdkOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'sdkOutput' => 'getSdkOutput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('sdkOutput', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['sdkOutput'] === null) { + $invalidProperties[] = "'sdkOutput' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the SCA device that you are registering. You can use it to help your users identify the device. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets sdkOutput + * + * @return string + */ + public function getSdkOutput() + { + return $this->container['sdkOutput']; + } + + /** + * Sets sdkOutput + * + * @param string $sdkOutput A base64-encoded block with the data required to register the SCA device. You obtain this information by using Adyen's authentication SDK. + * + * @return self + */ + public function setSdkOutput($sdkOutput) + { + $this->container['sdkOutput'] = $sdkOutput; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php new file mode 100644 index 000000000..97c87ef03 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/BeginScaDeviceRegistrationResponse.php @@ -0,0 +1,435 @@ + + */ +class BeginScaDeviceRegistrationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BeginScaDeviceRegistrationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaDevice' => '\Adyen\Model\BalancePlatform\ScaDevice', + 'sdkInput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaDevice' => null, + 'sdkInput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaDevice' => false, + 'sdkInput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'scaDevice' => 'scaDevice', + 'sdkInput' => 'sdkInput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaDevice' => 'setScaDevice', + 'sdkInput' => 'setSdkInput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaDevice' => 'getScaDevice', + 'sdkInput' => 'getSdkInput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('scaDevice', $data ?? [], null); + $this->setIfExists('sdkInput', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets scaDevice + * + * @return \Adyen\Model\BalancePlatform\ScaDevice|null + */ + public function getScaDevice() + { + return $this->container['scaDevice']; + } + + /** + * Sets scaDevice + * + * @param \Adyen\Model\BalancePlatform\ScaDevice|null $scaDevice scaDevice + * + * @return self + */ + public function setScaDevice($scaDevice) + { + $this->container['scaDevice'] = $scaDevice; + + return $this; + } + + /** + * Gets sdkInput + * + * @return string|null + */ + public function getSdkInput() + { + return $this->container['sdkInput']; + } + + /** + * Sets sdkInput + * + * @param string|null $sdkInput A string that you must pass to the authentication SDK to continue with the registration process. + * + * @return self + */ + public function setSdkInput($sdkInput) + { + $this->container['sdkInput'] = $sdkInput; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/BulkAddress.php b/src/Adyen/Model/BalancePlatform/BulkAddress.php index c54b11bc7..b5fe65f4b 100644 --- a/src/Adyen/Model/BalancePlatform/BulkAddress.php +++ b/src/Adyen/Model/BalancePlatform/BulkAddress.php @@ -46,7 +46,11 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => 'string', 'email' => 'string', 'houseNumberOrName' => 'string', + 'line1' => 'string', + 'line2' => 'string', + 'line3' => 'string', 'mobile' => 'string', + 'name' => 'string', 'postalCode' => 'string', 'stateOrProvince' => 'string', 'street' => 'string' @@ -65,7 +69,11 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => null, 'email' => null, 'houseNumberOrName' => null, + 'line1' => null, + 'line2' => null, + 'line3' => null, 'mobile' => null, + 'name' => null, 'postalCode' => null, 'stateOrProvince' => null, 'street' => null @@ -82,7 +90,11 @@ class BulkAddress implements ModelInterface, ArrayAccess, \JsonSerializable 'country' => false, 'email' => false, 'houseNumberOrName' => false, + 'line1' => false, + 'line2' => false, + 'line3' => false, 'mobile' => false, + 'name' => false, 'postalCode' => false, 'stateOrProvince' => false, 'street' => false @@ -179,7 +191,11 @@ public function isNullableSetToNull(string $property): bool 'country' => 'country', 'email' => 'email', 'houseNumberOrName' => 'houseNumberOrName', + 'line1' => 'line1', + 'line2' => 'line2', + 'line3' => 'line3', 'mobile' => 'mobile', + 'name' => 'name', 'postalCode' => 'postalCode', 'stateOrProvince' => 'stateOrProvince', 'street' => 'street' @@ -196,7 +212,11 @@ public function isNullableSetToNull(string $property): bool 'country' => 'setCountry', 'email' => 'setEmail', 'houseNumberOrName' => 'setHouseNumberOrName', + 'line1' => 'setLine1', + 'line2' => 'setLine2', + 'line3' => 'setLine3', 'mobile' => 'setMobile', + 'name' => 'setName', 'postalCode' => 'setPostalCode', 'stateOrProvince' => 'setStateOrProvince', 'street' => 'setStreet' @@ -213,7 +233,11 @@ public function isNullableSetToNull(string $property): bool 'country' => 'getCountry', 'email' => 'getEmail', 'houseNumberOrName' => 'getHouseNumberOrName', + 'line1' => 'getLine1', + 'line2' => 'getLine2', + 'line3' => 'getLine3', 'mobile' => 'getMobile', + 'name' => 'getName', 'postalCode' => 'getPostalCode', 'stateOrProvince' => 'getStateOrProvince', 'street' => 'getStreet' @@ -281,7 +305,11 @@ public function __construct(?array $data = null) $this->setIfExists('country', $data ?? [], null); $this->setIfExists('email', $data ?? [], null); $this->setIfExists('houseNumberOrName', $data ?? [], null); + $this->setIfExists('line1', $data ?? [], null); + $this->setIfExists('line2', $data ?? [], null); + $this->setIfExists('line3', $data ?? [], null); $this->setIfExists('mobile', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('postalCode', $data ?? [], null); $this->setIfExists('stateOrProvince', $data ?? [], null); $this->setIfExists('street', $data ?? [], null); @@ -452,6 +480,78 @@ public function setHouseNumberOrName($houseNumberOrName) return $this; } + /** + * Gets line1 + * + * @return string|null + */ + public function getLine1() + { + return $this->container['line1']; + } + + /** + * Sets line1 + * + * @param string|null $line1 The name of the street and the number of the building. For example: **Simon Carmiggeltstraat 6-50**. + * + * @return self + */ + public function setLine1($line1) + { + $this->container['line1'] = $line1; + + return $this; + } + + /** + * Gets line2 + * + * @return string|null + */ + public function getLine2() + { + return $this->container['line2']; + } + + /** + * Sets line2 + * + * @param string|null $line2 Additional information about the delivery address. For example, an apartment number. + * + * @return self + */ + public function setLine2($line2) + { + $this->container['line2'] = $line2; + + return $this; + } + + /** + * Gets line3 + * + * @return string|null + */ + public function getLine3() + { + return $this->container['line3']; + } + + /** + * Sets line3 + * + * @param string|null $line3 Additional information about the delivery address. + * + * @return self + */ + public function setLine3($line3) + { + $this->container['line3'] = $line3; + + return $this; + } + /** * Gets mobile * @@ -476,6 +576,30 @@ public function setMobile($mobile) return $this; } + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The recipient’s name (person or contact), for example ‘John Doe’. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + /** * Gets postalCode * diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index 267f118ca..0641a50c7 100644 --- a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -355,7 +355,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -379,7 +379,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -403,7 +403,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -436,7 +436,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Card.php b/src/Adyen/Model/BalancePlatform/Card.php index d5750d965..470215c83 100644 --- a/src/Adyen/Model/BalancePlatform/Card.php +++ b/src/Adyen/Model/BalancePlatform/Card.php @@ -386,9 +386,6 @@ public function listInvalidProperties() ); } - if ($this->container['number'] === null) { - $invalidProperties[] = "'number' can't be null"; - } return $invalidProperties; } @@ -681,7 +678,7 @@ public function setLastFour($lastFour) /** * Gets number * - * @return string + * @return string|null */ public function getNumber() { @@ -691,7 +688,7 @@ public function getNumber() /** * Sets number * - * @param string $number The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + * @param string|null $number The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/CardConfiguration.php b/src/Adyen/Model/BalancePlatform/CardConfiguration.php index 974a49db5..69848132b 100644 --- a/src/Adyen/Model/BalancePlatform/CardConfiguration.php +++ b/src/Adyen/Model/BalancePlatform/CardConfiguration.php @@ -380,7 +380,7 @@ public function getActivation() /** * Sets activation * - * @param string|null $activation Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + * @param string|null $activation The activation label attached to the card that contains the activation instructions. This field overrides the activation label design ID defined in the card configuration profile. * * @return self */ @@ -452,7 +452,7 @@ public function getCardImageId() /** * Sets cardImageId * - * @param string|null $cardImageId The ID of the card image. This is the image that will be printed on the full front of the card. + * @param string|null $cardImageId The unique identifier of the card image. This image is printed on the full front of the card. * * @return self */ @@ -476,7 +476,7 @@ public function getCarrier() /** * Sets carrier * - * @param string|null $carrier Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + * @param string|null $carrier The letter or packaging to which the card is attached. This field overrides the carrier design ID defined in the card configuration profile. * * @return self */ @@ -500,7 +500,7 @@ public function getCarrierImageId() /** * Sets carrierImageId * - * @param string|null $carrierImageId The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + * @param string|null $carrierImageId The unique identifier of the carrier image. This image is printed on the letter to which the card is attached. * * @return self */ @@ -524,7 +524,7 @@ public function getConfigurationProfileId() /** * Sets configurationProfileId * - * @param string $configurationProfileId The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + * @param string $configurationProfileId The unique identifier of the card configuration profile that contains the settings that are applied to the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. You can override some of the existing settings in the configuration profile by providing the corresponding fields in the `configuration` object. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. * * @return self */ @@ -548,7 +548,7 @@ public function getCurrency() /** * Sets currency * - * @param string|null $currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + * @param string|null $currency The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. This field overrides the existing currency setting on the card configuration profile. * * @return self */ @@ -572,7 +572,7 @@ public function getEnvelope() /** * Sets envelope * - * @param string|null $envelope Overrides the envelope design ID defined in the `configurationProfileId`. + * @param string|null $envelope Overrides the envelope design ID defined in the card configuration profile. * * @return self */ @@ -596,7 +596,7 @@ public function getInsert() /** * Sets insert * - * @param string|null $insert Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + * @param string|null $insert Any additional material, such as marketing material, that is shipped together with the card. This field overrides the insert design ID defined in the card configuration profile. * * @return self */ @@ -644,7 +644,7 @@ public function getLogoImageId() /** * Sets logoImageId * - * @param string|null $logoImageId The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + * @param string|null $logoImageId The unique identifier of the logo image. This image is printed on the partial front of the card, for example, a logo on the upper right corner. * * @return self */ @@ -668,7 +668,7 @@ public function getPinMailer() /** * Sets pinMailer * - * @param string|null $pinMailer Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + * @param string|null $pinMailer The letter on which the PIN of the card is printed. This field overrides the PIN mailer design ID defined in the card configuration profile. * * @return self */ @@ -692,7 +692,7 @@ public function getShipmentMethod() /** * Sets shipmentMethod * - * @param string|null $shipmentMethod Overrides the logistics company defined in the `configurationProfileId`. + * @param string|null $shipmentMethod The logistics company that ships the card. This field overrides the logistics company defined in the card configuration profile. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Condition.php b/src/Adyen/Model/BalancePlatform/Condition.php new file mode 100644 index 000000000..84dcec492 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Condition.php @@ -0,0 +1,549 @@ + + */ +class Condition implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Condition'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceType' => 'string', + 'conditionType' => 'string', + 'value' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceType' => null, + 'conditionType' => null, + 'value' => 'int64' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceType' => false, + 'conditionType' => false, + 'value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balanceType' => 'balanceType', + 'conditionType' => 'conditionType', + 'value' => 'value' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceType' => 'setBalanceType', + 'conditionType' => 'setConditionType', + 'value' => 'setValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceType' => 'getBalanceType', + 'conditionType' => 'getConditionType', + 'value' => 'getValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const BALANCE_TYPE_BALANCE = 'balance'; + public const BALANCE_TYPE_AVAILABLE = 'available'; + public const BALANCE_TYPE_PENDING = 'pending'; + public const BALANCE_TYPE_RESERVED = 'reserved'; + public const CONDITION_TYPE_GREATER_THAN = 'greaterThan'; + public const CONDITION_TYPE_GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual'; + public const CONDITION_TYPE_LESS_THAN = 'lessThan'; + public const CONDITION_TYPE_LESS_THAN_OR_EQUAL = 'lessThanOrEqual'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getBalanceTypeAllowableValues() + { + return [ + self::BALANCE_TYPE_BALANCE, + self::BALANCE_TYPE_AVAILABLE, + self::BALANCE_TYPE_PENDING, + self::BALANCE_TYPE_RESERVED, + ]; + } + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConditionTypeAllowableValues() + { + return [ + self::CONDITION_TYPE_GREATER_THAN, + self::CONDITION_TYPE_GREATER_THAN_OR_EQUAL, + self::CONDITION_TYPE_LESS_THAN, + self::CONDITION_TYPE_LESS_THAN_OR_EQUAL, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('balanceType', $data ?? [], null); + $this->setIfExists('conditionType', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['balanceType'] === null) { + $invalidProperties[] = "'balanceType' can't be null"; + } + $allowedValues = $this->getBalanceTypeAllowableValues(); + if (!is_null($this->container['balanceType']) && !in_array($this->container['balanceType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'balanceType', must be one of '%s'", + $this->container['balanceType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['conditionType'] === null) { + $invalidProperties[] = "'conditionType' can't be null"; + } + $allowedValues = $this->getConditionTypeAllowableValues(); + if (!is_null($this->container['conditionType']) && !in_array($this->container['conditionType'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conditionType', must be one of '%s'", + $this->container['conditionType'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balanceType + * + * @return string + */ + public function getBalanceType() + { + return $this->container['balanceType']; + } + + /** + * Sets balanceType + * + * @param string $balanceType Define the type of balance about which you want to get notified. Possible values: * **available**: the balance available for use. * **balance**: the sum of transactions that have already been settled. * **pending**: the sum of transactions that will be settled in the future. * **reserved**: the balance currently held in reserve. + * + * @return self + */ + public function setBalanceType($balanceType) + { + $allowedValues = $this->getBalanceTypeAllowableValues(); + if (!in_array($balanceType, $allowedValues, true)) { + error_log( + sprintf( + "balanceType: unexpected enum value '%s' - Supported values are [%s]", + $balanceType, + implode(', ', $allowedValues) + ) + ); + } + $this->container['balanceType'] = $balanceType; + + return $this; + } + + /** + * Gets conditionType + * + * @return string + */ + public function getConditionType() + { + return $this->container['conditionType']; + } + + /** + * Sets conditionType + * + * @param string $conditionType Define when you want to get notified about a balance change. Possible values: * **greaterThan**: the balance in the account(s) exceeds the specified `value`. * **greaterThanOrEqual**: the balance in the account(s) reaches or exceeds the specified `value`. * **lessThan**: the balance in the account(s) drops below the specified `value`. * **lessThanOrEqual**: the balance in the account(s) reaches to drops below the specified `value`. + * + * @return self + */ + public function setConditionType($conditionType) + { + $allowedValues = $this->getConditionTypeAllowableValues(); + if (!in_array($conditionType, $allowedValues, true)) { + error_log( + sprintf( + "conditionType: unexpected enum value '%s' - Supported values are [%s]", + $conditionType, + implode(', ', $allowedValues) + ) + ); + } + $this->container['conditionType'] = $conditionType; + + return $this; + } + + /** + * Gets value + * + * @return int + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param int $value The value limit in the specified balance type and currency, in minor units. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php index afbfc529b..2899135c6 100644 --- a/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/CreateSweepConfigurationV2.php @@ -328,6 +328,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; @@ -395,6 +396,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; @@ -661,7 +663,7 @@ public function getPriorities() /** * 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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/DefaultErrorResponseEntity.php b/src/Adyen/Model/BalancePlatform/DefaultErrorResponseEntity.php new file mode 100644 index 000000000..16767ab11 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/DefaultErrorResponseEntity.php @@ -0,0 +1,623 @@ + + */ +class DefaultErrorResponseEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DefaultErrorResponseEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\BalancePlatform\InvalidField[]', + 'requestId' => 'string', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'status' => true, + 'title' => 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 = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode Unique business error code. + * + * @return self + */ + public function setErrorCode($errorCode) + { + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A URI that identifies the specific occurrence of the problem if applicable. + * + * @return self + */ + public function setInstance($instance) + { + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\BalancePlatform\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\BalancePlatform\InvalidField[]|null $invalidFields Array of fields with validation errors when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId The unique reference for the request. + * + * @return self + */ + public function setRequestId($requestId) + { + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationRequest.php b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationRequest.php new file mode 100644 index 000000000..d3e56b387 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationRequest.php @@ -0,0 +1,407 @@ + + */ +class FinishScaDeviceRegistrationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FinishScaDeviceRegistrationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'sdkOutput' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'sdkOutput' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'sdkOutput' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sdkOutput' => 'sdkOutput' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sdkOutput' => 'setSdkOutput' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sdkOutput' => 'getSdkOutput' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('sdkOutput', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sdkOutput'] === null) { + $invalidProperties[] = "'sdkOutput' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sdkOutput + * + * @return string + */ + public function getSdkOutput() + { + return $this->container['sdkOutput']; + } + + /** + * Sets sdkOutput + * + * @param string $sdkOutput A base64-encoded block with the data required to register the SCA device. You obtain this information by using Adyen's authentication SDK. + * + * @return self + */ + public function setSdkOutput($sdkOutput) + { + $this->container['sdkOutput'] = $sdkOutput; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php new file mode 100644 index 000000000..3016f3d48 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/FinishScaDeviceRegistrationResponse.php @@ -0,0 +1,404 @@ + + */ +class FinishScaDeviceRegistrationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FinishScaDeviceRegistrationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaDevice' => '\Adyen\Model\BalancePlatform\ScaDevice' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaDevice' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaDevice' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'scaDevice' => 'scaDevice' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaDevice' => 'setScaDevice' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaDevice' => 'getScaDevice' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('scaDevice', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets scaDevice + * + * @return \Adyen\Model\BalancePlatform\ScaDevice|null + */ + public function getScaDevice() + { + return $this->container['scaDevice']; + } + + /** + * Sets scaDevice + * + * @param \Adyen\Model\BalancePlatform\ScaDevice|null $scaDevice scaDevice + * + * @return self + */ + public function setScaDevice($scaDevice) + { + $this->container['scaDevice'] = $scaDevice; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php index 7aeb5cd97..b8e140baa 100644 --- a/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/BalancePlatform/HKLocalAccountIdentification.php @@ -330,7 +330,7 @@ public function getAccountNumber() /** * Sets accountNumber * - * @param string $accountNumber The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. + * @param string $accountNumber The 9- to 17-digit bank account number, without separators or whitespace. Starts with the 3-digit branch code. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/LimitStatus.php b/src/Adyen/Model/BalancePlatform/LimitStatus.php index 0100348c5..5b8b01110 100644 --- a/src/Adyen/Model/BalancePlatform/LimitStatus.php +++ b/src/Adyen/Model/BalancePlatform/LimitStatus.php @@ -14,7 +14,6 @@ namespace Adyen\Model\BalancePlatform; - use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -51,3 +50,4 @@ public static function getAllowableEnumValues() ]; } } + diff --git a/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php b/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php new file mode 100644 index 000000000..722ddf414 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ListAssociationsResponse.php @@ -0,0 +1,509 @@ + + */ +class ListAssociationsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListAssociationsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'links' => '\Adyen\Model\BalancePlatform\Link', + 'data' => '\Adyen\Model\BalancePlatform\AssociationListing[]', + 'itemsTotal' => 'int', + 'pagesTotal' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'links' => null, + 'data' => null, + 'itemsTotal' => 'int32', + 'pagesTotal' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'links' => false, + 'data' => false, + 'itemsTotal' => true, + 'pagesTotal' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'links' => '_links', + 'data' => 'data', + 'itemsTotal' => 'itemsTotal', + 'pagesTotal' => 'pagesTotal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'links' => 'setLinks', + 'data' => 'setData', + 'itemsTotal' => 'setItemsTotal', + 'pagesTotal' => 'setPagesTotal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'links' => 'getLinks', + 'data' => 'getData', + 'itemsTotal' => 'getItemsTotal', + 'pagesTotal' => 'getPagesTotal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('data', $data ?? [], null); + $this->setIfExists('itemsTotal', $data ?? [], null); + $this->setIfExists('pagesTotal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['links'] === null) { + $invalidProperties[] = "'links' can't be null"; + } + if ($this->container['data'] === null) { + $invalidProperties[] = "'data' can't be null"; + } + if ($this->container['itemsTotal'] === null) { + $invalidProperties[] = "'itemsTotal' can't be null"; + } + if ($this->container['pagesTotal'] === null) { + $invalidProperties[] = "'pagesTotal' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets links + * + * @return \Adyen\Model\BalancePlatform\Link + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param \Adyen\Model\BalancePlatform\Link $links links + * + * @return self + */ + public function setLinks($links) + { + $this->container['links'] = $links; + + return $this; + } + + /** + * Gets data + * + * @return \Adyen\Model\BalancePlatform\AssociationListing[] + */ + public function getData() + { + return $this->container['data']; + } + + /** + * Sets data + * + * @param \Adyen\Model\BalancePlatform\AssociationListing[] $data Contains a list of associations and their corresponding details. + * + * @return self + */ + public function setData($data) + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets itemsTotal + * + * @return int + */ + public function getItemsTotal() + { + return $this->container['itemsTotal']; + } + + /** + * Sets itemsTotal + * + * @param int $itemsTotal The total number of items available. + * + * @return self + */ + public function setItemsTotal($itemsTotal) + { + $this->container['itemsTotal'] = $itemsTotal; + + return $this; + } + + /** + * Gets pagesTotal + * + * @return int + */ + public function getPagesTotal() + { + return $this->container['pagesTotal']; + } + + /** + * Sets pagesTotal + * + * @param int $pagesTotal The total number of pages available. + * + * @return self + */ + public function setPagesTotal($pagesTotal) + { + $this->container['pagesTotal'] = $pagesTotal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index dd0a6b47d..c611e4ccf 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,9 +118,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php b/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php new file mode 100644 index 000000000..e51d7e03f --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/RemoveAssociationRequest.php @@ -0,0 +1,475 @@ + + */ +class RemoveAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RemoveAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entityId' => 'string', + 'entityType' => '\Adyen\Model\BalancePlatform\ScaEntityType', + 'scaDeviceIds' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entityId' => null, + 'entityType' => null, + 'scaDeviceIds' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entityId' => false, + 'entityType' => false, + 'scaDeviceIds' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entityId' => 'entityId', + 'entityType' => 'entityType', + 'scaDeviceIds' => 'scaDeviceIds' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entityId' => 'setEntityId', + 'entityType' => 'setEntityType', + 'scaDeviceIds' => 'setScaDeviceIds' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entityId' => 'getEntityId', + 'entityType' => 'getEntityType', + 'scaDeviceIds' => 'getScaDeviceIds' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entityId', $data ?? [], null); + $this->setIfExists('entityType', $data ?? [], null); + $this->setIfExists('scaDeviceIds', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entityId'] === null) { + $invalidProperties[] = "'entityId' can't be null"; + } + if ($this->container['entityType'] === null) { + $invalidProperties[] = "'entityType' can't be null"; + } + if ($this->container['scaDeviceIds'] === null) { + $invalidProperties[] = "'scaDeviceIds' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entityId + * + * @return string + */ + public function getEntityId() + { + return $this->container['entityId']; + } + + /** + * Sets entityId + * + * @param string $entityId The unique identifier of the entity. + * + * @return self + */ + public function setEntityId($entityId) + { + $this->container['entityId'] = $entityId; + + return $this; + } + + /** + * Gets entityType + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getEntityType() + { + return $this->container['entityType']; + } + + /** + * Sets entityType + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $entityType entityType + * + * @return self + */ + public function setEntityType($entityType) + { + $this->container['entityType'] = $entityType; + + return $this; + } + + /** + * Gets scaDeviceIds + * + * @return string[] + */ + public function getScaDeviceIds() + { + return $this->container['scaDeviceIds']; + } + + /** + * Sets scaDeviceIds + * + * @param string[] $scaDeviceIds A list of device ids associated with the entity that should be removed. + * + * @return self + */ + public function setScaDeviceIds($scaDeviceIds) + { + $this->container['scaDeviceIds'] = $scaDeviceIds; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaDevice.php b/src/Adyen/Model/BalancePlatform/ScaDevice.php new file mode 100644 index 000000000..ebf3fc1d2 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaDevice.php @@ -0,0 +1,477 @@ + + */ +class ScaDevice implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScaDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'type' => '\Adyen\Model\BalancePlatform\ScaDeviceType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'name' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the SCA device you are registering. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The name of the SCA device that you are registering. You can use it to help your users identify the device. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\ScaDeviceType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScaDeviceType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaDeviceType.php b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php new file mode 100644 index 000000000..6b4f8129a --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php @@ -0,0 +1,48 @@ + + */ +class ScaEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ScaEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => '\Adyen\Model\BalancePlatform\ScaEntityType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the entity. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\ScaEntityType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\ScaEntityType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/ScaEntityType.php b/src/Adyen/Model/BalancePlatform/ScaEntityType.php new file mode 100644 index 000000000..31a7020f3 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/ScaEntityType.php @@ -0,0 +1,45 @@ + + */ +class SubmitScaAssociationRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitScaAssociationRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entities' => '\Adyen\Model\BalancePlatform\ScaEntity[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entities' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'entities' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entities' => 'entities' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entities' => 'setEntities' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entities' => 'getEntities' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entities', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['entities'] === null) { + $invalidProperties[] = "'entities' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entities + * + * @return \Adyen\Model\BalancePlatform\ScaEntity[] + */ + public function getEntities() + { + return $this->container['entities']; + } + + /** + * Sets entities + * + * @param \Adyen\Model\BalancePlatform\ScaEntity[] $entities The list of entities to be associated. + * + * @return self + */ + public function setEntities($entities) + { + $this->container['entities'] = $entities; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php b/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php new file mode 100644 index 000000000..6879a4b0c --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/SubmitScaAssociationResponse.php @@ -0,0 +1,407 @@ + + */ +class SubmitScaAssociationResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SubmitScaAssociationResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'scaAssociations' => '\Adyen\Model\BalancePlatform\Association[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'scaAssociations' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'scaAssociations' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'scaAssociations' => 'scaAssociations' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'scaAssociations' => 'setScaAssociations' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'scaAssociations' => 'getScaAssociations' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('scaAssociations', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['scaAssociations'] === null) { + $invalidProperties[] = "'scaAssociations' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets scaAssociations + * + * @return \Adyen\Model\BalancePlatform\Association[] + */ + public function getScaAssociations() + { + return $this->container['scaAssociations']; + } + + /** + * Sets scaAssociations + * + * @param \Adyen\Model\BalancePlatform\Association[] $scaAssociations List of associations created to the entities and their statuses. + * + * @return self + */ + public function setScaAssociations($scaAssociations) + { + $this->container['scaAssociations'] = $scaAssociations; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php index ff1580bbe..07621bcc9 100644 --- a/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/SweepConfigurationV2.php @@ -334,6 +334,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; @@ -401,6 +402,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; @@ -695,7 +697,7 @@ public function getPriorities() /** * 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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/Target.php b/src/Adyen/Model/BalancePlatform/Target.php new file mode 100644 index 000000000..c3bb38d86 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/Target.php @@ -0,0 +1,476 @@ + + */ +class Target implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Target'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BALANCE_ACCOUNT = 'balanceAccount'; + public const TYPE_ACCOUNT_HOLDER = 'accountHolder'; + public const TYPE_BALANCE_PLATFORM = 'balancePlatform'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_ACCOUNT_HOLDER, + self::TYPE_BALANCE_PLATFORM, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the `target.type`. This can be the ID of your: * balance platform * account holder * account holder's balance account + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type The resource for which you want to receive notifications. Possible values: * **balancePlatform**: receive notifications about balance changes in your entire balance platform. * **accountHolder**: receive notifications about balance changes of a specific user. * **balanceAccount**: receive notifications about balance changes in a specific balance account. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TargetUpdate.php b/src/Adyen/Model/BalancePlatform/TargetUpdate.php new file mode 100644 index 000000000..489cae856 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/TargetUpdate.php @@ -0,0 +1,470 @@ + + */ +class TargetUpdate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'TargetUpdate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const TYPE_BALANCE_ACCOUNT = 'balanceAccount'; + public const TYPE_ACCOUNT_HOLDER = 'accountHolder'; + public const TYPE_BALANCE_PLATFORM = 'balancePlatform'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTypeAllowableValues() + { + return [ + self::TYPE_BALANCE_ACCOUNT, + self::TYPE_ACCOUNT_HOLDER, + self::TYPE_BALANCE_PLATFORM, + ]; + } + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getTypeAllowableValues(); + if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'type', must be one of '%s'", + $this->container['type'], + implode("', '", $allowedValues) + ); + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the `target.type`. This can be the ID of your: * balance platform * account holder * account holder's balance account + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type The resource for which you want to receive notifications. Possible values: * **balancePlatform**: receive notifications about balance changes in your entire balance platform. * **accountHolder**: receive notifications about balance changes of a specific user. * **balanceAccount**: receive notifications about balance changes in a specific balance account. + * + * @return self + */ + public function setType($type) + { + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + error_log( + sprintf( + "type: unexpected enum value '%s' - Supported values are [%s]", + $type, + implode(', ', $allowedValues) + ) + ); + } + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/TransactionRule.php b/src/Adyen/Model/BalancePlatform/TransactionRule.php index 3b4bd388e..84c17a90d 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRule.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRule.php @@ -643,7 +643,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock** (default): the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. This value is not allowed when `requestType` is **bankTransfer**. * **enforceSCA**: your user is prompted to verify their identity using [3D Secure authentication](https://docs.adyen.com/issuing/3d-secure/). If the authentication fails or times out, the transaction is declined. This value is only allowed when `requestType` is **authentication**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php index 83e58d445..75ee5deae 100644 --- a/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php +++ b/src/Adyen/Model/BalancePlatform/TransactionRuleInfo.php @@ -612,7 +612,7 @@ public function getOutcomeType() /** * Sets outcomeType * - * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. Default value: **hardBlock**. > **scoreBased** is not allowed when `requestType` is **bankTransfer**. + * @param string|null $outcomeType The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. Possible values: * **hardBlock** (default): the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. This value is not allowed when `requestType` is **bankTransfer**. * **enforceSCA**: your user is prompted to verify their identity using [3D Secure authentication](https://docs.adyen.com/issuing/3d-secure/). If the authentication fails or times out, the transaction is declined. This value is only allowed when `requestType` is **authentication**. * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferRoute.php b/src/Adyen/Model/BalancePlatform/TransferRoute.php index e45e973de..9360369fe 100644 --- a/src/Adyen/Model/BalancePlatform/TransferRoute.php +++ b/src/Adyen/Model/BalancePlatform/TransferRoute.php @@ -466,7 +466,7 @@ public function getPriority() /** * 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**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php b/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php index f8f518824..6647df776 100644 --- a/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php +++ b/src/Adyen/Model/BalancePlatform/TransferRouteRequest.php @@ -534,7 +534,7 @@ public function getPriorities() /** * 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**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/TransferType.php b/src/Adyen/Model/BalancePlatform/TransferType.php index 2976ebab3..980229f1b 100644 --- a/src/Adyen/Model/BalancePlatform/TransferType.php +++ b/src/Adyen/Model/BalancePlatform/TransferType.php @@ -14,7 +14,6 @@ namespace Adyen\Model\BalancePlatform; - use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -45,3 +44,4 @@ public static function getAllowableEnumValues() ]; } } + diff --git a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php index 71c03a2a9..16aabed15 100644 --- a/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php +++ b/src/Adyen/Model/BalancePlatform/UpdateSweepConfigurationV2.php @@ -334,6 +334,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_ACTIVE = 'active'; @@ -401,6 +402,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; @@ -683,7 +685,7 @@ public function getPriorities() /** * 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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). + * @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, ordered by your preference. Adyen will try to pay out using the priorities in the given order. If the first priority is not currently supported or enabled for your platform, the system will try the next one, and so on. The request will be accepted as long as **at least one** of the provided priorities is valid (i.e., supported by Adyen and activated for your platform). For example, if you provide `[\"wire\",\"regular\"]`, and `wire` is not supported but `regular` is, the request will still be accepted and processed. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). Set `category` to **bank**. For more details, see optional priorities setup for [marketplaces](https://docs.adyen.com/marketplaces/payout-to-users/scheduled-payouts#optional-priorities-setup) or [platforms](https://docs.adyen.com/platforms/payout-to-users/scheduled-payouts#optional-priorities-setup). * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/VerificationError.php b/src/Adyen/Model/BalancePlatform/VerificationError.php index ba650e030..f6b6111f2 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationError.php +++ b/src/Adyen/Model/BalancePlatform/VerificationError.php @@ -298,6 +298,7 @@ public function getModelName() public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; public const TYPE_DATA_MISSING = 'dataMissing'; + public const TYPE_DATA_REVIEW = 'dataReview'; public const TYPE_INVALID_INPUT = 'invalidInput'; public const TYPE_PENDING_STATUS = 'pendingStatus'; @@ -375,6 +376,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_DATA_MISSING, + self::TYPE_DATA_REVIEW, self::TYPE_INVALID_INPUT, self::TYPE_PENDING_STATUS, ]; @@ -595,7 +597,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** + * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php b/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php index 887ac8f3a..61b7df08a 100644 --- a/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php +++ b/src/Adyen/Model/BalancePlatform/VerificationErrorRecursive.php @@ -292,6 +292,7 @@ public function getModelName() public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_COMMERCIAL = 'withdrawFromAtmInRestrictedCountriesCommercial'; public const CAPABILITIES_WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES_CONSUMER = 'withdrawFromAtmInRestrictedCountriesConsumer'; public const TYPE_DATA_MISSING = 'dataMissing'; + public const TYPE_DATA_REVIEW = 'dataReview'; public const TYPE_INVALID_INPUT = 'invalidInput'; public const TYPE_PENDING_STATUS = 'pendingStatus'; @@ -369,6 +370,7 @@ public function getTypeAllowableValues() { return [ self::TYPE_DATA_MISSING, + self::TYPE_DATA_REVIEW, self::TYPE_INVALID_INPUT, self::TYPE_PENDING_STATUS, ]; @@ -540,7 +542,7 @@ public function getType() /** * Sets type * - * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** + * @param string|null $type The type of error. Possible values: * **invalidInput** * **dataMissing** * **pendingStatus** * **dataReview** * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/WebhookSetting.php b/src/Adyen/Model/BalancePlatform/WebhookSetting.php new file mode 100644 index 000000000..b31cb5f78 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/WebhookSetting.php @@ -0,0 +1,546 @@ + + */ +class WebhookSetting implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WebhookSetting'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'currency' => 'string', + 'id' => 'string', + 'status' => 'string', + 'target' => '\Adyen\Model\BalancePlatform\Target', + 'type' => '\Adyen\Model\BalancePlatform\SettingType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'currency' => null, + 'id' => null, + 'status' => null, + 'target' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'currency' => false, + 'id' => false, + 'status' => false, + 'target' => false, + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'currency' => 'currency', + 'id' => 'id', + 'status' => 'status', + 'target' => 'target', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'currency' => 'setCurrency', + 'id' => 'setId', + 'status' => 'setStatus', + 'target' => 'setTarget', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'currency' => 'getCurrency', + 'id' => 'getId', + 'status' => 'getStatus', + 'target' => 'getTarget', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('currency', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('target', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['currency'] === null) { + $invalidProperties[] = "'currency' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['target'] === null) { + $invalidProperties[] = "'target' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets currency + * + * @return string + */ + public function getCurrency() + { + return $this->container['currency']; + } + + /** + * Sets currency + * + * @param string $currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * + * @return self + */ + public function setCurrency($currency) + { + $this->container['currency'] = $currency; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique identifier of the webhook setting. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets target + * + * @return \Adyen\Model\BalancePlatform\Target + */ + public function getTarget() + { + return $this->container['target']; + } + + /** + * Sets target + * + * @param \Adyen\Model\BalancePlatform\Target $target target + * + * @return self + */ + public function setTarget($target) + { + $this->container['target'] = $target; + + return $this; + } + + /** + * Gets type + * + * @return \Adyen\Model\BalancePlatform\SettingType + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\BalancePlatform\SettingType $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/BalancePlatform/WebhookSettings.php b/src/Adyen/Model/BalancePlatform/WebhookSettings.php new file mode 100644 index 000000000..ec0a9f834 --- /dev/null +++ b/src/Adyen/Model/BalancePlatform/WebhookSettings.php @@ -0,0 +1,404 @@ + + */ +class WebhookSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'WebhookSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'webhookSettings' => '\Adyen\Model\BalancePlatform\WebhookSetting[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'webhookSettings' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'webhookSettings' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'webhookSettings' => 'webhookSettings' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'webhookSettings' => 'setWebhookSettings' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'webhookSettings' => 'getWebhookSettings' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('webhookSettings', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets webhookSettings + * + * @return \Adyen\Model\BalancePlatform\WebhookSetting[]|null + */ + public function getWebhookSettings() + { + return $this->container['webhookSettings']; + } + + /** + * Sets webhookSettings + * + * @param \Adyen\Model\BalancePlatform\WebhookSetting[]|null $webhookSettings The list of webhook settings. + * + * @return self + */ + public function setWebhookSettings($webhookSettings) + { + $this->container['webhookSettings'] = $webhookSettings; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/DataProtection/ObjectSerializer.php b/src/Adyen/Model/DataProtection/ObjectSerializer.php index e00957f62..3ade10da2 100644 --- a/src/Adyen/Model/DataProtection/ObjectSerializer.php +++ b/src/Adyen/Model/DataProtection/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,9 +118,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/DataProtection/ServiceError.php b/src/Adyen/Model/DataProtection/ServiceError.php index a05214c2a..94e0d1b1e 100644 --- a/src/Adyen/Model/DataProtection/ServiceError.php +++ b/src/Adyen/Model/DataProtection/ServiceError.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DataProtection; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DataProtection\ObjectSerializer; /** * ServiceError Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class ServiceError implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.php b/src/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.php index 0fc7989de..9d971dd77 100644 --- a/src/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.php +++ b/src/Adyen/Model/DataProtection/SubjectErasureByPspReferenceRequest.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DataProtection; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DataProtection\ObjectSerializer; /** * SubjectErasureByPspReferenceRequest Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SubjectErasureByPspReferenceRequest implements ModelInterface, ArrayAccess, \JsonSerializable { diff --git a/src/Adyen/Model/DataProtection/SubjectErasureResponse.php b/src/Adyen/Model/DataProtection/SubjectErasureResponse.php index 5c389e12b..7586cb3ef 100644 --- a/src/Adyen/Model/DataProtection/SubjectErasureResponse.php +++ b/src/Adyen/Model/DataProtection/SubjectErasureResponse.php @@ -15,14 +15,14 @@ namespace Adyen\Model\DataProtection; -use \ArrayAccess; +use ArrayAccess; use Adyen\Model\DataProtection\ObjectSerializer; /** * SubjectErasureResponse Class Doc Comment * * @package Adyen - * @implements \ArrayAccess + * @implements ArrayAccess */ class SubjectErasureResponse implements ModelInterface, ArrayAccess, \JsonSerializable { @@ -321,11 +321,11 @@ public function setResult($result) { $allowedValues = $this->getResultAllowableValues(); if (!in_array($result, $allowedValues, true)) { - throw new \InvalidArgumentException( + error_log( sprintf( - "Invalid value '%s' for 'result', must be one of '%s'", + "result: unexpected enum value '%s' - Supported values are [%s]", $result, - implode("', '", $allowedValues) + implode(', ', $allowedValues) ) ); } diff --git a/src/Adyen/Model/LegalEntityManagement/Attachment.php b/src/Adyen/Model/LegalEntityManagement/Attachment.php index eb3905281..5ea8127f6 100644 --- a/src/Adyen/Model/LegalEntityManagement/Attachment.php +++ b/src/Adyen/Model/LegalEntityManagement/Attachment.php @@ -332,7 +332,7 @@ public function setContent($content) * Gets contentType * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getContentType() { @@ -345,7 +345,7 @@ public function getContentType() * @param string|null $contentType The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setContentType($contentType) { @@ -358,7 +358,7 @@ public function setContentType($contentType) * Gets filename * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getFilename() { @@ -371,7 +371,7 @@ public function getFilename() * @param string|null $filename The name of the file including the file extension. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setFilename($filename) { diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php index 952f086d6..8da19b0d1 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php @@ -329,7 +329,7 @@ public function setAccountIdentification($accountIdentification) * Gets accountType * * @return string|null - * @deprecated since Legal Entity Management API v2. + * @deprecated since Legal Entity Management API v2. */ public function getAccountType() { @@ -342,7 +342,7 @@ public function getAccountType() * @param string|null $accountType The type of bank account. * * @return self - * @deprecated since Legal Entity Management API v2. + * @deprecated since Legal Entity Management API v2. */ public function setAccountType($accountType) { diff --git a/src/Adyen/Model/LegalEntityManagement/Document.php b/src/Adyen/Model/LegalEntityManagement/Document.php index ce6076ede..273ddeb3b 100644 --- a/src/Adyen/Model/LegalEntityManagement/Document.php +++ b/src/Adyen/Model/LegalEntityManagement/Document.php @@ -522,7 +522,7 @@ public function setDescription($description) * Gets expiryDate * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getExpiryDate() { @@ -535,7 +535,7 @@ public function getExpiryDate() * @param string|null $expiryDate The expiry date of the document, in YYYY-MM-DD format. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setExpiryDate($expiryDate) { @@ -596,7 +596,7 @@ public function setId($id) * Gets issuerCountry * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerCountry() { @@ -609,7 +609,7 @@ public function getIssuerCountry() * @param string|null $issuerCountry The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the document was issued. For example, **US**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerCountry($issuerCountry) { @@ -622,7 +622,7 @@ public function setIssuerCountry($issuerCountry) * Gets issuerState * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerState() { @@ -635,7 +635,7 @@ public function getIssuerState() * @param string|null $issuerState The state or province where the document was issued (AU only). * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerState($issuerState) { diff --git a/src/Adyen/Model/LegalEntityManagement/FinancialReport.php b/src/Adyen/Model/LegalEntityManagement/FinancialReport.php index 489e6f17d..7fa2bc7e2 100644 --- a/src/Adyen/Model/LegalEntityManagement/FinancialReport.php +++ b/src/Adyen/Model/LegalEntityManagement/FinancialReport.php @@ -293,9 +293,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['dateOfFinancialData'] === null) { - $invalidProperties[] = "'dateOfFinancialData' can't be null"; - } return $invalidProperties; } @@ -386,7 +383,7 @@ public function setCurrencyOfFinancialData($currencyOfFinancialData) /** * Gets dateOfFinancialData * - * @return string + * @return string|null */ public function getDateOfFinancialData() { @@ -396,7 +393,7 @@ public function getDateOfFinancialData() /** * Sets dateOfFinancialData * - * @param string $dateOfFinancialData The date the financial data were provided, in YYYY-MM-DD format. + * @param string|null $dateOfFinancialData The date the financial data were provided, in YYYY-MM-DD format. * * @return self */ diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index cae8b20e4..02e6c1625 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -397,7 +397,7 @@ public function setExpiryDate($expiryDate) * Gets issuerCountry * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerCountry() { @@ -410,7 +410,7 @@ public function getIssuerCountry() * @param string|null $issuerCountry The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the document was issued. For example, **US**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerCountry($issuerCountry) { diff --git a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php index 3a2ad8485..dd57a5c33 100644 --- a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php +++ b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,9 +118,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php b/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php new file mode 100644 index 000000000..3a633aef1 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php @@ -0,0 +1,401 @@ + + */ +class AccountHolderResource extends Resource +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolderId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'accountHolderId' => 'accountHolderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('accountHolderId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['accountHolderId'] === null) { + $invalidProperties[] = "'accountHolderId' 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 accountHolderId + * + * @return string + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * Sets accountHolderId + * + * @param string $accountHolderId The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.php b/src/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.php new file mode 100644 index 000000000..d3eccdfeb --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/AccountHolderResourceAllOf.php @@ -0,0 +1,404 @@ + + */ +class AccountHolderResourceAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AccountHolderResource_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'accountHolderId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'accountHolderId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'accountHolderId' => 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 = [ + 'accountHolderId' => 'accountHolderId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'accountHolderId' => 'setAccountHolderId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'accountHolderId' => 'getAccountHolderId' + ]; + + /** + * 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('accountHolderId', $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 accountHolderId + * + * @return string|null + */ + public function getAccountHolderId() + { + return $this->container['accountHolderId']; + } + + /** + * Sets accountHolderId + * + * @param string|null $accountHolderId The unique identifier of the resource connected to the component. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the account holder linked to the balance account shown in the component. + * + * @return self + */ + public function setAccountHolderId($accountHolderId) + { + $this->container['accountHolderId'] = $accountHolderId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.php b/src/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.php new file mode 100644 index 000000000..c55602ed8 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/AuthenticationSessionRequest.php @@ -0,0 +1,475 @@ + + */ +class AuthenticationSessionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationSessionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'allowOrigin' => 'string', + 'policy' => '\Adyen\Model\SessionAuthentication\Policy', + 'product' => '\Adyen\Model\SessionAuthentication\ProductType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'allowOrigin' => null, + 'policy' => null, + 'product' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'allowOrigin' => false, + 'policy' => false, + 'product' => 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 = [ + 'allowOrigin' => 'allowOrigin', + 'policy' => 'policy', + 'product' => 'product' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'allowOrigin' => 'setAllowOrigin', + 'policy' => 'setPolicy', + 'product' => 'setProduct' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'allowOrigin' => 'getAllowOrigin', + 'policy' => 'getPolicy', + 'product' => 'getProduct' + ]; + + /** + * 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('allowOrigin', $data ?? [], null); + $this->setIfExists('policy', $data ?? [], null); + $this->setIfExists('product', $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['allowOrigin'] === null) { + $invalidProperties[] = "'allowOrigin' can't be null"; + } + if ($this->container['policy'] === null) { + $invalidProperties[] = "'policy' can't be null"; + } + if ($this->container['product'] === null) { + $invalidProperties[] = "'product' 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 allowOrigin + * + * @return string + */ + public function getAllowOrigin() + { + return $this->container['allowOrigin']; + } + + /** + * Sets allowOrigin + * + * @param string $allowOrigin The URL where the component will appear. In your live environment, you must protect the URL with an SSL certificate and ensure that it starts with `https://`. + * + * @return self + */ + public function setAllowOrigin($allowOrigin) + { + $this->container['allowOrigin'] = $allowOrigin; + + return $this; + } + + /** + * Gets policy + * + * @return \Adyen\Model\SessionAuthentication\Policy + */ + public function getPolicy() + { + return $this->container['policy']; + } + + /** + * Sets policy + * + * @param \Adyen\Model\SessionAuthentication\Policy $policy policy + * + * @return self + */ + public function setPolicy($policy) + { + $this->container['policy'] = $policy; + + return $this; + } + + /** + * Gets product + * + * @return \Adyen\Model\SessionAuthentication\ProductType + */ + public function getProduct() + { + return $this->container['product']; + } + + /** + * Sets product + * + * @param \Adyen\Model\SessionAuthentication\ProductType $product product + * + * @return self + */ + public function setProduct($product) + { + $this->container['product'] = $product; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.php b/src/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.php new file mode 100644 index 000000000..6df9a0190 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/AuthenticationSessionResponse.php @@ -0,0 +1,435 @@ + + */ +class AuthenticationSessionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuthenticationSessionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'id' => false, + 'token' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'token' => 'token' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'token' => 'setToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'token' => 'getToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier of the session. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets token + * + * @return string|null + */ + public function getToken() + { + return $this->container['token']; + } + + /** + * Sets token + * + * @param string|null $token The session token created. + * + * @return self + */ + public function setToken($token) + { + $this->container['token'] = $token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php b/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php new file mode 100644 index 000000000..a484855a2 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php @@ -0,0 +1,401 @@ + + */ +class BalanceAccountResource extends Resource +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'balanceAccountId' => 'balanceAccountId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('balanceAccountId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['balanceAccountId'] === null) { + $invalidProperties[] = "'balanceAccountId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balanceAccountId + * + * @return string + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string $balanceAccountId balanceAccountId + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.php b/src/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.php new file mode 100644 index 000000000..620366c3d --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/BalanceAccountResourceAllOf.php @@ -0,0 +1,404 @@ + + */ +class BalanceAccountResourceAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'BalanceAccountResource_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'balanceAccountId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'balanceAccountId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'balanceAccountId' => 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' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'balanceAccountId' => 'setBalanceAccountId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'balanceAccountId' => 'getBalanceAccountId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('balanceAccountId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets balanceAccountId + * + * @return string|null + */ + public function getBalanceAccountId() + { + return $this->container['balanceAccountId']; + } + + /** + * Sets balanceAccountId + * + * @param string|null $balanceAccountId balanceAccountId + * + * @return self + */ + public function setBalanceAccountId($balanceAccountId) + { + $this->container['balanceAccountId'] = $balanceAccountId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.php b/src/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.php new file mode 100644 index 000000000..d462d3474 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/DefaultErrorResponseEntity.php @@ -0,0 +1,623 @@ + + */ +class DefaultErrorResponseEntity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'DefaultErrorResponseEntity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'detail' => 'string', + 'errorCode' => 'string', + 'instance' => 'string', + 'invalidFields' => '\Adyen\Model\SessionAuthentication\InvalidField[]', + 'requestId' => 'string', + 'status' => 'int', + 'title' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'detail' => null, + 'errorCode' => null, + 'instance' => null, + 'invalidFields' => null, + 'requestId' => null, + 'status' => 'int32', + 'title' => null, + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'detail' => false, + 'errorCode' => false, + 'instance' => false, + 'invalidFields' => false, + 'requestId' => false, + 'status' => true, + 'title' => 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 = [ + 'detail' => 'detail', + 'errorCode' => 'errorCode', + 'instance' => 'instance', + 'invalidFields' => 'invalidFields', + 'requestId' => 'requestId', + 'status' => 'status', + 'title' => 'title', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'detail' => 'setDetail', + 'errorCode' => 'setErrorCode', + 'instance' => 'setInstance', + 'invalidFields' => 'setInvalidFields', + 'requestId' => 'setRequestId', + 'status' => 'setStatus', + 'title' => 'setTitle', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'detail' => 'getDetail', + 'errorCode' => 'getErrorCode', + 'instance' => 'getInstance', + 'invalidFields' => 'getInvalidFields', + 'requestId' => 'getRequestId', + 'status' => 'getStatus', + 'title' => 'getTitle', + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('detail', $data ?? [], null); + $this->setIfExists('errorCode', $data ?? [], null); + $this->setIfExists('instance', $data ?? [], null); + $this->setIfExists('invalidFields', $data ?? [], null); + $this->setIfExists('requestId', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets detail + * + * @return string|null + */ + public function getDetail() + { + return $this->container['detail']; + } + + /** + * Sets detail + * + * @param string|null $detail A human-readable explanation specific to this occurrence of the problem. + * + * @return self + */ + public function setDetail($detail) + { + $this->container['detail'] = $detail; + + return $this; + } + + /** + * Gets errorCode + * + * @return string|null + */ + public function getErrorCode() + { + return $this->container['errorCode']; + } + + /** + * Sets errorCode + * + * @param string|null $errorCode Unique business error code. + * + * @return self + */ + public function setErrorCode($errorCode) + { + $this->container['errorCode'] = $errorCode; + + return $this; + } + + /** + * Gets instance + * + * @return string|null + */ + public function getInstance() + { + return $this->container['instance']; + } + + /** + * Sets instance + * + * @param string|null $instance A URI that identifies the specific occurrence of the problem if applicable. + * + * @return self + */ + public function setInstance($instance) + { + $this->container['instance'] = $instance; + + return $this; + } + + /** + * Gets invalidFields + * + * @return \Adyen\Model\SessionAuthentication\InvalidField[]|null + */ + public function getInvalidFields() + { + return $this->container['invalidFields']; + } + + /** + * Sets invalidFields + * + * @param \Adyen\Model\SessionAuthentication\InvalidField[]|null $invalidFields Array of fields with validation errors when applicable. + * + * @return self + */ + public function setInvalidFields($invalidFields) + { + $this->container['invalidFields'] = $invalidFields; + + return $this; + } + + /** + * Gets requestId + * + * @return string|null + */ + public function getRequestId() + { + return $this->container['requestId']; + } + + /** + * Sets requestId + * + * @param string|null $requestId The unique reference for the request. + * + * @return self + */ + public function setRequestId($requestId) + { + $this->container['requestId'] = $requestId; + + return $this; + } + + /** + * Gets status + * + * @return int|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param int|null $status The HTTP status code. + * + * @return self + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets title + * + * @return string|null + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string|null $title A short, human-readable summary of the problem type. + * + * @return self + */ + public function setTitle($title) + { + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type A URI that identifies the validation error type. It points to human-readable documentation for the problem type. + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/InvalidField.php b/src/Adyen/Model/SessionAuthentication/InvalidField.php new file mode 100644 index 000000000..8aa01819b --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/InvalidField.php @@ -0,0 +1,475 @@ + + */ +class InvalidField implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'InvalidField'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'value' => 'string', + 'message' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'value' => null, + 'message' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'name' => false, + 'value' => false, + 'message' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'value' => 'value', + 'message' => 'message' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'value' => 'setValue', + 'message' => 'setMessage' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'value' => 'getValue', + 'message' => 'getMessage' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name The field that has an invalid value. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The invalid value. + * + * @return self + */ + public function setValue($value) + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message Description of the validation error. + * + * @return self + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php b/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php new file mode 100644 index 000000000..1ee77891c --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php @@ -0,0 +1,401 @@ + + */ +class LegalEntityResource extends Resource +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LegalEntityResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'legalEntityId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'legalEntityId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'legalEntityId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'legalEntityId' => 'legalEntityId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'legalEntityId' => 'setLegalEntityId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'legalEntityId' => 'getLegalEntityId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('legalEntityId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['legalEntityId'] === null) { + $invalidProperties[] = "'legalEntityId' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets legalEntityId + * + * @return string + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string $legalEntityId The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + * + * @return self + */ + public function setLegalEntityId($legalEntityId) + { + $this->container['legalEntityId'] = $legalEntityId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.php b/src/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.php new file mode 100644 index 000000000..9461de610 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/LegalEntityResourceAllOf.php @@ -0,0 +1,404 @@ + + */ +class LegalEntityResourceAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LegalEntityResource_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'legalEntityId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'legalEntityId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'legalEntityId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'legalEntityId' => 'legalEntityId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'legalEntityId' => 'setLegalEntityId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'legalEntityId' => 'getLegalEntityId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('legalEntityId', $data ?? [], null); + } + + /** + * 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 legalEntityId + * + * @return string|null + */ + public function getLegalEntityId() + { + return $this->container['legalEntityId']; + } + + /** + * Sets legalEntityId + * + * @param string|null $legalEntityId The unique identifier of the resource connected to the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the legal entity that has a contractual relationship with your platform and owns the [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments). For sole proprietorships, this is the legal entity of the individual owner. + * + * @return self + */ + public function setLegalEntityId($legalEntityId) + { + $this->container['legalEntityId'] = $legalEntityId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php b/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php new file mode 100644 index 000000000..a797941a8 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php @@ -0,0 +1,398 @@ + + */ +class MerchantAccountResource extends Resource +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantAccountResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchantAccountCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchantAccountCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchantAccountCode' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'merchantAccountCode' => 'merchantAccountCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchantAccountCode' => 'setMerchantAccountCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchantAccountCode' => 'getMerchantAccountCode' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('merchantAccountCode', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets merchantAccountCode + * + * @return string|null + */ + public function getMerchantAccountCode() + { + return $this->container['merchantAccountCode']; + } + + /** + * Sets merchantAccountCode + * + * @param string|null $merchantAccountCode merchantAccountCode + * + * @return self + */ + public function setMerchantAccountCode($merchantAccountCode) + { + $this->container['merchantAccountCode'] = $merchantAccountCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.php b/src/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.php new file mode 100644 index 000000000..1f844b89e --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/MerchantAccountResourceAllOf.php @@ -0,0 +1,404 @@ + + */ +class MerchantAccountResourceAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MerchantAccountResource_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'merchantAccountCode' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'merchantAccountCode' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'merchantAccountCode' => 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 = [ + 'merchantAccountCode' => 'merchantAccountCode' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'merchantAccountCode' => 'setMerchantAccountCode' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'merchantAccountCode' => 'getMerchantAccountCode' + ]; + + /** + * 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('merchantAccountCode', $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 merchantAccountCode + * + * @return string|null + */ + public function getMerchantAccountCode() + { + return $this->container['merchantAccountCode']; + } + + /** + * Sets merchantAccountCode + * + * @param string|null $merchantAccountCode merchantAccountCode + * + * @return self + */ + public function setMerchantAccountCode($merchantAccountCode) + { + $this->container['merchantAccountCode'] = $merchantAccountCode; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/ModelInterface.php b/src/Adyen/Model/SessionAuthentication/ModelInterface.php new file mode 100644 index 000000000..7780db481 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/ModelInterface.php @@ -0,0 +1,92 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\Adyen\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php new file mode 100644 index 000000000..b4abbe33d --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php @@ -0,0 +1,401 @@ + + */ +class PaymentInstrumentResource extends Resource +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentResource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentInstrumentId' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes + parent::openAPITypes(); + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats + parent::openAPIFormats(); + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables + parent::openAPINullables(); + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'paymentInstrumentId' => 'paymentInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentInstrumentId' => 'setPaymentInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentInstrumentId' => 'getPaymentInstrumentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return parent::attributeMap() + self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return parent::setters() + self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return parent::getters() + self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + parent::__construct($data); + + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = parent::listInvalidProperties(); + + if ($this->container['paymentInstrumentId'] === null) { + $invalidProperties[] = "'paymentInstrumentId' 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 paymentInstrumentId + * + * @return string + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string $paymentInstrumentId paymentInstrumentId + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.php b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.php new file mode 100644 index 000000000..e5985204e --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResourceAllOf.php @@ -0,0 +1,404 @@ + + */ +class PaymentInstrumentResourceAllOf implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PaymentInstrumentResource_allOf'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'paymentInstrumentId' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'paymentInstrumentId' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'paymentInstrumentId' => 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 = [ + 'paymentInstrumentId' => 'paymentInstrumentId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'paymentInstrumentId' => 'setPaymentInstrumentId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'paymentInstrumentId' => 'getPaymentInstrumentId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('paymentInstrumentId', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets paymentInstrumentId + * + * @return string|null + */ + public function getPaymentInstrumentId() + { + return $this->container['paymentInstrumentId']; + } + + /** + * Sets paymentInstrumentId + * + * @param string|null $paymentInstrumentId paymentInstrumentId + * + * @return self + */ + public function setPaymentInstrumentId($paymentInstrumentId) + { + $this->container['paymentInstrumentId'] = $paymentInstrumentId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/Policy.php b/src/Adyen/Model/SessionAuthentication/Policy.php new file mode 100644 index 000000000..b0f9d762a --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/Policy.php @@ -0,0 +1,435 @@ + + */ +class Policy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Policy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'resources' => '\Adyen\Model\SessionAuthentication\Resource[]', + 'roles' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'resources' => null, + 'roles' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'resources' => false, + 'roles' => 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 = [ + 'resources' => 'resources', + 'roles' => 'roles' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'resources' => 'setResources', + 'roles' => 'setRoles' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'resources' => 'getResources', + 'roles' => 'getRoles' + ]; + + /** + * 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('resources', $data ?? [], null); + $this->setIfExists('roles', $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 resources + * + * @return \Adyen\Model\SessionAuthentication\Resource[]|null + */ + public function getResources() + { + return $this->container['resources']; + } + + /** + * Sets resources + * + * @param \Adyen\Model\SessionAuthentication\Resource[]|null $resources An object containing the type and the unique identifier of the user of the component. For [Onboarding components](https://docs.adyen.com/platforms/onboard-users/components), this is the ID of the legal entity that has a contractual relationship with your platform. For sole proprietorships, use the ID of the legal entity of the individual owner. For [Platform Experience components](https://docs.adyen.com/platforms/build-user-dashboards), this is the ID of the account holder that is associated with the balance account shown in the component. + * + * @return self + */ + public function setResources($resources) + { + $this->container['resources'] = $resources; + + return $this; + } + + /** + * Gets roles + * + * @return string[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param string[]|null $roles The name of the role required to use the component. + * + * @return self + */ + public function setRoles($roles) + { + $this->container['roles'] = $roles; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/ProductType.php b/src/Adyen/Model/SessionAuthentication/ProductType.php new file mode 100644 index 000000000..c33344a98 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/ProductType.php @@ -0,0 +1,48 @@ + + */ +class Resource implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Resource'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'type' => '\Adyen\Model\SessionAuthentication\ResourceType' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static $openAPINullables = [ + 'type' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return \Adyen\Model\SessionAuthentication\ResourceType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Adyen\Model\SessionAuthentication\ResourceType|null $type type + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + public function toArray(): array + { + $array = []; + foreach (self::$openAPITypes as $propertyName => $propertyType) { + $propertyValue = $this[$propertyName]; + if ($propertyValue !== null) { + // Check if the property value is an object and has a toArray() method + if (is_object($propertyValue) && method_exists($propertyValue, 'toArray')) { + $array[$propertyName] = $propertyValue->toArray(); + // Check if it's type datetime + } elseif ($propertyValue instanceof \DateTime) { + $array[$propertyName] = $propertyValue->format(DATE_ATOM); + // If it's an array type we should check whether it contains objects and if so call toArray method + } elseif (is_array($propertyValue)) { + $array[$propertyName] = array_map(function ($item) { + return $item instanceof ModelInterface ? $item->toArray() : $item; + }, $propertyValue); + } else { + // Otherwise, directly assign the property value to the array + $array[$propertyName] = $propertyValue; + } + } + } + return $array; + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } +} diff --git a/src/Adyen/Model/SessionAuthentication/ResourceType.php b/src/Adyen/Model/SessionAuthentication/ResourceType.php new file mode 100644 index 000000000..92f36f0f2 --- /dev/null +++ b/src/Adyen/Model/SessionAuthentication/ResourceType.php @@ -0,0 +1,54 @@ + '\Adyen\Model\Transfers\PartyIdentification', - 'accountIdentification' => '\Adyen\Model\Transfers\BankAccountV3AccountIdentification' + 'accountIdentification' => '\Adyen\Model\Transfers\BankAccountV3AccountIdentification', + 'storedPaymentMethodId' => 'string' ]; /** @@ -54,7 +55,8 @@ class BankAccountV3 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'accountHolder' => null, - 'accountIdentification' => null + 'accountIdentification' => null, + 'storedPaymentMethodId' => null ]; /** @@ -64,7 +66,8 @@ class BankAccountV3 implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPINullables = [ 'accountHolder' => false, - 'accountIdentification' => false + 'accountIdentification' => false, + 'storedPaymentMethodId' => false ]; /** @@ -154,7 +157,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'accountHolder' => 'accountHolder', - 'accountIdentification' => 'accountIdentification' + 'accountIdentification' => 'accountIdentification', + 'storedPaymentMethodId' => 'storedPaymentMethodId' ]; /** @@ -164,7 +168,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'accountHolder' => 'setAccountHolder', - 'accountIdentification' => 'setAccountIdentification' + 'accountIdentification' => 'setAccountIdentification', + 'storedPaymentMethodId' => 'setStoredPaymentMethodId' ]; /** @@ -174,7 +179,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'accountHolder' => 'getAccountHolder', - 'accountIdentification' => 'getAccountIdentification' + 'accountIdentification' => 'getAccountIdentification', + 'storedPaymentMethodId' => 'getStoredPaymentMethodId' ]; /** @@ -236,6 +242,7 @@ public function __construct(?array $data = null) { $this->setIfExists('accountHolder', $data ?? [], null); $this->setIfExists('accountIdentification', $data ?? [], null); + $this->setIfExists('storedPaymentMethodId', $data ?? [], null); } /** @@ -333,6 +340,30 @@ public function setAccountIdentification($accountIdentification) return $this; } + + /** + * Gets storedPaymentMethodId + * + * @return string|null + */ + public function getStoredPaymentMethodId() + { + return $this->container['storedPaymentMethodId']; + } + + /** + * Sets storedPaymentMethodId + * + * @param string|null $storedPaymentMethodId The unique token that identifies the stored bank account details of the counterparty for a payout. + * + * @return self + */ + public function setStoredPaymentMethodId($storedPaymentMethodId) + { + $this->container['storedPaymentMethodId'] = $storedPaymentMethodId; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/src/Adyen/Model/Transfers/BankCategoryData.php b/src/Adyen/Model/Transfers/BankCategoryData.php index c042319dd..428ada1a2 100644 --- a/src/Adyen/Model/Transfers/BankCategoryData.php +++ b/src/Adyen/Model/Transfers/BankCategoryData.php @@ -345,7 +345,7 @@ public function getPriority() /** * 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. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ diff --git a/src/Adyen/Model/Transfers/ConfirmationTrackingData.php b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php index 5dc6faa9c..04ab2cf2a 100644 --- a/src/Adyen/Model/Transfers/ConfirmationTrackingData.php +++ b/src/Adyen/Model/Transfers/ConfirmationTrackingData.php @@ -219,6 +219,7 @@ public function getModelName() } public const STATUS_CREDITED = 'credited'; + public const STATUS_ACCEPTED = 'accepted'; public const TYPE_CONFIRMATION = 'confirmation'; /** @@ -230,6 +231,7 @@ public function getStatusAllowableValues() { return [ self::STATUS_CREDITED, + self::STATUS_ACCEPTED, ]; } /** @@ -341,7 +343,7 @@ public function getStatus() /** * Sets status * - * @param string $status The status of the transfer. Possible values: - **credited**: the funds are credited to your user's transfer instrument or bank account. + * @param string $status The status of the transfer. Possible values: - **credited**: the funds are credited to your user's transfer instrument or bank account.- **accepted**: the request is accepted by the integration. * * @return self */ diff --git a/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php index 9ea2682a9..490eea6ce 100644 --- a/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php +++ b/src/Adyen/Model/Transfers/HKLocalAccountIdentification.php @@ -330,7 +330,7 @@ public function getAccountNumber() /** * Sets accountNumber * - * @param string $accountNumber The 9- to 15-character bank account number (alphanumeric), without separators or whitespace. Starts with the 3-digit branch code. + * @param string $accountNumber The 9- to 17-digit bank account number, without separators or whitespace. Starts with the 3-digit branch code. * * @return self */ diff --git a/src/Adyen/Model/Transfers/ObjectSerializer.php b/src/Adyen/Model/Transfers/ObjectSerializer.php index 3f9686bb8..28b7de158 100644 --- a/src/Adyen/Model/Transfers/ObjectSerializer.php +++ b/src/Adyen/Model/Transfers/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,9 +118,7 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) { - return $timestamp; - } + if (!is_string($timestamp)) return $timestamp; return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/Transfers/PlatformPayment.php b/src/Adyen/Model/Transfers/PlatformPayment.php index 1478baa80..9d108a989 100644 --- a/src/Adyen/Model/Transfers/PlatformPayment.php +++ b/src/Adyen/Model/Transfers/PlatformPayment.php @@ -467,7 +467,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **DCCPlatformCommission**: for the DCC Commission for the platform on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked to your user after the deduction of the relevant fees. * **Commission**: Your platform's or marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your user's balance account. * **VAT**: The value-added tax charged on the payment. * * @return self */ diff --git a/src/Adyen/Model/Transfers/RoutingDetails.php b/src/Adyen/Model/Transfers/RoutingDetails.php index a0d60f71f..b56f5c2a0 100644 --- a/src/Adyen/Model/Transfers/RoutingDetails.php +++ b/src/Adyen/Model/Transfers/RoutingDetails.php @@ -386,7 +386,7 @@ public function getPriority() /** * 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. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ diff --git a/src/Adyen/Model/Transfers/Transfer.php b/src/Adyen/Model/Transfers/Transfer.php index 36b1fd07e..38480a797 100644 --- a/src/Adyen/Model/Transfers/Transfer.php +++ b/src/Adyen/Model/Transfers/Transfer.php @@ -357,6 +357,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; @@ -524,6 +525,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; @@ -874,7 +876,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * @param string $category The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A transfer between [balance accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - **platformPayment**: Funds movements related to payments that are acquired for your users. - **topUp**: An incoming transfer initiated by your user to top up their balance account. * * @return self */ @@ -1266,7 +1268,7 @@ public function getStatus() /** * Sets status * - * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. + * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferCategoryData.php b/src/Adyen/Model/Transfers/TransferCategoryData.php index 68f12aa94..81259ae20 100644 --- a/src/Adyen/Model/Transfers/TransferCategoryData.php +++ b/src/Adyen/Model/Transfers/TransferCategoryData.php @@ -390,7 +390,7 @@ public function getPriority() /** * 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. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ @@ -702,7 +702,7 @@ public function getPlatformPaymentType() /** * Sets platformPaymentType * - * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: for the acquiring fee incurred on a transaction. * **AdyenCommission**: for the transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: for all the transaction fees due to Adyen. This is the sum of Adyen's commission and Adyen's markup. * **AdyenMarkup**: for the transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: or the sale amount of a transaction. * **Commission**: for your platform's commission on a transaction. * **DCCPlatformCommission**: for the DCC Commission for the platform on a transaction. * **Interchange**: for the interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: for all of the transaction fees. * **Remainder**: for the left over amount after currency conversion. * **SchemeFee**: for the scheme fee incurred on a transaction. This is the sum of the interchange fees and the acquiring fees. * **Surcharge**: for the surcharge paid by the customer on a transaction. * **Tip**: for the tip paid by the customer. * **TopUp**: for an incoming transfer to top up your user's balance account. * **VAT**: for the Value Added Tax. + * @param string|null $platformPaymentType Specifies the nature of the transfer. This parameter helps categorize transfers so you can reconcile transactions at a later time, using the Balance Platform Accounting Report for [marketplaces](https://docs.adyen.com/marketplaces/reports-and-fees/balance-platform-accounting-report/) or [platforms](https://docs.adyen.com/platforms/reports-and-fees/balance-platform-accounting-report/). Possible values: * **AcquiringFees**: The acquiring fee (the aggregated amount of interchange and scheme fee) incurred on a transaction. * **AdyenCommission**: The transaction fee due to Adyen under [blended rates](https://www.adyen.com/knowledge-hub/guides/payments-training-guide/get-the-best-from-your-card-processing). * **AdyenFees**: All transaction fees due to Adyen. This is the aggregated amount of Adyen's commission and markup. * **AdyenMarkup**: The transaction fee due to Adyen under [Interchange++ pricing](https://www.adyen.com/pricing). * **BalanceAccount**: The amount booked to your user after the deduction of the relevant fees. * **Commission**: Your platform's or marketplace's commission on a transaction. * **DCCPlatformCommission**: The Dynamic Currency Conversion (DCC) fee on a transaction. * **Interchange**: The interchange fee (fee paid to the issuer) incurred on a transaction. * **PaymentFee**: The aggregated amount of all transaction fees. * **Remainder**: The leftover amount after currency conversion. * **SchemeFee**: The scheme fee incurred on a transaction. * **Surcharge**: The surcharge paid by the customer on a transaction. * **Tip**: The tip paid by the customer. * **TopUp**: An incoming transfer to top up your user's balance account. * **VAT**: The value-added tax charged on the payment. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferData.php b/src/Adyen/Model/Transfers/TransferData.php index 154fdfc96..c73c6c76f 100644 --- a/src/Adyen/Model/Transfers/TransferData.php +++ b/src/Adyen/Model/Transfers/TransferData.php @@ -411,6 +411,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; @@ -578,6 +579,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; @@ -982,7 +984,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * @param string $category The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A transfer between [balance accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - **platformPayment**: Funds movements related to payments that are acquired for your users. - **topUp**: An incoming transfer initiated by your user to top up their balance account. * * @return self */ @@ -1470,7 +1472,7 @@ public function getStatus() /** * Sets status * - * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. + * @param string $status The result of the transfer. For example: - **received**: an outgoing transfer request is created. - **refused**: the transfer request is rejected by Adyen for one of the following reasons: - Lack of funds in the balance account. - Transfer limit exceeded. - Transaction rule requirements violated. - **authorised**: the transfer request is authorized and the funds are reserved. - **booked**: the funds are deducted from your user's balance account. - **failed**: the transfer is rejected by the counterparty's bank. - **returned**: the transfer is returned by the counterparty's bank. * * @return self */ diff --git a/src/Adyen/Model/Transfers/TransferEvent.php b/src/Adyen/Model/Transfers/TransferEvent.php index 7bf9576fc..b7bf3cad4 100644 --- a/src/Adyen/Model/Transfers/TransferEvent.php +++ b/src/Adyen/Model/Transfers/TransferEvent.php @@ -337,6 +337,7 @@ public function getModelName() public const REASON_REFUSED_BY_CUSTOMER = 'refusedByCustomer'; public const REASON_ROUTE_NOT_FOUND = 'routeNotFound'; public const REASON_SCA_FAILED = 'scaFailed'; + public const REASON_SCHEME_ADVICE = 'schemeAdvice'; public const REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST = 'transferInstrumentDoesNotExist'; public const REASON_UNKNOWN = 'unknown'; public const STATUS_APPROVAL_PENDING = 'approvalPending'; @@ -440,6 +441,7 @@ public function getReasonAllowableValues() self::REASON_REFUSED_BY_CUSTOMER, self::REASON_ROUTE_NOT_FOUND, self::REASON_SCA_FAILED, + self::REASON_SCHEME_ADVICE, self::REASON_TRANSFER_INSTRUMENT_DOES_NOT_EXIST, self::REASON_UNKNOWN, ]; diff --git a/src/Adyen/Model/Transfers/TransferInfo.php b/src/Adyen/Model/Transfers/TransferInfo.php index 5ddf5e5cc..1680fc321 100644 --- a/src/Adyen/Model/Transfers/TransferInfo.php +++ b/src/Adyen/Model/Transfers/TransferInfo.php @@ -543,7 +543,7 @@ public function getCategory() /** * Sets category * - * @param string $category The category of the transfer. Possible values: - **bank**: a transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **card**: a transfer involving a third-party card. - **internal**: a transfer between [balance accounts](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: a transfer initiated by a Adyen-issued card. - **platformPayment**: funds movements related to payments that are acquired for your users. - **topUp**: an incoming transfer initiated by your user to top up their balance account. + * @param string $category The category of the transfer. Possible values: - **bank**: A transfer involving a [transfer instrument](https://docs.adyen.com/api-explorer/legalentity/latest/post/transferInstruments#responses-200-id) or a bank account. - **card**: A transfer involving a third-party card. - **internal**: A transfer between [balance accounts](https://docs.adyen.com/api-explorer/balanceplatform/latest/post/balanceAccounts#responses-200-id) within your platform. - **issuedCard**: A transfer initiated by an Adyen-issued card. - **platformPayment**: Funds movements related to payments that are acquired for your users. - **topUp**: An incoming transfer initiated by your user to top up their balance account. * * @return self */ @@ -673,7 +673,7 @@ public function getPriorities() /** * 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 you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). Required for transfers with `category` **bank**. For more details, see [fallback priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-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 you list first. If that's not possible, it moves on to the next option in the order of your provided priorities. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). Required for transfers with `category` **bank**. For more details, see [fallback priorities](https://docs.adyen.com/payouts/payout-service/payout-to-users/#fallback-priorities). * * @return self */ @@ -706,7 +706,7 @@ public function getPriority() /** * 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. Required for transfers with `category` **bank**. Possible values: * **regular**: for normal, low-value transactions. * **fast**: a faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: the fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: for instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: for high-value transfers to a recipient in a different country. * **internal**: for transfers to an Adyen-issued business bank account (by bank account number/IBAN). + * @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. Required for transfers with `category` **bank**. Possible values: * **regular**: For normal, low-value transactions. * **fast**: A faster way to transfer funds, but the fees are higher. Recommended for high-priority, low-value transactions. * **wire**: The fastest way to transfer funds, but this has the highest fees. Recommended for high-priority, high-value transactions. * **instant**: For instant funds transfers within the United States and in [SEPA locations](https://www.ecb.europa.eu/paym/integration/retail/sepa/html/index.en.html). * **crossBorder**: For high-value transfers to a recipient in a different country. * **internal**: For transfers to an Adyen-issued business bank account (by bank account number/IBAN). * * @return self */ diff --git a/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php b/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php index a1d3bc3bd..7b30b6e2e 100644 --- a/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php +++ b/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php @@ -45,13 +45,14 @@ public function __construct(Client $client) * @param string $paymentInstrumentId * @param \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers * @param array|null $requestOptions - + * @throws AdyenException */ public function createAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('POST'), (array) $authorisedCardUsers->jsonSerialize(), $requestOptions); + } /** @@ -59,13 +60,14 @@ public function createAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Mo * * @param string $paymentInstrumentId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAuthorisedCardUsers(string $paymentInstrumentId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** @@ -89,12 +91,13 @@ public function getAllAuthorisedCardUsers(string $paymentInstrumentId, ?array $r * @param string $paymentInstrumentId * @param \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers * @param array|null $requestOptions - + * @throws AdyenException */ public function updateAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $authorisedCardUsers->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 1f043d320..46eef3f9c 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -76,13 +76,14 @@ public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatfo * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/BalancesApi.php b/src/Adyen/Service/BalancePlatform/BalancesApi.php new file mode 100644 index 000000000..9f2ddb539 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/BalancesApi.php @@ -0,0 +1,126 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Create a balance webhook setting + * + * @param string $balancePlatformId + * @param string $webhookId + * @param \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfo $balanceWebhookSettingInfo + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function createWebhookSetting(string $balancePlatformId, string $webhookId, \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfo $balanceWebhookSettingInfo, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}'], [$balancePlatformId, $webhookId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $balanceWebhookSettingInfo->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } + + /** + * Delete a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function deleteWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + + } + + /** + * Get all balance webhook settings + * + * @param string $balancePlatformId + * @param string $webhookId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSettings + * @throws AdyenException + */ + public function getAllWebhookSettings(string $balancePlatformId, string $webhookId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSettings + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}'], [$balancePlatformId, $webhookId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSettings::class); + } + + /** + * Get a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function getWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } + + /** + * Update a balance webhook setting by id + * + * @param string $balancePlatformId + * @param string $webhookId + * @param string $settingId + * @param \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfoUpdate $balanceWebhookSettingInfoUpdate + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\WebhookSetting + * @throws AdyenException + */ + public function updateWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, \Adyen\Model\BalancePlatform\BalanceWebhookSettingInfoUpdate $balanceWebhookSettingInfoUpdate, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\WebhookSetting + { + $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $balanceWebhookSettingInfoUpdate->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\WebhookSetting::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index 8a8476931..420a1e8c2 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,12 +44,13 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php index fe3e6ff4f..853ba8dba 100644 --- a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -76,13 +76,14 @@ public function completeRegistrationOfScaDevice(string $id, \Adyen\Model\Balance * * @param string $id * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string]] - + * @throws AdyenException */ public function deleteRegistrationOfScaDevice(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php index 37f29b8d0..d3fdb6621 100644 --- a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -60,12 +60,13 @@ public function getNetworkToken(string $networkTokenId, ?array $requestOptions = * @param string $networkTokenId * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php new file mode 100644 index 000000000..e33c2d2c2 --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php @@ -0,0 +1,85 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Approve a pending approval association + * + * @param \Adyen\Model\BalancePlatform\ApproveAssociationRequest $approveAssociationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\ApproveAssociationResponse + * @throws AdyenException + */ + public function approveAssociation(\Adyen\Model\BalancePlatform\ApproveAssociationRequest $approveAssociationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\ApproveAssociationResponse + { + $endpoint = $this->baseURL . "/scaAssociations"; + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $approveAssociationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ApproveAssociationResponse::class); + } + + /** + * Get a list of devices associated with an entity + * + * @param array|null $requestOptions ['queryParams' => ['entityType'=> ScaEntityType, 'entityId'=> string, 'pageSize'=> int, 'pageNumber'=> int]] + * @return \Adyen\Model\BalancePlatform\ListAssociationsResponse + * @throws AdyenException + */ + public function listAssociations(?array $requestOptions = null): \Adyen\Model\BalancePlatform\ListAssociationsResponse + { + $endpoint = $this->baseURL . "/scaAssociations"; + $response = $this->requestHttp($endpoint, strtolower('GET'), null, $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\ListAssociationsResponse::class); + } + + /** + * Delete association to devices + * + * @param \Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function removeAssociation(\Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . "/scaAssociations"; + $this->requestHttp($endpoint, strtolower('DELETE'), (array) $removeAssociationRequest->jsonSerialize(), $requestOptions); + + } +} diff --git a/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php b/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php new file mode 100644 index 000000000..abdfa99db --- /dev/null +++ b/src/Adyen/Service/BalancePlatform/SCADeviceManagementApi.php @@ -0,0 +1,88 @@ +baseURL = $this->createBaseUrl("https://balanceplatform-api-test.adyen.com/bcl/v2"); + } + + /** + * Begin SCA device registration + * + * @param \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationRequest $beginScaDeviceRegistrationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse + * @throws AdyenException + */ + public function beginScaDeviceRegistration(\Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationRequest $beginScaDeviceRegistrationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse + { + $endpoint = $this->baseURL . "/scaDevices"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $beginScaDeviceRegistrationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\BeginScaDeviceRegistrationResponse::class); + } + + /** + * Finish registration process for a SCA device + * + * @param string $deviceId + * @param \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationRequest $finishScaDeviceRegistrationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse + * @throws AdyenException + */ + public function finishScaDeviceRegistration(string $deviceId, \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationRequest $finishScaDeviceRegistrationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse + { + $endpoint = $this->baseURL . str_replace(['{deviceId}'], [$deviceId], "/scaDevices/{deviceId}"); + $response = $this->requestHttp($endpoint, strtolower('PATCH'), (array) $finishScaDeviceRegistrationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\FinishScaDeviceRegistrationResponse::class); + } + + /** + * Create a new SCA association for a device + * + * @param string $deviceId + * @param \Adyen\Model\BalancePlatform\SubmitScaAssociationRequest $submitScaAssociationRequest + * @param array|null $requestOptions + * @return \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse + * @throws AdyenException + */ + public function submitScaAssociation(string $deviceId, \Adyen\Model\BalancePlatform\SubmitScaAssociationRequest $submitScaAssociationRequest, ?array $requestOptions = null): \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse + { + $endpoint = $this->baseURL . str_replace(['{deviceId}'], [$deviceId], "/scaDevices/{deviceId}/scaAssociations"); + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $submitScaAssociationRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\BalancePlatform\SubmitScaAssociationResponse::class); + } +} diff --git a/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php b/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php index 18f598993..ea8b82bb4 100644 --- a/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php +++ b/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php @@ -45,13 +45,14 @@ public function __construct(Client $client) * @param string $id * @param \Adyen\Model\BalancePlatform\ApproveTransferLimitRequest $approveTransferLimitRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approvePendingTransferLimits(string $id, \Adyen\Model\BalancePlatform\ApproveTransferLimitRequest $approveTransferLimitRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}/transferLimits/approve"); $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransferLimitRequest->jsonSerialize(), $requestOptions); + } /** @@ -76,13 +77,14 @@ public function createTransferLimit(string $id, \Adyen\Model\BalancePlatform\Cre * @param string $id * @param string $transferLimitId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePendingTransferLimit(string $id, string $transferLimitId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}', '{transferLimitId}'], [$id, $transferLimitId], "/balanceAccounts/{id}/transferLimits/{transferLimitId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php b/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php index 34121d895..bf1863db3 100644 --- a/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php +++ b/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php @@ -61,13 +61,14 @@ public function createTransferLimit(string $id, \Adyen\Model\BalancePlatform\Cre * @param string $id * @param string $transferLimitId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePendingTransferLimit(string $id, string $transferLimitId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}', '{transferLimitId}'], [$id, $transferLimitId], "/balancePlatforms/{id}/transferLimits/{transferLimitId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php index 33d080e1c..2cbf4fb8b 100644 --- a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php @@ -59,13 +59,14 @@ public function createBusinessLine(\Adyen\Model\LegalEntityManagement\BusinessLi * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteBusinessLine(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/businessLines/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index 485345850..7cfe2d19d 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteDocument(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php b/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php index 4d16220a9..e4dd92c79 100644 --- a/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php @@ -114,6 +114,21 @@ public function getLegalEntity(string $id, ?array $requestOptions = null): \Adye return ObjectSerializer::deserialize($response, \Adyen\Model\LegalEntityManagement\LegalEntity::class); } + /** + * Request periodic data review. + * + * @param string $id + * @param array|null $requestOptions + + * @throws AdyenException + */ + public function requestPeriodicReview(string $id, ?array $requestOptions = null) + { + $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/requestPeriodicReview"); + $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); + + } + /** * Update a legal entity * diff --git a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php index c4bab795a..c6b7abcf5 100644 --- a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php @@ -60,12 +60,13 @@ public function checkStatusOfConsentForElectronicDeliveryOfTaxForms(string $id, * @param string $id * @param \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function setConsentStatusForElectronicDeliveryOfTaxForms(string $id, \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/setTaxElectronicDeliveryConsent"); $this->requestHttp($endpoint, strtolower('POST'), (array) $setTaxElectronicDeliveryConsentRequest->jsonSerialize(), $requestOptions); + } } diff --git a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php index 8fe49fa59..e69341604 100644 --- a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php @@ -59,13 +59,14 @@ public function createTransferInstrument(\Adyen\Model\LegalEntityManagement\Tran * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteTransferInstrument(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/transferInstruments/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); + } /** diff --git a/src/Adyen/Service/SessionAuthentication/SessionAuthenticationApi.php b/src/Adyen/Service/SessionAuthentication/SessionAuthenticationApi.php new file mode 100644 index 000000000..27a883edc --- /dev/null +++ b/src/Adyen/Service/SessionAuthentication/SessionAuthenticationApi.php @@ -0,0 +1,56 @@ +baseURL = $this->createBaseUrl("https://test.adyen.com/authe/api/v1"); + } + + /** + * Create a session token + * + * @param \Adyen\Model\SessionAuthentication\AuthenticationSessionRequest $authenticationSessionRequest + * @param array|null $requestOptions + * @return \Adyen\Model\SessionAuthentication\AuthenticationSessionResponse + * @throws AdyenException + */ + public function createAuthenticationSession(\Adyen\Model\SessionAuthentication\AuthenticationSessionRequest $authenticationSessionRequest, ?array $requestOptions = null): \Adyen\Model\SessionAuthentication\AuthenticationSessionResponse + { + $endpoint = $this->baseURL . "/sessions"; + $response = $this->requestHttp($endpoint, strtolower('POST'), (array) $authenticationSessionRequest->jsonSerialize(), $requestOptions); + return ObjectSerializer::deserialize($response, \Adyen\Model\SessionAuthentication\AuthenticationSessionResponse::class); + } +} diff --git a/src/Adyen/Service/Transfers/TransfersApi.php b/src/Adyen/Service/Transfers/TransfersApi.php index 23ede4f10..598c2e878 100644 --- a/src/Adyen/Service/Transfers/TransfersApi.php +++ b/src/Adyen/Service/Transfers/TransfersApi.php @@ -44,13 +44,14 @@ public function __construct(Client $client) * * @param \Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/approve"; $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransfersRequest->jsonSerialize(), $requestOptions); + } /** @@ -58,13 +59,14 @@ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfer * * @param \Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function cancelInitiatedTransfers(\Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/cancel"; $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelTransfersRequest->jsonSerialize(), $requestOptions); + } /** From b5ee830567c915fe4cac1462fbe8db6bf9a361e9 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot Date: Wed, 19 Nov 2025 10:50:29 +0000 Subject: [PATCH 2/2] style(fmt): code formatted --- .../Model/BalancePlatform/AssociationStatus.php | 2 +- .../Model/BalancePlatform/BalanceWebhookSetting.php | 1 + .../Model/BalancePlatform/CapabilitySettings.php | 8 ++++---- src/Adyen/Model/BalancePlatform/LimitStatus.php | 2 +- src/Adyen/Model/BalancePlatform/ObjectSerializer.php | 6 ++++-- src/Adyen/Model/BalancePlatform/ScaDeviceType.php | 2 +- src/Adyen/Model/BalancePlatform/ScaEntityType.php | 2 +- src/Adyen/Model/BalancePlatform/ScaExemption.php | 2 +- src/Adyen/Model/BalancePlatform/ScaStatus.php | 2 +- src/Adyen/Model/BalancePlatform/Scope.php | 2 +- src/Adyen/Model/BalancePlatform/SettingType.php | 2 +- src/Adyen/Model/BalancePlatform/TransferType.php | 2 +- src/Adyen/Model/DataProtection/ObjectSerializer.php | 6 ++++-- src/Adyen/Model/LegalEntityManagement/Attachment.php | 8 ++++---- .../Model/LegalEntityManagement/BankAccountInfo.php | 4 ++-- src/Adyen/Model/LegalEntityManagement/Document.php | 12 ++++++------ .../LegalEntityManagement/IdentificationData.php | 4 ++-- .../Model/LegalEntityManagement/ObjectSerializer.php | 6 ++++-- .../SessionAuthentication/AccountHolderResource.php | 1 + .../SessionAuthentication/BalanceAccountResource.php | 1 + .../SessionAuthentication/LegalEntityResource.php | 1 + .../MerchantAccountResource.php | 1 + .../Model/SessionAuthentication/ObjectSerializer.php | 6 ++++-- .../PaymentInstrumentResource.php | 1 + .../Model/SessionAuthentication/ProductType.php | 2 +- .../Model/SessionAuthentication/ResourceType.php | 2 +- src/Adyen/Model/Transfers/ObjectSerializer.php | 6 ++++-- .../BalancePlatform/AuthorizedCardUsersApi.php | 9 +++------ .../Service/BalancePlatform/BalanceAccountsApi.php | 3 +-- src/Adyen/Service/BalancePlatform/BalancesApi.php | 3 +-- .../BalancePlatform/BankAccountValidationApi.php | 3 +-- .../Service/BalancePlatform/ManageSCADevicesApi.php | 3 +-- .../Service/BalancePlatform/NetworkTokensApi.php | 3 +-- .../BalancePlatform/SCAAssociationManagementApi.php | 3 +-- .../TransferLimitsBalanceAccountLevelApi.php | 6 ++---- .../TransferLimitsBalancePlatformLevelApi.php | 3 +-- .../LegalEntityManagement/BusinessLinesApi.php | 3 +-- .../Service/LegalEntityManagement/DocumentsApi.php | 3 +-- .../LegalEntityManagement/LegalEntitiesApi.php | 3 +-- .../LegalEntityManagement/TaxEDeliveryConsentApi.php | 3 +-- .../LegalEntityManagement/TransferInstrumentsApi.php | 3 +-- src/Adyen/Service/Transfers/TransfersApi.php | 6 ++---- 42 files changed, 74 insertions(+), 77 deletions(-) diff --git a/src/Adyen/Model/BalancePlatform/AssociationStatus.php b/src/Adyen/Model/BalancePlatform/AssociationStatus.php index f0b5e52b8..073d176a0 100644 --- a/src/Adyen/Model/BalancePlatform/AssociationStatus.php +++ b/src/Adyen/Model/BalancePlatform/AssociationStatus.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -42,4 +43,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php b/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php index 805c8aa13..3678ea9d6 100644 --- a/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php +++ b/src/Adyen/Model/BalancePlatform/BalanceWebhookSetting.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** diff --git a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php index 0641a50c7..267f118ca 100644 --- a/src/Adyen/Model/BalancePlatform/CapabilitySettings.php +++ b/src/Adyen/Model/BalancePlatform/CapabilitySettings.php @@ -355,7 +355,7 @@ public function getAmountPerIndustry() /** * Sets amountPerIndustry * - * @param array|null $amountPerIndustry + * @param array|null $amountPerIndustry * * @return self */ @@ -379,7 +379,7 @@ public function getAuthorizedCardUsers() /** * Sets authorizedCardUsers * - * @param bool|null $authorizedCardUsers + * @param bool|null $authorizedCardUsers * * @return self */ @@ -403,7 +403,7 @@ public function getFundingSource() /** * Sets fundingSource * - * @param string[]|null $fundingSource + * @param string[]|null $fundingSource * * @return self */ @@ -436,7 +436,7 @@ public function getInterval() /** * Sets interval * - * @param string|null $interval + * @param string|null $interval * * @return self */ diff --git a/src/Adyen/Model/BalancePlatform/LimitStatus.php b/src/Adyen/Model/BalancePlatform/LimitStatus.php index 5b8b01110..0100348c5 100644 --- a/src/Adyen/Model/BalancePlatform/LimitStatus.php +++ b/src/Adyen/Model/BalancePlatform/LimitStatus.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -50,4 +51,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php index c611e4ccf..dd0a6b47d 100644 --- a/src/Adyen/Model/BalancePlatform/ObjectSerializer.php +++ b/src/Adyen/Model/BalancePlatform/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,7 +118,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/BalancePlatform/ScaDeviceType.php b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php index 6b4f8129a..f61fdfb66 100644 --- a/src/Adyen/Model/BalancePlatform/ScaDeviceType.php +++ b/src/Adyen/Model/BalancePlatform/ScaDeviceType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -45,4 +46,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/ScaEntityType.php b/src/Adyen/Model/BalancePlatform/ScaEntityType.php index 31a7020f3..553a97206 100644 --- a/src/Adyen/Model/BalancePlatform/ScaEntityType.php +++ b/src/Adyen/Model/BalancePlatform/ScaEntityType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -42,4 +43,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/ScaExemption.php b/src/Adyen/Model/BalancePlatform/ScaExemption.php index f4ec06de5..afb2f5947 100644 --- a/src/Adyen/Model/BalancePlatform/ScaExemption.php +++ b/src/Adyen/Model/BalancePlatform/ScaExemption.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -53,4 +54,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/ScaStatus.php b/src/Adyen/Model/BalancePlatform/ScaStatus.php index 8bdcf3039..818f96696 100644 --- a/src/Adyen/Model/BalancePlatform/ScaStatus.php +++ b/src/Adyen/Model/BalancePlatform/ScaStatus.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -47,4 +48,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/Scope.php b/src/Adyen/Model/BalancePlatform/Scope.php index 90608ff73..ae2fe9eb5 100644 --- a/src/Adyen/Model/BalancePlatform/Scope.php +++ b/src/Adyen/Model/BalancePlatform/Scope.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -44,4 +45,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/SettingType.php b/src/Adyen/Model/BalancePlatform/SettingType.php index 2c7c0a59c..c81526a23 100644 --- a/src/Adyen/Model/BalancePlatform/SettingType.php +++ b/src/Adyen/Model/BalancePlatform/SettingType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -39,4 +40,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/BalancePlatform/TransferType.php b/src/Adyen/Model/BalancePlatform/TransferType.php index 980229f1b..2976ebab3 100644 --- a/src/Adyen/Model/BalancePlatform/TransferType.php +++ b/src/Adyen/Model/BalancePlatform/TransferType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\BalancePlatform; + use Adyen\Model\BalancePlatform\ObjectSerializer; /** @@ -44,4 +45,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/DataProtection/ObjectSerializer.php b/src/Adyen/Model/DataProtection/ObjectSerializer.php index 3ade10da2..e00957f62 100644 --- a/src/Adyen/Model/DataProtection/ObjectSerializer.php +++ b/src/Adyen/Model/DataProtection/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,7 +118,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/LegalEntityManagement/Attachment.php b/src/Adyen/Model/LegalEntityManagement/Attachment.php index 5ea8127f6..eb3905281 100644 --- a/src/Adyen/Model/LegalEntityManagement/Attachment.php +++ b/src/Adyen/Model/LegalEntityManagement/Attachment.php @@ -332,7 +332,7 @@ public function setContent($content) * Gets contentType * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getContentType() { @@ -345,7 +345,7 @@ public function getContentType() * @param string|null $contentType The file format. Possible values: **application/pdf**, **image/jpg**, **image/jpeg**, **image/png**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setContentType($contentType) { @@ -358,7 +358,7 @@ public function setContentType($contentType) * Gets filename * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getFilename() { @@ -371,7 +371,7 @@ public function getFilename() * @param string|null $filename The name of the file including the file extension. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setFilename($filename) { diff --git a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php index 8da19b0d1..952f086d6 100644 --- a/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php +++ b/src/Adyen/Model/LegalEntityManagement/BankAccountInfo.php @@ -329,7 +329,7 @@ public function setAccountIdentification($accountIdentification) * Gets accountType * * @return string|null - * @deprecated since Legal Entity Management API v2. + * @deprecated since Legal Entity Management API v2. */ public function getAccountType() { @@ -342,7 +342,7 @@ public function getAccountType() * @param string|null $accountType The type of bank account. * * @return self - * @deprecated since Legal Entity Management API v2. + * @deprecated since Legal Entity Management API v2. */ public function setAccountType($accountType) { diff --git a/src/Adyen/Model/LegalEntityManagement/Document.php b/src/Adyen/Model/LegalEntityManagement/Document.php index 273ddeb3b..ce6076ede 100644 --- a/src/Adyen/Model/LegalEntityManagement/Document.php +++ b/src/Adyen/Model/LegalEntityManagement/Document.php @@ -522,7 +522,7 @@ public function setDescription($description) * Gets expiryDate * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getExpiryDate() { @@ -535,7 +535,7 @@ public function getExpiryDate() * @param string|null $expiryDate The expiry date of the document, in YYYY-MM-DD format. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setExpiryDate($expiryDate) { @@ -596,7 +596,7 @@ public function setId($id) * Gets issuerCountry * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerCountry() { @@ -609,7 +609,7 @@ public function getIssuerCountry() * @param string|null $issuerCountry The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the document was issued. For example, **US**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerCountry($issuerCountry) { @@ -622,7 +622,7 @@ public function setIssuerCountry($issuerCountry) * Gets issuerState * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerState() { @@ -635,7 +635,7 @@ public function getIssuerState() * @param string|null $issuerState The state or province where the document was issued (AU only). * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerState($issuerState) { diff --git a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php index 02e6c1625..cae8b20e4 100644 --- a/src/Adyen/Model/LegalEntityManagement/IdentificationData.php +++ b/src/Adyen/Model/LegalEntityManagement/IdentificationData.php @@ -397,7 +397,7 @@ public function setExpiryDate($expiryDate) * Gets issuerCountry * * @return string|null - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function getIssuerCountry() { @@ -410,7 +410,7 @@ public function getIssuerCountry() * @param string|null $issuerCountry The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the document was issued. For example, **US**. * * @return self - * @deprecated since Legal Entity Management API v1. + * @deprecated since Legal Entity Management API v1. */ public function setIssuerCountry($issuerCountry) { diff --git a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php index dd57a5c33..3a2ad8485 100644 --- a/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php +++ b/src/Adyen/Model/LegalEntityManagement/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,7 +118,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php b/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php index 3a633aef1..855834c7a 100644 --- a/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php +++ b/src/Adyen/Model/SessionAuthentication/AccountHolderResource.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** diff --git a/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php b/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php index a484855a2..7f4609ba8 100644 --- a/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php +++ b/src/Adyen/Model/SessionAuthentication/BalanceAccountResource.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** diff --git a/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php b/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php index 1ee77891c..a3ce2901e 100644 --- a/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php +++ b/src/Adyen/Model/SessionAuthentication/LegalEntityResource.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** diff --git a/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php b/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php index a797941a8..7d79c1874 100644 --- a/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php +++ b/src/Adyen/Model/SessionAuthentication/MerchantAccountResource.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** diff --git a/src/Adyen/Model/SessionAuthentication/ObjectSerializer.php b/src/Adyen/Model/SessionAuthentication/ObjectSerializer.php index d86335768..6e7bc0e27 100644 --- a/src/Adyen/Model/SessionAuthentication/ObjectSerializer.php +++ b/src/Adyen/Model/SessionAuthentication/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,7 +118,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php index b4abbe33d..23fb96e66 100644 --- a/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php +++ b/src/Adyen/Model/SessionAuthentication/PaymentInstrumentResource.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** diff --git a/src/Adyen/Model/SessionAuthentication/ProductType.php b/src/Adyen/Model/SessionAuthentication/ProductType.php index c33344a98..09ec78e5e 100644 --- a/src/Adyen/Model/SessionAuthentication/ProductType.php +++ b/src/Adyen/Model/SessionAuthentication/ProductType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** @@ -45,4 +46,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/SessionAuthentication/ResourceType.php b/src/Adyen/Model/SessionAuthentication/ResourceType.php index 92f36f0f2..07e6028e3 100644 --- a/src/Adyen/Model/SessionAuthentication/ResourceType.php +++ b/src/Adyen/Model/SessionAuthentication/ResourceType.php @@ -14,6 +14,7 @@ namespace Adyen\Model\SessionAuthentication; + use Adyen\Model\SessionAuthentication\ObjectSerializer; /** @@ -51,4 +52,3 @@ public static function getAllowableEnumValues() ]; } } - diff --git a/src/Adyen/Model/Transfers/ObjectSerializer.php b/src/Adyen/Model/Transfers/ObjectSerializer.php index 28b7de158..3f9686bb8 100644 --- a/src/Adyen/Model/Transfers/ObjectSerializer.php +++ b/src/Adyen/Model/Transfers/ObjectSerializer.php @@ -82,7 +82,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } @@ -118,7 +118,9 @@ public static function sanitizeFilename($filename) */ public static function sanitizeTimestamp($timestamp) { - if (!is_string($timestamp)) return $timestamp; + if (!is_string($timestamp)) { + return $timestamp; + } return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); } diff --git a/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php b/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php index 7b30b6e2e..a1d3bc3bd 100644 --- a/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php +++ b/src/Adyen/Service/BalancePlatform/AuthorizedCardUsersApi.php @@ -45,14 +45,13 @@ public function __construct(Client $client) * @param string $paymentInstrumentId * @param \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers * @param array|null $requestOptions - + * @throws AdyenException */ public function createAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('POST'), (array) $authorisedCardUsers->jsonSerialize(), $requestOptions); - } /** @@ -60,14 +59,13 @@ public function createAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Mo * * @param string $paymentInstrumentId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteAuthorisedCardUsers(string $paymentInstrumentId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** @@ -91,13 +89,12 @@ public function getAllAuthorisedCardUsers(string $paymentInstrumentId, ?array $r * @param string $paymentInstrumentId * @param \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers * @param array|null $requestOptions - + * @throws AdyenException */ public function updateAuthorisedCardUsers(string $paymentInstrumentId, \Adyen\Model\BalancePlatform\AuthorisedCardUsers $authorisedCardUsers, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{paymentInstrumentId}'], [$paymentInstrumentId], "/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $authorisedCardUsers->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php index 46eef3f9c..1f043d320 100644 --- a/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php +++ b/src/Adyen/Service/BalancePlatform/BalanceAccountsApi.php @@ -76,14 +76,13 @@ public function createSweep(string $balanceAccountId, \Adyen\Model\BalancePlatfo * @param string $balanceAccountId * @param string $sweepId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteSweep(string $balanceAccountId, string $sweepId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balanceAccountId}', '{sweepId}'], [$balanceAccountId, $sweepId], "/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BalancesApi.php b/src/Adyen/Service/BalancePlatform/BalancesApi.php index 9f2ddb539..04f9415ca 100644 --- a/src/Adyen/Service/BalancePlatform/BalancesApi.php +++ b/src/Adyen/Service/BalancePlatform/BalancesApi.php @@ -63,14 +63,13 @@ public function createWebhookSetting(string $balancePlatformId, string $webhookI * @param string $webhookId * @param string $settingId * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteWebhookSetting(string $balancePlatformId, string $webhookId, string $settingId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{balancePlatformId}', '{webhookId}', '{settingId}'], [$balancePlatformId, $webhookId, $settingId], "/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php index 420a1e8c2..8a8476931 100644 --- a/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php +++ b/src/Adyen/Service/BalancePlatform/BankAccountValidationApi.php @@ -44,13 +44,12 @@ public function __construct(Client $client) * * @param \Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function validateBankAccountIdentification(\Adyen\Model\BalancePlatform\BankAccountIdentificationValidationRequest $bankAccountIdentificationValidationRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/validateBankAccountIdentification"; $this->requestHttp($endpoint, strtolower('POST'), (array) $bankAccountIdentificationValidationRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php index 853ba8dba..fe3e6ff4f 100644 --- a/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php +++ b/src/Adyen/Service/BalancePlatform/ManageSCADevicesApi.php @@ -76,14 +76,13 @@ public function completeRegistrationOfScaDevice(string $id, \Adyen\Model\Balance * * @param string $id * @param array|null $requestOptions ['queryParams' => ['paymentInstrumentId'=> string]] - + * @throws AdyenException */ public function deleteRegistrationOfScaDevice(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/registeredDevices/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php index d3fdb6621..37f29b8d0 100644 --- a/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php +++ b/src/Adyen/Service/BalancePlatform/NetworkTokensApi.php @@ -60,13 +60,12 @@ public function getNetworkToken(string $networkTokenId, ?array $requestOptions = * @param string $networkTokenId * @param \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function updateNetworkToken(string $networkTokenId, \Adyen\Model\BalancePlatform\UpdateNetworkTokenRequest $updateNetworkTokenRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{networkTokenId}'], [$networkTokenId], "/networkTokens/{networkTokenId}"); $this->requestHttp($endpoint, strtolower('PATCH'), (array) $updateNetworkTokenRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php index e33c2d2c2..d84445a5d 100644 --- a/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php +++ b/src/Adyen/Service/BalancePlatform/SCAAssociationManagementApi.php @@ -73,13 +73,12 @@ public function listAssociations(?array $requestOptions = null): \Adyen\Model\Ba * * @param \Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function removeAssociation(\Adyen\Model\BalancePlatform\RemoveAssociationRequest $removeAssociationRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/scaAssociations"; $this->requestHttp($endpoint, strtolower('DELETE'), (array) $removeAssociationRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php b/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php index ea8b82bb4..18f598993 100644 --- a/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php +++ b/src/Adyen/Service/BalancePlatform/TransferLimitsBalanceAccountLevelApi.php @@ -45,14 +45,13 @@ public function __construct(Client $client) * @param string $id * @param \Adyen\Model\BalancePlatform\ApproveTransferLimitRequest $approveTransferLimitRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approvePendingTransferLimits(string $id, \Adyen\Model\BalancePlatform\ApproveTransferLimitRequest $approveTransferLimitRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/balanceAccounts/{id}/transferLimits/approve"); $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransferLimitRequest->jsonSerialize(), $requestOptions); - } /** @@ -77,14 +76,13 @@ public function createTransferLimit(string $id, \Adyen\Model\BalancePlatform\Cre * @param string $id * @param string $transferLimitId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePendingTransferLimit(string $id, string $transferLimitId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}', '{transferLimitId}'], [$id, $transferLimitId], "/balanceAccounts/{id}/transferLimits/{transferLimitId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php b/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php index bf1863db3..34121d895 100644 --- a/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php +++ b/src/Adyen/Service/BalancePlatform/TransferLimitsBalancePlatformLevelApi.php @@ -61,14 +61,13 @@ public function createTransferLimit(string $id, \Adyen\Model\BalancePlatform\Cre * @param string $id * @param string $transferLimitId * @param array|null $requestOptions - + * @throws AdyenException */ public function deletePendingTransferLimit(string $id, string $transferLimitId, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}', '{transferLimitId}'], [$id, $transferLimitId], "/balancePlatforms/{id}/transferLimits/{transferLimitId}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php index 2cbf4fb8b..33d080e1c 100644 --- a/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/BusinessLinesApi.php @@ -59,14 +59,13 @@ public function createBusinessLine(\Adyen\Model\LegalEntityManagement\BusinessLi * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteBusinessLine(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/businessLines/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php index 7cfe2d19d..485345850 100644 --- a/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/DocumentsApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteDocument(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/documents/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php b/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php index e4dd92c79..f1300b760 100644 --- a/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php +++ b/src/Adyen/Service/LegalEntityManagement/LegalEntitiesApi.php @@ -119,14 +119,13 @@ public function getLegalEntity(string $id, ?array $requestOptions = null): \Adye * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function requestPeriodicReview(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/requestPeriodicReview"); $this->requestHttp($endpoint, strtolower('POST'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php index c6b7abcf5..c4bab795a 100644 --- a/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TaxEDeliveryConsentApi.php @@ -60,13 +60,12 @@ public function checkStatusOfConsentForElectronicDeliveryOfTaxForms(string $id, * @param string $id * @param \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function setConsentStatusForElectronicDeliveryOfTaxForms(string $id, \Adyen\Model\LegalEntityManagement\SetTaxElectronicDeliveryConsentRequest $setTaxElectronicDeliveryConsentRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/legalEntities/{id}/setTaxElectronicDeliveryConsent"); $this->requestHttp($endpoint, strtolower('POST'), (array) $setTaxElectronicDeliveryConsentRequest->jsonSerialize(), $requestOptions); - } } diff --git a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php index e69341604..8fe49fa59 100644 --- a/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php +++ b/src/Adyen/Service/LegalEntityManagement/TransferInstrumentsApi.php @@ -59,14 +59,13 @@ public function createTransferInstrument(\Adyen\Model\LegalEntityManagement\Tran * * @param string $id * @param array|null $requestOptions - + * @throws AdyenException */ public function deleteTransferInstrument(string $id, ?array $requestOptions = null) { $endpoint = $this->baseURL . str_replace(['{id}'], [$id], "/transferInstruments/{id}"); $this->requestHttp($endpoint, strtolower('DELETE'), null, $requestOptions); - } /** diff --git a/src/Adyen/Service/Transfers/TransfersApi.php b/src/Adyen/Service/Transfers/TransfersApi.php index 598c2e878..23ede4f10 100644 --- a/src/Adyen/Service/Transfers/TransfersApi.php +++ b/src/Adyen/Service/Transfers/TransfersApi.php @@ -44,14 +44,13 @@ public function __construct(Client $client) * * @param \Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfersRequest $approveTransfersRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/approve"; $this->requestHttp($endpoint, strtolower('POST'), (array) $approveTransfersRequest->jsonSerialize(), $requestOptions); - } /** @@ -59,14 +58,13 @@ public function approveInitiatedTransfers(\Adyen\Model\Transfers\ApproveTransfer * * @param \Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest * @param array|null $requestOptions - + * @throws AdyenException */ public function cancelInitiatedTransfers(\Adyen\Model\Transfers\CancelTransfersRequest $cancelTransfersRequest, ?array $requestOptions = null) { $endpoint = $this->baseURL . "/transfers/cancel"; $this->requestHttp($endpoint, strtolower('POST'), (array) $cancelTransfersRequest->jsonSerialize(), $requestOptions); - } /**