mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
feat(php-nextgen-client): add support for streaming (#19192)
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
This commit is contained in:
parent
4874a0bce7
commit
7f551bb9a0
7
bin/configs/php-nextgen-echo-api-streaming.yaml
Normal file
7
bin/configs/php-nextgen-echo-api-streaming.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
generatorName: php-nextgen
|
||||
outputDir: samples/client/echo_api/php-nextgen-streaming
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/php-nextgen
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
supportStreaming: true
|
@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|srcBasePath|The directory to serve as source root.| |null|
|
||||
|supportStreaming|Support streaming endpoint| |false|
|
||||
|variableNamingConvention|naming convention of variable name, e.g. camelCase.| |snake_case|
|
||||
|
||||
## IMPORT MAPPING
|
||||
|
@ -18,6 +18,8 @@
|
||||
package org.openapitools.codegen.languages;
|
||||
|
||||
import io.swagger.v3.oas.models.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openapitools.codegen.*;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
@ -42,6 +44,11 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
@SuppressWarnings("hiding")
|
||||
private final Logger LOGGER = LoggerFactory.getLogger(PhpNextgenClientCodegen.class);
|
||||
|
||||
public static final String SUPPORT_STREAMING = "supportStreaming";
|
||||
|
||||
@Getter @Setter
|
||||
protected boolean supportStreaming = false;
|
||||
|
||||
public PhpNextgenClientCodegen() {
|
||||
super();
|
||||
|
||||
@ -92,6 +99,7 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.ALLOW_UNICODE_IDENTIFIERS_DESC)
|
||||
.defaultValue(Boolean.TRUE.toString()));
|
||||
cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint", this.supportStreaming));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -113,6 +121,8 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
convertPropertyToBooleanAndWriteBack(SUPPORT_STREAMING, this::setSupportStreaming);
|
||||
|
||||
supportingFiles.add(new SupportingFile("ApiException.mustache", toSrcPath(invokerPackage, srcBasePath), "ApiException.php"));
|
||||
supportingFiles.add(new SupportingFile("Configuration.mustache", toSrcPath(invokerPackage, srcBasePath), "Configuration.php"));
|
||||
supportingFiles.add(new SupportingFile("ObjectSerializer.mustache", toSrcPath(invokerPackage, srcBasePath), "ObjectSerializer.php"));
|
||||
@ -125,6 +135,10 @@ public class PhpNextgenClientCodegen extends AbstractPhpCodegen {
|
||||
supportingFiles.add(new SupportingFile(".php-cs-fixer.dist.php", "", ".php-cs-fixer.dist.php"));
|
||||
supportingFiles.add(new SupportingFile(".phplint.mustache", "", ".phplint.yml"));
|
||||
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));
|
||||
|
||||
if(this.supportStreaming) {
|
||||
typeMapping.put("file", "\\Psr\\\\Http\\\\Message\\\\StreamInterface");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -442,6 +442,10 @@ class ObjectSerializer
|
||||
}
|
||||
}
|
||||
|
||||
if ($class === '\Psr\Http\Message\StreamInterface') {
|
||||
return Utils::streamFor($data);
|
||||
}
|
||||
|
||||
if ($class === '\SplFileObject') {
|
||||
$data = Utils::streamFor($data);
|
||||
|
||||
|
@ -306,7 +306,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
{{/-first}}
|
||||
{{#dataType}}
|
||||
{{^isRange}}{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}}
|
||||
if ('{{{dataType}}}' === '\SplFileObject') {
|
||||
if (in_array('{{{dataType}}}', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -339,7 +339,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
{{/responses}}
|
||||
|
||||
$returnType = '{{{returnType}}}';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -546,7 +546,7 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
{{#returnType}}
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -755,7 +755,9 @@ use {{invokerPackage}}\ObjectSerializer;
|
||||
$formParams['{{baseName}}'] = [];
|
||||
$paramFiles = is_array(${{paramName}}) ? ${{paramName}} : [${{paramName}}];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['{{baseName}}'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['{{baseName}}'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.openapitools.codegen.php;
|
||||
|
||||
import org.openapitools.codegen.languages.PhpNextgenClientCodegen;
|
||||
import org.openapitools.codegen.testutils.ConfigAssert;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class PhpNextgenClientCodegenTest {
|
||||
|
||||
@Test
|
||||
public void testInitialConfigValues() throws Exception {
|
||||
final PhpNextgenClientCodegen codegen = new PhpNextgenClientCodegen();
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
Assert.assertEquals(codegen.isSupportStreaming(), false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSettersForConfigValues() throws Exception {
|
||||
final PhpNextgenClientCodegen codegen = new PhpNextgenClientCodegen();
|
||||
|
||||
codegen.setSupportStreaming(true);
|
||||
|
||||
codegen.processOpts();
|
||||
|
||||
Assert.assertEquals(codegen.isSupportStreaming(), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdditionalPropertiesPutForConfigValuesWithFalseValue() throws Exception {
|
||||
final PhpNextgenClientCodegen codegen = new PhpNextgenClientCodegen();
|
||||
|
||||
codegen.additionalProperties().put(PhpNextgenClientCodegen.SUPPORT_STREAMING, false);
|
||||
|
||||
codegen.processOpts();
|
||||
ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties());
|
||||
|
||||
configAssert.assertValue(PhpNextgenClientCodegen.SUPPORT_STREAMING, codegen::isSupportStreaming, Boolean.FALSE);
|
||||
Assert.assertEquals(codegen.isSupportStreaming(), false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAdditionalPropertiesPutForConfigValuesWithTrueValue() throws Exception {
|
||||
final PhpNextgenClientCodegen codegen = new PhpNextgenClientCodegen();
|
||||
|
||||
codegen.additionalProperties().put(PhpNextgenClientCodegen.SUPPORT_STREAMING, true);
|
||||
|
||||
codegen.processOpts();
|
||||
ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties());
|
||||
|
||||
configAssert.assertValue(PhpNextgenClientCodegen.SUPPORT_STREAMING, codegen::isSupportStreaming, Boolean.TRUE);
|
||||
Assert.assertEquals(codegen.isSupportStreaming(), true);
|
||||
}
|
||||
}
|
19
samples/client/echo_api/php-nextgen-streaming/.gitignore
vendored
Normal file
19
samples/client/echo_api/php-nextgen-streaming/.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
|
||||
|
||||
composer.phar
|
||||
/vendor/
|
||||
|
||||
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
|
||||
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
|
||||
# makes sense since it's a library(client SDK) and not a project
|
||||
composer.lock
|
||||
|
||||
# php-cs-fixer cache
|
||||
.php_cs.cache
|
||||
.php-cs-fixer.cache
|
||||
|
||||
# PHPUnit cache
|
||||
.phpunit.result.cache
|
||||
|
||||
# PHPLint cache
|
||||
build/phplint.cache
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1,49 @@
|
||||
.gitignore
|
||||
.php-cs-fixer.dist.php
|
||||
.phplint.yml
|
||||
.travis.yml
|
||||
README.md
|
||||
composer.json
|
||||
docs/Api/AuthApi.md
|
||||
docs/Api/BodyApi.md
|
||||
docs/Api/FormApi.md
|
||||
docs/Api/HeaderApi.md
|
||||
docs/Api/PathApi.md
|
||||
docs/Api/QueryApi.md
|
||||
docs/Model/Bird.md
|
||||
docs/Model/Category.md
|
||||
docs/Model/DataQuery.md
|
||||
docs/Model/DefaultValue.md
|
||||
docs/Model/NumberPropertiesOnly.md
|
||||
docs/Model/Pet.md
|
||||
docs/Model/Query.md
|
||||
docs/Model/StringEnumRef.md
|
||||
docs/Model/Tag.md
|
||||
docs/Model/TestFormObjectMultipartRequestMarker.md
|
||||
docs/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md
|
||||
docs/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md
|
||||
git_push.sh
|
||||
phpunit.xml.dist
|
||||
src/Api/AuthApi.php
|
||||
src/Api/BodyApi.php
|
||||
src/Api/FormApi.php
|
||||
src/Api/HeaderApi.php
|
||||
src/Api/PathApi.php
|
||||
src/Api/QueryApi.php
|
||||
src/ApiException.php
|
||||
src/Configuration.php
|
||||
src/HeaderSelector.php
|
||||
src/Model/Bird.php
|
||||
src/Model/Category.php
|
||||
src/Model/DataQuery.php
|
||||
src/Model/DefaultValue.php
|
||||
src/Model/ModelInterface.php
|
||||
src/Model/NumberPropertiesOnly.php
|
||||
src/Model/Pet.php
|
||||
src/Model/Query.php
|
||||
src/Model/StringEnumRef.php
|
||||
src/Model/Tag.php
|
||||
src/Model/TestFormObjectMultipartRequestMarker.php
|
||||
src/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.php
|
||||
src/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.php
|
||||
src/ObjectSerializer.php
|
@ -0,0 +1 @@
|
||||
7.8.0-SNAPSHOT
|
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @generated
|
||||
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
|
||||
*/
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->in(__DIR__)
|
||||
->exclude('vendor')
|
||||
->exclude('test')
|
||||
->exclude('tests')
|
||||
;
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@PSR12' => true,
|
||||
'phpdoc_order' => true,
|
||||
'array_syntax' => [ 'syntax' => 'short' ],
|
||||
'strict_comparison' => true,
|
||||
'strict_param' => true,
|
||||
'no_trailing_whitespace' => false,
|
||||
'no_trailing_whitespace_in_comment' => false,
|
||||
'braces' => false,
|
||||
'single_blank_line_at_eof' => false,
|
||||
'blank_line_after_namespace' => false,
|
||||
'no_leading_import_slash' => false,
|
||||
])
|
||||
->setFinder($finder)
|
||||
;
|
11
samples/client/echo_api/php-nextgen-streaming/.phplint.yml
Normal file
11
samples/client/echo_api/php-nextgen-streaming/.phplint.yml
Normal file
@ -0,0 +1,11 @@
|
||||
path:
|
||||
- ./src
|
||||
- ./tests
|
||||
jobs: 10
|
||||
extensions:
|
||||
- php
|
||||
exclude:
|
||||
- vendor
|
||||
warning: true
|
||||
memory-limit: -1
|
||||
no-cache: true
|
12
samples/client/echo_api/php-nextgen-streaming/.travis.yml
Normal file
12
samples/client/echo_api/php-nextgen-streaming/.travis.yml
Normal file
@ -0,0 +1,12 @@
|
||||
language: php
|
||||
# Jammy Jellyfish environment has preinstalled PHP 8.1
|
||||
# Focal Fossa doesn't fit since it contains preinstalled PHP 7.4 only
|
||||
# https://docs.travis-ci.com/user/reference/jammy/#php-support
|
||||
dist: jammy
|
||||
os:
|
||||
- linux
|
||||
php:
|
||||
- 8.1
|
||||
- 8.2
|
||||
before_install: "composer install"
|
||||
script: "vendor/bin/phpunit"
|
152
samples/client/echo_api/php-nextgen-streaming/README.md
Normal file
152
samples/client/echo_api/php-nextgen-streaming/README.md
Normal file
@ -0,0 +1,152 @@
|
||||
# OpenAPIClient-php
|
||||
|
||||
Echo Server API
|
||||
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
### Requirements
|
||||
|
||||
PHP 8.1 and later.
|
||||
|
||||
### Composer
|
||||
|
||||
To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "vcs",
|
||||
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Then run `composer install`
|
||||
|
||||
### Manual Installation
|
||||
|
||||
Download the files and include `autoload.php`:
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
// Configure HTTP basic authorization: http_auth
|
||||
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
|
||||
->setUsername('YOUR_USERNAME')
|
||||
->setPassword('YOUR_PASSWORD');
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\AuthApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client(),
|
||||
$config
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testAuthHttpBasic();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling AuthApi->testAuthHttpBasic: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
All URIs are relative to *http://localhost:3000*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AuthApi* | [**testAuthHttpBasic**](docs/Api/AuthApi.md#testauthhttpbasic) | **POST** /auth/http/basic | To test HTTP basic authentication
|
||||
*AuthApi* | [**testAuthHttpBearer**](docs/Api/AuthApi.md#testauthhttpbearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication
|
||||
*BodyApi* | [**testBinaryGif**](docs/Api/BodyApi.md#testbinarygif) | **POST** /binary/gif | Test binary (gif) response body
|
||||
*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/Api/BodyApi.md#testbodyapplicationoctetstreambinary) | **POST** /body/application/octetstream/binary | Test body parameter(s)
|
||||
*BodyApi* | [**testBodyMultipartFormdataArrayOfBinary**](docs/Api/BodyApi.md#testbodymultipartformdataarrayofbinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime
|
||||
*BodyApi* | [**testBodyMultipartFormdataSingleBinary**](docs/Api/BodyApi.md#testbodymultipartformdatasinglebinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime
|
||||
*BodyApi* | [**testEchoBodyAllOfPet**](docs/Api/BodyApi.md#testechobodyallofpet) | **POST** /echo/body/allOf/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/Api/BodyApi.md#testechobodyfreeformobjectresponsestring) | **POST** /echo/body/FreeFormObject/response_string | Test free form object
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/Api/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetResponseString**](docs/Api/BodyApi.md#testechobodypetresponsestring) | **POST** /echo/body/Pet/response_string | Test empty response body
|
||||
*BodyApi* | [**testEchoBodyStringEnum**](docs/Api/BodyApi.md#testechobodystringenum) | **POST** /echo/body/string_enum | Test string enum response body
|
||||
*BodyApi* | [**testEchoBodyTagResponseString**](docs/Api/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body)
|
||||
*FormApi* | [**testFormIntegerBooleanString**](docs/Api/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s)
|
||||
*FormApi* | [**testFormObjectMultipart**](docs/Api/FormApi.md#testformobjectmultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema
|
||||
*FormApi* | [**testFormOneof**](docs/Api/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema
|
||||
*HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/Api/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s)
|
||||
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/Api/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s)
|
||||
*QueryApi* | [**testEnumRefString**](docs/Api/QueryApi.md#testenumrefstring) | **GET** /query/enum_ref_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryDatetimeDateString**](docs/Api/QueryApi.md#testquerydatetimedatestring) | **GET** /query/datetime/date/string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryIntegerBooleanString**](docs/Api/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/Api/QueryApi.md#testquerystyledeepobjectexplodetrueobject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/Api/QueryApi.md#testquerystyledeepobjectexplodetrueobjectallof) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeFalseArrayInteger**](docs/Api/QueryApi.md#testquerystyleformexplodefalsearrayinteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeFalseArrayString**](docs/Api/QueryApi.md#testquerystyleformexplodefalsearraystring) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/Api/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/Api/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
|
||||
*QueryApi* | [**testQueryStyleFormExplodeTrueObjectAllOf**](docs/Api/QueryApi.md#testquerystyleformexplodetrueobjectallof) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s)
|
||||
|
||||
## Models
|
||||
|
||||
- [Bird](docs/Model/Bird.md)
|
||||
- [Category](docs/Model/Category.md)
|
||||
- [DataQuery](docs/Model/DataQuery.md)
|
||||
- [DefaultValue](docs/Model/DefaultValue.md)
|
||||
- [NumberPropertiesOnly](docs/Model/NumberPropertiesOnly.md)
|
||||
- [Pet](docs/Model/Pet.md)
|
||||
- [Query](docs/Model/Query.md)
|
||||
- [StringEnumRef](docs/Model/StringEnumRef.md)
|
||||
- [Tag](docs/Model/Tag.md)
|
||||
- [TestFormObjectMultipartRequestMarker](docs/Model/TestFormObjectMultipartRequestMarker.md)
|
||||
- [TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter](docs/Model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.md)
|
||||
- [TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/Model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md)
|
||||
|
||||
## Authorization
|
||||
|
||||
### http_auth
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
|
||||
### http_bearer_auth
|
||||
|
||||
- **Type**: Bearer authentication
|
||||
|
||||
## Tests
|
||||
|
||||
To run the tests, use:
|
||||
|
||||
```bash
|
||||
composer install
|
||||
vendor/bin/phpunit
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
team@openapitools.org
|
||||
|
||||
## About this package
|
||||
|
||||
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||
|
||||
- API version: `0.1.0`
|
||||
- Generator version: `7.8.0-SNAPSHOT`
|
||||
- Build package: `org.openapitools.codegen.languages.PhpNextgenClientCodegen`
|
45
samples/client/echo_api/php-nextgen-streaming/composer.json
Normal file
45
samples/client/echo_api/php-nextgen-streaming/composer.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"description": "Echo Server API",
|
||||
"keywords": [
|
||||
"openapitools",
|
||||
"openapi-generator",
|
||||
"openapi",
|
||||
"php",
|
||||
"sdk",
|
||||
"rest",
|
||||
"api"
|
||||
],
|
||||
"homepage": "https://openapi-generator.tech",
|
||||
"license": "unlicense",
|
||||
"authors": [
|
||||
{
|
||||
"name": "OpenAPI-Generator contributors",
|
||||
"homepage": "https://openapi-generator.tech"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"guzzlehttp/guzzle": "^7.4.5",
|
||||
"guzzlehttp/psr7": "^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.5",
|
||||
"overtrue/phplint": "^9.0",
|
||||
"phpunit/phpunit": "^9.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "OpenAPI\\Client\\" : "src/" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "OpenAPI\\Client\\Test\\" : "tests/" }
|
||||
},
|
||||
"scripts": {
|
||||
"test": [
|
||||
"@phplint"
|
||||
],
|
||||
"phplint": "phplint"
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
# OpenAPI\Client\AuthApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testAuthHttpBasic()**](AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication |
|
||||
| [**testAuthHttpBearer()**](AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication |
|
||||
|
||||
|
||||
## `testAuthHttpBasic()`
|
||||
|
||||
```php
|
||||
testAuthHttpBasic(): string
|
||||
```
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
To test HTTP basic authentication
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
// Configure HTTP basic authorization: http_auth
|
||||
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
|
||||
->setUsername('YOUR_USERNAME')
|
||||
->setPassword('YOUR_PASSWORD');
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\AuthApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client(),
|
||||
$config
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testAuthHttpBasic();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling AuthApi->testAuthHttpBasic: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_auth](../../README.md#http_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testAuthHttpBearer()`
|
||||
|
||||
```php
|
||||
testAuthHttpBearer(): string
|
||||
```
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
To test HTTP bearer authentication
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
// Configure Bearer authorization: http_bearer_auth
|
||||
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\AuthApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client(),
|
||||
$config
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testAuthHttpBearer();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling AuthApi->testAuthHttpBearer: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_bearer_auth](../../README.md#http_bearer_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,574 @@
|
||||
# OpenAPI\Client\BodyApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testBinaryGif()**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body |
|
||||
| [**testBodyApplicationOctetstreamBinary()**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) |
|
||||
| [**testBodyMultipartFormdataArrayOfBinary()**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime |
|
||||
| [**testBodyMultipartFormdataSingleBinary()**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime |
|
||||
| [**testEchoBodyAllOfPet()**](BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyFreeFormObjectResponseString()**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object |
|
||||
| [**testEchoBodyPet()**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) |
|
||||
| [**testEchoBodyPetResponseString()**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body |
|
||||
| [**testEchoBodyStringEnum()**](BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body |
|
||||
| [**testEchoBodyTagResponseString()**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) |
|
||||
|
||||
|
||||
## `testBinaryGif()`
|
||||
|
||||
```php
|
||||
testBinaryGif(): \Psr\Http\Message\StreamInterface
|
||||
```
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
Test binary (gif) response body
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testBinaryGif();
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testBinaryGif: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**\Psr\Http\Message\StreamInterface**](../Model/\Psr\Http\Message\StreamInterface.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `image/gif`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testBodyApplicationOctetstreamBinary()`
|
||||
|
||||
```php
|
||||
testBodyApplicationOctetstreamBinary($body): string
|
||||
```
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = "/path/to/file.txt"; // \Psr\Http\Message\StreamInterface
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testBodyApplicationOctetstreamBinary($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testBodyApplicationOctetstreamBinary: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **body** | **\Psr\Http\Message\StreamInterface****\Psr\Http\Message\StreamInterface**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/octet-stream`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testBodyMultipartFormdataArrayOfBinary()`
|
||||
|
||||
```php
|
||||
testBodyMultipartFormdataArrayOfBinary($files): string
|
||||
```
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
Test array of binary in multipart mime
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$files = array("/path/to/file.txt"); // \Psr\Http\Message\StreamInterface[]
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testBodyMultipartFormdataArrayOfBinary($files);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testBodyMultipartFormdataArrayOfBinary: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **files** | **\Psr\Http\Message\StreamInterface[]**| | |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `multipart/form-data`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testBodyMultipartFormdataSingleBinary()`
|
||||
|
||||
```php
|
||||
testBodyMultipartFormdataSingleBinary($my_file): string
|
||||
```
|
||||
|
||||
Test single binary in multipart mime
|
||||
|
||||
Test single binary in multipart mime
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$my_file = "/path/to/file.txt"; // \Psr\Http\Message\StreamInterface
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testBodyMultipartFormdataSingleBinary($my_file);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testBodyMultipartFormdataSingleBinary: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **my_file** | **\Psr\Http\Message\StreamInterface****\Psr\Http\Message\StreamInterface**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `multipart/form-data`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyAllOfPet()`
|
||||
|
||||
```php
|
||||
testEchoBodyAllOfPet($pet): \OpenAPI\Client\Model\Pet
|
||||
```
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyAllOfPet($pet);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyAllOfPet: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyFreeFormObjectResponseString()`
|
||||
|
||||
```php
|
||||
testEchoBodyFreeFormObjectResponseString($body): string
|
||||
```
|
||||
|
||||
Test free form object
|
||||
|
||||
Test free form object
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = array('key' => new \stdClass); // object | Free form object
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyFreeFormObjectResponseString($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyFreeFormObjectResponseString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **body** | **object**| Free form object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyPet()`
|
||||
|
||||
```php
|
||||
testEchoBodyPet($pet): \OpenAPI\Client\Model\Pet
|
||||
```
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
Test body parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyPet($pet);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyPet: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyPetResponseString()`
|
||||
|
||||
```php
|
||||
testEchoBodyPetResponseString($pet): string
|
||||
```
|
||||
|
||||
Test empty response body
|
||||
|
||||
Test empty response body
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyPetResponseString($pet);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyPetResponseString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyStringEnum()`
|
||||
|
||||
```php
|
||||
testEchoBodyStringEnum($body): \OpenAPI\Client\Model\StringEnumRef
|
||||
```
|
||||
|
||||
Test string enum response body
|
||||
|
||||
Test string enum response body
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$body = 'body_example'; // string | String enum
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyStringEnum($body);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyStringEnum: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **body** | **string**| String enum | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**\OpenAPI\Client\Model\StringEnumRef**](../Model/StringEnumRef.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `application/json`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testEchoBodyTagResponseString()`
|
||||
|
||||
```php
|
||||
testEchoBodyTagResponseString($tag): string
|
||||
```
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
Test empty json (request body)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\BodyApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$tag = new \OpenAPI\Client\Model\Tag(); // \OpenAPI\Client\Model\Tag | Tag object
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEchoBodyTagResponseString($tag);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling BodyApi->testEchoBodyTagResponseString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **tag** | [**\OpenAPI\Client\Model\Tag**](../Model/Tag.md)| Tag object | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/json`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,192 @@
|
||||
# OpenAPI\Client\FormApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testFormIntegerBooleanString()**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) |
|
||||
| [**testFormObjectMultipart()**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema |
|
||||
| [**testFormOneof()**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema |
|
||||
|
||||
|
||||
## `testFormIntegerBooleanString()`
|
||||
|
||||
```php
|
||||
testFormIntegerBooleanString($integer_form, $boolean_form, $string_form): string
|
||||
```
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
Test form parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\FormApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$integer_form = 56; // int
|
||||
$boolean_form = True; // bool
|
||||
$string_form = 'string_form_example'; // string
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testFormIntegerBooleanString($integer_form, $boolean_form, $string_form);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FormApi->testFormIntegerBooleanString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **integer_form** | **int**| | [optional] |
|
||||
| **boolean_form** | **bool**| | [optional] |
|
||||
| **string_form** | **string**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/x-www-form-urlencoded`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testFormObjectMultipart()`
|
||||
|
||||
```php
|
||||
testFormObjectMultipart($marker): string
|
||||
```
|
||||
|
||||
Test form parameter(s) for multipart schema
|
||||
|
||||
Test form parameter(s) for multipart schema
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\FormApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$marker = new \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker(); // \OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testFormObjectMultipart($marker);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FormApi->testFormObjectMultipart: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **marker** | [**\OpenAPI\Client\Model\TestFormObjectMultipartRequestMarker**](../Model/TestFormObjectMultipartRequestMarker.md)| | |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `multipart/form-data`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testFormOneof()`
|
||||
|
||||
```php
|
||||
testFormOneof($form1, $form2, $form3, $form4, $id, $name): string
|
||||
```
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
Test form parameter(s) for oneOf schema
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\FormApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$form1 = 'form1_example'; // string
|
||||
$form2 = 56; // int
|
||||
$form3 = 'form3_example'; // string
|
||||
$form4 = True; // bool
|
||||
$id = 56; // int
|
||||
$name = 'name_example'; // string
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testFormOneof($form1, $form2, $form3, $form4, $id, $name);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling FormApi->testFormOneof: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **form1** | **string**| | [optional] |
|
||||
| **form2** | **int**| | [optional] |
|
||||
| **form3** | **string**| | [optional] |
|
||||
| **form4** | **bool**| | [optional] |
|
||||
| **id** | **int**| | [optional] |
|
||||
| **name** | **string**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: `application/x-www-form-urlencoded`
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,72 @@
|
||||
# OpenAPI\Client\HeaderApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testHeaderIntegerBooleanStringEnums()**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) |
|
||||
|
||||
|
||||
## `testHeaderIntegerBooleanStringEnums()`
|
||||
|
||||
```php
|
||||
testHeaderIntegerBooleanStringEnums($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header): string
|
||||
```
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
Test header parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\HeaderApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$integer_header = 56; // int
|
||||
$boolean_header = True; // bool
|
||||
$string_header = 'string_header_example'; // string
|
||||
$enum_nonref_string_header = 'enum_nonref_string_header_example'; // string
|
||||
$enum_ref_string_header = new \OpenAPI\Client\Model\StringEnumRef(); // StringEnumRef
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testHeaderIntegerBooleanStringEnums($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling HeaderApi->testHeaderIntegerBooleanStringEnums: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **integer_header** | **int**| | [optional] |
|
||||
| **boolean_header** | **bool**| | [optional] |
|
||||
| **string_header** | **string**| | [optional] |
|
||||
| **enum_nonref_string_header** | **string**| | [optional] |
|
||||
| **enum_ref_string_header** | [**StringEnumRef**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,70 @@
|
||||
# OpenAPI\Client\PathApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath()**](PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) |
|
||||
|
||||
|
||||
## `testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath()`
|
||||
|
||||
```php
|
||||
testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path): string
|
||||
```
|
||||
|
||||
Test path parameter(s)
|
||||
|
||||
Test path parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\PathApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$path_string = 'path_string_example'; // string
|
||||
$path_integer = 56; // int
|
||||
$enum_nonref_string_path = 'enum_nonref_string_path_example'; // string
|
||||
$enum_ref_string_path = new \OpenAPI\Client\Model\StringEnumRef(); // StringEnumRef
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling PathApi->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **path_string** | **string**| | |
|
||||
| **path_integer** | **int**| | |
|
||||
| **enum_nonref_string_path** | **string**| | |
|
||||
| **enum_ref_string_path** | [**StringEnumRef**](../Model/.md)| | |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,587 @@
|
||||
# OpenAPI\Client\QueryApi
|
||||
|
||||
All URIs are relative to http://localhost:3000, except if the operation defines another base path.
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
| ------------- | ------------- | ------------- |
|
||||
| [**testEnumRefString()**](QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s) |
|
||||
| [**testQueryDatetimeDateString()**](QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s) |
|
||||
| [**testQueryIntegerBooleanString()**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) |
|
||||
| [**testQueryStyleDeepObjectExplodeTrueObject()**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf()**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeFalseArrayInteger()**](QueryApi.md#testQueryStyleFormExplodeFalseArrayInteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeFalseArrayString()**](QueryApi.md#testQueryStyleFormExplodeFalseArrayString) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueArrayString()**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObject()**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
|
||||
| [**testQueryStyleFormExplodeTrueObjectAllOf()**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) |
|
||||
|
||||
|
||||
## `testEnumRefString()`
|
||||
|
||||
```php
|
||||
testEnumRefString($enum_nonref_string_query, $enum_ref_string_query): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$enum_nonref_string_query = 'enum_nonref_string_query_example'; // string
|
||||
$enum_ref_string_query = new \OpenAPI\Client\Model\StringEnumRef(); // StringEnumRef
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testEnumRefString($enum_nonref_string_query, $enum_ref_string_query);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testEnumRefString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **enum_nonref_string_query** | **string**| | [optional] |
|
||||
| **enum_ref_string_query** | [**StringEnumRef**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryDatetimeDateString()`
|
||||
|
||||
```php
|
||||
testQueryDatetimeDateString($datetime_query, $date_query, $string_query): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$datetime_query = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime
|
||||
$date_query = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime
|
||||
$string_query = 'string_query_example'; // string
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryDatetimeDateString($datetime_query, $date_query, $string_query);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryDatetimeDateString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **datetime_query** | **\DateTime**| | [optional] |
|
||||
| **date_query** | **\DateTime**| | [optional] |
|
||||
| **string_query** | **string**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryIntegerBooleanString()`
|
||||
|
||||
```php
|
||||
testQueryIntegerBooleanString($integer_query, $boolean_query, $string_query): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$integer_query = 56; // int
|
||||
$boolean_query = True; // bool
|
||||
$string_query = 'string_query_example'; // string
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryIntegerBooleanString($integer_query, $boolean_query, $string_query);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryIntegerBooleanString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **integer_query** | **int**| | [optional] |
|
||||
| **boolean_query** | **bool**| | [optional] |
|
||||
| **string_query** | **string**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleDeepObjectExplodeTrueObject()`
|
||||
|
||||
```php
|
||||
testQueryStyleDeepObjectExplodeTrueObject($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = new \OpenAPI\Client\Model\Pet(); // Pet
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleDeepObjectExplodeTrueObject($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleDeepObjectExplodeTrueObject: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**Pet**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleDeepObjectExplodeTrueObjectAllOf()`
|
||||
|
||||
```php
|
||||
testQueryStyleDeepObjectExplodeTrueObjectAllOf($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = new \OpenAPI\Client\Model\TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(); // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleDeepObjectExplodeTrueObjectAllOf($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleDeepObjectExplodeTrueObjectAllOf: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleFormExplodeFalseArrayInteger()`
|
||||
|
||||
```php
|
||||
testQueryStyleFormExplodeFalseArrayInteger($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = array(56); // int[]
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleFormExplodeFalseArrayInteger($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleFormExplodeFalseArrayInteger: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**int[]**](../Model/int.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleFormExplodeFalseArrayString()`
|
||||
|
||||
```php
|
||||
testQueryStyleFormExplodeFalseArrayString($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = array('query_object_example'); // string[]
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleFormExplodeFalseArrayString($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleFormExplodeFalseArrayString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**string[]**](../Model/string.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleFormExplodeTrueArrayString()`
|
||||
|
||||
```php
|
||||
testQueryStyleFormExplodeTrueArrayString($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = new \OpenAPI\Client\Model\TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(); // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleFormExplodeTrueArrayString($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleFormExplodeTrueArrayString: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleFormExplodeTrueObject()`
|
||||
|
||||
```php
|
||||
testQueryStyleFormExplodeTrueObject($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = new \OpenAPI\Client\Model\Pet(); // Pet
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleFormExplodeTrueObject($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleFormExplodeTrueObject: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**Pet**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
||||
|
||||
## `testQueryStyleFormExplodeTrueObjectAllOf()`
|
||||
|
||||
```php
|
||||
testQueryStyleFormExplodeTrueObjectAllOf($query_object): string
|
||||
```
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
Test query parameter(s)
|
||||
|
||||
### Example
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once(__DIR__ . '/vendor/autoload.php');
|
||||
|
||||
|
||||
|
||||
$apiInstance = new OpenAPI\Client\Api\QueryApi(
|
||||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
|
||||
// This is optional, `GuzzleHttp\Client` will be used as default.
|
||||
new GuzzleHttp\Client()
|
||||
);
|
||||
$query_object = new \OpenAPI\Client\Model\DataQuery(); // DataQuery
|
||||
|
||||
try {
|
||||
$result = $apiInstance->testQueryStyleFormExplodeTrueObjectAllOf($query_object);
|
||||
print_r($result);
|
||||
} catch (Exception $e) {
|
||||
echo 'Exception when calling QueryApi->testQueryStyleFormExplodeTrueObjectAllOf: ', $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
| ------------- | ------------- | ------------- | ------------- |
|
||||
| **query_object** | [**DataQuery**](../Model/.md)| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: `text/plain`
|
||||
|
||||
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
|
||||
[[Back to Model list]](../../README.md#models)
|
||||
[[Back to README]](../../README.md)
|
@ -0,0 +1,10 @@
|
||||
# # Bird
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**size** | **string** | | [optional]
|
||||
**color** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,10 @@
|
||||
# # Category
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,11 @@
|
||||
# # DataQuery
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**suffix** | **string** | test suffix | [optional]
|
||||
**text** | **string** | Some text containing white spaces | [optional]
|
||||
**date** | **\DateTime** | A date | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,16 @@
|
||||
# # DefaultValue
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**array_string_enum_ref_default** | [**\OpenAPI\Client\Model\StringEnumRef[]**](StringEnumRef.md) | | [optional] [default to [["success","failure"]]]
|
||||
**array_string_enum_default** | **string[]** | | [optional] [default to [["success","failure"]]]
|
||||
**array_string_default** | **string[]** | | [optional] [default to [["failure","skipped"]]]
|
||||
**array_integer_default** | **int[]** | | [optional] [default to [[1,3]]]
|
||||
**array_string** | **string[]** | | [optional]
|
||||
**array_string_nullable** | **string[]** | | [optional]
|
||||
**array_string_extension_nullable** | **string[]** | | [optional]
|
||||
**string_nullable** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,11 @@
|
||||
# # NumberPropertiesOnly
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**number** | **float** | | [optional]
|
||||
**float** | **float** | | [optional]
|
||||
**double** | **float** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,14 @@
|
||||
# # Pet
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | |
|
||||
**category** | [**\OpenAPI\Client\Model\Category**](Category.md) | | [optional]
|
||||
**photo_urls** | **string[]** | |
|
||||
**tags** | [**\OpenAPI\Client\Model\Tag[]**](Tag.md) | | [optional]
|
||||
**status** | **string** | pet status in the store | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,10 @@
|
||||
# # Query
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | Query | [optional]
|
||||
**outcomes** | **string[]** | | [optional] [default to [["SUCCESS","FAILURE"]]]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,8 @@
|
||||
# # StringEnumRef
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,10 @@
|
||||
# # Tag
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,9 @@
|
||||
# # TestFormObjectMultipartRequestMarker
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,12 @@
|
||||
# # TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**size** | **string** | | [optional]
|
||||
**color** | **string** | | [optional]
|
||||
**id** | **int** | | [optional]
|
||||
**name** | **string** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
@ -0,0 +1,9 @@
|
||||
# # TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**values** | **string[]** | | [optional]
|
||||
|
||||
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
|
57
samples/client/echo_api/php-nextgen-streaming/git_push.sh
Normal file
57
samples/client/echo_api/php-nextgen-streaming/git_push.sh
Normal file
@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
git_host=$4
|
||||
|
||||
if [ "$git_host" = "" ]; then
|
||||
git_host="github.com"
|
||||
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||
fi
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="GIT_USER_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="GIT_REPO_ID"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=$(git remote)
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||
<coverage processUncoveredFiles="true">
|
||||
<include>
|
||||
<directory suffix=".php">./src/Api</directory>
|
||||
<directory suffix=".php">./src/Model</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="tests">
|
||||
<directory>./tests/Api</directory>
|
||||
<directory>./tests/Model</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<php>
|
||||
<ini name="error_reporting" value="E_ALL"/>
|
||||
</php>
|
||||
</phpunit>
|
@ -0,0 +1,749 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthApi
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Api;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use GuzzleHttp\Client;
|
||||
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;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* AuthApi Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AuthApi
|
||||
{
|
||||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected ClientInterface $client;
|
||||
|
||||
/**
|
||||
* @var Configuration
|
||||
*/
|
||||
protected Configuration $config;
|
||||
|
||||
/**
|
||||
* @var HeaderSelector
|
||||
*/
|
||||
protected HeaderSelector $headerSelector;
|
||||
|
||||
/**
|
||||
* @var int Host index
|
||||
*/
|
||||
protected int $hostIndex;
|
||||
|
||||
/** @var string[] $contentTypes **/
|
||||
public const contentTypes = [
|
||||
'testAuthHttpBasic' => [
|
||||
'application/json',
|
||||
],
|
||||
'testAuthHttpBearer' => [
|
||||
'application/json',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param ClientInterface|null $client
|
||||
* @param Configuration|null $config
|
||||
* @param HeaderSelector|null $selector
|
||||
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
|
||||
*/
|
||||
public function __construct(
|
||||
ClientInterface $client = null,
|
||||
Configuration $config = null,
|
||||
HeaderSelector $selector = null,
|
||||
int $hostIndex = 0
|
||||
) {
|
||||
$this->client = $client ?: new Client();
|
||||
$this->config = $config ?: new Configuration();
|
||||
$this->headerSelector = $selector ?: new HeaderSelector();
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the host index
|
||||
*
|
||||
* @param int $hostIndex Host index (required)
|
||||
*/
|
||||
public function setHostIndex(int $hostIndex): void
|
||||
{
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the host index
|
||||
*
|
||||
* @return int Host index
|
||||
*/
|
||||
public function getHostIndex(): int
|
||||
{
|
||||
return $this->hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Configuration
|
||||
*/
|
||||
public function getConfig(): Configuration
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBasic
|
||||
*
|
||||
* To test HTTP basic authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBasic'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return string
|
||||
*/
|
||||
public function testAuthHttpBasic(
|
||||
string $contentType = self::contentTypes['testAuthHttpBasic'][0]
|
||||
): string
|
||||
{
|
||||
list($response) = $this->testAuthHttpBasicWithHttpInfo($contentType);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBasicWithHttpInfo
|
||||
*
|
||||
* To test HTTP basic authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBasic'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testAuthHttpBasicWithHttpInfo(
|
||||
string $contentType = self::contentTypes['testAuthHttpBasic'][0]
|
||||
): array
|
||||
{
|
||||
$request = $this->testAuthHttpBasicRequest($contentType);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||
);
|
||||
} catch (ConnectException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
(string) $request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = ObjectSerializer::deserialize(
|
||||
$e->getResponseBody(),
|
||||
'string',
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBasicAsync
|
||||
*
|
||||
* To test HTTP basic authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBasic'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testAuthHttpBasicAsync(
|
||||
string $contentType = self::contentTypes['testAuthHttpBasic'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
return $this->testAuthHttpBasicAsyncWithHttpInfo($contentType)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBasicAsyncWithHttpInfo
|
||||
*
|
||||
* To test HTTP basic authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBasic'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testAuthHttpBasicAsyncWithHttpInfo(
|
||||
string $contentType = self::contentTypes['testAuthHttpBasic'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
$returnType = 'string';
|
||||
$request = $this->testAuthHttpBasicRequest($contentType);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'testAuthHttpBasic'
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBasic'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
public function testAuthHttpBasicRequest(
|
||||
string $contentType = self::contentTypes['testAuthHttpBasic'][0]
|
||||
): Request
|
||||
{
|
||||
|
||||
|
||||
$resourcePath = '/auth/http/basic';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['text/plain', ],
|
||||
$contentType,
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
// this endpoint requires HTTP basic authentication
|
||||
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
|
||||
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
|
||||
}
|
||||
|
||||
$defaultHeaders = [];
|
||||
if ($this->config->getUserAgent()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$operationHost = $this->config->getHost();
|
||||
$query = ObjectSerializer::buildQuery($queryParams);
|
||||
return new Request(
|
||||
'POST',
|
||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBearer
|
||||
*
|
||||
* To test HTTP bearer authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBearer'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return string
|
||||
*/
|
||||
public function testAuthHttpBearer(
|
||||
string $contentType = self::contentTypes['testAuthHttpBearer'][0]
|
||||
): string
|
||||
{
|
||||
list($response) = $this->testAuthHttpBearerWithHttpInfo($contentType);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBearerWithHttpInfo
|
||||
*
|
||||
* To test HTTP bearer authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBearer'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testAuthHttpBearerWithHttpInfo(
|
||||
string $contentType = self::contentTypes['testAuthHttpBearer'][0]
|
||||
): array
|
||||
{
|
||||
$request = $this->testAuthHttpBearerRequest($contentType);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||
);
|
||||
} catch (ConnectException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
(string) $request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = ObjectSerializer::deserialize(
|
||||
$e->getResponseBody(),
|
||||
'string',
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBearerAsync
|
||||
*
|
||||
* To test HTTP bearer authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBearer'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testAuthHttpBearerAsync(
|
||||
string $contentType = self::contentTypes['testAuthHttpBearer'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
return $this->testAuthHttpBearerAsyncWithHttpInfo($contentType)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testAuthHttpBearerAsyncWithHttpInfo
|
||||
*
|
||||
* To test HTTP bearer authentication
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBearer'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testAuthHttpBearerAsyncWithHttpInfo(
|
||||
string $contentType = self::contentTypes['testAuthHttpBearer'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
$returnType = 'string';
|
||||
$request = $this->testAuthHttpBearerRequest($contentType);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'testAuthHttpBearer'
|
||||
*
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testAuthHttpBearer'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
public function testAuthHttpBearerRequest(
|
||||
string $contentType = self::contentTypes['testAuthHttpBearer'][0]
|
||||
): Request
|
||||
{
|
||||
|
||||
|
||||
$resourcePath = '/auth/http/bearer';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['text/plain', ],
|
||||
$contentType,
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
// this endpoint requires Bearer authentication (access token)
|
||||
if (!empty($this->config->getAccessToken())) {
|
||||
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
|
||||
}
|
||||
|
||||
$defaultHeaders = [];
|
||||
if ($this->config->getUserAgent()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$operationHost = $this->config->getHost();
|
||||
$query = ObjectSerializer::buildQuery($queryParams);
|
||||
return new Request(
|
||||
'POST',
|
||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create http client option
|
||||
*
|
||||
* @throws \RuntimeException on file opening failure
|
||||
* @return array of http client options
|
||||
*/
|
||||
protected function createHttpClientOption(): array
|
||||
{
|
||||
$options = [];
|
||||
if ($this->config->getDebug()) {
|
||||
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
|
||||
if (!$options[RequestOptions::DEBUG]) {
|
||||
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
3323
samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php
Normal file
3323
samples/client/echo_api/php-nextgen-streaming/src/Api/BodyApi.php
Normal file
File diff suppressed because it is too large
Load Diff
1197
samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php
Normal file
1197
samples/client/echo_api/php-nextgen-streaming/src/Api/FormApi.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,516 @@
|
||||
<?php
|
||||
/**
|
||||
* HeaderApi
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Api;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use GuzzleHttp\Client;
|
||||
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;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* HeaderApi Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class HeaderApi
|
||||
{
|
||||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected ClientInterface $client;
|
||||
|
||||
/**
|
||||
* @var Configuration
|
||||
*/
|
||||
protected Configuration $config;
|
||||
|
||||
/**
|
||||
* @var HeaderSelector
|
||||
*/
|
||||
protected HeaderSelector $headerSelector;
|
||||
|
||||
/**
|
||||
* @var int Host index
|
||||
*/
|
||||
protected int $hostIndex;
|
||||
|
||||
/** @var string[] $contentTypes **/
|
||||
public const contentTypes = [
|
||||
'testHeaderIntegerBooleanStringEnums' => [
|
||||
'application/json',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param ClientInterface|null $client
|
||||
* @param Configuration|null $config
|
||||
* @param HeaderSelector|null $selector
|
||||
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
|
||||
*/
|
||||
public function __construct(
|
||||
ClientInterface $client = null,
|
||||
Configuration $config = null,
|
||||
HeaderSelector $selector = null,
|
||||
int $hostIndex = 0
|
||||
) {
|
||||
$this->client = $client ?: new Client();
|
||||
$this->config = $config ?: new Configuration();
|
||||
$this->headerSelector = $selector ?: new HeaderSelector();
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the host index
|
||||
*
|
||||
* @param int $hostIndex Host index (required)
|
||||
*/
|
||||
public function setHostIndex(int $hostIndex): void
|
||||
{
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the host index
|
||||
*
|
||||
* @return int Host index
|
||||
*/
|
||||
public function getHostIndex(): int
|
||||
{
|
||||
return $this->hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Configuration
|
||||
*/
|
||||
public function getConfig(): Configuration
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testHeaderIntegerBooleanStringEnums
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* @param int|null $integer_header integer_header (optional)
|
||||
* @param bool|null $boolean_header boolean_header (optional)
|
||||
* @param string|null $string_header string_header (optional)
|
||||
* @param string|null $enum_nonref_string_header enum_nonref_string_header (optional)
|
||||
* @param StringEnumRef|null $enum_ref_string_header enum_ref_string_header (optional)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testHeaderIntegerBooleanStringEnums'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return string
|
||||
*/
|
||||
public function testHeaderIntegerBooleanStringEnums(
|
||||
?int $integer_header = null,
|
||||
?bool $boolean_header = null,
|
||||
?string $string_header = null,
|
||||
?string $enum_nonref_string_header = null,
|
||||
?StringEnumRef $enum_ref_string_header = null,
|
||||
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
|
||||
): string
|
||||
{
|
||||
list($response) = $this->testHeaderIntegerBooleanStringEnumsWithHttpInfo($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header, $contentType);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testHeaderIntegerBooleanStringEnumsWithHttpInfo
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* @param int|null $integer_header (optional)
|
||||
* @param bool|null $boolean_header (optional)
|
||||
* @param string|null $string_header (optional)
|
||||
* @param string|null $enum_nonref_string_header (optional)
|
||||
* @param StringEnumRef|null $enum_ref_string_header (optional)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testHeaderIntegerBooleanStringEnums'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testHeaderIntegerBooleanStringEnumsWithHttpInfo(
|
||||
?int $integer_header = null,
|
||||
?bool $boolean_header = null,
|
||||
?string $string_header = null,
|
||||
?string $enum_nonref_string_header = null,
|
||||
?StringEnumRef $enum_ref_string_header = null,
|
||||
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
|
||||
): array
|
||||
{
|
||||
$request = $this->testHeaderIntegerBooleanStringEnumsRequest($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header, $contentType);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||
);
|
||||
} catch (ConnectException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
(string) $request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = ObjectSerializer::deserialize(
|
||||
$e->getResponseBody(),
|
||||
'string',
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testHeaderIntegerBooleanStringEnumsAsync
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* @param int|null $integer_header (optional)
|
||||
* @param bool|null $boolean_header (optional)
|
||||
* @param string|null $string_header (optional)
|
||||
* @param string|null $enum_nonref_string_header (optional)
|
||||
* @param StringEnumRef|null $enum_ref_string_header (optional)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testHeaderIntegerBooleanStringEnums'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testHeaderIntegerBooleanStringEnumsAsync(
|
||||
?int $integer_header = null,
|
||||
?bool $boolean_header = null,
|
||||
?string $string_header = null,
|
||||
?string $enum_nonref_string_header = null,
|
||||
?StringEnumRef $enum_ref_string_header = null,
|
||||
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
return $this->testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header, $contentType)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo
|
||||
*
|
||||
* Test header parameter(s)
|
||||
*
|
||||
* @param int|null $integer_header (optional)
|
||||
* @param bool|null $boolean_header (optional)
|
||||
* @param string|null $string_header (optional)
|
||||
* @param string|null $enum_nonref_string_header (optional)
|
||||
* @param StringEnumRef|null $enum_ref_string_header (optional)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testHeaderIntegerBooleanStringEnums'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testHeaderIntegerBooleanStringEnumsAsyncWithHttpInfo(
|
||||
$integer_header = null,
|
||||
$boolean_header = null,
|
||||
$string_header = null,
|
||||
$enum_nonref_string_header = null,
|
||||
$enum_ref_string_header = null,
|
||||
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
$returnType = 'string';
|
||||
$request = $this->testHeaderIntegerBooleanStringEnumsRequest($integer_header, $boolean_header, $string_header, $enum_nonref_string_header, $enum_ref_string_header, $contentType);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'testHeaderIntegerBooleanStringEnums'
|
||||
*
|
||||
* @param int|null $integer_header (optional)
|
||||
* @param bool|null $boolean_header (optional)
|
||||
* @param string|null $string_header (optional)
|
||||
* @param string|null $enum_nonref_string_header (optional)
|
||||
* @param StringEnumRef|null $enum_ref_string_header (optional)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testHeaderIntegerBooleanStringEnums'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
public function testHeaderIntegerBooleanStringEnumsRequest(
|
||||
$integer_header = null,
|
||||
$boolean_header = null,
|
||||
$string_header = null,
|
||||
$enum_nonref_string_header = null,
|
||||
$enum_ref_string_header = null,
|
||||
string $contentType = self::contentTypes['testHeaderIntegerBooleanStringEnums'][0]
|
||||
): Request
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$resourcePath = '/header/integer/boolean/string/enums';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
// header params
|
||||
if ($integer_header !== null) {
|
||||
$headerParams['integer_header'] = ObjectSerializer::toHeaderValue($integer_header);
|
||||
}
|
||||
// header params
|
||||
if ($boolean_header !== null) {
|
||||
$headerParams['boolean_header'] = ObjectSerializer::toHeaderValue($boolean_header);
|
||||
}
|
||||
// header params
|
||||
if ($string_header !== null) {
|
||||
$headerParams['string_header'] = ObjectSerializer::toHeaderValue($string_header);
|
||||
}
|
||||
// header params
|
||||
if ($enum_nonref_string_header !== null) {
|
||||
$headerParams['enum_nonref_string_header'] = ObjectSerializer::toHeaderValue($enum_nonref_string_header);
|
||||
}
|
||||
// header params
|
||||
if ($enum_ref_string_header !== null) {
|
||||
$headerParams['enum_ref_string_header'] = ObjectSerializer::toHeaderValue($enum_ref_string_header);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['text/plain', ],
|
||||
$contentType,
|
||||
$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()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$operationHost = $this->config->getHost();
|
||||
$query = ObjectSerializer::buildQuery($queryParams);
|
||||
return new Request(
|
||||
'GET',
|
||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create http client option
|
||||
*
|
||||
* @throws \RuntimeException on file opening failure
|
||||
* @return array of http client options
|
||||
*/
|
||||
protected function createHttpClientOption(): array
|
||||
{
|
||||
$options = [];
|
||||
if ($this->config->getDebug()) {
|
||||
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
|
||||
if (!$options[RequestOptions::DEBUG]) {
|
||||
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
@ -0,0 +1,541 @@
|
||||
<?php
|
||||
/**
|
||||
* PathApi
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Api;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use GuzzleHttp\Client;
|
||||
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;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\HeaderSelector;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* PathApi Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class PathApi
|
||||
{
|
||||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected ClientInterface $client;
|
||||
|
||||
/**
|
||||
* @var Configuration
|
||||
*/
|
||||
protected Configuration $config;
|
||||
|
||||
/**
|
||||
* @var HeaderSelector
|
||||
*/
|
||||
protected HeaderSelector $headerSelector;
|
||||
|
||||
/**
|
||||
* @var int Host index
|
||||
*/
|
||||
protected int $hostIndex;
|
||||
|
||||
/** @var string[] $contentTypes **/
|
||||
public const contentTypes = [
|
||||
'testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath' => [
|
||||
'application/json',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param ClientInterface|null $client
|
||||
* @param Configuration|null $config
|
||||
* @param HeaderSelector|null $selector
|
||||
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
|
||||
*/
|
||||
public function __construct(
|
||||
ClientInterface $client = null,
|
||||
Configuration $config = null,
|
||||
HeaderSelector $selector = null,
|
||||
int $hostIndex = 0
|
||||
) {
|
||||
$this->client = $client ?: new Client();
|
||||
$this->config = $config ?: new Configuration();
|
||||
$this->headerSelector = $selector ?: new HeaderSelector();
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the host index
|
||||
*
|
||||
* @param int $hostIndex Host index (required)
|
||||
*/
|
||||
public function setHostIndex(int $hostIndex): void
|
||||
{
|
||||
$this->hostIndex = $hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the host index
|
||||
*
|
||||
* @return int Host index
|
||||
*/
|
||||
public function getHostIndex(): int
|
||||
{
|
||||
return $this->hostIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Configuration
|
||||
*/
|
||||
public function getConfig(): Configuration
|
||||
{
|
||||
return $this->config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath
|
||||
*
|
||||
* Test path parameter(s)
|
||||
*
|
||||
* @param string $path_string path_string (required)
|
||||
* @param int $path_integer path_integer (required)
|
||||
* @param string $enum_nonref_string_path enum_nonref_string_path (required)
|
||||
* @param StringEnumRef $enum_ref_string_path enum_ref_string_path (required)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return string
|
||||
*/
|
||||
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(
|
||||
string $path_string,
|
||||
int $path_integer,
|
||||
string $enum_nonref_string_path,
|
||||
StringEnumRef $enum_ref_string_path,
|
||||
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
|
||||
): string
|
||||
{
|
||||
list($response) = $this->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path, $contentType);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo
|
||||
*
|
||||
* Test path parameter(s)
|
||||
*
|
||||
* @param string $path_string (required)
|
||||
* @param int $path_integer (required)
|
||||
* @param string $enum_nonref_string_path (required)
|
||||
* @param StringEnumRef $enum_ref_string_path (required)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'] to see the possible values for this operation
|
||||
*
|
||||
* @throws ApiException on non-2xx response or if the response body is not in the expected format
|
||||
* @throws InvalidArgumentException
|
||||
* @return array of string, HTTP status code, HTTP response headers (array of strings)
|
||||
*/
|
||||
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(
|
||||
string $path_string,
|
||||
int $path_integer,
|
||||
string $enum_nonref_string_path,
|
||||
StringEnumRef $enum_ref_string_path,
|
||||
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
|
||||
): array
|
||||
{
|
||||
$request = $this->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path, $contentType);
|
||||
|
||||
try {
|
||||
$options = $this->createHttpClientOption();
|
||||
try {
|
||||
$response = $this->client->send($request, $options);
|
||||
} catch (RequestException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
|
||||
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
|
||||
);
|
||||
} catch (ConnectException $e) {
|
||||
throw new ApiException(
|
||||
"[{$e->getCode()}] {$e->getMessage()}",
|
||||
(int) $e->getCode(),
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
$statusCode = $response->getStatusCode();
|
||||
|
||||
if ($statusCode < 200 || $statusCode > 299) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
(string) $request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ('string' !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, 'string', []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
try {
|
||||
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $exception) {
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'Error JSON decoding server response (%s)',
|
||||
$request->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
$content
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
|
||||
} catch (ApiException $e) {
|
||||
switch ($e->getCode()) {
|
||||
case 200:
|
||||
$data = ObjectSerializer::deserialize(
|
||||
$e->getResponseBody(),
|
||||
'string',
|
||||
$e->getResponseHeaders()
|
||||
);
|
||||
$e->setResponseObject($data);
|
||||
break;
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsync
|
||||
*
|
||||
* Test path parameter(s)
|
||||
*
|
||||
* @param string $path_string (required)
|
||||
* @param int $path_integer (required)
|
||||
* @param string $enum_nonref_string_path (required)
|
||||
* @param StringEnumRef $enum_ref_string_path (required)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsync(
|
||||
string $path_string,
|
||||
int $path_integer,
|
||||
string $enum_nonref_string_path,
|
||||
StringEnumRef $enum_ref_string_path,
|
||||
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
return $this->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path, $contentType)
|
||||
->then(
|
||||
function ($response) {
|
||||
return $response[0];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Operation testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo
|
||||
*
|
||||
* Test path parameter(s)
|
||||
*
|
||||
* @param string $path_string (required)
|
||||
* @param int $path_integer (required)
|
||||
* @param string $enum_nonref_string_path (required)
|
||||
* @param StringEnumRef $enum_ref_string_path (required)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return PromiseInterface
|
||||
*/
|
||||
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathAsyncWithHttpInfo(
|
||||
$path_string,
|
||||
$path_integer,
|
||||
$enum_nonref_string_path,
|
||||
$enum_ref_string_path,
|
||||
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
|
||||
): PromiseInterface
|
||||
{
|
||||
$returnType = 'string';
|
||||
$request = $this->testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest($path_string, $path_integer, $enum_nonref_string_path, $enum_ref_string_path, $contentType);
|
||||
|
||||
return $this->client
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
if ($returnType !== 'string') {
|
||||
$content = json_decode($content);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
ObjectSerializer::deserialize($content, $returnType, []),
|
||||
$response->getStatusCode(),
|
||||
$response->getHeaders()
|
||||
];
|
||||
},
|
||||
function ($exception) {
|
||||
$response = $exception->getResponse();
|
||||
$statusCode = $response->getStatusCode();
|
||||
throw new ApiException(
|
||||
sprintf(
|
||||
'[%d] Error connecting to the API (%s)',
|
||||
$statusCode,
|
||||
$exception->getRequest()->getUri()
|
||||
),
|
||||
$statusCode,
|
||||
$response->getHeaders(),
|
||||
(string) $response->getBody()
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create request for operation 'testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'
|
||||
*
|
||||
* @param string $path_string (required)
|
||||
* @param int $path_integer (required)
|
||||
* @param string $enum_nonref_string_path (required)
|
||||
* @param StringEnumRef $enum_ref_string_path (required)
|
||||
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'] to see the possible values for this operation
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return \GuzzleHttp\Psr7\Request
|
||||
*/
|
||||
public function testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest(
|
||||
$path_string,
|
||||
$path_integer,
|
||||
$enum_nonref_string_path,
|
||||
$enum_ref_string_path,
|
||||
string $contentType = self::contentTypes['testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'][0]
|
||||
): Request
|
||||
{
|
||||
|
||||
// verify the required parameter 'path_string' is set
|
||||
if ($path_string === null || (is_array($path_string) && count($path_string) === 0)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Missing the required parameter $path_string when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'
|
||||
);
|
||||
}
|
||||
|
||||
// verify the required parameter 'path_integer' is set
|
||||
if ($path_integer === null || (is_array($path_integer) && count($path_integer) === 0)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Missing the required parameter $path_integer when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'
|
||||
);
|
||||
}
|
||||
|
||||
// verify the required parameter 'enum_nonref_string_path' is set
|
||||
if ($enum_nonref_string_path === null || (is_array($enum_nonref_string_path) && count($enum_nonref_string_path) === 0)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Missing the required parameter $enum_nonref_string_path when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'
|
||||
);
|
||||
}
|
||||
|
||||
// verify the required parameter 'enum_ref_string_path' is set
|
||||
if ($enum_ref_string_path === null || (is_array($enum_ref_string_path) && count($enum_ref_string_path) === 0)) {
|
||||
throw new InvalidArgumentException(
|
||||
'Missing the required parameter $enum_ref_string_path when calling testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$resourcePath = '/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}';
|
||||
$formParams = [];
|
||||
$queryParams = [];
|
||||
$headerParams = [];
|
||||
$httpBody = '';
|
||||
$multipart = false;
|
||||
|
||||
|
||||
|
||||
// path params
|
||||
if ($path_string !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'path_string' . '}',
|
||||
ObjectSerializer::toPathValue($path_string),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// path params
|
||||
if ($path_integer !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'path_integer' . '}',
|
||||
ObjectSerializer::toPathValue($path_integer),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// path params
|
||||
if ($enum_nonref_string_path !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'enum_nonref_string_path' . '}',
|
||||
ObjectSerializer::toPathValue($enum_nonref_string_path),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
// path params
|
||||
if ($enum_ref_string_path !== null) {
|
||||
$resourcePath = str_replace(
|
||||
'{' . 'enum_ref_string_path' . '}',
|
||||
ObjectSerializer::toPathValue($enum_ref_string_path),
|
||||
$resourcePath
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$headers = $this->headerSelector->selectHeaders(
|
||||
['text/plain', ],
|
||||
$contentType,
|
||||
$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()) {
|
||||
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
|
||||
}
|
||||
|
||||
$headers = array_merge(
|
||||
$defaultHeaders,
|
||||
$headerParams,
|
||||
$headers
|
||||
);
|
||||
|
||||
$operationHost = $this->config->getHost();
|
||||
$query = ObjectSerializer::buildQuery($queryParams);
|
||||
return new Request(
|
||||
'GET',
|
||||
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
|
||||
$headers,
|
||||
$httpBody
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create http client option
|
||||
*
|
||||
* @throws \RuntimeException on file opening failure
|
||||
* @return array of http client options
|
||||
*/
|
||||
protected function createHttpClientOption(): array
|
||||
{
|
||||
$options = [];
|
||||
if ($this->config->getDebug()) {
|
||||
$options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a');
|
||||
if (!$options[RequestOptions::DEBUG]) {
|
||||
throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile());
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
3441
samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php
Normal file
3441
samples/client/echo_api/php-nextgen-streaming/src/Api/QueryApi.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,119 @@
|
||||
<?php
|
||||
/**
|
||||
* ApiException
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
use Exception;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* ApiException Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ApiException extends Exception
|
||||
{
|
||||
/**
|
||||
* The HTTP body of the server response either as Json or string.
|
||||
*
|
||||
* @var stdClass|string|null
|
||||
*/
|
||||
protected stdClass|string|null $responseBody;
|
||||
|
||||
/**
|
||||
* The HTTP header of the server response.
|
||||
*
|
||||
* @var string[][]|null
|
||||
*/
|
||||
protected ?array $responseHeaders;
|
||||
|
||||
/**
|
||||
* The deserialized response object
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected mixed $responseObject = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $message Error message
|
||||
* @param int $code HTTP status code
|
||||
* @param string[][]|null $responseHeaders HTTP response header
|
||||
* @param stdClass|string|null $responseBody HTTP decoded body of the server response either as stdClass or string
|
||||
*/
|
||||
public function __construct(string $message = "", int $code = 0, ?array $responseHeaders = [], stdClass|string|null $responseBody = null)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
$this->responseHeaders = $responseHeaders;
|
||||
$this->responseBody = $responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP response header
|
||||
*
|
||||
* @return string[][]|null HTTP response header
|
||||
*/
|
||||
public function getResponseHeaders(): ?array
|
||||
{
|
||||
return $this->responseHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP body of the server response either as Json or string
|
||||
*
|
||||
* @return stdClass|string|null HTTP body of the server response either as \stdClass or string
|
||||
*/
|
||||
public function getResponseBody(): stdClass|string|null
|
||||
{
|
||||
return $this->responseBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the deserialized response object (during deserialization)
|
||||
*
|
||||
* @param mixed $obj Deserialized response object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setResponseObject(mixed $obj): void
|
||||
{
|
||||
$this->responseObject = $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the deserialized response object (during deserialization)
|
||||
*
|
||||
* @return mixed the deserialized response object
|
||||
*/
|
||||
public function getResponseObject(): mixed
|
||||
{
|
||||
return $this->responseObject;
|
||||
}
|
||||
}
|
@ -0,0 +1,527 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Configuration Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class Configuration
|
||||
{
|
||||
public const BOOLEAN_FORMAT_INT = 'int';
|
||||
public const BOOLEAN_FORMAT_STRING = 'string';
|
||||
|
||||
/**
|
||||
* @var Configuration|null
|
||||
*/
|
||||
private static ?Configuration $defaultConfiguration = null;
|
||||
|
||||
/**
|
||||
* Associate array to store API key(s)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected array $apiKeys = [];
|
||||
|
||||
/**
|
||||
* Associate array to store API prefix (e.g. Bearer)
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected array $apiKeyPrefixes = [];
|
||||
|
||||
/**
|
||||
* Access token for OAuth/Bearer authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $accessToken = '';
|
||||
|
||||
/**
|
||||
* Boolean format for query string
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $booleanFormatForQueryString = self::BOOLEAN_FORMAT_INT;
|
||||
|
||||
/**
|
||||
* Username for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $username = '';
|
||||
|
||||
/**
|
||||
* Password for HTTP basic authentication
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $password = '';
|
||||
|
||||
/**
|
||||
* The host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $host = 'http://localhost:3000';
|
||||
|
||||
/**
|
||||
* User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $userAgent = 'OpenAPI-Generator/1.0.0/PHP';
|
||||
|
||||
/**
|
||||
* Debug switch (default set to false)
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected bool $debug = false;
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $debugFile = 'php://output';
|
||||
|
||||
/**
|
||||
* Debug file location (log to STDOUT by default)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected string $tempFolderPath;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->tempFolderPath = sys_get_temp_dir();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $key API key or token
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKey(string $apiKeyIdentifier, string $key): static
|
||||
{
|
||||
$this->apiKeys[$apiKeyIdentifier] = $key;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return null|string API key or token
|
||||
*/
|
||||
public function getApiKey(string $apiKeyIdentifier): ?string
|
||||
{
|
||||
return $this->apiKeys[$apiKeyIdentifier] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prefix for API key (e.g. Bearer)
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
* @param string $prefix API key prefix, e.g. Bearer
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setApiKeyPrefix(string $apiKeyIdentifier, string $prefix): static
|
||||
{
|
||||
$this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets API key prefix
|
||||
*
|
||||
* @param string $apiKeyIdentifier API key identifier (authentication scheme)
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function getApiKeyPrefix(string $apiKeyIdentifier): ?string
|
||||
{
|
||||
return $this->apiKeyPrefixes[$apiKeyIdentifier] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the access token for OAuth
|
||||
*
|
||||
* @param string $accessToken Token for OAuth
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAccessToken(string $accessToken): static
|
||||
{
|
||||
$this->accessToken = $accessToken;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the access token for OAuth
|
||||
*
|
||||
* @return string Access token for OAuth
|
||||
*/
|
||||
public function getAccessToken(): string
|
||||
{
|
||||
return $this->accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets boolean format for query string.
|
||||
*
|
||||
* @param string $booleanFormat Boolean format for query string
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBooleanFormatForQueryString(string $booleanFormat): static
|
||||
{
|
||||
$this->booleanFormatForQueryString = $booleanFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets boolean format for query string.
|
||||
*
|
||||
* @return string Boolean format for query string
|
||||
*/
|
||||
public function getBooleanFormatForQueryString(): string
|
||||
{
|
||||
return $this->booleanFormatForQueryString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the username for HTTP basic authentication
|
||||
*
|
||||
* @param string $username Username for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setUsername(string $username): static
|
||||
{
|
||||
$this->username = $username;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the username for HTTP basic authentication
|
||||
*
|
||||
* @return string Username for HTTP basic authentication
|
||||
*/
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the password for HTTP basic authentication
|
||||
*
|
||||
* @param string $password Password for HTTP basic authentication
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the password for HTTP basic authentication
|
||||
*
|
||||
* @return string Password for HTTP basic authentication
|
||||
*/
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the host
|
||||
*
|
||||
* @param string $host Host
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setHost(string $host): static
|
||||
{
|
||||
$this->host = $host;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the host
|
||||
*
|
||||
* @return string Host
|
||||
*/
|
||||
public function getHost(): string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user agent of the api client
|
||||
*
|
||||
* @param string $userAgent the user agent of the api client
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
* @return $this
|
||||
*/
|
||||
public function setUserAgent(string $userAgent): static
|
||||
{
|
||||
$this->userAgent = $userAgent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user agent of the api client
|
||||
*
|
||||
* @return string user agent
|
||||
*/
|
||||
public function getUserAgent(): string
|
||||
{
|
||||
return $this->userAgent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets debug flag
|
||||
*
|
||||
* @param bool $debug Debug flag
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebug(bool $debug): static
|
||||
{
|
||||
$this->debug = $debug;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug flag
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getDebug(): bool
|
||||
{
|
||||
return $this->debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the debug file
|
||||
*
|
||||
* @param string $debugFile Debug file
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDebugFile(string $debugFile): static
|
||||
{
|
||||
$this->debugFile = $debugFile;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the debug file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDebugFile(): string
|
||||
{
|
||||
return $this->debugFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the temp folder path
|
||||
*
|
||||
* @param string $tempFolderPath Temp folder path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTempFolderPath(string $tempFolderPath): static
|
||||
{
|
||||
$this->tempFolderPath = $tempFolderPath;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the temp folder path
|
||||
*
|
||||
* @return string Temp folder path
|
||||
*/
|
||||
public function getTempFolderPath(): string
|
||||
{
|
||||
return $this->tempFolderPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default configuration instance
|
||||
*
|
||||
* @return Configuration
|
||||
*/
|
||||
public static function getDefaultConfiguration(): Configuration
|
||||
{
|
||||
if (self::$defaultConfiguration === null) {
|
||||
self::$defaultConfiguration = new Configuration();
|
||||
}
|
||||
|
||||
return self::$defaultConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default configuration instance
|
||||
*
|
||||
* @param Configuration $config An instance of the Configuration Object
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setDefaultConfiguration(Configuration $config): void
|
||||
{
|
||||
self::$defaultConfiguration = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the essential information for debugging
|
||||
*
|
||||
* @return string The report for debugging
|
||||
*/
|
||||
public static function toDebugReport(): string
|
||||
{
|
||||
$report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL;
|
||||
$report .= ' OS: ' . php_uname() . PHP_EOL;
|
||||
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
|
||||
$report .= ' The version of the OpenAPI document: 0.1.0' . PHP_EOL;
|
||||
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
|
||||
|
||||
return $report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get API key (with prefix if set)
|
||||
*
|
||||
* @param string $apiKeyIdentifier name of apikey
|
||||
*
|
||||
* @return null|string API key with the prefix
|
||||
*/
|
||||
public function getApiKeyWithPrefix(string $apiKeyIdentifier): ?string
|
||||
{
|
||||
$prefix = $this->getApiKeyPrefix($apiKeyIdentifier);
|
||||
$apiKey = $this->getApiKey($apiKeyIdentifier);
|
||||
|
||||
if ($apiKey === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($prefix === null) {
|
||||
$keyWithPrefix = $apiKey;
|
||||
} else {
|
||||
$keyWithPrefix = $prefix . ' ' . $apiKey;
|
||||
}
|
||||
|
||||
return $keyWithPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of host settings
|
||||
*
|
||||
* @return array an array of host settings
|
||||
*/
|
||||
public function getHostSettings(): array
|
||||
{
|
||||
return [
|
||||
[
|
||||
"url" => "http://localhost:3000",
|
||||
"description" => "No description provided",
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns URL based on host settings, index and variables
|
||||
*
|
||||
* @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients
|
||||
* @param int $hostIndex index of the host settings
|
||||
* @param array|null $variables hash of variable and the corresponding value (optional)
|
||||
* @return string URL based on host settings
|
||||
*/
|
||||
public static function getHostString(array $hostSettings, int $hostIndex, array $variables = null): string
|
||||
{
|
||||
if (null === $variables) {
|
||||
$variables = [];
|
||||
}
|
||||
|
||||
// check array index out of bound
|
||||
if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) {
|
||||
throw new InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings));
|
||||
}
|
||||
|
||||
$host = $hostSettings[$hostIndex];
|
||||
$url = $host["url"];
|
||||
|
||||
// go through variable and assign a value
|
||||
foreach ($host["variables"] ?? [] as $name => $variable) {
|
||||
if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user
|
||||
if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum
|
||||
$url = str_replace("{".$name."}", $variables[$name], $url);
|
||||
} else {
|
||||
throw new InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"]).".");
|
||||
}
|
||||
} else {
|
||||
// use default value
|
||||
$url = str_replace("{".$name."}", $variable["default_value"], $url);
|
||||
}
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns URL based on the index and variables
|
||||
*
|
||||
* @param int $index index of the host settings
|
||||
* @param array|null $variables hash of variable and the corresponding value (optional)
|
||||
* @return string URL based on host settings
|
||||
*/
|
||||
public function getHostFromSettings(int $index, ?array $variables = null): string
|
||||
{
|
||||
return self::getHostString($this->getHostSettings(), $index, $variables);
|
||||
}
|
||||
}
|
@ -0,0 +1,244 @@
|
||||
<?php
|
||||
/**
|
||||
* HeaderSelector
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
/**
|
||||
* HeaderSelector Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class HeaderSelector
|
||||
{
|
||||
/**
|
||||
* @param string[] $accept
|
||||
* @param string $contentType
|
||||
* @param bool $isMultipart
|
||||
* @return string[]
|
||||
*/
|
||||
public function selectHeaders(array $accept, string $contentType, bool $isMultipart): array
|
||||
{
|
||||
$headers = [];
|
||||
|
||||
$accept = $this->selectAcceptHeader($accept);
|
||||
if ($accept !== null) {
|
||||
$headers['Accept'] = $accept;
|
||||
}
|
||||
|
||||
if (!$isMultipart) {
|
||||
if($contentType === '') {
|
||||
$contentType = 'application/json';
|
||||
}
|
||||
|
||||
$headers['Content-Type'] = $contentType;
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the header 'Accept' based on an array of Accept provided.
|
||||
*
|
||||
* @param string[] $accept Array of header
|
||||
*
|
||||
* @return null|string Accept (e.g. application/json)
|
||||
*/
|
||||
private function selectAcceptHeader(array $accept): ?string
|
||||
{
|
||||
# filter out empty entries
|
||||
$accept = array_filter($accept);
|
||||
|
||||
if (count($accept) === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
# If there's only one Accept header, just use it
|
||||
if (count($accept) === 1) {
|
||||
return reset($accept);
|
||||
}
|
||||
|
||||
# If none of the available Accept headers is of type "json", then just use all them
|
||||
$headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept);
|
||||
if (count($headersWithJson) === 0) {
|
||||
return implode(',', $accept);
|
||||
}
|
||||
|
||||
# If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1,
|
||||
# to give the highest priority to json-like headers - recalculating the existing ones, if needed
|
||||
return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an Accept header string from the given "Accept" headers array, recalculating all weights
|
||||
*
|
||||
* @param string[] $accept Array of Accept Headers
|
||||
* @param string[] $headersWithJson Array of Accept Headers of type "json"
|
||||
*
|
||||
* @return string "Accept" Header (e.g. "application/json, text/html; q=0.9")
|
||||
*/
|
||||
private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string
|
||||
{
|
||||
$processedHeaders = [
|
||||
'withApplicationJson' => [],
|
||||
'withJson' => [],
|
||||
'withoutJson' => [],
|
||||
];
|
||||
|
||||
foreach ($accept as $header) {
|
||||
|
||||
$headerData = $this->getHeaderAndWeight($header);
|
||||
|
||||
if (stripos($headerData['header'], 'application/json') === 0) {
|
||||
$processedHeaders['withApplicationJson'][] = $headerData;
|
||||
} elseif (in_array($header, $headersWithJson, true)) {
|
||||
$processedHeaders['withJson'][] = $headerData;
|
||||
} else {
|
||||
$processedHeaders['withoutJson'][] = $headerData;
|
||||
}
|
||||
}
|
||||
|
||||
$acceptHeaders = [];
|
||||
$currentWeight = 1000;
|
||||
|
||||
$hasMoreThan28Headers = count($accept) > 28;
|
||||
|
||||
foreach($processedHeaders as $headers) {
|
||||
if (count($headers) > 0) {
|
||||
$acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers);
|
||||
}
|
||||
}
|
||||
|
||||
$acceptHeaders = array_merge(...$acceptHeaders);
|
||||
|
||||
return implode(',', $acceptHeaders);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an Accept header, returns an associative array splitting the header and its weight
|
||||
*
|
||||
* @param string $header "Accept" Header
|
||||
*
|
||||
* @return array with the header and its weight
|
||||
*/
|
||||
private function getHeaderAndWeight(string $header): array
|
||||
{
|
||||
# matches headers with weight, splitting the header and the weight in $outputArray
|
||||
if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) {
|
||||
$headerData = [
|
||||
'header' => $outputArray[1],
|
||||
'weight' => (int)($outputArray[2] * 1000),
|
||||
];
|
||||
} else {
|
||||
$headerData = [
|
||||
'header' => trim($header),
|
||||
'weight' => 1000,
|
||||
];
|
||||
}
|
||||
|
||||
return $headerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array[] $headers
|
||||
* @param float $currentWeight
|
||||
* @param bool $hasMoreThan28Headers
|
||||
* @return string[] array of adjusted "Accept" headers
|
||||
*/
|
||||
private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array
|
||||
{
|
||||
usort($headers, function (array $a, array $b) {
|
||||
return $b['weight'] - $a['weight'];
|
||||
});
|
||||
|
||||
$acceptHeaders = [];
|
||||
foreach ($headers as $index => $header) {
|
||||
if($index > 0 && $headers[$index - 1]['weight'] > $header['weight'])
|
||||
{
|
||||
$currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
|
||||
}
|
||||
|
||||
$weight = $currentWeight;
|
||||
|
||||
$acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight);
|
||||
}
|
||||
|
||||
$currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers);
|
||||
|
||||
return $acceptHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $header
|
||||
* @param int $weight
|
||||
* @return string
|
||||
*/
|
||||
private function buildAcceptHeader(string $header, int $weight): string
|
||||
{
|
||||
if($weight === 1000) {
|
||||
return $header;
|
||||
}
|
||||
|
||||
return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0');
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the next weight, based on the current one.
|
||||
*
|
||||
* If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the
|
||||
* following formula:
|
||||
*
|
||||
* next weight = current weight - 10 ^ (floor(log(current weight - 1)))
|
||||
*
|
||||
* ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) )
|
||||
*
|
||||
* Starting from 1000, this generates the following series:
|
||||
*
|
||||
* 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
|
||||
*
|
||||
* The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works
|
||||
* if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1
|
||||
* decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc.
|
||||
*
|
||||
* @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value)
|
||||
* @param bool $hasMoreThan28Headers
|
||||
* @return int
|
||||
*/
|
||||
public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int
|
||||
{
|
||||
if ($currentWeight <= 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($hasMoreThan28Headers) {
|
||||
return $currentWeight - 1;
|
||||
}
|
||||
|
||||
return $currentWeight - 10 ** floor( log10($currentWeight - 1) );
|
||||
}
|
||||
}
|
442
samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php
Normal file
442
samples/client/echo_api/php-nextgen-streaming/src/Model/Bird.php
Normal file
@ -0,0 +1,442 @@
|
||||
<?php
|
||||
/**
|
||||
* Bird
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Bird Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class Bird implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'Bird';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'size' => 'string',
|
||||
'color' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'size' => null,
|
||||
'color' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'size' => false,
|
||||
'color' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'size' => 'size',
|
||||
'color' => 'color'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'size' => 'setSize',
|
||||
'color' => 'setColor'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'size' => 'getSize',
|
||||
'color' => 'getColor'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('size', $data ?? [], null);
|
||||
$this->setIfExists('color', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets size
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSize(): ?string
|
||||
{
|
||||
return $this->container['size'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets size
|
||||
*
|
||||
* @param string|null $size size
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSize(?string $size): static
|
||||
{
|
||||
if (is_null($size)) {
|
||||
throw new InvalidArgumentException('non-nullable size cannot be null');
|
||||
}
|
||||
$this->container['size'] = $size;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets color
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getColor(): ?string
|
||||
{
|
||||
return $this->container['color'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets color
|
||||
*
|
||||
* @param string|null $color color
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setColor(?string $color): static
|
||||
{
|
||||
if (is_null($color)) {
|
||||
throw new InvalidArgumentException('non-nullable color cannot be null');
|
||||
}
|
||||
$this->container['color'] = $color;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,442 @@
|
||||
<?php
|
||||
/**
|
||||
* Category
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Category Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class Category implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'Category';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'id' => 'int',
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'id' => 'int64',
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'id' => false,
|
||||
'name' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'id' => 'setId',
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'id' => 'getId',
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param int|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId(?int $id): static
|
||||
{
|
||||
if (is_null($id)) {
|
||||
throw new InvalidArgumentException('non-nullable id cannot be null');
|
||||
}
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
if (is_null($name)) {
|
||||
throw new InvalidArgumentException('non-nullable name cannot be null');
|
||||
}
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,466 @@
|
||||
<?php
|
||||
/**
|
||||
* DataQuery
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
/**
|
||||
* DataQuery Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class DataQuery extends Query
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'DataQuery';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'suffix' => 'string',
|
||||
'text' => 'string',
|
||||
'date' => '\DateTime'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'suffix' => null,
|
||||
'text' => null,
|
||||
'date' => 'date-time'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'suffix' => false,
|
||||
'text' => false,
|
||||
'date' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes + parent::openAPITypes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats + parent::openAPIFormats();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables + parent::openAPINullables();
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'suffix' => 'suffix',
|
||||
'text' => 'text',
|
||||
'date' => 'date'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'suffix' => 'setSuffix',
|
||||
'text' => 'setText',
|
||||
'date' => 'setDate'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'suffix' => 'getSuffix',
|
||||
'text' => 'getText',
|
||||
'date' => 'getDate'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return parent::attributeMap() + self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return parent::setters() + self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return parent::getters() + self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
parent::__construct($data);
|
||||
|
||||
$this->setIfExists('suffix', $data ?? [], null);
|
||||
$this->setIfExists('text', $data ?? [], null);
|
||||
$this->setIfExists('date', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets suffix
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSuffix(): ?string
|
||||
{
|
||||
return $this->container['suffix'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets suffix
|
||||
*
|
||||
* @param string|null $suffix test suffix
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSuffix(?string $suffix): static
|
||||
{
|
||||
if (is_null($suffix)) {
|
||||
throw new InvalidArgumentException('non-nullable suffix cannot be null');
|
||||
}
|
||||
$this->container['suffix'] = $suffix;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets text
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getText(): ?string
|
||||
{
|
||||
return $this->container['text'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets text
|
||||
*
|
||||
* @param string|null $text Some text containing white spaces
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setText(?string $text): static
|
||||
{
|
||||
if (is_null($text)) {
|
||||
throw new InvalidArgumentException('non-nullable text cannot be null');
|
||||
}
|
||||
$this->container['text'] = $text;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date
|
||||
*
|
||||
* @return \DateTime|null
|
||||
*/
|
||||
public function getDate(): ?\DateTime
|
||||
{
|
||||
return $this->container['date'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets date
|
||||
*
|
||||
* @param \DateTime|null $date A date
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDate(?\DateTime $date): static
|
||||
{
|
||||
if (is_null($date)) {
|
||||
throw new InvalidArgumentException('non-nullable date cannot be null');
|
||||
}
|
||||
$this->container['date'] = $date;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,694 @@
|
||||
<?php
|
||||
/**
|
||||
* DefaultValue
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* DefaultValue Class Doc Comment
|
||||
*
|
||||
* @description to test the default value of properties
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class DefaultValue implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'DefaultValue';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'array_string_enum_ref_default' => '\OpenAPI\Client\Model\StringEnumRef[]',
|
||||
'array_string_enum_default' => 'string[]',
|
||||
'array_string_default' => 'string[]',
|
||||
'array_integer_default' => 'int[]',
|
||||
'array_string' => 'string[]',
|
||||
'array_string_nullable' => 'string[]',
|
||||
'array_string_extension_nullable' => 'string[]',
|
||||
'string_nullable' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'array_string_enum_ref_default' => null,
|
||||
'array_string_enum_default' => null,
|
||||
'array_string_default' => null,
|
||||
'array_integer_default' => null,
|
||||
'array_string' => null,
|
||||
'array_string_nullable' => null,
|
||||
'array_string_extension_nullable' => null,
|
||||
'string_nullable' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'array_string_enum_ref_default' => false,
|
||||
'array_string_enum_default' => false,
|
||||
'array_string_default' => false,
|
||||
'array_integer_default' => false,
|
||||
'array_string' => false,
|
||||
'array_string_nullable' => true,
|
||||
'array_string_extension_nullable' => true,
|
||||
'string_nullable' => true
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'array_string_enum_ref_default' => 'array_string_enum_ref_default',
|
||||
'array_string_enum_default' => 'array_string_enum_default',
|
||||
'array_string_default' => 'array_string_default',
|
||||
'array_integer_default' => 'array_integer_default',
|
||||
'array_string' => 'array_string',
|
||||
'array_string_nullable' => 'array_string_nullable',
|
||||
'array_string_extension_nullable' => 'array_string_extension_nullable',
|
||||
'string_nullable' => 'string_nullable'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'array_string_enum_ref_default' => 'setArrayStringEnumRefDefault',
|
||||
'array_string_enum_default' => 'setArrayStringEnumDefault',
|
||||
'array_string_default' => 'setArrayStringDefault',
|
||||
'array_integer_default' => 'setArrayIntegerDefault',
|
||||
'array_string' => 'setArrayString',
|
||||
'array_string_nullable' => 'setArrayStringNullable',
|
||||
'array_string_extension_nullable' => 'setArrayStringExtensionNullable',
|
||||
'string_nullable' => 'setStringNullable'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'array_string_enum_ref_default' => 'getArrayStringEnumRefDefault',
|
||||
'array_string_enum_default' => 'getArrayStringEnumDefault',
|
||||
'array_string_default' => 'getArrayStringDefault',
|
||||
'array_integer_default' => 'getArrayIntegerDefault',
|
||||
'array_string' => 'getArrayString',
|
||||
'array_string_nullable' => 'getArrayStringNullable',
|
||||
'array_string_extension_nullable' => 'getArrayStringExtensionNullable',
|
||||
'string_nullable' => 'getStringNullable'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
public const ARRAY_STRING_ENUM_DEFAULT_SUCCESS = 'success';
|
||||
public const ARRAY_STRING_ENUM_DEFAULT_FAILURE = 'failure';
|
||||
public const ARRAY_STRING_ENUM_DEFAULT_UNCLASSIFIED = 'unclassified';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getArrayStringEnumDefaultAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::ARRAY_STRING_ENUM_DEFAULT_SUCCESS,
|
||||
self::ARRAY_STRING_ENUM_DEFAULT_FAILURE,
|
||||
self::ARRAY_STRING_ENUM_DEFAULT_UNCLASSIFIED,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('array_string_enum_ref_default', $data ?? [], [["success","failure"]]);
|
||||
$this->setIfExists('array_string_enum_default', $data ?? [], [["success","failure"]]);
|
||||
$this->setIfExists('array_string_default', $data ?? [], [["failure","skipped"]]);
|
||||
$this->setIfExists('array_integer_default', $data ?? [], [[1,3]]);
|
||||
$this->setIfExists('array_string', $data ?? [], null);
|
||||
$this->setIfExists('array_string_nullable', $data ?? [], null);
|
||||
$this->setIfExists('array_string_extension_nullable', $data ?? [], null);
|
||||
$this->setIfExists('string_nullable', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets array_string_enum_ref_default
|
||||
*
|
||||
* @return \OpenAPI\Client\Model\StringEnumRef[]|null
|
||||
*/
|
||||
public function getArrayStringEnumRefDefault(): ?array
|
||||
{
|
||||
return $this->container['array_string_enum_ref_default'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string_enum_ref_default
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\StringEnumRef[]|null $array_string_enum_ref_default array_string_enum_ref_default
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayStringEnumRefDefault(?array $array_string_enum_ref_default): static
|
||||
{
|
||||
if (is_null($array_string_enum_ref_default)) {
|
||||
throw new InvalidArgumentException('non-nullable array_string_enum_ref_default cannot be null');
|
||||
}
|
||||
$this->container['array_string_enum_ref_default'] = $array_string_enum_ref_default;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_string_enum_default
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getArrayStringEnumDefault(): ?array
|
||||
{
|
||||
return $this->container['array_string_enum_default'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string_enum_default
|
||||
*
|
||||
* @param string[]|null $array_string_enum_default array_string_enum_default
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayStringEnumDefault(?array $array_string_enum_default): static
|
||||
{
|
||||
if (is_null($array_string_enum_default)) {
|
||||
throw new InvalidArgumentException('non-nullable array_string_enum_default cannot be null');
|
||||
}
|
||||
$allowedValues = $this->getArrayStringEnumDefaultAllowableValues();
|
||||
if (array_diff($array_string_enum_default, $allowedValues)) {
|
||||
throw new InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'array_string_enum_default', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['array_string_enum_default'] = $array_string_enum_default;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_string_default
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getArrayStringDefault(): ?array
|
||||
{
|
||||
return $this->container['array_string_default'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string_default
|
||||
*
|
||||
* @param string[]|null $array_string_default array_string_default
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayStringDefault(?array $array_string_default): static
|
||||
{
|
||||
if (is_null($array_string_default)) {
|
||||
throw new InvalidArgumentException('non-nullable array_string_default cannot be null');
|
||||
}
|
||||
$this->container['array_string_default'] = $array_string_default;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_integer_default
|
||||
*
|
||||
* @return int[]|null
|
||||
*/
|
||||
public function getArrayIntegerDefault(): ?array
|
||||
{
|
||||
return $this->container['array_integer_default'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_integer_default
|
||||
*
|
||||
* @param int[]|null $array_integer_default array_integer_default
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayIntegerDefault(?array $array_integer_default): static
|
||||
{
|
||||
if (is_null($array_integer_default)) {
|
||||
throw new InvalidArgumentException('non-nullable array_integer_default cannot be null');
|
||||
}
|
||||
$this->container['array_integer_default'] = $array_integer_default;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_string
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getArrayString(): ?array
|
||||
{
|
||||
return $this->container['array_string'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string
|
||||
*
|
||||
* @param string[]|null $array_string array_string
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayString(?array $array_string): static
|
||||
{
|
||||
if (is_null($array_string)) {
|
||||
throw new InvalidArgumentException('non-nullable array_string cannot be null');
|
||||
}
|
||||
$this->container['array_string'] = $array_string;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_string_nullable
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getArrayStringNullable(): ?array
|
||||
{
|
||||
return $this->container['array_string_nullable'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string_nullable
|
||||
*
|
||||
* @param string[]|null $array_string_nullable array_string_nullable
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayStringNullable(?array $array_string_nullable): static
|
||||
{
|
||||
if (is_null($array_string_nullable)) {
|
||||
array_push($this->openAPINullablesSetToNull, 'array_string_nullable');
|
||||
} else {
|
||||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||||
$index = array_search('array_string_nullable', $nullablesSetToNull);
|
||||
if ($index !== FALSE) {
|
||||
unset($nullablesSetToNull[$index]);
|
||||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||||
}
|
||||
}
|
||||
$this->container['array_string_nullable'] = $array_string_nullable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets array_string_extension_nullable
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getArrayStringExtensionNullable(): ?array
|
||||
{
|
||||
return $this->container['array_string_extension_nullable'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets array_string_extension_nullable
|
||||
*
|
||||
* @param string[]|null $array_string_extension_nullable array_string_extension_nullable
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setArrayStringExtensionNullable(?array $array_string_extension_nullable): static
|
||||
{
|
||||
if (is_null($array_string_extension_nullable)) {
|
||||
array_push($this->openAPINullablesSetToNull, 'array_string_extension_nullable');
|
||||
} else {
|
||||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||||
$index = array_search('array_string_extension_nullable', $nullablesSetToNull);
|
||||
if ($index !== FALSE) {
|
||||
unset($nullablesSetToNull[$index]);
|
||||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||||
}
|
||||
}
|
||||
$this->container['array_string_extension_nullable'] = $array_string_extension_nullable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets string_nullable
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStringNullable(): ?string
|
||||
{
|
||||
return $this->container['string_nullable'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets string_nullable
|
||||
*
|
||||
* @param string|null $string_nullable string_nullable
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStringNullable(?string $string_nullable): static
|
||||
{
|
||||
if (is_null($string_nullable)) {
|
||||
array_push($this->openAPINullablesSetToNull, 'string_nullable');
|
||||
} else {
|
||||
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
|
||||
$index = array_search('string_nullable', $nullablesSetToNull);
|
||||
if ($index !== FALSE) {
|
||||
unset($nullablesSetToNull[$index]);
|
||||
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
|
||||
}
|
||||
}
|
||||
$this->container['string_nullable'] = $string_nullable;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* ModelInterface
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client\Model
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
/**
|
||||
* Interface abstracting model access.
|
||||
*
|
||||
* @package OpenAPI\Client\Model
|
||||
* @author OpenAPI Generator team
|
||||
*/
|
||||
interface ModelInterface
|
||||
{
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string;
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPITypes(): array;
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function openAPIFormats(): array;
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name, and the value is the original name
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function attributeMap(): array;
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function setters(): array;
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getters(): array;
|
||||
|
||||
/**
|
||||
* Show all the invalid properties with reasons.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listInvalidProperties(): array;
|
||||
|
||||
/**
|
||||
* Validate all the properties in the model
|
||||
* return true if all passed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function valid(): bool;
|
||||
|
||||
/**
|
||||
* Checks if a property is nullable
|
||||
*
|
||||
* @param string $property
|
||||
* @return bool
|
||||
*/
|
||||
public static function isNullable(string $property): bool;
|
||||
|
||||
/**
|
||||
* Checks if a nullable property is set to null.
|
||||
*
|
||||
* @param string $property
|
||||
* @return bool
|
||||
*/
|
||||
public function isNullableSetToNull(string $property): bool;
|
||||
}
|
@ -0,0 +1,492 @@
|
||||
<?php
|
||||
/**
|
||||
* NumberPropertiesOnly
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* NumberPropertiesOnly Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class NumberPropertiesOnly implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'NumberPropertiesOnly';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'number' => 'float',
|
||||
'float' => 'float',
|
||||
'double' => 'float'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'number' => null,
|
||||
'float' => 'float',
|
||||
'double' => 'double'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'number' => false,
|
||||
'float' => false,
|
||||
'double' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'number' => 'number',
|
||||
'float' => 'float',
|
||||
'double' => 'double'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'number' => 'setNumber',
|
||||
'float' => 'setFloat',
|
||||
'double' => 'setDouble'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'number' => 'getNumber',
|
||||
'float' => 'getFloat',
|
||||
'double' => 'getDouble'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('number', $data ?? [], null);
|
||||
$this->setIfExists('float', $data ?? [], null);
|
||||
$this->setIfExists('double', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if (!is_null($this->container['double']) && ($this->container['double'] > 50.2)) {
|
||||
$invalidProperties[] = "invalid value for 'double', must be smaller than or equal to 50.2.";
|
||||
}
|
||||
|
||||
if (!is_null($this->container['double']) && ($this->container['double'] < 0.8)) {
|
||||
$invalidProperties[] = "invalid value for 'double', must be bigger than or equal to 0.8.";
|
||||
}
|
||||
|
||||
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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets number
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
public function getNumber(): ?float
|
||||
{
|
||||
return $this->container['number'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets number
|
||||
*
|
||||
* @param float|null $number number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNumber(?float $number): static
|
||||
{
|
||||
if (is_null($number)) {
|
||||
throw new InvalidArgumentException('non-nullable number cannot be null');
|
||||
}
|
||||
$this->container['number'] = $number;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets float
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
public function getFloat(): ?float
|
||||
{
|
||||
return $this->container['float'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets float
|
||||
*
|
||||
* @param float|null $float float
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFloat(?float $float): static
|
||||
{
|
||||
if (is_null($float)) {
|
||||
throw new InvalidArgumentException('non-nullable float cannot be null');
|
||||
}
|
||||
$this->container['float'] = $float;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets double
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
public function getDouble(): ?float
|
||||
{
|
||||
return $this->container['double'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets double
|
||||
*
|
||||
* @param float|null $double double
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setDouble(?float $double): static
|
||||
{
|
||||
if (is_null($double)) {
|
||||
throw new InvalidArgumentException('non-nullable double cannot be null');
|
||||
}
|
||||
|
||||
if (($double > 50.2)) {
|
||||
throw new InvalidArgumentException('invalid value for $double when calling NumberPropertiesOnly., must be smaller than or equal to 50.2.');
|
||||
}
|
||||
if (($double < 0.8)) {
|
||||
throw new InvalidArgumentException('invalid value for $double when calling NumberPropertiesOnly., must be bigger than or equal to 0.8.');
|
||||
}
|
||||
|
||||
$this->container['double'] = $double;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
620
samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php
Normal file
620
samples/client/echo_api/php-nextgen-streaming/src/Model/Pet.php
Normal file
@ -0,0 +1,620 @@
|
||||
<?php
|
||||
/**
|
||||
* Pet
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Pet Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class Pet implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'Pet';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'id' => 'int',
|
||||
'name' => 'string',
|
||||
'category' => '\OpenAPI\Client\Model\Category',
|
||||
'photo_urls' => 'string[]',
|
||||
'tags' => '\OpenAPI\Client\Model\Tag[]',
|
||||
'status' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'id' => 'int64',
|
||||
'name' => null,
|
||||
'category' => null,
|
||||
'photo_urls' => null,
|
||||
'tags' => null,
|
||||
'status' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'id' => false,
|
||||
'name' => false,
|
||||
'category' => false,
|
||||
'photo_urls' => false,
|
||||
'tags' => false,
|
||||
'status' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
'category' => 'category',
|
||||
'photo_urls' => 'photoUrls',
|
||||
'tags' => 'tags',
|
||||
'status' => 'status'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'id' => 'setId',
|
||||
'name' => 'setName',
|
||||
'category' => 'setCategory',
|
||||
'photo_urls' => 'setPhotoUrls',
|
||||
'tags' => 'setTags',
|
||||
'status' => 'setStatus'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'id' => 'getId',
|
||||
'name' => 'getName',
|
||||
'category' => 'getCategory',
|
||||
'photo_urls' => 'getPhotoUrls',
|
||||
'tags' => 'getTags',
|
||||
'status' => 'getStatus'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
public const STATUS_AVAILABLE = 'available';
|
||||
public const STATUS_PENDING = 'pending';
|
||||
public const STATUS_SOLD = 'sold';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatusAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::STATUS_AVAILABLE,
|
||||
self::STATUS_PENDING,
|
||||
self::STATUS_SOLD,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $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('category', $data ?? [], null);
|
||||
$this->setIfExists('photo_urls', $data ?? [], null);
|
||||
$this->setIfExists('tags', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$invalidProperties = [];
|
||||
|
||||
if ($this->container['name'] === null) {
|
||||
$invalidProperties[] = "'name' can't be null";
|
||||
}
|
||||
if ($this->container['photo_urls'] === null) {
|
||||
$invalidProperties[] = "'photo_urls' 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)
|
||||
);
|
||||
}
|
||||
|
||||
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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param int|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId(?int $id): static
|
||||
{
|
||||
if (is_null($id)) {
|
||||
throw new InvalidArgumentException('non-nullable id cannot be null');
|
||||
}
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName(string $name): static
|
||||
{
|
||||
if (is_null($name)) {
|
||||
throw new InvalidArgumentException('non-nullable name cannot be null');
|
||||
}
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets category
|
||||
*
|
||||
* @return \OpenAPI\Client\Model\Category|null
|
||||
*/
|
||||
public function getCategory(): ?\OpenAPI\Client\Model\Category
|
||||
{
|
||||
return $this->container['category'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets category
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\Category|null $category category
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCategory(?\OpenAPI\Client\Model\Category $category): static
|
||||
{
|
||||
if (is_null($category)) {
|
||||
throw new InvalidArgumentException('non-nullable category cannot be null');
|
||||
}
|
||||
$this->container['category'] = $category;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets photo_urls
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPhotoUrls(): array
|
||||
{
|
||||
return $this->container['photo_urls'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets photo_urls
|
||||
*
|
||||
* @param string[] $photo_urls photo_urls
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhotoUrls(array $photo_urls): static
|
||||
{
|
||||
if (is_null($photo_urls)) {
|
||||
throw new InvalidArgumentException('non-nullable photo_urls cannot be null');
|
||||
}
|
||||
$this->container['photo_urls'] = $photo_urls;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets tags
|
||||
*
|
||||
* @return \OpenAPI\Client\Model\Tag[]|null
|
||||
*/
|
||||
public function getTags(): ?array
|
||||
{
|
||||
return $this->container['tags'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets tags
|
||||
*
|
||||
* @param \OpenAPI\Client\Model\Tag[]|null $tags tags
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTags(?array $tags): static
|
||||
{
|
||||
if (is_null($tags)) {
|
||||
throw new InvalidArgumentException('non-nullable tags cannot be null');
|
||||
}
|
||||
$this->container['tags'] = $tags;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets status
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStatus(): ?string
|
||||
{
|
||||
return $this->container['status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets status
|
||||
*
|
||||
* @param string|null $status pet status in the store
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatus(?string $status): static
|
||||
{
|
||||
if (is_null($status)) {
|
||||
throw new InvalidArgumentException('non-nullable status cannot be null');
|
||||
}
|
||||
$allowedValues = $this->getStatusAllowableValues();
|
||||
if (!in_array($status, $allowedValues, true)) {
|
||||
throw new InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value '%s' for 'status', must be one of '%s'",
|
||||
$status,
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['status'] = $status;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,468 @@
|
||||
<?php
|
||||
/**
|
||||
* Query
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Query Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class Query implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'Query';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'id' => 'int',
|
||||
'outcomes' => 'string[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'id' => 'int64',
|
||||
'outcomes' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'id' => false,
|
||||
'outcomes' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'id' => 'id',
|
||||
'outcomes' => 'outcomes'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'id' => 'setId',
|
||||
'outcomes' => 'setOutcomes'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'id' => 'getId',
|
||||
'outcomes' => 'getOutcomes'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
public const OUTCOMES_SUCCESS = 'SUCCESS';
|
||||
public const OUTCOMES_FAILURE = 'FAILURE';
|
||||
public const OUTCOMES_SKIPPED = 'SKIPPED';
|
||||
|
||||
/**
|
||||
* Gets allowable values of the enum
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getOutcomesAllowableValues()
|
||||
{
|
||||
return [
|
||||
self::OUTCOMES_SUCCESS,
|
||||
self::OUTCOMES_FAILURE,
|
||||
self::OUTCOMES_SKIPPED,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('id', $data ?? [], null);
|
||||
$this->setIfExists('outcomes', $data ?? [], [["SUCCESS","FAILURE"]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param int|null $id Query
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId(?int $id): static
|
||||
{
|
||||
if (is_null($id)) {
|
||||
throw new InvalidArgumentException('non-nullable id cannot be null');
|
||||
}
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets outcomes
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getOutcomes(): ?array
|
||||
{
|
||||
return $this->container['outcomes'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets outcomes
|
||||
*
|
||||
* @param string[]|null $outcomes outcomes
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOutcomes(?array $outcomes): static
|
||||
{
|
||||
if (is_null($outcomes)) {
|
||||
throw new InvalidArgumentException('non-nullable outcomes cannot be null');
|
||||
}
|
||||
$allowedValues = $this->getOutcomesAllowableValues();
|
||||
if (array_diff($outcomes, $allowedValues)) {
|
||||
throw new InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for 'outcomes', must be one of '%s'",
|
||||
implode("', '", $allowedValues)
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->container['outcomes'] = $outcomes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* StringEnumRef
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
/**
|
||||
* StringEnumRef Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
enum StringEnumRef: string
|
||||
{
|
||||
case SUCCESS = 'success';
|
||||
|
||||
case FAILURE = 'failure';
|
||||
|
||||
case UNCLASSIFIED = 'unclassified';
|
||||
|
||||
}
|
||||
|
||||
|
442
samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php
Normal file
442
samples/client/echo_api/php-nextgen-streaming/src/Model/Tag.php
Normal file
@ -0,0 +1,442 @@
|
||||
<?php
|
||||
/**
|
||||
* Tag
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* Tag Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class Tag implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'Tag';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'id' => 'int',
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'id' => 'int64',
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'id' => false,
|
||||
'name' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'id' => 'setId',
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'id' => 'getId',
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param int|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId(?int $id): static
|
||||
{
|
||||
if (is_null($id)) {
|
||||
throw new InvalidArgumentException('non-nullable id cannot be null');
|
||||
}
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
if (is_null($name)) {
|
||||
throw new InvalidArgumentException('non-nullable name cannot be null');
|
||||
}
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,408 @@
|
||||
<?php
|
||||
/**
|
||||
* TestFormObjectMultipartRequestMarker
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* TestFormObjectMultipartRequestMarker Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class TestFormObjectMultipartRequestMarker implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'test_form_object_multipart_request_marker';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'name' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('name', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
if (is_null($name)) {
|
||||
throw new InvalidArgumentException('non-nullable name cannot be null');
|
||||
}
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,510 @@
|
||||
<?php
|
||||
/**
|
||||
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'test_query_style_deepObject_explode_true_object_allOf_query_object_parameter';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'size' => 'string',
|
||||
'color' => 'string',
|
||||
'id' => 'int',
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'size' => null,
|
||||
'color' => null,
|
||||
'id' => 'int64',
|
||||
'name' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'size' => false,
|
||||
'color' => false,
|
||||
'id' => false,
|
||||
'name' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'size' => 'size',
|
||||
'color' => 'color',
|
||||
'id' => 'id',
|
||||
'name' => 'name'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'size' => 'setSize',
|
||||
'color' => 'setColor',
|
||||
'id' => 'setId',
|
||||
'name' => 'setName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'size' => 'getSize',
|
||||
'color' => 'getColor',
|
||||
'id' => 'getId',
|
||||
'name' => 'getName'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('size', $data ?? [], null);
|
||||
$this->setIfExists('color', $data ?? [], null);
|
||||
$this->setIfExists('id', $data ?? [], null);
|
||||
$this->setIfExists('name', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets size
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSize(): ?string
|
||||
{
|
||||
return $this->container['size'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets size
|
||||
*
|
||||
* @param string|null $size size
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSize(?string $size): static
|
||||
{
|
||||
if (is_null($size)) {
|
||||
throw new InvalidArgumentException('non-nullable size cannot be null');
|
||||
}
|
||||
$this->container['size'] = $size;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets color
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getColor(): ?string
|
||||
{
|
||||
return $this->container['color'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets color
|
||||
*
|
||||
* @param string|null $color color
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setColor(?string $color): static
|
||||
{
|
||||
if (is_null($color)) {
|
||||
throw new InvalidArgumentException('non-nullable color cannot be null');
|
||||
}
|
||||
$this->container['color'] = $color;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets id
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->container['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets id
|
||||
*
|
||||
* @param int|null $id id
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setId(?int $id): static
|
||||
{
|
||||
if (is_null($id)) {
|
||||
throw new InvalidArgumentException('non-nullable id cannot be null');
|
||||
}
|
||||
$this->container['id'] = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->container['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets name
|
||||
*
|
||||
* @param string|null $name name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
if (is_null($name)) {
|
||||
throw new InvalidArgumentException('non-nullable name cannot be null');
|
||||
}
|
||||
$this->container['name'] = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,408 @@
|
||||
<?php
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Model;
|
||||
|
||||
use ArrayAccess;
|
||||
use JsonSerializable;
|
||||
use InvalidArgumentException;
|
||||
use ReturnTypeWillChange;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
* @implements ArrayAccess<string, mixed>
|
||||
*/
|
||||
class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter implements ModelInterface, ArrayAccess, JsonSerializable
|
||||
{
|
||||
public const DISCRIMINATOR = null;
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected static string $openAPIModelName = 'test_query_style_form_explode_true_array_string_query_object_parameter';
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $openAPITypes = [
|
||||
'values' => 'string[]'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, string|null>
|
||||
*/
|
||||
protected static array $openAPIFormats = [
|
||||
'values' => null
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of nullable properties. Used for (de)serialization
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected static array $openAPINullables = [
|
||||
'values' => false
|
||||
];
|
||||
|
||||
/**
|
||||
* If a nullable field gets set to null, insert it here
|
||||
*
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
protected array $openAPINullablesSetToNull = [];
|
||||
|
||||
/**
|
||||
* Array of property to type mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPITypes(): array
|
||||
{
|
||||
return self::$openAPITypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of property to format mappings. Used for (de)serialization
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function openAPIFormats(): array
|
||||
{
|
||||
return self::$openAPIFormats;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable properties
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
protected static function openAPINullables(): array
|
||||
{
|
||||
return self::$openAPINullables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*/
|
||||
private function getOpenAPINullablesSetToNull(): array
|
||||
{
|
||||
return $this->openAPINullablesSetToNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter - Array of nullable field names deliberately set to null
|
||||
*
|
||||
* @param array<string, bool> $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 array<string, string>
|
||||
*/
|
||||
protected static array $attributeMap = [
|
||||
'values' => 'values'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $setters = [
|
||||
'values' => 'setValues'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected static array $getters = [
|
||||
'values' => 'getValues'
|
||||
];
|
||||
|
||||
/**
|
||||
* Array of attributes where the key is the local name,
|
||||
* and the value is the original name
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function attributeMap(): array
|
||||
{
|
||||
return self::$attributeMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to setter functions (for deserialization of responses)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function setters(): array
|
||||
{
|
||||
return self::$setters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of attributes to getter functions (for serialization of requests)
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function getters(): array
|
||||
{
|
||||
return self::$getters;
|
||||
}
|
||||
|
||||
/**
|
||||
* The original name of the model.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModelName(): string
|
||||
{
|
||||
return self::$openAPIModelName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Associative array for storing property values
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $container = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $data Associated array of property values initializing the model
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
{
|
||||
$this->setIfExists('values', $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, mixed $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 string[] invalid properties with reasons
|
||||
*/
|
||||
public function listInvalidProperties(): array
|
||||
{
|
||||
$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(): bool
|
||||
{
|
||||
return count($this->listInvalidProperties()) === 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets values
|
||||
*
|
||||
* @return string[]|null
|
||||
*/
|
||||
public function getValues(): ?array
|
||||
{
|
||||
return $this->container['values'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets values
|
||||
*
|
||||
* @param string[]|null $values values
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValues(?array $values): static
|
||||
{
|
||||
if (is_null($values)) {
|
||||
throw new InvalidArgumentException('non-nullable values cannot be null');
|
||||
}
|
||||
$this->container['values'] = $values;
|
||||
|
||||
return $this;
|
||||
}
|
||||
/**
|
||||
* Returns true if offset exists. False otherwise.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function offsetExists(mixed $offset): bool
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets offset.
|
||||
*
|
||||
* @param integer $offset Offset
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
#[ReturnTypeWillChange]
|
||||
public function offsetGet(mixed $offset): mixed
|
||||
{
|
||||
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(mixed $offset, mixed $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(mixed $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(): mixed
|
||||
{
|
||||
return ObjectSerializer::sanitizeForSerialization($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
return json_encode(
|
||||
ObjectSerializer::sanitizeForSerialization($this),
|
||||
JSON_PRETTY_PRINT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a header-safe presentation of the object
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderValue(): string
|
||||
{
|
||||
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,603 @@
|
||||
<?php
|
||||
/**
|
||||
* ObjectSerializer
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client;
|
||||
|
||||
use DateTimeInterface;
|
||||
use DateTime;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use OpenAPI\Client\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* ObjectSerializer Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class ObjectSerializer
|
||||
{
|
||||
/** @var string */
|
||||
private static string $dateTimeFormat = DateTimeInterface::ATOM;
|
||||
|
||||
/**
|
||||
* Change the date format
|
||||
*
|
||||
* @param string $format the new date format to use
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setDateTimeFormat(string $format): void
|
||||
{
|
||||
self::$dateTimeFormat = $format;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize data
|
||||
*
|
||||
* @param mixed $data the data to serialize
|
||||
* @param string|null $type the OpenAPIToolsType of the data
|
||||
* @param string|null $format the format of the OpenAPITools type of the data
|
||||
*
|
||||
* @return scalar|object|array|null serialized form of $data
|
||||
*/
|
||||
public static function sanitizeForSerialization(mixed $data, string $type = null, string $format = null): mixed
|
||||
{
|
||||
if (is_scalar($data) || null === $data) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
if ($data instanceof DateTime) {
|
||||
return ($format === 'date') ? $data->format('Y-m-d') : $data->format(self::$dateTimeFormat);
|
||||
}
|
||||
|
||||
if ($data instanceof \BackedEnum) {
|
||||
return $data->value;
|
||||
}
|
||||
|
||||
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', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
|
||||
if (is_subclass_of($openAPIType, '\BackedEnum')) {
|
||||
if (is_scalar($value)) {
|
||||
$value = $openAPIType::tryFrom($value);
|
||||
if ($value === null) {
|
||||
$imploded = implode("', '", array_map(fn($case) => $case->value, $openAPIType::cases()));
|
||||
throw new \InvalidArgumentException(
|
||||
sprintf(
|
||||
"Invalid value for enum '%s', must be one of: '%s'",
|
||||
$openAPIType::class,
|
||||
$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(string $filename): string
|
||||
{
|
||||
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(string $timestamp): string
|
||||
{
|
||||
return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the path, by url-encoding.
|
||||
*
|
||||
* @param string $value a string which will be part of the path
|
||||
*
|
||||
* @return string the serialized object
|
||||
*/
|
||||
public static function toPathValue(string $value): string
|
||||
{
|
||||
return rawurlencode(self::toString($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a value is empty, based on its OpenAPI type.
|
||||
*
|
||||
* @param mixed $value
|
||||
* @param string $openApiType
|
||||
*
|
||||
* @return bool true if $value is empty
|
||||
*/
|
||||
private static function isEmptyValue(mixed $value, string $openApiType): bool
|
||||
{
|
||||
# If empty() returns false, it is not empty regardless of its type.
|
||||
if (!empty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
# Null is always empty, as we cannot send a real "null" value in a query parameter.
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return match ($openApiType) {
|
||||
# For numeric values, false and '' are considered empty.
|
||||
# This comparison is safe for floating point values, since the previous call to empty() will
|
||||
# filter out values that don't match 0.
|
||||
'int','integer' => $value !== 0,
|
||||
'number'|'float' => $value !== 0 && $value !== 0.0,
|
||||
|
||||
# For boolean values, '' is considered empty
|
||||
'bool','boolean' => !in_array($value, [false, 0], true),
|
||||
|
||||
# For all the other types, any value at this point can be considered empty.
|
||||
default => true
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Take query parameter properties and turn it into an array suitable for
|
||||
* native http_build_query or GuzzleHttp\Psr7\Query::build.
|
||||
*
|
||||
* @param mixed $value Parameter value
|
||||
* @param string $paramName Parameter name
|
||||
* @param string $openApiType OpenAPIType e.g. array or object
|
||||
* @param string $style Parameter serialization style
|
||||
* @param bool $explode Parameter explode option
|
||||
* @param bool $required Whether query param is required or not
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function toQueryValue(
|
||||
mixed $value,
|
||||
string $paramName,
|
||||
string $openApiType = 'string',
|
||||
string $style = 'form',
|
||||
bool $explode = true,
|
||||
bool $required = true
|
||||
): array {
|
||||
|
||||
# Check if we should omit this parameter from the query. This should only happen when:
|
||||
# - Parameter is NOT required; AND
|
||||
# - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For
|
||||
# example, 0 as "int" or "boolean" is NOT an empty value.
|
||||
if (self::isEmptyValue($value, $openApiType)) {
|
||||
if ($required) {
|
||||
return ["{$paramName}" => ''];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
# Handle DateTime objects in query
|
||||
if($openApiType === "\DateTime" && $value instanceof DateTime) {
|
||||
return ["{$paramName}" => $value->format(self::$dateTimeFormat)];
|
||||
}
|
||||
|
||||
$query = [];
|
||||
$value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value;
|
||||
|
||||
// since \GuzzleHttp\Psr7\Query::build fails with nested arrays
|
||||
// need to flatten array first
|
||||
$flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) {
|
||||
if (!is_array($arr)) return $arr;
|
||||
|
||||
foreach ($arr as $k => $v) {
|
||||
$prop = ($style === 'deepObject') ? "{$name}[{$k}]" : $k;
|
||||
|
||||
if (is_array($v)) {
|
||||
$flattenArray($v, $prop, $result);
|
||||
} else {
|
||||
if ($style !== 'deepObject' && !$explode) {
|
||||
// push key itself
|
||||
$result[] = $prop;
|
||||
}
|
||||
$result[$prop] = $v;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
};
|
||||
|
||||
$value = $flattenArray($value, $paramName);
|
||||
|
||||
if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ('boolean' === $openApiType && is_bool($value)) {
|
||||
$value = self::convertBoolToQueryStringFormat($value);
|
||||
}
|
||||
|
||||
// handle style in serializeCollection
|
||||
$query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert boolean value to format for query string.
|
||||
*
|
||||
* @param bool $value Boolean value
|
||||
*
|
||||
* @return int|string Boolean value in format
|
||||
*/
|
||||
public static function convertBoolToQueryStringFormat(bool $value): int|string
|
||||
{
|
||||
if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) {
|
||||
return $value ? 'true' : 'false';
|
||||
}
|
||||
|
||||
return (int) $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the header. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
*
|
||||
* @param string $value a string which will be part of the header
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
public static function toHeaderValue(string $value): string
|
||||
{
|
||||
$callable = [$value, 'toHeaderValue'];
|
||||
if (is_callable($callable)) {
|
||||
return $callable();
|
||||
}
|
||||
|
||||
return self::toString($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the http body (form parameter). If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
*
|
||||
* @param string|\SplFileObject $value the value of the form parameter
|
||||
*
|
||||
* @return string the form string
|
||||
*/
|
||||
public static function toFormValue(string|\SplFileObject $value): string
|
||||
{
|
||||
if ($value instanceof \SplFileObject) {
|
||||
return $value->getRealPath();
|
||||
} else {
|
||||
return self::toString($value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Take value and turn it into a string suitable for inclusion in
|
||||
* the parameter. If it's a string, pass through unchanged
|
||||
* If it's a datetime object, format it in ISO8601
|
||||
* If it's a boolean, convert it to "true" or "false".
|
||||
*
|
||||
* @param string|bool|DateTime $value the value of the parameter
|
||||
*
|
||||
* @return string the header string
|
||||
*/
|
||||
public static function toString(string|bool|DateTime $value): string
|
||||
{
|
||||
if ($value instanceof DateTime) { // datetime in ISO8601 format
|
||||
return $value->format(self::$dateTimeFormat);
|
||||
} elseif (is_bool($value)) {
|
||||
return $value ? 'true' : 'false';
|
||||
} else {
|
||||
return (string) $value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, string $style, bool $allowCollectionFormatMulti = false): string
|
||||
{
|
||||
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, '', '&'));
|
||||
}
|
||||
return match ($style) {
|
||||
'pipeDelimited', 'pipes' => implode('|', $collection),
|
||||
'tsv' => implode("\t", $collection),
|
||||
'spaceDelimited', 'ssv' => implode(' ', $collection),
|
||||
default => 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[]|null $httpHeaders HTTP headers
|
||||
*
|
||||
* @return mixed a single or an array of $class instances
|
||||
*/
|
||||
public static function deserialize(mixed $data, string $class, array $httpHeaders = null): mixed
|
||||
{
|
||||
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<string,int>
|
||||
$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 === '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;
|
||||
}
|
||||
}
|
||||
|
||||
if ($class === '\Psr\Http\Message\StreamInterface') {
|
||||
return Utils::streamFor($data);
|
||||
}
|
||||
|
||||
if ($class === '\SplFileObject') {
|
||||
$data = Utils::streamFor($data);
|
||||
|
||||
/** @var \Psr\Http\Message\StreamInterface $data */
|
||||
|
||||
// determine file name
|
||||
if (
|
||||
is_array($httpHeaders)
|
||||
&& array_key_exists('Content-Disposition', $httpHeaders)
|
||||
&& preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)
|
||||
) {
|
||||
$filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]);
|
||||
} else {
|
||||
$filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), '');
|
||||
}
|
||||
|
||||
$file = fopen($filename, 'w');
|
||||
while ($chunk = $data->read(200)) {
|
||||
fwrite($file, $chunk);
|
||||
}
|
||||
fclose($file);
|
||||
|
||||
return new \SplFileObject($filename, 'r');
|
||||
}
|
||||
|
||||
/** @psalm-suppress ParadoxicalCondition */
|
||||
// handle primitive types
|
||||
if (in_array($class, ['\DateTime', '\SplFileObject'], true)) {
|
||||
return $data;
|
||||
} elseif (in_array($class, ['array', 'bool', 'boolean', 'float', 'double', 'int', 'integer', 'object', 'string', 'null'], true)) {
|
||||
// type ref: https://www.php.net/manual/en/function.settype.php
|
||||
// byte, mixed, void in the old php client were removed
|
||||
settype($data, $class);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
if (is_subclass_of($class, '\BackedEnum')) {
|
||||
$data = $class::tryFrom($data);
|
||||
if ($data === null) {
|
||||
$imploded = implode("', '", array_map(fn($case) => $case->value, $class::cases()));
|
||||
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 = '\OpenAPI\Client\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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a query string from an array of key value pairs.
|
||||
*
|
||||
* This function can use the return value of `parse()` to build a query
|
||||
* string. This function does not modify the provided keys when an array is
|
||||
* encountered (like `http_build_query()` would).
|
||||
*
|
||||
* @param array $params Query string parameters.
|
||||
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
|
||||
* to encode using RFC3986, or PHP_QUERY_RFC1738
|
||||
* to encode using RFC1738.
|
||||
*/
|
||||
public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string
|
||||
{
|
||||
if (!$params) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($encoding === false) {
|
||||
$encoder = function (string $str): string {
|
||||
return $str;
|
||||
};
|
||||
} elseif ($encoding === PHP_QUERY_RFC3986) {
|
||||
$encoder = 'rawurlencode';
|
||||
} elseif ($encoding === PHP_QUERY_RFC1738) {
|
||||
$encoder = 'urlencode';
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Invalid type');
|
||||
}
|
||||
|
||||
$castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()
|
||||
? function ($v) { return (int) $v; }
|
||||
: function ($v) { return $v ? 'true' : 'false'; };
|
||||
|
||||
$qs = '';
|
||||
foreach ($params as $k => $v) {
|
||||
$k = $encoder((string) $k);
|
||||
if (!is_array($v)) {
|
||||
$qs .= $k;
|
||||
$v = is_bool($v) ? $castBool($v) : $v;
|
||||
if ($v !== null) {
|
||||
$qs .= '='.$encoder((string) $v);
|
||||
}
|
||||
$qs .= '&';
|
||||
} else {
|
||||
foreach ($v as $vv) {
|
||||
$qs .= $k;
|
||||
$vv = is_bool($vv) ? $castBool($vv) : $vv;
|
||||
if ($vv !== null) {
|
||||
$qs .= '='.$encoder((string) $vv);
|
||||
}
|
||||
$qs .= '&';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $qs ? (string) substr($qs, 0, -1) : '';
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* AuthApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* AuthApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class AuthApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testAuthHttpBasic
|
||||
*
|
||||
* To test HTTP basic authentication.
|
||||
*
|
||||
*/
|
||||
public function testTestAuthHttpBasic()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testAuthHttpBearer
|
||||
*
|
||||
* To test HTTP bearer authentication.
|
||||
*
|
||||
*/
|
||||
public function testTestAuthHttpBearer()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* BodyApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* BodyApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BodyApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBinaryGif
|
||||
*
|
||||
* Test binary (gif) response body.
|
||||
*
|
||||
*/
|
||||
public function testTestBinaryGif()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBodyApplicationOctetstreamBinary
|
||||
*
|
||||
* Test body parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestBodyApplicationOctetstreamBinary()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBodyMultipartFormdataArrayOfBinary
|
||||
*
|
||||
* Test array of binary in multipart mime.
|
||||
*
|
||||
*/
|
||||
public function testTestBodyMultipartFormdataArrayOfBinary()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testBodyMultipartFormdataSingleBinary
|
||||
*
|
||||
* Test single binary in multipart mime.
|
||||
*
|
||||
*/
|
||||
public function testTestBodyMultipartFormdataSingleBinary()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyAllOfPet
|
||||
*
|
||||
* Test body parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyAllOfPet()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyFreeFormObjectResponseString
|
||||
*
|
||||
* Test free form object.
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyFreeFormObjectResponseString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyPet
|
||||
*
|
||||
* Test body parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyPet()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyPetResponseString
|
||||
*
|
||||
* Test empty response body.
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyPetResponseString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyStringEnum
|
||||
*
|
||||
* Test string enum response body.
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyStringEnum()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEchoBodyTagResponseString
|
||||
*
|
||||
* Test empty json (request body).
|
||||
*
|
||||
*/
|
||||
public function testTestEchoBodyTagResponseString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/**
|
||||
* FormApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* FormApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class FormApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testFormIntegerBooleanString
|
||||
*
|
||||
* Test form parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestFormIntegerBooleanString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testFormObjectMultipart
|
||||
*
|
||||
* Test form parameter(s) for multipart schema.
|
||||
*
|
||||
*/
|
||||
public function testTestFormObjectMultipart()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testFormOneof
|
||||
*
|
||||
* Test form parameter(s) for oneOf schema.
|
||||
*
|
||||
*/
|
||||
public function testTestFormOneof()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* HeaderApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* HeaderApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class HeaderApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testHeaderIntegerBooleanStringEnums
|
||||
*
|
||||
* Test header parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestHeaderIntegerBooleanStringEnums()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/**
|
||||
* PathApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* PathApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class PathApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath
|
||||
*
|
||||
* Test path parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* QueryApiTest
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the endpoint.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Api;
|
||||
|
||||
use OpenAPI\Client\Configuration;
|
||||
use OpenAPI\Client\ApiException;
|
||||
use OpenAPI\Client\ObjectSerializer;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* QueryApiTest Class Doc Comment
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class QueryApiTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test cases
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testEnumRefString
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestEnumRefString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryDatetimeDateString
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryDatetimeDateString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryIntegerBooleanString
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryIntegerBooleanString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleDeepObjectExplodeTrueObject
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleDeepObjectExplodeTrueObject()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleDeepObjectExplodeTrueObjectAllOf
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleDeepObjectExplodeTrueObjectAllOf()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleFormExplodeFalseArrayInteger
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeFalseArrayInteger()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleFormExplodeFalseArrayString
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeFalseArrayString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleFormExplodeTrueArrayString
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeTrueArrayString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleFormExplodeTrueObject
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeTrueObject()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test case for testQueryStyleFormExplodeTrueObjectAllOf
|
||||
*
|
||||
* Test query parameter(s).
|
||||
*
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeTrueObjectAllOf()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* BirdTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* BirdTest Class Doc Comment
|
||||
*
|
||||
* @description Bird
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class BirdTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "Bird"
|
||||
*/
|
||||
public function testBird()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "size"
|
||||
*/
|
||||
public function testPropertySize()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "color"
|
||||
*/
|
||||
public function testPropertyColor()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* CategoryTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* CategoryTest Class Doc Comment
|
||||
*
|
||||
* @description Category
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class CategoryTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "Category"
|
||||
*/
|
||||
public function testCategory()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* DataQueryTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* DataQueryTest Class Doc Comment
|
||||
*
|
||||
* @description DataQuery
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class DataQueryTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "DataQuery"
|
||||
*/
|
||||
public function testDataQuery()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "suffix"
|
||||
*/
|
||||
public function testPropertySuffix()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "text"
|
||||
*/
|
||||
public function testPropertyText()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "date"
|
||||
*/
|
||||
public function testPropertyDate()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* DefaultValueTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* DefaultValueTest Class Doc Comment
|
||||
*
|
||||
* @description to test the default value of properties
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class DefaultValueTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "DefaultValue"
|
||||
*/
|
||||
public function testDefaultValue()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string_enum_ref_default"
|
||||
*/
|
||||
public function testPropertyArrayStringEnumRefDefault()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string_enum_default"
|
||||
*/
|
||||
public function testPropertyArrayStringEnumDefault()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string_default"
|
||||
*/
|
||||
public function testPropertyArrayStringDefault()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_integer_default"
|
||||
*/
|
||||
public function testPropertyArrayIntegerDefault()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string"
|
||||
*/
|
||||
public function testPropertyArrayString()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string_nullable"
|
||||
*/
|
||||
public function testPropertyArrayStringNullable()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "array_string_extension_nullable"
|
||||
*/
|
||||
public function testPropertyArrayStringExtensionNullable()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "string_nullable"
|
||||
*/
|
||||
public function testPropertyStringNullable()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/**
|
||||
* NumberPropertiesOnlyTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* NumberPropertiesOnlyTest Class Doc Comment
|
||||
*
|
||||
* @description NumberPropertiesOnly
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class NumberPropertiesOnlyTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "NumberPropertiesOnly"
|
||||
*/
|
||||
public function testNumberPropertiesOnly()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "number"
|
||||
*/
|
||||
public function testPropertyNumber()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "float"
|
||||
*/
|
||||
public function testPropertyFloat()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "double"
|
||||
*/
|
||||
public function testPropertyDouble()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* PetTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* PetTest Class Doc Comment
|
||||
*
|
||||
* @description Pet
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class PetTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "Pet"
|
||||
*/
|
||||
public function testPet()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "category"
|
||||
*/
|
||||
public function testPropertyCategory()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "photo_urls"
|
||||
*/
|
||||
public function testPropertyPhotoUrls()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "tags"
|
||||
*/
|
||||
public function testPropertyTags()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "status"
|
||||
*/
|
||||
public function testPropertyStatus()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* QueryTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* QueryTest Class Doc Comment
|
||||
*
|
||||
* @description Query
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class QueryTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "Query"
|
||||
*/
|
||||
public function testQuery()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "outcomes"
|
||||
*/
|
||||
public function testPropertyOutcomes()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/**
|
||||
* StringEnumRefTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* StringEnumRefTest Class Doc Comment
|
||||
*
|
||||
* @description StringEnumRef
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class StringEnumRefTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "StringEnumRef"
|
||||
*/
|
||||
public function testStringEnumRef()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* TagTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* TagTest Class Doc Comment
|
||||
*
|
||||
* @description Tag
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class TagTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "Tag"
|
||||
*/
|
||||
public function testTag()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* TestFormObjectMultipartRequestMarkerTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* TestFormObjectMultipartRequestMarkerTest Class Doc Comment
|
||||
*
|
||||
* @description TestFormObjectMultipartRequestMarker
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class TestFormObjectMultipartRequestMarkerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "TestFormObjectMultipartRequestMarker"
|
||||
*/
|
||||
public function testTestFormObjectMultipartRequestMarker()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest Class Doc Comment
|
||||
*
|
||||
* @description TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter"
|
||||
*/
|
||||
public function testTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "size"
|
||||
*/
|
||||
public function testPropertySize()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "color"
|
||||
*/
|
||||
public function testPropertyColor()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "id"
|
||||
*/
|
||||
public function testPropertyId()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "name"
|
||||
*/
|
||||
public function testPropertyName()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest
|
||||
*
|
||||
* PHP version 8.1
|
||||
*
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
/**
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* @generated Generated by: https://openapi-generator.tech
|
||||
* Generator version: 7.8.0-SNAPSHOT
|
||||
*/
|
||||
|
||||
/**
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Please update the test case below to test the model.
|
||||
*/
|
||||
|
||||
namespace OpenAPI\Client\Test\Model;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest Class Doc Comment
|
||||
*
|
||||
* @description TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
* @package OpenAPI\Client
|
||||
* @author OpenAPI Generator team
|
||||
* @link https://openapi-generator.tech
|
||||
*/
|
||||
class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup before running any test case
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup before running each test case
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running each test case
|
||||
*/
|
||||
public function tearDown(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean up after running all test cases
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Test "TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter"
|
||||
*/
|
||||
public function testTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test attribute "values"
|
||||
*/
|
||||
public function testPropertyValues()
|
||||
{
|
||||
// TODO: implement
|
||||
self::markTestIncomplete('Not implemented');
|
||||
}
|
||||
}
|
@ -199,7 +199,7 @@ class AuthApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -228,7 +228,7 @@ class AuthApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -313,7 +313,7 @@ class AuthApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -500,7 +500,7 @@ class AuthApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -529,7 +529,7 @@ class AuthApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -614,7 +614,7 @@ class AuthApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -223,7 +223,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\SplFileObject' === '\SplFileObject') {
|
||||
if (in_array('\SplFileObject', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -252,7 +252,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = '\SplFileObject';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -337,7 +337,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -524,7 +524,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -553,7 +553,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -642,7 +642,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -839,7 +839,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -868,7 +868,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -957,7 +957,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1028,7 +1028,9 @@ class BodyApi
|
||||
$formParams['files'] = [];
|
||||
$paramFiles = is_array($files) ? $files : [$files];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['files'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['files'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
@ -1165,7 +1167,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1194,7 +1196,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1283,7 +1285,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1348,7 +1350,9 @@ class BodyApi
|
||||
$formParams['my-file'] = [];
|
||||
$paramFiles = is_array($my_file) ? $my_file : [$my_file];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['my-file'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['my-file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
@ -1485,7 +1489,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Pet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1514,7 +1518,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1603,7 +1607,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1800,7 +1804,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1829,7 +1833,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1918,7 +1922,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2115,7 +2119,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Pet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2144,7 +2148,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2233,7 +2237,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2430,7 +2434,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2459,7 +2463,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2548,7 +2552,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2745,7 +2749,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\StringEnumRef' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\StringEnumRef', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2774,7 +2778,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\StringEnumRef';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2863,7 +2867,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3060,7 +3064,7 @@ class BodyApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3089,7 +3093,7 @@ class BodyApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3178,7 +3182,7 @@ class BodyApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -214,7 +214,7 @@ class FormApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -243,7 +243,7 @@ class FormApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -340,7 +340,7 @@ class FormApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -548,7 +548,7 @@ class FormApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -577,7 +577,7 @@ class FormApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -666,7 +666,7 @@ class FormApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -886,7 +886,7 @@ class FormApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -915,7 +915,7 @@ class FormApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1024,7 +1024,7 @@ class FormApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -216,7 +216,7 @@ class HeaderApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -245,7 +245,7 @@ class HeaderApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -350,7 +350,7 @@ class HeaderApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -212,7 +212,7 @@ class PathApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -241,7 +241,7 @@ class PathApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -342,7 +342,7 @@ class PathApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -231,7 +231,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -260,7 +260,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -353,7 +353,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -572,7 +572,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -601,7 +601,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -698,7 +698,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -929,7 +929,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -958,7 +958,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1055,7 +1055,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1278,7 +1278,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1307,7 +1307,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1396,7 +1396,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1595,7 +1595,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1624,7 +1624,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1713,7 +1713,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1912,7 +1912,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1941,7 +1941,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2030,7 +2030,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2229,7 +2229,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2258,7 +2258,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2347,7 +2347,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2546,7 +2546,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2575,7 +2575,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2664,7 +2664,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2863,7 +2863,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2892,7 +2892,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2981,7 +2981,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3180,7 +3180,7 @@ class QueryApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3209,7 +3209,7 @@ class QueryApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3298,7 +3298,7 @@ class QueryApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -452,6 +452,10 @@ class ObjectSerializer
|
||||
}
|
||||
}
|
||||
|
||||
if ($class === '\Psr\Http\Message\StreamInterface') {
|
||||
return Utils::streamFor($data);
|
||||
}
|
||||
|
||||
if ($class === '\SplFileObject') {
|
||||
$data = Utils::streamFor($data);
|
||||
|
||||
|
@ -199,7 +199,7 @@ class AnotherFakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Client', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -228,7 +228,7 @@ class AnotherFakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Client';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -317,7 +317,7 @@ class AnotherFakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -191,7 +191,7 @@ class DefaultApi
|
||||
|
||||
switch($statusCode) {
|
||||
default:
|
||||
if ('\OpenAPI\Client\Model\FooGetDefaultResponse' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\FooGetDefaultResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -220,7 +220,7 @@ class DefaultApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\FooGetDefaultResponse';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -301,7 +301,7 @@ class DefaultApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -255,7 +255,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\FakeBigDecimalMap200Response' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\FakeBigDecimalMap200Response', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -284,7 +284,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\FakeBigDecimalMap200Response';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -365,7 +365,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -548,7 +548,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\HealthCheckResult' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\HealthCheckResult', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -577,7 +577,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\HealthCheckResult';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -662,7 +662,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1123,7 +1123,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('bool' === '\SplFileObject') {
|
||||
if (in_array('bool', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1152,7 +1152,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = 'bool';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1237,7 +1237,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1430,7 +1430,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\OuterComposite', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1459,7 +1459,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\OuterComposite';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1544,7 +1544,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1737,7 +1737,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('float' === '\SplFileObject') {
|
||||
if (in_array('float', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1766,7 +1766,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = 'float';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1851,7 +1851,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2044,7 +2044,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2073,7 +2073,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2158,7 +2158,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2351,7 +2351,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\OuterObjectWithEnumProperty' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\OuterObjectWithEnumProperty', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2380,7 +2380,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\OuterObjectWithEnumProperty';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2465,7 +2465,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3642,7 +3642,7 @@ class FakeApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Client', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3671,7 +3671,7 @@ class FakeApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Client';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3760,7 +3760,7 @@ class FakeApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -4310,7 +4310,9 @@ class FakeApi
|
||||
$formParams['binary'] = [];
|
||||
$paramFiles = is_array($binary) ? $binary : [$binary];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['binary'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['binary'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
|
@ -199,7 +199,7 @@ class FakeClassnameTags123Api
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Client', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -228,7 +228,7 @@ class FakeClassnameTags123Api
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Client';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -317,7 +317,7 @@ class FakeClassnameTags123Api
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -887,7 +887,7 @@ class PetApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Pet[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -916,7 +916,7 @@ class PetApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet[]';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1005,7 +1005,7 @@ class PetApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1216,7 +1216,7 @@ class PetApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Pet[]', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1245,7 +1245,7 @@ class PetApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet[]';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1336,7 +1336,7 @@ class PetApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1546,7 +1546,7 @@ class PetApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Pet', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1575,7 +1575,7 @@ class PetApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Pet';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1664,7 +1664,7 @@ class PetApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2558,7 +2558,7 @@ class PetApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\ApiResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2587,7 +2587,7 @@ class PetApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\ApiResponse';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2684,7 +2684,7 @@ class PetApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2773,7 +2773,9 @@ class PetApi
|
||||
$formParams['file'] = [];
|
||||
$paramFiles = is_array($file) ? $file : [$file];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['file'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
@ -2922,7 +2924,7 @@ class PetApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\ApiResponse', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -2951,7 +2953,7 @@ class PetApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\ApiResponse';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3048,7 +3050,7 @@ class PetApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -3143,7 +3145,9 @@ class PetApi
|
||||
$formParams['requiredFile'] = [];
|
||||
$paramFiles = is_array($required_file) ? $required_file : [$required_file];
|
||||
foreach ($paramFiles as $paramFile) {
|
||||
$formParams['requiredFile'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
$formParams['requiredFile'][] = $paramFile instanceof \Psr\Http\Message\StreamInterface
|
||||
? $paramFile
|
||||
: \GuzzleHttp\Psr7\Utils::tryFopen(
|
||||
ObjectSerializer::toFormValue($paramFile),
|
||||
'rb'
|
||||
);
|
||||
|
@ -448,7 +448,7 @@ class StoreApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('array<string,int>' === '\SplFileObject') {
|
||||
if (in_array('array<string,int>', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -477,7 +477,7 @@ class StoreApi
|
||||
}
|
||||
|
||||
$returnType = 'array<string,int>';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -562,7 +562,7 @@ class StoreApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -754,7 +754,7 @@ class StoreApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Order', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -783,7 +783,7 @@ class StoreApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Order';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -872,7 +872,7 @@ class StoreApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1082,7 +1082,7 @@ class StoreApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\Order', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1111,7 +1111,7 @@ class StoreApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\Order';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1200,7 +1200,7 @@ class StoreApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -1193,7 +1193,7 @@ class UserApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('\OpenAPI\Client\Model\User' === '\SplFileObject') {
|
||||
if (in_array('\OpenAPI\Client\Model\User', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1222,7 +1222,7 @@ class UserApi
|
||||
}
|
||||
|
||||
$returnType = '\OpenAPI\Client\Model\User';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1311,7 +1311,7 @@ class UserApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1519,7 +1519,7 @@ class UserApi
|
||||
|
||||
switch($statusCode) {
|
||||
case 200:
|
||||
if ('string' === '\SplFileObject') {
|
||||
if (in_array('string', ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1548,7 +1548,7 @@ class UserApi
|
||||
}
|
||||
|
||||
$returnType = 'string';
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
@ -1641,7 +1641,7 @@ class UserApi
|
||||
->sendAsync($request, $this->createHttpClientOption())
|
||||
->then(
|
||||
function ($response) use ($returnType) {
|
||||
if ($returnType === '\SplFileObject') {
|
||||
if (in_array($returnType, ['\SplFileObject', '\Psr\Http\Message\StreamInterface'])) {
|
||||
$content = $response->getBody(); //stream goes to serializer
|
||||
} else {
|
||||
$content = (string) $response->getBody();
|
||||
|
@ -451,6 +451,10 @@ class ObjectSerializer
|
||||
}
|
||||
}
|
||||
|
||||
if ($class === '\Psr\Http\Message\StreamInterface') {
|
||||
return Utils::streamFor($data);
|
||||
}
|
||||
|
||||
if ($class === '\SplFileObject') {
|
||||
$data = Utils::streamFor($data);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user