Skip to content

Commit

Permalink
[reformat][adyen-sdk-automation] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
AdyenAutomationBot committed Feb 23, 2024
1 parent 524c9cb commit 8587035
Show file tree
Hide file tree
Showing 1,015 changed files with 28,184 additions and 384 deletions.
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/AuthenticationInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/AuthenticationNotificationData.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/AuthenticationNotificationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,32 @@ 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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/ChallengeInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,32 @@ 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
*
Expand Down
9 changes: 4 additions & 5 deletions src/Adyen/Model/AcsWebhooks/ObjectSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,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);
}
}
Expand Down Expand Up @@ -117,9 +117,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);
}
Expand Down Expand Up @@ -242,7 +240,8 @@ public static function deserialize($data, $class, $httpHeaders = null)
/** @var \Psr\Http\Message\StreamInterface $data */

// determine file name
if (is_array($httpHeaders)
if (
is_array($httpHeaders)
&& array_key_exists('Content-Disposition', $httpHeaders)
&& preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)
) {
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/PurchaseInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/AcsWebhooks/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/BalanceControl/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/BalanceControl/BalanceTransferRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,32 @@ 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
*
Expand Down
26 changes: 26 additions & 0 deletions src/Adyen/Model/BalanceControl/BalanceTransferResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,32 @@ 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
*
Expand Down
Loading

0 comments on commit 8587035

Please sign in to comment.