Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update models #590

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/Adyen/Model/BalancePlatform/AddressRequirement.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,28 @@ public function getModelName()
return self::$openAPIModelName;
}

public const REQUIRED_ADDRESS_FIELDS_CITY = 'city';
public const REQUIRED_ADDRESS_FIELDS_COUNTRY = 'country';
public const REQUIRED_ADDRESS_FIELDS_LINE1 = 'line1';
public const REQUIRED_ADDRESS_FIELDS_POSTAL_CODE = 'postalCode';
public const REQUIRED_ADDRESS_FIELDS_STATE_OR_PROVINCE = 'stateOrProvince';
public const TYPE_ADDRESS_REQUIREMENT = 'addressRequirement';

/**
* Gets allowable values of the enum
*
* @return string[]
*/
public function getRequiredAddressFieldsAllowableValues()
{
return [
self::REQUIRED_ADDRESS_FIELDS_CITY,
self::REQUIRED_ADDRESS_FIELDS_COUNTRY,
self::REQUIRED_ADDRESS_FIELDS_LINE1,
self::REQUIRED_ADDRESS_FIELDS_POSTAL_CODE,
self::REQUIRED_ADDRESS_FIELDS_STATE_OR_PROVINCE,
];
}
/**
* Gets allowable values of the enum
*
Expand Down Expand Up @@ -363,6 +383,15 @@ public function setRequiredAddressFields($requiredAddressFields)
if (is_null($requiredAddressFields)) {
throw new \InvalidArgumentException('non-nullable requiredAddressFields cannot be null');
}
$allowedValues = $this->getRequiredAddressFieldsAllowableValues();
if (array_diff($requiredAddressFields, $allowedValues)) {
throw new \InvalidArgumentException(
sprintf(
"Invalid value for 'requiredAddressFields', must be one of '%s'",
implode("', '", $allowedValues)
)
);
}
$this->container['requiredAddressFields'] = $requiredAddressFields;

return $this;
Expand Down
6 changes: 3 additions & 3 deletions src/Adyen/Model/BalancePlatform/RestServiceError.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RestServiceError implements ModelInterface, ArrayAccess, \JsonSerializable
'instance' => 'string',
'invalidFields' => '\Adyen\Model\BalancePlatform\InvalidField[]',
'requestId' => 'string',
'response' => '\Adyen\Model\BalancePlatform\JSONObject',
'response' => 'object',
'status' => 'int',
'title' => 'string',
'type' => 'string'
Expand Down Expand Up @@ -485,7 +485,7 @@ public function setRequestId($requestId)
/**
* Gets response
*
* @return \Adyen\Model\BalancePlatform\JSONObject|null
* @return object|null
*/
public function getResponse()
{
Expand All @@ -495,7 +495,7 @@ public function getResponse()
/**
* Sets response
*
* @param \Adyen\Model\BalancePlatform\JSONObject|null $response response
* @param object|null $response response
*
* @return self
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
use Adyen\Model\BalancePlatform\ObjectSerializer;

/**
* JSONObject Class Doc Comment
* SameAmountRestriction Class Doc Comment
*
* @category Class
* @package Adyen
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess<string, mixed>
*/
class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable
class SameAmountRestriction implements ModelInterface, ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;

Expand All @@ -36,16 +36,16 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable
*
* @var string
*/
protected static $openAPIModelName = 'JSONObject';
protected static $openAPIModelName = 'SameAmountRestriction';

/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'paths' => '\Adyen\Model\BalancePlatform\JSONPath[]',
'rootPath' => '\Adyen\Model\BalancePlatform\JSONPath'
'operation' => 'string',
'value' => 'bool'
];

/**
Expand All @@ -56,8 +56,8 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'paths' => null,
'rootPath' => null
'operation' => null,
'value' => null
];

/**
Expand All @@ -66,8 +66,8 @@ class JSONObject implements ModelInterface, ArrayAccess, \JsonSerializable
* @var boolean[]
*/
protected static $openAPINullables = [
'paths' => false,
'rootPath' => false
'operation' => false,
'value' => false
];

/**
Expand Down Expand Up @@ -156,8 +156,8 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $attributeMap = [
'paths' => 'paths',
'rootPath' => 'rootPath'
'operation' => 'operation',
'value' => 'value'
];

/**
Expand All @@ -166,8 +166,8 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $setters = [
'paths' => 'setPaths',
'rootPath' => 'setRootPath'
'operation' => 'setOperation',
'value' => 'setValue'
];

/**
Expand All @@ -176,8 +176,8 @@ public function isNullableSetToNull(string $property): bool
* @var string[]
*/
protected static $getters = [
'paths' => 'getPaths',
'rootPath' => 'getRootPath'
'operation' => 'getOperation',
'value' => 'getValue'
];

/**
Expand Down Expand Up @@ -237,8 +237,8 @@ public function getModelName()
*/
public function __construct(array $data = null)
{
$this->setIfExists('paths', $data ?? [], null);
$this->setIfExists('rootPath', $data ?? [], null);
$this->setIfExists('operation', $data ?? [], null);
$this->setIfExists('value', $data ?? [], null);
}

/**
Expand Down Expand Up @@ -268,6 +268,9 @@ public function listInvalidProperties()
{
$invalidProperties = [];

if ($this->container['operation'] === null) {
$invalidProperties[] = "'operation' can't be null";
}
return $invalidProperties;
}

Expand All @@ -284,55 +287,55 @@ public function valid()


/**
* Gets paths
* Gets operation
*
* @return \Adyen\Model\BalancePlatform\JSONPath[]|null
* @return string
*/
public function getPaths()
public function getOperation()
{
return $this->container['paths'];
return $this->container['operation'];
}

/**
* Sets paths
* Sets operation
*
* @param \Adyen\Model\BalancePlatform\JSONPath[]|null $paths paths
* @param string $operation Defines how the condition must be evaluated.
*
* @return self
*/
public function setPaths($paths)
public function setOperation($operation)
{
if (is_null($paths)) {
throw new \InvalidArgumentException('non-nullable paths cannot be null');
if (is_null($operation)) {
throw new \InvalidArgumentException('non-nullable operation cannot be null');
}
$this->container['paths'] = $paths;
$this->container['operation'] = $operation;

return $this;
}

/**
* Gets rootPath
* Gets value
*
* @return \Adyen\Model\BalancePlatform\JSONPath|null
* @return bool|null
*/
public function getRootPath()
public function getValue()
{
return $this->container['rootPath'];
return $this->container['value'];
}

/**
* Sets rootPath
* Sets value
*
* @param \Adyen\Model\BalancePlatform\JSONPath|null $rootPath rootPath
* @param bool|null $value value
*
* @return self
*/
public function setRootPath($rootPath)
public function setValue($value)
{
if (is_null($rootPath)) {
throw new \InvalidArgumentException('non-nullable rootPath cannot be null');
if (is_null($value)) {
throw new \InvalidArgumentException('non-nullable value cannot be null');
}
$this->container['rootPath'] = $rootPath;
$this->container['value'] = $value;

return $this;
}
Expand Down
Loading