Skip to content

Commit 30fcbb5

Browse files
refactor: replace VerifyAddressResponse with VerificationVerifyAddressOKResponseBody and update related components
- Changed `VerifyAddressResponse` to `VerificationVerifyAddressOKResponseBody` in the `VerificationVerifyAddressOKResponse` class. - Updated the `body` property definition and its associated methods to reflect the new structure and type. - Refined the API documentation to clarify the expected country format. - Removed obsolete classes: `VerifyAddressConfidence` and `VerifyAddressResponse`.
1 parent 3657c41 commit 30fcbb5

5 files changed

Lines changed: 23 additions & 37 deletions

File tree

src/Generated/V2/Clients/Misc/VerificationVerifyAddress/VerificationVerifyAddressOKResponse.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use InvalidArgumentException;
88
use JsonSchema\Validator;
99
use Mittwald\ApiClient\Client\ResponseContainer;
10-
use Mittwald\ApiClient\Generated\V2\Schemas\Verification\VerifyAddressResponse;
1110
use Psr\Http\Message\ResponseInterface;
1211

1312
class VerificationVerifyAddressOKResponse implements ResponseContainer
@@ -22,26 +21,34 @@ class VerificationVerifyAddressOKResponse implements ResponseContainer
2221
],
2322
'properties' => [
2423
'body' => [
25-
'$ref' => '#/components/schemas/de.mittwald.v1.verification.VerifyAddressResponse',
24+
'properties' => [
25+
'exists' => [
26+
'type' => 'boolean',
27+
],
28+
],
29+
'required' => [
30+
'exists',
31+
],
32+
'type' => 'object',
2633
],
2734
],
2835
];
2936

30-
private VerifyAddressResponse $body;
37+
private VerificationVerifyAddressOKResponseBody $body;
3138

3239
private ResponseInterface|null $httpResponse = null;
3340

34-
public function __construct(VerifyAddressResponse $body)
41+
public function __construct(VerificationVerifyAddressOKResponseBody $body)
3542
{
3643
$this->body = $body;
3744
}
3845

39-
public function getBody(): VerifyAddressResponse
46+
public function getBody(): VerificationVerifyAddressOKResponseBody
4047
{
4148
return $this->body;
4249
}
4350

44-
public function withBody(VerifyAddressResponse $body): self
51+
public function withBody(VerificationVerifyAddressOKResponseBody $body): self
4552
{
4653
$clone = clone $this;
4754
$clone->body = $body;
@@ -64,7 +71,7 @@ public static function buildFromInput(array|object $input, bool $validate = true
6471
static::validateInput($input);
6572
}
6673

67-
$body = VerifyAddressResponse::buildFromInput($input->{'body'}, validate: $validate);
74+
$body = VerificationVerifyAddressOKResponseBody::buildFromInput($input->{'body'}, validate: $validate);
6875

6976
$obj = new self($body);
7077

@@ -79,7 +86,7 @@ public static function buildFromInput(array|object $input, bool $validate = true
7986
public function toJson(): array
8087
{
8188
$output = [];
82-
$output['body'] = $this->body->toJson();
89+
$output['body'] = ($this->body)->toJson();
8390

8491
return $output;
8592
}
@@ -110,6 +117,7 @@ public static function validateInput(array|object $input, bool $return = false):
110117

111118
public function __clone()
112119
{
120+
$this->body = clone $this->body;
113121
}
114122

115123
public static function fromResponse(ResponseInterface $httpResponse): self

src/Generated/V2/Schemas/Verification/VerifyAddressResponse.php renamed to src/Generated/V2/Clients/Misc/VerificationVerifyAddress/VerificationVerifyAddressOKResponseBody.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,12 @@
22

33
declare(strict_types=1);
44

5-
namespace Mittwald\ApiClient\Generated\V2\Schemas\Verification;
5+
namespace Mittwald\ApiClient\Generated\V2\Clients\Misc\VerificationVerifyAddress;
66

77
use InvalidArgumentException;
88
use JsonSchema\Validator;
99

10-
/**
11-
* Auto-generated class for de.mittwald.v1.verification.VerifyAddressResponse.
12-
*
13-
* DO NOT EDIT; this class was generated by the mittwald/api-client-builder package
14-
* (https://github.com/mittwald/api-client-php-builder). Please make any changes
15-
* there.
16-
*
17-
* @generated
18-
* @see https://github.com/mittwald/api-client-php-builder
19-
*/
20-
class VerifyAddressResponse
10+
class VerificationVerifyAddressOKResponseBody
2111
{
2212
/**
2313
* Schema used to validate input for creating instances of this class
@@ -65,10 +55,10 @@ public function withExists(bool $exists): self
6555
*
6656
* @param array|object $input Input data
6757
* @param bool $validate Set this to false to skip validation; use at own risk
68-
* @return VerifyAddressResponse Created instance
58+
* @return VerificationVerifyAddressOKResponseBody Created instance
6959
* @throws InvalidArgumentException
7060
*/
71-
public static function buildFromInput(array|object $input, bool $validate = true): VerifyAddressResponse
61+
public static function buildFromInput(array|object $input, bool $validate = true): VerificationVerifyAddressOKResponseBody
7262
{
7363
$input = is_array($input) ? Validator::arrayToObjectRecursive($input) : $input;
7464
if ($validate) {

src/Generated/V2/Clients/Misc/VerificationVerifyAddress/VerificationVerifyAddressRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class VerificationVerifyAddressRequest
2424
'type' => 'string',
2525
],
2626
'country' => [
27-
'description' => 'Accepts the whole english or german name as well as the ISO 3166-2 country codes.',
27+
'description' => 'The country format should be ISO 3166-2 Alpha 2 Country Code.',
2828
'example' => 'DE',
2929
'type' => 'string',
3030
],

src/Generated/V2/Clients/Misc/VerificationVerifyAddress/VerificationVerifyAddressRequestBody.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class VerificationVerifyAddressRequestBody
1919
'type' => 'string',
2020
],
2121
'country' => [
22-
'description' => 'Accepts the whole english or german name as well as the ISO 3166-2 country codes.',
22+
'description' => 'The country format should be ISO 3166-2 Alpha 2 Country Code.',
2323
'example' => 'DE',
2424
'type' => 'string',
2525
],
@@ -45,7 +45,7 @@ class VerificationVerifyAddressRequestBody
4545
private string $city;
4646

4747
/**
48-
* Accepts the whole english or german name as well as the ISO 3166-2 country codes.
48+
* The country format should be ISO 3166-2 Alpha 2 Country Code.
4949
*/
5050
private string $country;
5151

src/Generated/V2/Schemas/Verification/VerifyAddressConfidence.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)