Skip to content
Open
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
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ src/ApiException.php
src/Configuration.php
src/FormDataProcessor.php
src/HeaderSelector.php
src/Model/AnyOfInterface.php
src/Model/CheckVatRequest.php
src/Model/CheckVatResponse.php
src/Model/CommonResponse.php
src/Model/CountryStatus.php
src/Model/ErrorWrapper.php
src/Model/ModelInterface.php
src/Model/OneOfInterface.php
src/Model/Status.php
src/Model/StatusInformationResponse.php
src/Model/StatusInformationResponseVow.php
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.20.0
7.25.0
73 changes: 27 additions & 46 deletions src/Api/PublicApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.20.0
* Generator version: 7.25.0
*/

/**
Expand All @@ -32,7 +32,6 @@
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\MultipartStream;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\RequestOptions;
use GuzzleHttp\Promise\PromiseInterface;
Expand All @@ -41,7 +40,6 @@
use Cone\Vies\ApiException;
use Cone\Vies\Configuration;
use Cone\Vies\HeaderSelector;
use Cone\Vies\FormDataProcessor;
use Cone\Vies\ObjectSerializer;

/**
Expand Down Expand Up @@ -72,7 +70,7 @@ class PublicApi
*/
protected int $hostIndex;

/** @var string[] $contentTypes **/
/** @var array<string,string[]> $contentTypes **/
public const contentTypes = [
'checkStatus' => [
'application/json',
Expand Down Expand Up @@ -158,7 +156,7 @@ public function checkStatus(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \Cone\Vies\Model\StatusInformationResponse|\Cone\Vies\Model\CommonResponse|\Cone\Vies\Model\CommonResponse, HTTP status code, HTTP response headers (array of strings)
* @return array{0: \Cone\Vies\Model\StatusInformationResponse|\Cone\Vies\Model\CommonResponse, 1: int, 2: array<string, string[]>} [response data, HTTP status code, HTTP response headers]
*/
public function checkStatusWithHttpInfo(
string $contentType = self::contentTypes['checkStatus'][0]
Expand Down Expand Up @@ -208,7 +206,6 @@ public function checkStatusWithHttpInfo(
);
}


if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
Expand Down Expand Up @@ -344,9 +341,7 @@ public function checkStatusRequest(
string $contentType = self::contentTypes['checkStatus'][0]
): Request {


$resourcePath = '/check-status';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
Expand All @@ -362,30 +357,6 @@ public function checkStatusRequest(
$multipart
);

// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem,
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);

} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
// if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
}
}

$defaultHeaders = [];
if ($this->config->getUserAgent()) {
Expand Down Expand Up @@ -438,7 +409,7 @@ public function checkVatNumber(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \Cone\Vies\Model\CheckVatResponse|\Cone\Vies\Model\CommonResponse|\Cone\Vies\Model\CommonResponse, HTTP status code, HTTP response headers (array of strings)
* @return array{0: \Cone\Vies\Model\CheckVatResponse|\Cone\Vies\Model\CommonResponse, 1: int, 2: array<string, string[]>} [response data, HTTP status code, HTTP response headers]
*/
public function checkVatNumberWithHttpInfo(
\Cone\Vies\Model\CheckVatRequest $body,
Expand Down Expand Up @@ -489,7 +460,6 @@ public function checkVatNumberWithHttpInfo(
);
}


if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
Expand Down Expand Up @@ -630,15 +600,13 @@ public function checkVatNumberRequest(
\Cone\Vies\Model\CheckVatRequest $body,
string $contentType = self::contentTypes['checkVatNumber'][0]
): Request {

// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new InvalidArgumentException(
'Missing the required parameter $body when calling checkVatNumber'
);
}


$resourcePath = '/check-vat-number';
$formParams = [];
$queryParams = [];
Expand All @@ -660,7 +628,11 @@ public function checkVatNumberRequest(
if (isset($body)) {
if (stripos($headers['Content-Type'], 'application/json') !== false) {
// if Content-Type contains "application/json", json_encode the body
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body));
try {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($body), JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
}
} else {
$httpBody = $body;
}
Expand All @@ -677,11 +649,15 @@ public function checkVatNumberRequest(
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
$httpBody = new \GuzzleHttp\Psr7\MultipartStream($multipartContents);

} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
// if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
try {
$httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
}
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
Expand Down Expand Up @@ -739,7 +715,7 @@ public function checkVatTestService(
*
* @throws ApiException on non-2xx response or if the response body is not in the expected format
* @throws InvalidArgumentException
* @return array of \Cone\Vies\Model\CheckVatResponse|\Cone\Vies\Model\CommonResponse|\Cone\Vies\Model\CommonResponse, HTTP status code, HTTP response headers (array of strings)
* @return array{0: \Cone\Vies\Model\CheckVatResponse|\Cone\Vies\Model\CommonResponse, 1: int, 2: array<string, string[]>} [response data, HTTP status code, HTTP response headers]
*/
public function checkVatTestServiceWithHttpInfo(
\Cone\Vies\Model\CheckVatRequest $body,
Expand Down Expand Up @@ -790,7 +766,6 @@ public function checkVatTestServiceWithHttpInfo(
);
}


if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
Expand Down Expand Up @@ -931,15 +906,13 @@ public function checkVatTestServiceRequest(
\Cone\Vies\Model\CheckVatRequest $body,
string $contentType = self::contentTypes['checkVatTestService'][0]
): Request {

// verify the required parameter 'body' is set
if ($body === null || (is_array($body) && count($body) === 0)) {
throw new InvalidArgumentException(
'Missing the required parameter $body when calling checkVatTestService'
);
}


$resourcePath = '/check-vat-test-service';
$formParams = [];
$queryParams = [];
Expand All @@ -961,7 +934,11 @@ public function checkVatTestServiceRequest(
if (isset($body)) {
if (stripos($headers['Content-Type'], 'application/json') !== false) {
// if Content-Type contains "application/json", json_encode the body
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($body));
try {
$httpBody = json_encode(ObjectSerializer::sanitizeForSerialization($body), JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
}
} else {
$httpBody = $body;
}
Expand All @@ -978,11 +955,15 @@ public function checkVatTestServiceRequest(
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
$httpBody = new \GuzzleHttp\Psr7\MultipartStream($multipartContents);

} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
// if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
try {
$httpBody = json_encode($formParams, JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new \InvalidArgumentException('json_encode error: ' . $e->getMessage(), 0, $e);
}
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
Expand Down
2 changes: 1 addition & 1 deletion src/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.20.0
* Generator version: 7.25.0
*/

/**
Expand Down
32 changes: 31 additions & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.20.0
* Generator version: 7.25.0
*/

/**
Expand Down Expand Up @@ -122,6 +122,13 @@ class Configuration
*/
protected string $tempFolderPath;

/**
* Ignore operation specific hosts
*
* @var bool
*/
protected bool $ignoreOperationHosts = false;

/**
* Constructor
*/
Expand Down Expand Up @@ -391,6 +398,29 @@ public function getTempFolderPath(): string
return $this->tempFolderPath;
}

/**
* Sets the ignore operation specific hosts flag
*
* @param bool $ignoreOperationHosts Ignore operation specific hosts flag
*
* @return $this
*/
public function setIgnoreOperationHosts(bool $ignoreOperationHosts): static
{
$this->ignoreOperationHosts = $ignoreOperationHosts;
return $this;
}

/**
* Gets the ignore operation specific hosts flag
*
* @return bool Ignore operation specific hosts flag
*/
public function getIgnoreOperationHosts(): bool
{
return $this->ignoreOperationHosts;
}

/**
* Gets the default configuration instance
*
Expand Down
2 changes: 1 addition & 1 deletion src/FormDataProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.20.0
* Generator version: 7.25.0
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion src/HeaderSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.20.0
* Generator version: 7.25.0
*/

/**
Expand Down
65 changes: 65 additions & 0 deletions src/Model/AnyOfInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

declare(strict_types=1);
/**
* AnyOfInterface
*
* PHP version 8.1
*
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/

/**
* Vies on-the-Web Endpoint
*
* This is the contract for Vies on-the-Web endpoints. The checkVat service supports exact and approximate matching at the same time. In order to retrieve the requestIdentifier, the information about requesterMemberStateCode and requesterNumber have to be provided.
*
* The version of the OpenAPI document: 1.0.0
* @generated Generated by: https://openapi-generator.tech
* Generator version: 7.25.0
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace Cone\Vies\Model;

/**
* Interface implemented by models generated from an `anyOf` schema.
*
* An `anyOf` schema is not represented by a value object; instead a value is one of the
* member types. Classes implementing this interface only carry the metadata that
* {@see ObjectSerializer::deserialize()} needs to resolve the concrete member type.
*
* @author OpenAPI Generator team
*/
interface AnyOfInterface
{
/**
* List of the types a value of this `anyOf` schema may be. Each entry uses the same
* notation as the values of {@see ModelInterface::openAPITypes()}.
*
* @return string[]
*/
public static function getAnyOfTypes(): array;

/**
* Name of the discriminator property used to resolve the concrete member type, or null
* when the schema has no discriminator.
*
* @return string|null
*/
public static function getAnyOfDiscriminator(): ?string;

/**
* Mapping of discriminator values to the concrete member type. Empty when the schema has
* no discriminator.
*
* @return array<string,string>
*/
public static function getAnyOfDiscriminatorMappings(): array;
}
Loading