forked from loafle/openapi-generator-original
when using useJakartaEe=true
also set java 17 (#14360)
webclient now uses Sring Boot 3.0.1 with `useJakartaEe`
This commit is contained in:
parent
da8d984ea4
commit
fd2b141c53
9
bin/configs/java-webclient-jakarta.yaml
Normal file
9
bin/configs/java-webclient-jakarta.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/webclient-jakarta
|
||||
library: webclient
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-webclient
|
||||
hideGenerationTimestamp: "true"
|
||||
useJakartaEe: true
|
@ -144,8 +144,14 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
{{#useJakartaEe}}
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
{{/useJakartaEe}}
|
||||
{{^useJakartaEe}}
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
{{/useJakartaEe}}
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
@ -45,8 +45,14 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
{{#useJakartaEe}}
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
{{/useJakartaEe}}
|
||||
{{^useJakartaEe}}
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
{{/useJakartaEe}}
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -149,21 +155,24 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>1.6.6</swagger-annotations-version>
|
||||
<spring-boot-version>2.6.6</spring-boot-version>
|
||||
<jackson-version>2.13.4</jackson-version>
|
||||
<jackson-databind-version>2.13.4.2</jackson-databind-version>
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<spring-boot-version>3.0.1</spring-boot-version>
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<reactor-version>3.5.1</reactor-version>
|
||||
<reactor-netty-version>1.1.1</reactor-netty-version>
|
||||
{{/useJakartaEe}}
|
||||
{{^useJakartaEe}}
|
||||
<spring-boot-version>2.6.6</spring-boot-version>
|
||||
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
|
||||
{{/useJakartaEe}}
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<reactor-version>3.4.3</reactor-version>
|
||||
<reactor-netty-version>1.0.4</reactor-netty-version>
|
||||
{{/useJakartaEe}}
|
||||
<junit-version>4.13.2</junit-version>
|
||||
{{#joda}}
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
{{/joda}}
|
||||
|
@ -137,8 +137,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
30
samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml
vendored
Normal file
30
samples/client/petstore/java/webclient-jakarta/.github/workflows/maven.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
#
|
||||
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build OpenAPI Petstore
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '8' ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --no-transfer-progress --file pom.xml
|
21
samples/client/petstore/java/webclient-jakarta/.gitignore
vendored
Normal file
21
samples/client/petstore/java/webclient-jakarta/.gitignore
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
*.class
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# exclude jar for gradle wrapper
|
||||
!gradle/wrapper/*.jar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
# build files
|
||||
**/target
|
||||
target
|
||||
.gradle
|
||||
build
|
@ -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,138 @@
|
||||
.github/workflows/maven.yml
|
||||
.gitignore
|
||||
.travis.yml
|
||||
README.md
|
||||
api/openapi.yaml
|
||||
build.gradle
|
||||
build.sbt
|
||||
docs/AdditionalPropertiesClass.md
|
||||
docs/AllOfWithSingleRef.md
|
||||
docs/Animal.md
|
||||
docs/AnotherFakeApi.md
|
||||
docs/ArrayOfArrayOfNumberOnly.md
|
||||
docs/ArrayOfNumberOnly.md
|
||||
docs/ArrayTest.md
|
||||
docs/Capitalization.md
|
||||
docs/Cat.md
|
||||
docs/CatAllOf.md
|
||||
docs/Category.md
|
||||
docs/ClassModel.md
|
||||
docs/Client.md
|
||||
docs/DefaultApi.md
|
||||
docs/DeprecatedObject.md
|
||||
docs/Dog.md
|
||||
docs/DogAllOf.md
|
||||
docs/EnumArrays.md
|
||||
docs/EnumClass.md
|
||||
docs/EnumTest.md
|
||||
docs/FakeApi.md
|
||||
docs/FakeClassnameTags123Api.md
|
||||
docs/FileSchemaTestClass.md
|
||||
docs/Foo.md
|
||||
docs/FooGetDefaultResponse.md
|
||||
docs/FormatTest.md
|
||||
docs/HasOnlyReadOnly.md
|
||||
docs/HealthCheckResult.md
|
||||
docs/MapTest.md
|
||||
docs/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
docs/Model200Response.md
|
||||
docs/ModelApiResponse.md
|
||||
docs/ModelFile.md
|
||||
docs/ModelList.md
|
||||
docs/ModelReturn.md
|
||||
docs/Name.md
|
||||
docs/NullableClass.md
|
||||
docs/NumberOnly.md
|
||||
docs/ObjectWithDeprecatedFields.md
|
||||
docs/Order.md
|
||||
docs/OuterComposite.md
|
||||
docs/OuterEnum.md
|
||||
docs/OuterEnumDefaultValue.md
|
||||
docs/OuterEnumInteger.md
|
||||
docs/OuterEnumIntegerDefaultValue.md
|
||||
docs/OuterObjectWithEnumProperty.md
|
||||
docs/Pet.md
|
||||
docs/PetApi.md
|
||||
docs/ReadOnlyFirst.md
|
||||
docs/SingleRefType.md
|
||||
docs/SpecialModelName.md
|
||||
docs/StoreApi.md
|
||||
docs/Tag.md
|
||||
docs/User.md
|
||||
docs/UserApi.md
|
||||
git_push.sh
|
||||
gradle.properties
|
||||
gradle/wrapper/gradle-wrapper.jar
|
||||
gradle/wrapper/gradle-wrapper.properties
|
||||
gradlew
|
||||
gradlew.bat
|
||||
pom.xml
|
||||
settings.gradle
|
||||
src/main/AndroidManifest.xml
|
||||
src/main/java/org/openapitools/client/ApiClient.java
|
||||
src/main/java/org/openapitools/client/JavaTimeFormatter.java
|
||||
src/main/java/org/openapitools/client/RFC3339DateFormat.java
|
||||
src/main/java/org/openapitools/client/ServerConfiguration.java
|
||||
src/main/java/org/openapitools/client/ServerVariable.java
|
||||
src/main/java/org/openapitools/client/StringUtil.java
|
||||
src/main/java/org/openapitools/client/api/AnotherFakeApi.java
|
||||
src/main/java/org/openapitools/client/api/DefaultApi.java
|
||||
src/main/java/org/openapitools/client/api/FakeApi.java
|
||||
src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java
|
||||
src/main/java/org/openapitools/client/api/PetApi.java
|
||||
src/main/java/org/openapitools/client/api/StoreApi.java
|
||||
src/main/java/org/openapitools/client/api/UserApi.java
|
||||
src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
|
||||
src/main/java/org/openapitools/client/auth/Authentication.java
|
||||
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
|
||||
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
|
||||
src/main/java/org/openapitools/client/auth/OAuth.java
|
||||
src/main/java/org/openapitools/client/auth/OAuthFlow.java
|
||||
src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
|
||||
src/main/java/org/openapitools/client/model/Animal.java
|
||||
src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
|
||||
src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
|
||||
src/main/java/org/openapitools/client/model/ArrayTest.java
|
||||
src/main/java/org/openapitools/client/model/Capitalization.java
|
||||
src/main/java/org/openapitools/client/model/Cat.java
|
||||
src/main/java/org/openapitools/client/model/CatAllOf.java
|
||||
src/main/java/org/openapitools/client/model/Category.java
|
||||
src/main/java/org/openapitools/client/model/ClassModel.java
|
||||
src/main/java/org/openapitools/client/model/Client.java
|
||||
src/main/java/org/openapitools/client/model/DeprecatedObject.java
|
||||
src/main/java/org/openapitools/client/model/Dog.java
|
||||
src/main/java/org/openapitools/client/model/DogAllOf.java
|
||||
src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||
src/main/java/org/openapitools/client/model/Foo.java
|
||||
src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java
|
||||
src/main/java/org/openapitools/client/model/FormatTest.java
|
||||
src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
|
||||
src/main/java/org/openapitools/client/model/HealthCheckResult.java
|
||||
src/main/java/org/openapitools/client/model/MapTest.java
|
||||
src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
|
||||
src/main/java/org/openapitools/client/model/Model200Response.java
|
||||
src/main/java/org/openapitools/client/model/ModelApiResponse.java
|
||||
src/main/java/org/openapitools/client/model/ModelFile.java
|
||||
src/main/java/org/openapitools/client/model/ModelList.java
|
||||
src/main/java/org/openapitools/client/model/ModelReturn.java
|
||||
src/main/java/org/openapitools/client/model/Name.java
|
||||
src/main/java/org/openapitools/client/model/NullableClass.java
|
||||
src/main/java/org/openapitools/client/model/NumberOnly.java
|
||||
src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java
|
||||
src/main/java/org/openapitools/client/model/Order.java
|
||||
src/main/java/org/openapitools/client/model/OuterComposite.java
|
||||
src/main/java/org/openapitools/client/model/OuterEnum.java
|
||||
src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java
|
||||
src/main/java/org/openapitools/client/model/OuterEnumInteger.java
|
||||
src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java
|
||||
src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
|
||||
src/main/java/org/openapitools/client/model/SingleRefType.java
|
||||
src/main/java/org/openapitools/client/model/SpecialModelName.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/User.java
|
@ -0,0 +1 @@
|
||||
6.3.0-SNAPSHOT
|
22
samples/client/petstore/java/webclient-jakarta/.travis.yml
Normal file
22
samples/client/petstore/java/webclient-jakarta/.travis.yml
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# Generated by OpenAPI Generator: https://openapi-generator.tech
|
||||
#
|
||||
# Ref: https://docs.travis-ci.com/user/languages/java/
|
||||
#
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk12
|
||||
- openjdk11
|
||||
- openjdk10
|
||||
- openjdk9
|
||||
- openjdk8
|
||||
before_install:
|
||||
# ensure gradlew has proper permission
|
||||
- chmod a+x ./gradlew
|
||||
script:
|
||||
# test using maven
|
||||
#- mvn test
|
||||
# test using gradle
|
||||
- gradle test
|
||||
# test using sbt
|
||||
# - sbt test
|
261
samples/client/petstore/java/webclient-jakarta/README.md
Normal file
261
samples/client/petstore/java/webclient-jakarta/README.md
Normal file
@ -0,0 +1,261 @@
|
||||
# petstore-webclient
|
||||
|
||||
OpenAPI Petstore
|
||||
|
||||
- API version: 1.0.0
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
|
||||
*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
|
||||
|
||||
## Requirements
|
||||
|
||||
Building the API client library requires:
|
||||
|
||||
1. Java 1.8+
|
||||
2. Maven/Gradle
|
||||
|
||||
## Installation
|
||||
|
||||
To install the API client library to your local Maven repository, simply execute:
|
||||
|
||||
```shell
|
||||
mvn clean install
|
||||
```
|
||||
|
||||
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
|
||||
|
||||
```shell
|
||||
mvn clean deploy
|
||||
```
|
||||
|
||||
Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information.
|
||||
|
||||
### Maven users
|
||||
|
||||
Add this dependency to your project's POM:
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-webclient</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### Gradle users
|
||||
|
||||
Add this dependency to your project's build file:
|
||||
|
||||
```groovy
|
||||
repositories {
|
||||
mavenCentral() // Needed if the 'petstore-webclient' jar has been published to maven central.
|
||||
mavenLocal() // Needed if the 'petstore-webclient' jar has been published to the local maven repo.
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "org.openapitools:petstore-webclient:1.0.0"
|
||||
}
|
||||
```
|
||||
|
||||
### Others
|
||||
|
||||
At first generate the JAR by executing:
|
||||
|
||||
```shell
|
||||
mvn clean package
|
||||
```
|
||||
|
||||
Then manually install the following JARs:
|
||||
|
||||
- `target/petstore-webclient-1.0.0.jar`
|
||||
- `target/lib/*.jar`
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation](#installation) instruction and execute the following Java code:
|
||||
|
||||
```java
|
||||
|
||||
import org.openapitools.client.*;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.openapitools.client.api.AnotherFakeApi;
|
||||
|
||||
public class AnotherFakeApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||
Client client = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.call123testSpecialTags(client);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooGet) | **GET** /foo |
|
||||
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
|
||||
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
|
||||
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](docs/FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int |
|
||||
*FakeApi* | [**testBodyWithBinary**](docs/FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary |
|
||||
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters |
|
||||
*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user
|
||||
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Documentation for Models
|
||||
|
||||
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
||||
- [Animal](docs/Animal.md)
|
||||
- [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
- [ArrayTest](docs/ArrayTest.md)
|
||||
- [Capitalization](docs/Capitalization.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [CatAllOf](docs/CatAllOf.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [ClassModel](docs/ClassModel.md)
|
||||
- [Client](docs/Client.md)
|
||||
- [DeprecatedObject](docs/DeprecatedObject.md)
|
||||
- [Dog](docs/Dog.md)
|
||||
- [DogAllOf](docs/DogAllOf.md)
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [Foo](docs/Foo.md)
|
||||
- [FooGetDefaultResponse](docs/FooGetDefaultResponse.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [HealthCheckResult](docs/HealthCheckResult.md)
|
||||
- [MapTest](docs/MapTest.md)
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](docs/Model200Response.md)
|
||||
- [ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [ModelFile](docs/ModelFile.md)
|
||||
- [ModelList](docs/ModelList.md)
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
- [Name](docs/Name.md)
|
||||
- [NullableClass](docs/NullableClass.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
- [ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [OuterComposite](docs/OuterComposite.md)
|
||||
- [OuterEnum](docs/OuterEnum.md)
|
||||
- [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
|
||||
- [OuterEnumInteger](docs/OuterEnumInteger.md)
|
||||
- [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
|
||||
- [OuterObjectWithEnumProperty](docs/OuterObjectWithEnumProperty.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [SingleRefType](docs/SingleRefType.md)
|
||||
- [SpecialModelName](docs/SpecialModelName.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [User](docs/User.md)
|
||||
|
||||
|
||||
## Documentation for Authorization
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### api_key
|
||||
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
### api_key_query
|
||||
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
### bearer_test
|
||||
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### http_basic_test
|
||||
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### http_signature_test
|
||||
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### petstore_auth
|
||||
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
|
||||
## Recommendation
|
||||
|
||||
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
2170
samples/client/petstore/java/webclient-jakarta/api/openapi.yaml
Normal file
2170
samples/client/petstore/java/webclient-jakarta/api/openapi.yaml
Normal file
File diff suppressed because it is too large
Load Diff
141
samples/client/petstore/java/webclient-jakarta/build.gradle
Normal file
141
samples/client/petstore/java/webclient-jakarta/build.gradle
Normal file
@ -0,0 +1,141 @@
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
group = 'org.openapitools'
|
||||
version = '1.0.0'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.+'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
if(hasProperty('target') && target == 'android') {
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 25
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
// Rename the aar correctly
|
||||
libraryVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||
output.outputFile = new File(outputFile.parent, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
android.libraryVariants.all { variant ->
|
||||
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||
task.description = "Create jar artifact for ${variant.name}"
|
||||
task.dependsOn variant.javaCompile
|
||||
task.from variant.javaCompile.destinationDir
|
||||
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||
artifacts.add('archives', task);
|
||||
}
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifactId = 'petstore-webclient'
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task execute(type:JavaExec) {
|
||||
main = System.getProperty('mainClass')
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.6.3"
|
||||
spring_boot_version = "2.6.6"
|
||||
jackson_version = "2.13.4"
|
||||
jackson_databind_version = "2.13.4.2"
|
||||
jackson_databind_nullable_version = "0.2.4"
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
reactor_version = "3.4.3"
|
||||
reactor_netty_version = "1.0.4"
|
||||
jodatime_version = "2.9.9"
|
||||
junit_version = "4.13.2"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
implementation "com.google.code.findbugs:jsr305:3.0.2"
|
||||
implementation "io.projectreactor:reactor-core:$reactor_version"
|
||||
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
|
||||
implementation "io.projectreactor.netty:reactor-netty-http:$reactor_netty_version"
|
||||
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version"
|
||||
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
|
||||
implementation "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
|
||||
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
testImplementation "junit:junit:$junit_version"
|
||||
}
|
1
samples/client/petstore/java/webclient-jakarta/build.sbt
Normal file
1
samples/client/petstore/java/webclient-jakarta/build.sbt
Normal file
@ -0,0 +1 @@
|
||||
# TODO
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# AdditionalPropertiesClass
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**mapProperty** | **Map<String, String>** | | [optional] |
|
||||
|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# AllOfWithSingleRef
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**username** | **String** | | [optional] |
|
||||
|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# Animal
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**className** | **String** | | |
|
||||
|**color** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,75 @@
|
||||
# AnotherFakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags |
|
||||
|
||||
|
||||
|
||||
## call123testSpecialTags
|
||||
|
||||
> Client call123testSpecialTags(client)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.AnotherFakeApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient);
|
||||
Client client = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.call123testSpecialTags(client);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **client** | [**Client**](Client.md)| client model | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ArrayOfArrayOfNumberOnly
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ArrayOfNumberOnly
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**arrayNumber** | **List<BigDecimal>** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# ArrayTest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**arrayOfString** | **List<String>** | | [optional] |
|
||||
|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] |
|
||||
|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
# Capitalization
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**smallCamel** | **String** | | [optional] |
|
||||
|**capitalCamel** | **String** | | [optional] |
|
||||
|**smallSnake** | **String** | | [optional] |
|
||||
|**capitalSnake** | **String** | | [optional] |
|
||||
|**scAETHFlowPoints** | **String** | | [optional] |
|
||||
|**ATT_NAME** | **String** | Name of the pet | [optional] |
|
||||
|
||||
|
||||
|
13
samples/client/petstore/java/webclient-jakarta/docs/Cat.md
Normal file
13
samples/client/petstore/java/webclient-jakarta/docs/Cat.md
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Cat
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**declawed** | **Boolean** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# CatAllOf
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**declawed** | **Boolean** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# Category
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**name** | **String** | | |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ClassModel
|
||||
|
||||
Model for testing model with \"_class\" property
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**propertyClass** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Client
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**client** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
# DefaultApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | |
|
||||
|
||||
|
||||
|
||||
## fooGet
|
||||
|
||||
> FooGetDefaultResponse fooGet()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.DefaultApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
DefaultApi apiInstance = new DefaultApi(defaultClient);
|
||||
try {
|
||||
FooGetDefaultResponse result = apiInstance.fooGet();
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling DefaultApi#fooGet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | response | - |
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# DeprecatedObject
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**name** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
13
samples/client/petstore/java/webclient-jakarta/docs/Dog.md
Normal file
13
samples/client/petstore/java/webclient-jakarta/docs/Dog.md
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Dog
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**breed** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# DogAllOf
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**breed** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
# EnumArrays
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] |
|
||||
|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: JustSymbolEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| GREATER_THAN_OR_EQUAL_TO | ">=" |
|
||||
| DOLLAR | "$" |
|
||||
|
||||
|
||||
|
||||
## Enum: List<ArrayEnumEnum>
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| FISH | "fish" |
|
||||
| CRAB | "crab" |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# EnumClass
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `_ABC` (value: `"_abc"`)
|
||||
|
||||
* `_EFG` (value: `"-efg"`)
|
||||
|
||||
* `_XYZ_` (value: `"(xyz)"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,58 @@
|
||||
|
||||
|
||||
# EnumTest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] |
|
||||
|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | |
|
||||
|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] |
|
||||
|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] |
|
||||
|**outerEnum** | **OuterEnum** | | [optional] |
|
||||
|**outerEnumInteger** | **OuterEnumInteger** | | [optional] |
|
||||
|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] |
|
||||
|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: EnumStringEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| UPPER | "UPPER" |
|
||||
| LOWER | "lower" |
|
||||
| EMPTY | "" |
|
||||
|
||||
|
||||
|
||||
## Enum: EnumStringRequiredEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| UPPER | "UPPER" |
|
||||
| LOWER | "lower" |
|
||||
| EMPTY | "" |
|
||||
|
||||
|
||||
|
||||
## Enum: EnumIntegerEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| NUMBER_1 | 1 |
|
||||
| NUMBER_MINUS_1 | -1 |
|
||||
|
||||
|
||||
|
||||
## Enum: EnumNumberEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| NUMBER_1_DOT_1 | 1.1 |
|
||||
| NUMBER_MINUS_1_DOT_2 | -1.2 |
|
||||
|
||||
|
||||
|
1214
samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md
Normal file
1214
samples/client/petstore/java/webclient-jakarta/docs/FakeApi.md
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,82 @@
|
||||
# FakeClassnameTags123Api
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case |
|
||||
|
||||
|
||||
|
||||
## testClassname
|
||||
|
||||
> Client testClassname(client)
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.FakeClassnameTags123Api;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key_query
|
||||
ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query");
|
||||
api_key_query.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key_query.setApiKeyPrefix("Token");
|
||||
|
||||
FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient);
|
||||
Client client = new Client(); // Client | client model
|
||||
try {
|
||||
Client result = apiInstance.testClassname(client);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling FakeClassnameTags123Api#testClassname");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **client** | [**Client**](Client.md)| client model | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key_query](../README.md#api_key_query)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**_file** | [**ModelFile**](ModelFile.md) | | [optional] |
|
||||
|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] |
|
||||
|
||||
|
||||
|
13
samples/client/petstore/java/webclient-jakarta/docs/Foo.md
Normal file
13
samples/client/petstore/java/webclient-jakarta/docs/Foo.md
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# Foo
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**bar** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# FooGetDefaultResponse
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**string** | [**Foo**](Foo.md) | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
# FormatTest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**integer** | **Integer** | | [optional] |
|
||||
|**int32** | **Integer** | | [optional] |
|
||||
|**int64** | **Long** | | [optional] |
|
||||
|**number** | **BigDecimal** | | |
|
||||
|**_float** | **Float** | | [optional] |
|
||||
|**_double** | **Double** | | [optional] |
|
||||
|**decimal** | **BigDecimal** | | [optional] |
|
||||
|**string** | **String** | | [optional] |
|
||||
|**_byte** | **byte[]** | | |
|
||||
|**binary** | **File** | | [optional] |
|
||||
|**date** | **LocalDate** | | |
|
||||
|**dateTime** | **OffsetDateTime** | | [optional] |
|
||||
|**uuid** | **UUID** | | [optional] |
|
||||
|**password** | **String** | | |
|
||||
|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] |
|
||||
|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# HasOnlyReadOnly
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**bar** | **String** | | [optional] [readonly] |
|
||||
|**foo** | **String** | | [optional] [readonly] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# HealthCheckResult
|
||||
|
||||
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**nullableMessage** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# MapTest
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] |
|
||||
|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] |
|
||||
|**directMap** | **Map<String, Boolean>** | | [optional] |
|
||||
|**indirectMap** | **Map<String, Boolean>** | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: Map<String, InnerEnum>
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| UPPER | "UPPER" |
|
||||
| LOWER | "lower" |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**uuid** | **UUID** | | [optional] |
|
||||
|**dateTime** | **OffsetDateTime** | | [optional] |
|
||||
|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# Model200Response
|
||||
|
||||
Model for testing model name starting with number
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**name** | **Integer** | | [optional] |
|
||||
|**propertyClass** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# ModelApiResponse
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**code** | **Integer** | | [optional] |
|
||||
|**type** | **String** | | [optional] |
|
||||
|**message** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**sourceURI** | **String** | Test capitalization | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**_123list** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelReturn
|
||||
|
||||
Model for testing reserved words
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**_return** | **Integer** | | [optional] |
|
||||
|
||||
|
||||
|
17
samples/client/petstore/java/webclient-jakarta/docs/Name.md
Normal file
17
samples/client/petstore/java/webclient-jakarta/docs/Name.md
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
# Name
|
||||
|
||||
Model for testing model name same as property name
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**name** | **Integer** | | |
|
||||
|**snakeCase** | **Integer** | | [optional] [readonly] |
|
||||
|**property** | **String** | | [optional] |
|
||||
|**_123number** | **Integer** | | [optional] [readonly] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
# NullableClass
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**integerProp** | **Integer** | | [optional] |
|
||||
|**numberProp** | **BigDecimal** | | [optional] |
|
||||
|**booleanProp** | **Boolean** | | [optional] |
|
||||
|**stringProp** | **String** | | [optional] |
|
||||
|**dateProp** | **LocalDate** | | [optional] |
|
||||
|**datetimeProp** | **OffsetDateTime** | | [optional] |
|
||||
|**arrayNullableProp** | **List<Object>** | | [optional] |
|
||||
|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] |
|
||||
|**arrayItemsNullable** | **List<Object>** | | [optional] |
|
||||
|**objectNullableProp** | **Map<String, Object>** | | [optional] |
|
||||
|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] |
|
||||
|**objectItemsNullable** | **Map<String, Object>** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# NumberOnly
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**justNumber** | **BigDecimal** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# ObjectWithDeprecatedFields
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**uuid** | **String** | | [optional] |
|
||||
|**id** | **BigDecimal** | | [optional] |
|
||||
|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] |
|
||||
|**bars** | **List<String>** | | [optional] |
|
||||
|
||||
|
||||
|
28
samples/client/petstore/java/webclient-jakarta/docs/Order.md
Normal file
28
samples/client/petstore/java/webclient-jakarta/docs/Order.md
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
# Order
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**petId** | **Long** | | [optional] |
|
||||
|**quantity** | **Integer** | | [optional] |
|
||||
|**shipDate** | **OffsetDateTime** | | [optional] |
|
||||
|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] |
|
||||
|**complete** | **Boolean** | | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: StatusEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| PLACED | "placed" |
|
||||
| APPROVED | "approved" |
|
||||
| DELIVERED | "delivered" |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterComposite
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**myNumber** | **BigDecimal** | | [optional] |
|
||||
|**myString** | **String** | | [optional] |
|
||||
|**myBoolean** | **Boolean** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterEnum
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `PLACED` (value: `"placed"`)
|
||||
|
||||
* `APPROVED` (value: `"approved"`)
|
||||
|
||||
* `DELIVERED` (value: `"delivered"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterEnumDefaultValue
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `PLACED` (value: `"placed"`)
|
||||
|
||||
* `APPROVED` (value: `"approved"`)
|
||||
|
||||
* `DELIVERED` (value: `"delivered"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterEnumInteger
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `NUMBER_0` (value: `0`)
|
||||
|
||||
* `NUMBER_1` (value: `1`)
|
||||
|
||||
* `NUMBER_2` (value: `2`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
# OuterEnumIntegerDefaultValue
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `NUMBER_0` (value: `0`)
|
||||
|
||||
* `NUMBER_1` (value: `1`)
|
||||
|
||||
* `NUMBER_2` (value: `2`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# OuterObjectWithEnumProperty
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**value** | **OuterEnumInteger** | | |
|
||||
|
||||
|
||||
|
28
samples/client/petstore/java/webclient-jakarta/docs/Pet.md
Normal file
28
samples/client/petstore/java/webclient-jakarta/docs/Pet.md
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
# Pet
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**category** | [**Category**](Category.md) | | [optional] |
|
||||
|**name** | **String** | | |
|
||||
|**photoUrls** | **Set<String>** | | |
|
||||
|**tags** | [**List<Tag>**](Tag.md) | | [optional] |
|
||||
|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] |
|
||||
|
||||
|
||||
|
||||
## Enum: StatusEnum
|
||||
|
||||
| Name | Value |
|
||||
|---- | -----|
|
||||
| AVAILABLE | "available" |
|
||||
| PENDING | "pending" |
|
||||
| SOLD | "sold" |
|
||||
|
||||
|
||||
|
678
samples/client/petstore/java/webclient-jakarta/docs/PetApi.md
Normal file
678
samples/client/petstore/java/webclient-jakarta/docs/PetApi.md
Normal file
@ -0,0 +1,678 @@
|
||||
# PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store |
|
||||
| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet |
|
||||
| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status |
|
||||
| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags |
|
||||
| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID |
|
||||
| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet |
|
||||
| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data |
|
||||
| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image |
|
||||
| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
|
||||
|
||||
|
||||
|
||||
## addPet
|
||||
|
||||
> addPet(pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.addPet(pet);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#addPet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
|
||||
## deletePet
|
||||
|
||||
> deletePet(petId, apiKey)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | Pet id to delete
|
||||
String apiKey = "apiKey_example"; // String |
|
||||
try {
|
||||
apiInstance.deletePet(petId, apiKey);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#deletePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **petId** | **Long**| Pet id to delete | |
|
||||
| **apiKey** | **String**| | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
| **400** | Invalid pet value | - |
|
||||
|
||||
|
||||
## findPetsByStatus
|
||||
|
||||
> List<Pet> findPetsByStatus(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
List<String> status = Arrays.asList("available"); // List<String> | Status values that need to be considered for filter
|
||||
try {
|
||||
List<Pet> result = apiInstance.findPetsByStatus(status);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByStatus");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid status value | - |
|
||||
|
||||
|
||||
## findPetsByTags
|
||||
|
||||
> Set<Pet> findPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Set<String> tags = Arrays.asList(); // Set<String> | Tags to filter by
|
||||
try {
|
||||
Set<Pet> result = apiInstance.findPetsByTags(tags);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#findPetsByTags");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **tags** | [**Set<String>**](String.md)| Tags to filter by | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Set<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid tag value | - |
|
||||
|
||||
|
||||
## getPetById
|
||||
|
||||
> Pet getPetById(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||
api_key.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.setApiKeyPrefix("Token");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to return
|
||||
try {
|
||||
Pet result = apiInstance.getPetById(petId);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#getPetById");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **petId** | **Long**| ID of pet to return | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
|
||||
|
||||
## updatePet
|
||||
|
||||
> updatePet(pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.updatePet(pet);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Pet not found | - |
|
||||
| **405** | Validation exception | - |
|
||||
|
||||
|
||||
## updatePetWithForm
|
||||
|
||||
> updatePetWithForm(petId, name, status)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet that needs to be updated
|
||||
String name = "name_example"; // String | Updated name of the pet
|
||||
String status = "status_example"; // String | Updated status of the pet
|
||||
try {
|
||||
apiInstance.updatePetWithForm(petId, name, status);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#updatePetWithForm");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **petId** | **Long**| ID of pet that needs to be updated | |
|
||||
| **name** | **String**| Updated name of the pet | [optional] |
|
||||
| **status** | **String**| Updated status of the pet | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | Successful operation | - |
|
||||
| **405** | Invalid input | - |
|
||||
|
||||
|
||||
## uploadFile
|
||||
|
||||
> ModelApiResponse uploadFile(petId, additionalMetadata, _file)
|
||||
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
File _file = new File("/path/to/file"); // File | file to upload
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFile");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **petId** | **Long**| ID of pet to update | |
|
||||
| **additionalMetadata** | **String**| Additional data to pass to server | [optional] |
|
||||
| **_file** | **File**| file to upload | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
## uploadFileWithRequiredFile
|
||||
|
||||
> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.PetApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure OAuth2 access token for authorization: petstore_auth
|
||||
OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth");
|
||||
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
|
||||
|
||||
PetApi apiInstance = new PetApi(defaultClient);
|
||||
Long petId = 56L; // Long | ID of pet to update
|
||||
File requiredFile = new File("/path/to/file"); // File | file to upload
|
||||
String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server
|
||||
try {
|
||||
ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **petId** | **Long**| ID of pet to update | |
|
||||
| **requiredFile** | **File**| file to upload | |
|
||||
| **additionalMetadata** | **String**| Additional data to pass to server | [optional] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ReadOnlyFirst
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**bar** | **String** | | [optional] [readonly] |
|
||||
|**baz** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# SingleRefType
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `ADMIN` (value: `"admin"`)
|
||||
|
||||
* `USER` (value: `"user"`)
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# SpecialModelName
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**$specialPropertyName** | **Long** | | [optional] |
|
||||
|
||||
|
||||
|
282
samples/client/petstore/java/webclient-jakarta/docs/StoreApi.md
Normal file
282
samples/client/petstore/java/webclient-jakarta/docs/StoreApi.md
Normal file
@ -0,0 +1,282 @@
|
||||
# StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID |
|
||||
| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status |
|
||||
| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID |
|
||||
| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet |
|
||||
|
||||
|
||||
|
||||
## deleteOrder
|
||||
|
||||
> deleteOrder(orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
String orderId = "orderId_example"; // String | ID of the order that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteOrder(orderId);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#deleteOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **orderId** | **String**| ID of the order that needs to be deleted | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
|
||||
## getInventory
|
||||
|
||||
> Map<String, Integer> getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.auth.*;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
// Configure API key authorization: api_key
|
||||
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
|
||||
api_key.setApiKey("YOUR API KEY");
|
||||
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
||||
//api_key.setApiKeyPrefix("Token");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
try {
|
||||
Map<String, Integer> result = apiInstance.getInventory();
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getInventory");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**Map<String, Integer>**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
|
||||
|
||||
## getOrderById
|
||||
|
||||
> Order getOrderById(orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
Long orderId = 56L; // Long | ID of pet that needs to be fetched
|
||||
try {
|
||||
Order result = apiInstance.getOrderById(orderId);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#getOrderById");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **orderId** | **Long**| ID of pet that needs to be fetched | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid ID supplied | - |
|
||||
| **404** | Order not found | - |
|
||||
|
||||
|
||||
## placeOrder
|
||||
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.StoreApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
StoreApi apiInstance = new StoreApi(defaultClient);
|
||||
Order order = new Order(); // Order | order placed for purchasing the pet
|
||||
try {
|
||||
Order result = apiInstance.placeOrder(order);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling StoreApi#placeOrder");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **order** | [**Order**](Order.md)| order placed for purchasing the pet | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid Order | - |
|
||||
|
14
samples/client/petstore/java/webclient-jakarta/docs/Tag.md
Normal file
14
samples/client/petstore/java/webclient-jakarta/docs/Tag.md
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# Tag
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**name** | **String** | | [optional] |
|
||||
|
||||
|
||||
|
20
samples/client/petstore/java/webclient-jakarta/docs/User.md
Normal file
20
samples/client/petstore/java/webclient-jakarta/docs/User.md
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
# User
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------ | ------------- | ------------- | -------------|
|
||||
|**id** | **Long** | | [optional] |
|
||||
|**username** | **String** | | [optional] |
|
||||
|**firstName** | **String** | | [optional] |
|
||||
|**lastName** | **String** | | [optional] |
|
||||
|**email** | **String** | | [optional] |
|
||||
|**password** | **String** | | [optional] |
|
||||
|**phone** | **String** | | [optional] |
|
||||
|**userStatus** | **Integer** | User Status | [optional] |
|
||||
|
||||
|
||||
|
543
samples/client/petstore/java/webclient-jakarta/docs/UserApi.md
Normal file
543
samples/client/petstore/java/webclient-jakarta/docs/UserApi.md
Normal file
@ -0,0 +1,543 @@
|
||||
# UserApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|------------- | ------------- | -------------|
|
||||
| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user |
|
||||
| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array |
|
||||
| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array |
|
||||
| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user |
|
||||
| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name |
|
||||
| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system |
|
||||
| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session |
|
||||
| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user |
|
||||
|
||||
|
||||
|
||||
## createUser
|
||||
|
||||
> createUser(user)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
User user = new User(); // User | Created user object
|
||||
try {
|
||||
apiInstance.createUser(user);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **user** | [**User**](User.md)| Created user object | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## createUsersWithArrayInput
|
||||
|
||||
> createUsersWithArrayInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
List<User> user = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithArrayInput(user);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **user** | [**List<User>**](User.md)| List of user object | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## createUsersWithListInput
|
||||
|
||||
> createUsersWithListInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
List<User> user = Arrays.asList(); // List<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithListInput(user);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#createUsersWithListInput");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **user** | [**List<User>**](User.md)| List of user object | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## deleteUser
|
||||
|
||||
> deleteUser(username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The name that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteUser(username);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#deleteUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **username** | **String**| The name that needs to be deleted | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
|
||||
## getUserByName
|
||||
|
||||
> User getUserByName(username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
try {
|
||||
User result = apiInstance.getUserByName(username);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#getUserByName");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | |
|
||||
|
||||
### Return type
|
||||
|
||||
[**User**](User.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | - |
|
||||
| **400** | Invalid username supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
||||
|
||||
## loginUser
|
||||
|
||||
> String loginUser(username, password)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | The user name for login
|
||||
String password = "password_example"; // String | The password for login in clear text
|
||||
try {
|
||||
String result = apiInstance.loginUser(username, password);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#loginUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **username** | **String**| The user name for login | |
|
||||
| **password** | **String**| The password for login in clear text | |
|
||||
|
||||
### Return type
|
||||
|
||||
**String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
|
||||
| **400** | Invalid username/password supplied | - |
|
||||
|
||||
|
||||
## logoutUser
|
||||
|
||||
> logoutUser()
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
try {
|
||||
apiInstance.logoutUser();
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#logoutUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **0** | successful operation | - |
|
||||
|
||||
|
||||
## updateUser
|
||||
|
||||
> updateUser(username, user)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
|
||||
```java
|
||||
// Import classes:
|
||||
import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Configuration;
|
||||
import org.openapitools.client.models.*;
|
||||
import org.openapitools.client.api.UserApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
UserApi apiInstance = new UserApi(defaultClient);
|
||||
String username = "username_example"; // String | name that need to be deleted
|
||||
User user = new User(); // User | Updated user object
|
||||
try {
|
||||
apiInstance.updateUser(username, user);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling UserApi#updateUser");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
| Name | Type | Description | Notes |
|
||||
|------------- | ------------- | ------------- | -------------|
|
||||
| **username** | **String**| name that need to be deleted | |
|
||||
| **user** | [**User**](User.md)| Updated user object | |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
| **400** | Invalid user supplied | - |
|
||||
| **404** | User not found | - |
|
||||
|
57
samples/client/petstore/java/webclient-jakarta/git_push.sh
Normal file
57
samples/client/petstore/java/webclient-jakarta/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,6 @@
|
||||
# This file is automatically generated by OpenAPI Generator (https://github.com/openAPITools/openapi-generator).
|
||||
# To include other gradle properties as part of the code generation process, please use the `gradleProperties` option.
|
||||
#
|
||||
# Gradle properties reference: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
|
||||
# For example, uncomment below to build for Android
|
||||
#target = android
|
BIN
samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
samples/client/petstore/java/webclient-jakarta/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
234
samples/client/petstore/java/webclient-jakarta/gradlew
vendored
Normal file
234
samples/client/petstore/java/webclient-jakarta/gradlew
vendored
Normal file
@ -0,0 +1,234 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
89
samples/client/petstore/java/webclient-jakarta/gradlew.bat
vendored
Normal file
89
samples/client/petstore/java/webclient-jakarta/gradlew.bat
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
133
samples/client/petstore/java/webclient-jakarta/pom.xml
Normal file
133
samples/client/petstore/java/webclient-jakarta/pom.xml
Normal file
@ -0,0 +1,133 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>petstore-webclient</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>petstore-webclient</name>
|
||||
<version>1.0.0</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<description>OpenAPI Java</description>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:openapitools/openapi-generator.git</developerConnection>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
</scm>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>Unlicense</name>
|
||||
<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>OpenAPI-Generator Contributors</name>
|
||||
<email>team@openapitools.org</email>
|
||||
<organization>OpenAPITools.org</organization>
|
||||
<organizationUrl>http://openapitools.org</organizationUrl>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- @Nullable annotation -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-core</artifactId>
|
||||
<version>${reactor-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- HTTP client: Springboot starter WebFlux -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
<version>${spring-boot-version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.projectreactor.netty</groupId>
|
||||
<artifactId>reactor-netty-http</artifactId>
|
||||
<version>${reactor-netty-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON processing: jackson -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson-databind-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>${jackson-databind-nullable-version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.annotation</groupId>
|
||||
<artifactId>jakarta.annotation-api</artifactId>
|
||||
<version>${jakarta-annotation-version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>${junit-version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<swagger-annotations-version>1.6.6</swagger-annotations-version>
|
||||
<jackson-version>2.13.4</jackson-version>
|
||||
<jackson-databind-version>2.13.4.2</jackson-databind-version>
|
||||
<jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
|
||||
<spring-boot-version>3.0.1</spring-boot-version>
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<reactor-version>3.5.1</reactor-version>
|
||||
<reactor-netty-version>1.1.1</reactor-netty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
</properties>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
rootProject.name = "petstore-webclient"
|
@ -0,0 +1,3 @@
|
||||
<manifest package="org.openapitools.client" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application />
|
||||
</manifest>
|
@ -0,0 +1,754 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import org.openapitools.jackson.nullable.JsonNullableModule;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.InvalidMediaTypeException;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.RequestEntity;
|
||||
import org.springframework.http.RequestEntity.BodyBuilder;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.http.client.BufferingClientHttpRequestFactory;
|
||||
import org.springframework.http.client.ClientHttpRequestExecution;
|
||||
import org.springframework.http.client.ClientHttpRequestInterceptor;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.http.codec.json.Jackson2JsonDecoder;
|
||||
import org.springframework.http.codec.json.Jackson2JsonEncoder;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.http.client.reactive.ClientHttpRequest;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.ClientResponse;
|
||||
import org.springframework.web.reactive.function.BodyInserter;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
import org.springframework.web.reactive.function.client.ExchangeStrategies;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
import java.util.Optional;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import jakarta.annotation.Nullable;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import org.openapitools.client.auth.Authentication;
|
||||
import org.openapitools.client.auth.HttpBasicAuth;
|
||||
import org.openapitools.client.auth.HttpBearerAuth;
|
||||
import org.openapitools.client.auth.ApiKeyAuth;
|
||||
import org.openapitools.client.auth.OAuth;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ApiClient extends JavaTimeFormatter {
|
||||
public enum CollectionFormat {
|
||||
CSV(","), TSV("\t"), SSV(" "), PIPES("|"), MULTI(null);
|
||||
|
||||
private final String separator;
|
||||
private CollectionFormat(String separator) {
|
||||
this.separator = separator;
|
||||
}
|
||||
|
||||
private String collectionToString(Collection<?> collection) {
|
||||
return StringUtils.collectionToDelimitedString(collection, separator);
|
||||
}
|
||||
}
|
||||
|
||||
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
|
||||
|
||||
private HttpHeaders defaultHeaders = new HttpHeaders();
|
||||
private MultiValueMap<String, String> defaultCookies = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
private String basePath = "http://petstore.swagger.io:80/v2";
|
||||
|
||||
private final WebClient webClient;
|
||||
private final DateFormat dateFormat;
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
private Map<String, Authentication> authentications;
|
||||
|
||||
|
||||
public ApiClient() {
|
||||
this.dateFormat = createDefaultDateFormat();
|
||||
this.objectMapper = createDefaultObjectMapper(this.dateFormat);
|
||||
this.webClient = buildWebClient(this.objectMapper);
|
||||
this.init();
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient) {
|
||||
this(Optional.ofNullable(webClient).orElseGet(() -> buildWebClient()), createDefaultDateFormat());
|
||||
}
|
||||
|
||||
public ApiClient(ObjectMapper mapper, DateFormat format) {
|
||||
this(buildWebClient(mapper.copy()), format);
|
||||
}
|
||||
|
||||
public ApiClient(WebClient webClient, ObjectMapper mapper, DateFormat format) {
|
||||
this(Optional.ofNullable(webClient).orElseGet(() -> buildWebClient(mapper.copy())), format);
|
||||
}
|
||||
|
||||
private ApiClient(WebClient webClient, DateFormat format) {
|
||||
this.webClient = webClient;
|
||||
this.dateFormat = format;
|
||||
this.objectMapper = createDefaultObjectMapper(format);
|
||||
this.init();
|
||||
}
|
||||
|
||||
public static DateFormat createDefaultDateFormat() {
|
||||
DateFormat dateFormat = new RFC3339DateFormat();
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
public static ObjectMapper createDefaultObjectMapper(@Nullable DateFormat dateFormat) {
|
||||
if (null == dateFormat) {
|
||||
dateFormat = createDefaultDateFormat();
|
||||
}
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setDateFormat(dateFormat);
|
||||
mapper.registerModule(new JavaTimeModule());
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
JsonNullableModule jnm = new JsonNullableModule();
|
||||
mapper.registerModule(jnm);
|
||||
return mapper;
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
// Setup authentications (key: authentication name, value: authentication).
|
||||
authentications = new HashMap<String, Authentication>();
|
||||
authentications.put("api_key", new ApiKeyAuth("header", "api_key"));
|
||||
authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query"));
|
||||
authentications.put("bearer_test", new HttpBearerAuth("bearer"));
|
||||
authentications.put("http_basic_test", new HttpBasicAuth());
|
||||
authentications.put("http_signature_test", new HttpBearerAuth("signature"));
|
||||
authentications.put("petstore_auth", new OAuth());
|
||||
// Prevent the authentications from being modified.
|
||||
authentications = Collections.unmodifiableMap(authentications);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the WebClientBuilder used to make WebClient.
|
||||
* @param mapper ObjectMapper used for serialize/deserialize
|
||||
* @return WebClient
|
||||
*/
|
||||
public static WebClient.Builder buildWebClientBuilder(ObjectMapper mapper) {
|
||||
ExchangeStrategies strategies = ExchangeStrategies
|
||||
.builder()
|
||||
.codecs(clientDefaultCodecsConfigurer -> {
|
||||
clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonEncoder(new Jackson2JsonEncoder(mapper, MediaType.APPLICATION_JSON));
|
||||
clientDefaultCodecsConfigurer.defaultCodecs().jackson2JsonDecoder(new Jackson2JsonDecoder(mapper, MediaType.APPLICATION_JSON));
|
||||
}).build();
|
||||
WebClient.Builder webClientBuilder = WebClient.builder().exchangeStrategies(strategies);
|
||||
return webClientBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the WebClientBuilder used to make WebClient.
|
||||
* @return WebClient
|
||||
*/
|
||||
public static WebClient.Builder buildWebClientBuilder() {
|
||||
return buildWebClientBuilder(createDefaultObjectMapper(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the WebClient used to make HTTP requests.
|
||||
* @param mapper ObjectMapper used for serialize/deserialize
|
||||
* @return WebClient
|
||||
*/
|
||||
public static WebClient buildWebClient(ObjectMapper mapper) {
|
||||
return buildWebClientBuilder(mapper).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the WebClient used to make HTTP requests.
|
||||
* @return WebClient
|
||||
*/
|
||||
public static WebClient buildWebClient() {
|
||||
return buildWebClientBuilder(createDefaultObjectMapper(null)).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current base path
|
||||
* @return String the base path
|
||||
*/
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the base path, which should include the host
|
||||
* @param basePath the base path
|
||||
* @return ApiClient this client
|
||||
*/
|
||||
public ApiClient setBasePath(String basePath) {
|
||||
this.basePath = basePath;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get authentications (key: authentication name, value: authentication).
|
||||
* @return Map the currently configured authentication types
|
||||
*/
|
||||
public Map<String, Authentication> getAuthentications() {
|
||||
return authentications;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get authentication for the given name.
|
||||
*
|
||||
* @param authName The authentication name
|
||||
* @return The authentication, null if not found
|
||||
*/
|
||||
public Authentication getAuthentication(String authName) {
|
||||
return authentications.get(authName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set access token for the first Bearer authentication.
|
||||
* @param bearerToken Bearer token
|
||||
*/
|
||||
public void setBearerToken(String bearerToken) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof HttpBearerAuth) {
|
||||
((HttpBearerAuth) auth).setBearerToken(bearerToken);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No Bearer authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set username for the first HTTP basic authentication.
|
||||
* @param username the username
|
||||
*/
|
||||
public void setUsername(String username) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof HttpBasicAuth) {
|
||||
((HttpBasicAuth) auth).setUsername(username);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No HTTP basic authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set password for the first HTTP basic authentication.
|
||||
* @param password the password
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof HttpBasicAuth) {
|
||||
((HttpBasicAuth) auth).setPassword(password);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No HTTP basic authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set API key value for the first API key authentication.
|
||||
* @param apiKey the API key
|
||||
*/
|
||||
public void setApiKey(String apiKey) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof ApiKeyAuth) {
|
||||
((ApiKeyAuth) auth).setApiKey(apiKey);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No API key authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set API key prefix for the first API key authentication.
|
||||
* @param apiKeyPrefix the API key prefix
|
||||
*/
|
||||
public void setApiKeyPrefix(String apiKeyPrefix) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof ApiKeyAuth) {
|
||||
((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No API key authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to set access token for the first OAuth2 authentication.
|
||||
* @param accessToken the access token
|
||||
*/
|
||||
public void setAccessToken(String accessToken) {
|
||||
for (Authentication auth : authentications.values()) {
|
||||
if (auth instanceof OAuth) {
|
||||
((OAuth) auth).setAccessToken(accessToken);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("No OAuth2 authentication configured!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the User-Agent header's value (by adding to the default header map).
|
||||
* @param userAgent the user agent string
|
||||
* @return ApiClient this client
|
||||
*/
|
||||
public ApiClient setUserAgent(String userAgent) {
|
||||
addDefaultHeader("User-Agent", userAgent);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a default header.
|
||||
*
|
||||
* @param name The header's name
|
||||
* @param value The header's value
|
||||
* @return ApiClient this client
|
||||
*/
|
||||
public ApiClient addDefaultHeader(String name, String value) {
|
||||
if (defaultHeaders.containsKey(name)) {
|
||||
defaultHeaders.remove(name);
|
||||
}
|
||||
defaultHeaders.add(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a default cookie.
|
||||
*
|
||||
* @param name The cookie's name
|
||||
* @param value The cookie's value
|
||||
* @return ApiClient this client
|
||||
*/
|
||||
public ApiClient addDefaultCookie(String name, String value) {
|
||||
if (defaultCookies.containsKey(name)) {
|
||||
defaultCookies.remove(name);
|
||||
}
|
||||
defaultCookies.add(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the date format used to parse/format date parameters.
|
||||
* @return DateFormat format
|
||||
*/
|
||||
public DateFormat getDateFormat() {
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given string into Date object.
|
||||
*/
|
||||
public Date parseDate(String str) {
|
||||
try {
|
||||
return dateFormat.parse(str);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the given Date object into string.
|
||||
*/
|
||||
public String formatDate(Date date) {
|
||||
return dateFormat.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ObjectMapper used to make HTTP requests.
|
||||
* @return ObjectMapper objectMapper
|
||||
*/
|
||||
public ObjectMapper getObjectMapper() {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the WebClient used to make HTTP requests.
|
||||
* @return WebClient webClient
|
||||
*/
|
||||
public WebClient getWebClient() {
|
||||
return webClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the given parameter object into string.
|
||||
* @param param the object to convert
|
||||
* @return String the parameter represented as a String
|
||||
*/
|
||||
public String parameterToString(Object param) {
|
||||
if (param == null) {
|
||||
return "";
|
||||
} else if (param instanceof Date) {
|
||||
return formatDate( (Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection<?>) param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(",");
|
||||
}
|
||||
b.append(String.valueOf(o));
|
||||
}
|
||||
return b.toString();
|
||||
} else {
|
||||
return String.valueOf(param);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a parameter to a {@link MultiValueMap} for use in REST requests
|
||||
* @param collectionFormat The format to convert to
|
||||
* @param name The name of the parameter
|
||||
* @param value The parameter's value
|
||||
* @return a Map containing the String value(s) of the input parameter
|
||||
*/
|
||||
public MultiValueMap<String, String> parameterToMultiValueMap(CollectionFormat collectionFormat, String name, Object value) {
|
||||
final MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
if (name == null || name.isEmpty() || value == null) {
|
||||
return params;
|
||||
}
|
||||
|
||||
if(collectionFormat == null) {
|
||||
collectionFormat = CollectionFormat.CSV;
|
||||
}
|
||||
|
||||
if (value instanceof Map) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Map<String, Object> valuesMap = (Map<String, Object>) value;
|
||||
for (final Entry<String, Object> entry : valuesMap.entrySet()) {
|
||||
params.add(entry.getKey(), parameterToString(entry.getValue()));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
Collection<?> valueCollection = null;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(name, parameterToString(value));
|
||||
return params;
|
||||
}
|
||||
|
||||
if (valueCollection.isEmpty()){
|
||||
return params;
|
||||
}
|
||||
|
||||
if (collectionFormat.equals(CollectionFormat.MULTI)) {
|
||||
for (Object item : valueCollection) {
|
||||
params.add(name, parameterToString(item));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
List<String> values = new ArrayList<String>();
|
||||
for(Object o : valueCollection) {
|
||||
values.add(parameterToString(o));
|
||||
}
|
||||
params.add(name, collectionFormat.collectionToString(values));
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given {@code String} is a JSON MIME.
|
||||
* @param mediaType the input MediaType
|
||||
* @return boolean true if the MediaType represents JSON, false otherwise
|
||||
*/
|
||||
public boolean isJsonMime(String mediaType) {
|
||||
// "* / *" is default to JSON
|
||||
if ("*/*".equals(mediaType)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
return isJsonMime(MediaType.parseMediaType(mediaType));
|
||||
} catch (InvalidMediaTypeException e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given MIME is a JSON MIME.
|
||||
* JSON MIME examples:
|
||||
* application/json
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* @param mediaType the input MediaType
|
||||
* @return boolean true if the MediaType represents JSON, false otherwise
|
||||
*/
|
||||
public boolean isJsonMime(MediaType mediaType) {
|
||||
return mediaType != null && (MediaType.APPLICATION_JSON.isCompatibleWith(mediaType) || mediaType.getSubtype().matches("^.*(\\+json|ndjson)[;]?\\s*$"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given {@code String} is a Problem JSON MIME (RFC-7807).
|
||||
* @param mediaType the input MediaType
|
||||
* @return boolean true if the MediaType represents Problem JSON, false otherwise
|
||||
*/
|
||||
public boolean isProblemJsonMime(String mediaType) {
|
||||
return "application/problem+json".equalsIgnoreCase(mediaType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the Accept header's value from the given accepts array:
|
||||
* if JSON exists in the given array, use it;
|
||||
* otherwise use all of them (joining into a string)
|
||||
*
|
||||
* @param accepts The accepts array to select from
|
||||
* @return List The list of MediaTypes to use for the Accept header
|
||||
*/
|
||||
public List<MediaType> selectHeaderAccept(String[] accepts) {
|
||||
if (accepts.length == 0) {
|
||||
return null;
|
||||
}
|
||||
for (String accept : accepts) {
|
||||
MediaType mediaType = MediaType.parseMediaType(accept);
|
||||
if (isJsonMime(mediaType) && !isProblemJsonMime(accept)) {
|
||||
return Collections.singletonList(mediaType);
|
||||
}
|
||||
}
|
||||
return MediaType.parseMediaTypes(StringUtils.arrayToCommaDelimitedString(accepts));
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the Content-Type header's value from the given array:
|
||||
* if JSON exists in the given array, use it;
|
||||
* otherwise use the first one of the array.
|
||||
*
|
||||
* @param contentTypes The Content-Type array to select from
|
||||
* @return MediaType The Content-Type header to use. If the given array is empty, null will be returned.
|
||||
*/
|
||||
public MediaType selectHeaderContentType(String[] contentTypes) {
|
||||
if (contentTypes.length == 0) {
|
||||
return null;
|
||||
}
|
||||
for (String contentType : contentTypes) {
|
||||
MediaType mediaType = MediaType.parseMediaType(contentType);
|
||||
if (isJsonMime(mediaType)) {
|
||||
return mediaType;
|
||||
}
|
||||
}
|
||||
return MediaType.parseMediaType(contentTypes[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the body to use for the request
|
||||
* @param obj the body object
|
||||
* @param formParams the form parameters
|
||||
* @param contentType the content type of the request
|
||||
* @return Object the selected body
|
||||
*/
|
||||
protected BodyInserter<?, ? super ClientHttpRequest> selectBody(Object obj, MultiValueMap<String, Object> formParams, MediaType contentType) {
|
||||
if(MediaType.APPLICATION_FORM_URLENCODED.equals(contentType)) {
|
||||
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
||||
|
||||
formParams
|
||||
.toSingleValueMap()
|
||||
.entrySet()
|
||||
.forEach(es -> map.add(es.getKey(), String.valueOf(es.getValue())));
|
||||
|
||||
return BodyInserters.fromFormData(map);
|
||||
} else if(MediaType.MULTIPART_FORM_DATA.equals(contentType)) {
|
||||
return BodyInserters.fromMultipartData(formParams);
|
||||
} else {
|
||||
return obj != null ? BodyInserters.fromValue(obj) : null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoke API by sending HTTP request with the given options.
|
||||
*
|
||||
* @param <T> the return type to use
|
||||
* @param path The sub-path of the HTTP URL
|
||||
* @param method The request method
|
||||
* @param pathParams The path parameters
|
||||
* @param queryParams The query parameters
|
||||
* @param body The request body object
|
||||
* @param headerParams The header parameters
|
||||
* @param formParams The form parameters
|
||||
* @param accept The request's Accept header
|
||||
* @param contentType The request's Content-Type header
|
||||
* @param authNames The authentications to apply
|
||||
* @param returnType The return type into which to deserialize the response
|
||||
* @return The response body in chosen type
|
||||
*/
|
||||
public <T> ResponseSpec invokeAPI(String path, HttpMethod method, Map<String, Object> pathParams, MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept, MediaType contentType, String[] authNames, ParameterizedTypeReference<T> returnType) throws RestClientException {
|
||||
final WebClient.RequestBodySpec requestBuilder = prepareRequest(path, method, pathParams, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames);
|
||||
return requestBuilder.retrieve();
|
||||
}
|
||||
|
||||
/**
|
||||
* Include queryParams in uriParams taking into account the paramName
|
||||
* @param queryParams The query parameters
|
||||
* @param uriParams The path parameters
|
||||
* return templatized query string
|
||||
*/
|
||||
private String generateQueryUri(MultiValueMap<String, String> queryParams, Map<String, Object> uriParams) {
|
||||
StringBuilder queryBuilder = new StringBuilder();
|
||||
queryParams.forEach((name, values) -> {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
} else {
|
||||
int valueItemCounter = 0;
|
||||
for (Object value : values) {
|
||||
if (queryBuilder.length() != 0) {
|
||||
queryBuilder.append('&');
|
||||
}
|
||||
queryBuilder.append(name);
|
||||
if (value != null) {
|
||||
String templatizedKey = name + valueItemCounter++;
|
||||
uriParams.put(templatizedKey, value.toString());
|
||||
queryBuilder.append('=').append("{").append(templatizedKey).append("}");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return queryBuilder.toString();
|
||||
}
|
||||
|
||||
private WebClient.RequestBodySpec prepareRequest(String path, HttpMethod method, Map<String, Object> pathParams,
|
||||
MultiValueMap<String, String> queryParams, Object body, HttpHeaders headerParams,
|
||||
MultiValueMap<String, String> cookieParams, MultiValueMap<String, Object> formParams, List<MediaType> accept,
|
||||
MediaType contentType, String[] authNames) {
|
||||
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
|
||||
|
||||
final UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(basePath).path(path);
|
||||
|
||||
String finalUri = builder.build(false).toUriString();
|
||||
Map<String, Object> uriParams = new HashMap<>();
|
||||
uriParams.putAll(pathParams);
|
||||
|
||||
if (queryParams != null && !queryParams.isEmpty()) {
|
||||
//Include queryParams in uriParams taking into account the paramName
|
||||
String queryUri = generateQueryUri(queryParams, uriParams);
|
||||
//Append to finalUri the templatized query string like "?param1={param1Value}&.......
|
||||
finalUri += "?" + queryUri;
|
||||
}
|
||||
|
||||
final WebClient.RequestBodySpec requestBuilder = webClient.method(method).uri(finalUri, uriParams);
|
||||
|
||||
if (accept != null) {
|
||||
requestBuilder.accept(accept.toArray(new MediaType[accept.size()]));
|
||||
}
|
||||
if(contentType != null) {
|
||||
requestBuilder.contentType(contentType);
|
||||
}
|
||||
|
||||
addHeadersToRequest(headerParams, requestBuilder);
|
||||
addHeadersToRequest(defaultHeaders, requestBuilder);
|
||||
addCookiesToRequest(cookieParams, requestBuilder);
|
||||
addCookiesToRequest(defaultCookies, requestBuilder);
|
||||
|
||||
requestBuilder.attribute(URI_TEMPLATE_ATTRIBUTE, path);
|
||||
|
||||
requestBuilder.body(selectBody(body, formParams, contentType));
|
||||
return requestBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add headers to the request that is being built
|
||||
* @param headers The headers to add
|
||||
* @param requestBuilder The current request
|
||||
*/
|
||||
protected void addHeadersToRequest(HttpHeaders headers, WebClient.RequestBodySpec requestBuilder) {
|
||||
for (Entry<String, List<String>> entry : headers.entrySet()) {
|
||||
List<String> values = entry.getValue();
|
||||
for(String value : values) {
|
||||
if (value != null) {
|
||||
requestBuilder.header(entry.getKey(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add cookies to the request that is being built
|
||||
* @param cookies The cookies to add
|
||||
* @param requestBuilder The current request
|
||||
*/
|
||||
protected void addCookiesToRequest(MultiValueMap<String, String> cookies, WebClient.RequestBodySpec requestBuilder) {
|
||||
for (Entry<String, List<String>> entry : cookies.entrySet()) {
|
||||
List<String> values = entry.getValue();
|
||||
for(String value : values) {
|
||||
if (value != null) {
|
||||
requestBuilder.cookie(entry.getKey(), value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update query and header parameters based on authentication settings.
|
||||
*
|
||||
* @param authNames The authentications to apply
|
||||
* @param queryParams The query parameters
|
||||
* @param headerParams The header parameters
|
||||
* @param cookieParams the cookie parameters
|
||||
*/
|
||||
protected void updateParamsForAuth(String[] authNames, MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams) {
|
||||
for (String authName : authNames) {
|
||||
Authentication auth = authentications.get(authName);
|
||||
if (auth == null) {
|
||||
throw new RestClientException("Authentication undefined: " + authName);
|
||||
}
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats the specified collection path parameter to a string value.
|
||||
*
|
||||
* @param collectionFormat The collection format of the parameter.
|
||||
* @param values The values of the parameter.
|
||||
* @return String representation of the parameter
|
||||
*/
|
||||
public String collectionPathParameterToString(CollectionFormat collectionFormat, Collection<?> values) {
|
||||
// create the value based on the collection format
|
||||
if (CollectionFormat.MULTI.equals(collectionFormat)) {
|
||||
// not valid for path params
|
||||
return parameterToString(values);
|
||||
}
|
||||
|
||||
// collectionFormat is assumed to be "csv" by default
|
||||
if(collectionFormat == null) {
|
||||
collectionFormat = CollectionFormat.CSV;
|
||||
}
|
||||
|
||||
return collectionFormat.collectionToString(values);
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
|
||||
/**
|
||||
* Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class.
|
||||
* It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}.
|
||||
*/
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class JavaTimeFormatter {
|
||||
|
||||
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
|
||||
/**
|
||||
* Get the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||
* @return DateTimeFormatter
|
||||
*/
|
||||
public DateTimeFormatter getOffsetDateTimeFormatter() {
|
||||
return offsetDateTimeFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the date format used to parse/format {@code OffsetDateTime} parameters.
|
||||
* @param offsetDateTimeFormatter {@code DateTimeFormatter}
|
||||
*/
|
||||
public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) {
|
||||
this.offsetDateTimeFormatter = offsetDateTimeFormatter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given string into {@code OffsetDateTime} object.
|
||||
* @param str String
|
||||
* @return {@code OffsetDateTime}
|
||||
*/
|
||||
public OffsetDateTime parseOffsetDateTime(String str) {
|
||||
try {
|
||||
return OffsetDateTime.parse(str, offsetDateTimeFormatter);
|
||||
} catch (DateTimeParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Format the given {@code OffsetDateTime} object into string.
|
||||
* @param offsetDateTime {@code OffsetDateTime}
|
||||
* @return {@code OffsetDateTime} in string format
|
||||
*/
|
||||
public String formatOffsetDateTime(OffsetDateTime offsetDateTime) {
|
||||
return offsetDateTimeFormatter.format(offsetDateTime);
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import com.fasterxml.jackson.databind.util.StdDateFormat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.FieldPosition;
|
||||
import java.text.ParsePosition;
|
||||
import java.util.Date;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class RFC3339DateFormat extends DateFormat {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
|
||||
|
||||
private final StdDateFormat fmt = new StdDateFormat()
|
||||
.withTimeZone(TIMEZONE_Z)
|
||||
.withColonInTimeZone(true);
|
||||
|
||||
public RFC3339DateFormat() {
|
||||
this.calendar = new GregorianCalendar();
|
||||
this.numberFormat = new DecimalFormat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String source) {
|
||||
return parse(source, new ParsePosition(0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date parse(String source, ParsePosition pos) {
|
||||
return fmt.parse(source, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
|
||||
return fmt.format(date, toAppendTo, fieldPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object clone() {
|
||||
return super.clone();
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Representing a Server configuration.
|
||||
*/
|
||||
public class ServerConfiguration {
|
||||
public String URL;
|
||||
public String description;
|
||||
public Map<String, ServerVariable> variables;
|
||||
|
||||
/**
|
||||
* @param URL A URL to the target host.
|
||||
* @param description A description of the host designated by the URL.
|
||||
* @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
||||
*/
|
||||
public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) {
|
||||
this.URL = URL;
|
||||
this.description = description;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using given variables.
|
||||
*
|
||||
* @param variables A map between a variable name and its value.
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL(Map<String, String> variables) {
|
||||
String url = this.URL;
|
||||
|
||||
// go through variables and replace placeholders
|
||||
for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) {
|
||||
String name = variable.getKey();
|
||||
ServerVariable serverVariable = variable.getValue();
|
||||
String value = serverVariable.defaultValue;
|
||||
|
||||
if (variables != null && variables.containsKey(name)) {
|
||||
value = variables.get(name);
|
||||
if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) {
|
||||
throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + ".");
|
||||
}
|
||||
}
|
||||
url = url.replace("{" + name + "}", value);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format URL template using default server variables.
|
||||
*
|
||||
* @return Formatted URL.
|
||||
*/
|
||||
public String URL() {
|
||||
return URL(null);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Representing a Server Variable for server URL template substitution.
|
||||
*/
|
||||
public class ServerVariable {
|
||||
public String description;
|
||||
public String defaultValue;
|
||||
public HashSet<String> enumValues = null;
|
||||
|
||||
/**
|
||||
* @param description A description for the server variable.
|
||||
* @param defaultValue The default value to use for substitution.
|
||||
* @param enumValues An enumeration of string values to be used if the substitution options are from a limited set.
|
||||
*/
|
||||
public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) {
|
||||
this.description = description;
|
||||
this.defaultValue = defaultValue;
|
||||
this.enumValues = enumValues;
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class StringUtil {
|
||||
/**
|
||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||
*
|
||||
* @param array The array
|
||||
* @param value The value to search
|
||||
* @return true if the array contains the value
|
||||
*/
|
||||
public static boolean containsIgnoreCase(String[] array, String value) {
|
||||
for (String str : array) {
|
||||
if (value == null && str == null) {
|
||||
return true;
|
||||
}
|
||||
if (value != null && value.equalsIgnoreCase(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Join an array of strings with the given separator.
|
||||
* <p>
|
||||
* Note: This might be replaced by utility method from commons-lang or guava someday
|
||||
* if one of those libraries is added as dependency.
|
||||
* </p>
|
||||
*
|
||||
* @param array The array of strings
|
||||
* @param separator The separator
|
||||
* @return the resulting string
|
||||
*/
|
||||
public static String join(String[] array, String separator) {
|
||||
int len = array.length;
|
||||
if (len == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
out.append(array[0]);
|
||||
for (int i = 1; i < len; i++) {
|
||||
out.append(separator).append(array[i]);
|
||||
}
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Join a list of strings with the given separator.
|
||||
*
|
||||
* @param list The list of strings
|
||||
* @param separator The separator
|
||||
* @return the resulting string
|
||||
*/
|
||||
public static String join(Collection<String> list, String separator) {
|
||||
Iterator<String> iterator = list.iterator();
|
||||
StringBuilder out = new StringBuilder();
|
||||
if (iterator.hasNext()) {
|
||||
out.append(iterator.next());
|
||||
}
|
||||
while (iterator.hasNext()) {
|
||||
out.append(separator).append(iterator.next());
|
||||
}
|
||||
return out.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AnotherFakeApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public AnotherFakeApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public AnotherFakeApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return Client
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec call123testSpecialTagsRequestCreation(Client client) throws WebClientResponseException {
|
||||
Object postBody = client;
|
||||
// verify the required parameter 'client' is set
|
||||
if (client == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'client' when calling call123testSpecialTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI("/another-fake/dummy", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return Client
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Client> call123testSpecialTags(Client client) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return call123testSpecialTagsRequestCreation(client).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return ResponseEntity<Client>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Client>> call123testSpecialTagsWithHttpInfo(Client client) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return call123testSpecialTagsRequestCreation(client).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec call123testSpecialTagsWithResponseSpec(Client client) throws WebClientResponseException {
|
||||
return call123testSpecialTagsRequestCreation(client);
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import org.openapitools.client.model.FooGetDefaultResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class DefaultApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public DefaultApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public DefaultApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <p><b>0</b> - response
|
||||
* @return FooGetDefaultResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec fooGetRequestCreation() throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<FooGetDefaultResponse> localVarReturnType = new ParameterizedTypeReference<FooGetDefaultResponse>() {};
|
||||
return apiClient.invokeAPI("/foo", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <p><b>0</b> - response
|
||||
* @return FooGetDefaultResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<FooGetDefaultResponse> fooGet() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<FooGetDefaultResponse> localVarReturnType = new ParameterizedTypeReference<FooGetDefaultResponse>() {};
|
||||
return fooGetRequestCreation().bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <p><b>0</b> - response
|
||||
* @return ResponseEntity<FooGetDefaultResponse>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<FooGetDefaultResponse>> fooGetWithHttpInfo() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<FooGetDefaultResponse> localVarReturnType = new ParameterizedTypeReference<FooGetDefaultResponse>() {};
|
||||
return fooGetRequestCreation().toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <p><b>0</b> - response
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec fooGetWithResponseSpec() throws WebClientResponseException {
|
||||
return fooGetRequestCreation();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,123 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import org.openapitools.client.model.Client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class FakeClassnameTags123Api {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public FakeClassnameTags123Api() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public FakeClassnameTags123Api(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return Client
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec testClassnameRequestCreation(Client client) throws WebClientResponseException {
|
||||
Object postBody = client;
|
||||
// verify the required parameter 'client' is set
|
||||
if (client == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'client' when calling testClassname", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key_query" };
|
||||
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return apiClient.invokeAPI("/fake_classname_test", HttpMethod.PATCH, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return Client
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Client> testClassname(Client client) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return testClassnameRequestCreation(client).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return ResponseEntity<Client>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Client>> testClassnameWithHttpInfo(Client client) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Client> localVarReturnType = new ParameterizedTypeReference<Client>() {};
|
||||
return testClassnameRequestCreation(client).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param client client model
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec testClassnameWithResponseSpec(Client client) throws WebClientResponseException {
|
||||
return testClassnameRequestCreation(client);
|
||||
}
|
||||
}
|
@ -0,0 +1,795 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.ModelApiResponse;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import java.util.Set;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class PetApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public PetApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public PetApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec addPetRequestCreation(Pet pet) throws WebClientResponseException {
|
||||
Object postBody = pet;
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'pet' when calling addPet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> addPet(Pet pet) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return addPetRequestCreation(pet).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> addPetWithHttpInfo(Pet pet) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return addPetRequestCreation(pet).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec addPetWithResponseSpec(Pet pet) throws WebClientResponseException {
|
||||
return addPetRequestCreation(pet);
|
||||
}
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec deletePetRequestCreation(Long petId, String apiKey) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'petId' when calling deletePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
if (apiKey != null)
|
||||
headerParams.add("api_key", apiClient.parameterToString(apiKey));
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> deletePet(Long petId, String apiKey) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deletePetRequestCreation(petId, apiKey).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> deletePetWithHttpInfo(Long petId, String apiKey) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deletePetRequestCreation(petId, apiKey).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid pet value
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey The apiKey parameter
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec deletePetWithResponseSpec(Long petId, String apiKey) throws WebClientResponseException {
|
||||
return deletePetRequestCreation(petId, apiKey);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid status value
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @return List<Pet>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec findPetsByStatusRequestCreation(List<String> status) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'status' is set
|
||||
if (status == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'status' when calling findPetsByStatus", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "status", status));
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return apiClient.invokeAPI("/pet/findByStatus", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid status value
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @return List<Pet>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return findPetsByStatusRequestCreation(status).bodyToFlux(localVarReturnType).collectList().block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid status value
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @return ResponseEntity<List<Pet>>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseEntity<List<Pet>> findPetsByStatusWithHttpInfo(List<String> status) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return findPetsByStatusRequestCreation(status).toEntityList(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid status value
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec findPetsByStatusWithResponseSpec(List<String> status) throws WebClientResponseException {
|
||||
return findPetsByStatusRequestCreation(status);
|
||||
}
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid tag value
|
||||
* @param tags Tags to filter by
|
||||
* @return Set<Pet>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
private ResponseSpec findPetsByTagsRequestCreation(Set<String> tags) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'tags' is set
|
||||
if (tags == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'tags' when calling findPetsByTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase(Locale.ROOT)), "tags", tags));
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return apiClient.invokeAPI("/pet/findByTags", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid tag value
|
||||
* @param tags Tags to filter by
|
||||
* @return Set<Pet>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Set<Pet> findPetsByTags(Set<String> tags) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return findPetsByTagsRequestCreation(tags).bodyToFlux(localVarReturnType).collect(Collectors.toSet()).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid tag value
|
||||
* @param tags Tags to filter by
|
||||
* @return ResponseEntity<Set<Pet>>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseEntity<List<Pet>> findPetsByTagsWithHttpInfo(Set<String> tags) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return findPetsByTagsRequestCreation(tags).toEntityList(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid tag value
|
||||
* @param tags Tags to filter by
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec findPetsByTagsWithResponseSpec(Set<String> tags) throws WebClientResponseException {
|
||||
return findPetsByTagsRequestCreation(tags);
|
||||
}
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* @param petId ID of pet to return
|
||||
* @return Pet
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec getPetByIdRequestCreation(Long petId) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'petId' when calling getPetById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* @param petId ID of pet to return
|
||||
* @return Pet
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Pet getPetById(Long petId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return getPetByIdRequestCreation(petId).bodyToMono(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* @param petId ID of pet to return
|
||||
* @return ResponseEntity<Pet>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseEntity<Pet> getPetByIdWithHttpInfo(Long petId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Pet> localVarReturnType = new ParameterizedTypeReference<Pet>() {};
|
||||
return getPetByIdRequestCreation(petId).toEntity(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* @param petId ID of pet to return
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec getPetByIdWithResponseSpec(Long petId) throws WebClientResponseException {
|
||||
return getPetByIdRequestCreation(petId);
|
||||
}
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec updatePetRequestCreation(Pet pet) throws WebClientResponseException {
|
||||
Object postBody = pet;
|
||||
// verify the required parameter 'pet' is set
|
||||
if (pet == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'pet' when calling updatePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json", "application/xml"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/pet", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public void updatePet(Pet pet) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
updatePetRequestCreation(pet).bodyToMono(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseEntity<Void> updatePetWithHttpInfo(Pet pet) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return updatePetRequestCreation(pet).toEntity(localVarReturnType).block();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Pet not found
|
||||
* <p><b>405</b> - Validation exception
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec updatePetWithResponseSpec(Pet pet) throws WebClientResponseException {
|
||||
return updatePetRequestCreation(pet);
|
||||
}
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec updatePetWithFormRequestCreation(Long petId, String name, String status) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'petId' when calling updatePetWithForm", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
if (name != null)
|
||||
formParams.add("name", name);
|
||||
if (status != null)
|
||||
formParams.add("status", status);
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return updatePetWithFormRequestCreation(petId, name, status).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return updatePetWithFormRequestCreation(petId, name, status).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* <p><b>200</b> - Successful operation
|
||||
* <p><b>405</b> - Invalid input
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec updatePetWithFormWithResponseSpec(Long petId, String name, String status) throws WebClientResponseException {
|
||||
return updatePetWithFormRequestCreation(petId, name, status);
|
||||
}
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param _file file to upload
|
||||
* @return ModelApiResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec uploadFileRequestCreation(Long petId, String additionalMetadata, File _file) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
if (additionalMetadata != null)
|
||||
formParams.add("additionalMetadata", additionalMetadata);
|
||||
if (_file != null)
|
||||
formParams.add("file", new FileSystemResource(_file));
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"multipart/form-data"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI("/pet/{petId}/uploadImage", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param _file file to upload
|
||||
* @return ModelApiResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ModelApiResponse> uploadFile(Long petId, String additionalMetadata, File _file) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return uploadFileRequestCreation(petId, additionalMetadata, _file).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param _file file to upload
|
||||
* @return ResponseEntity<ModelApiResponse>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<ModelApiResponse>> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return uploadFileRequestCreation(petId, additionalMetadata, _file).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param _file file to upload
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec uploadFileWithResponseSpec(Long petId, String additionalMetadata, File _file) throws WebClientResponseException {
|
||||
return uploadFileRequestCreation(petId, additionalMetadata, _file);
|
||||
}
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @return ModelApiResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec uploadFileWithRequiredFileRequestCreation(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("petId", petId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
if (additionalMetadata != null)
|
||||
formParams.add("additionalMetadata", additionalMetadata);
|
||||
if (requiredFile != null)
|
||||
formParams.add("requiredFile", new FileSystemResource(requiredFile));
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"multipart/form-data"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "petstore_auth" };
|
||||
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return apiClient.invokeAPI("/fake/{petId}/uploadImageWithRequiredFile", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @return ModelApiResponse
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ModelApiResponse> uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @return ResponseEntity<ModelApiResponse>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<ModelApiResponse>> uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<ModelApiResponse> localVarReturnType = new ParameterizedTypeReference<ModelApiResponse>() {};
|
||||
return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec uploadFileWithRequiredFileWithResponseSpec(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException {
|
||||
return uploadFileWithRequiredFileRequestCreation(petId, requiredFile, additionalMetadata);
|
||||
}
|
||||
}
|
@ -0,0 +1,346 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import org.openapitools.client.model.Order;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class StoreApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public StoreApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public StoreApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec deleteOrderRequestCreation(String orderId) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'orderId' when calling deleteOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("order_id", orderId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> deleteOrder(String orderId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deleteOrderRequestCreation(orderId).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> deleteOrderWithHttpInfo(String orderId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deleteOrderRequestCreation(orderId).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec deleteOrderWithResponseSpec(String orderId) throws WebClientResponseException {
|
||||
return deleteOrderRequestCreation(orderId);
|
||||
}
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* <p><b>200</b> - successful operation
|
||||
* @return Map<String, Integer>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec getInventoryRequestCreation() throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { "api_key" };
|
||||
|
||||
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
|
||||
return apiClient.invokeAPI("/store/inventory", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* <p><b>200</b> - successful operation
|
||||
* @return Map<String, Integer>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Map<String, Integer>> getInventory() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
|
||||
return getInventoryRequestCreation().bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* <p><b>200</b> - successful operation
|
||||
* @return ResponseEntity<Map<String, Integer>>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Map<String, Integer>>> getInventoryWithHttpInfo() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Map<String, Integer>> localVarReturnType = new ParameterizedTypeReference<Map<String, Integer>>() {};
|
||||
return getInventoryRequestCreation().toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* <p><b>200</b> - successful operation
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec getInventoryWithResponseSpec() throws WebClientResponseException {
|
||||
return getInventoryRequestCreation();
|
||||
}
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec getOrderByIdRequestCreation(Long orderId) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'orderId' when calling getOrderById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("order_id", orderId);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI("/store/order/{order_id}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Order> getOrderById(Long orderId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return getOrderByIdRequestCreation(orderId).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return ResponseEntity<Order>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Order>> getOrderByIdWithHttpInfo(Long orderId) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return getOrderByIdRequestCreation(orderId).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid ID supplied
|
||||
* <p><b>404</b> - Order not found
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec getOrderByIdWithResponseSpec(Long orderId) throws WebClientResponseException {
|
||||
return getOrderByIdRequestCreation(orderId);
|
||||
}
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid Order
|
||||
* @param order order placed for purchasing the pet
|
||||
* @return Order
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec placeOrderRequestCreation(Order order) throws WebClientResponseException {
|
||||
Object postBody = order;
|
||||
// verify the required parameter 'order' is set
|
||||
if (order == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'order' when calling placeOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return apiClient.invokeAPI("/store/order", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid Order
|
||||
* @param order order placed for purchasing the pet
|
||||
* @return Order
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Order> placeOrder(Order order) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return placeOrderRequestCreation(order).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid Order
|
||||
* @param order order placed for purchasing the pet
|
||||
* @return ResponseEntity<Order>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Order>> placeOrderWithHttpInfo(Order order) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Order> localVarReturnType = new ParameterizedTypeReference<Order>() {};
|
||||
return placeOrderRequestCreation(order).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid Order
|
||||
* @param order order placed for purchasing the pet
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec placeOrderWithResponseSpec(Order order) throws WebClientResponseException {
|
||||
return placeOrderRequestCreation(order);
|
||||
}
|
||||
}
|
@ -0,0 +1,641 @@
|
||||
package org.openapitools.client.api;
|
||||
|
||||
import org.openapitools.client.ApiClient;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import org.openapitools.client.model.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.web.reactive.function.client.WebClient.ResponseSpec;
|
||||
import org.springframework.web.reactive.function.client.WebClientResponseException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class UserApi {
|
||||
private ApiClient apiClient;
|
||||
|
||||
public UserApi() {
|
||||
this(new ApiClient());
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public UserApi(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
public ApiClient getApiClient() {
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
public void setApiClient(ApiClient apiClient) {
|
||||
this.apiClient = apiClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user Created user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec createUserRequestCreation(User user) throws WebClientResponseException {
|
||||
Object postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'user' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user Created user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> createUser(User user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUserRequestCreation(user).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user Created user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> createUserWithHttpInfo(User user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUserRequestCreation(user).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user Created user object
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec createUserWithResponseSpec(User user) throws WebClientResponseException {
|
||||
return createUserRequestCreation(user);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec createUsersWithArrayInputRequestCreation(List<User> user) throws WebClientResponseException {
|
||||
Object postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'user' when calling createUsersWithArrayInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user/createWithArray", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> createUsersWithArrayInput(List<User> user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUsersWithArrayInputRequestCreation(user).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> createUsersWithArrayInputWithHttpInfo(List<User> user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUsersWithArrayInputRequestCreation(user).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec createUsersWithArrayInputWithResponseSpec(List<User> user) throws WebClientResponseException {
|
||||
return createUsersWithArrayInputRequestCreation(user);
|
||||
}
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec createUsersWithListInputRequestCreation(List<User> user) throws WebClientResponseException {
|
||||
Object postBody = user;
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'user' when calling createUsersWithListInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user/createWithList", HttpMethod.POST, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> createUsersWithListInput(List<User> user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUsersWithListInputRequestCreation(user).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> createUsersWithListInputWithHttpInfo(List<User> user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return createUsersWithListInputRequestCreation(user).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @param user List of user object
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec createUsersWithListInputWithResponseSpec(List<User> user) throws WebClientResponseException {
|
||||
return createUsersWithListInputRequestCreation(user);
|
||||
}
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec deleteUserRequestCreation(String username) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("username", username);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.DELETE, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> deleteUser(String username) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deleteUserRequestCreation(username).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be deleted
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> deleteUserWithHttpInfo(String username) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return deleteUserRequestCreation(username).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be deleted
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec deleteUserWithResponseSpec(String username) throws WebClientResponseException {
|
||||
return deleteUserRequestCreation(username);
|
||||
}
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec getUserByNameRequestCreation(String username) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'username' when calling getUserByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("username", username);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<User> getUserByName(String username) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
|
||||
return getUserByNameRequestCreation(username).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return ResponseEntity<User>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<User>> getUserByNameWithHttpInfo(String username) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<User> localVarReturnType = new ParameterizedTypeReference<User>() {};
|
||||
return getUserByNameRequestCreation(username).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec getUserByNameWithResponseSpec(String username) throws WebClientResponseException {
|
||||
return getUserByNameRequestCreation(username);
|
||||
}
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username/password supplied
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @return String
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec loginUserRequestCreation(String username, String password) throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// verify the required parameter 'password' is set
|
||||
if (password == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "username", username));
|
||||
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "password", password));
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
"application/xml", "application/json"
|
||||
};
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
|
||||
return apiClient.invokeAPI("/user/login", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username/password supplied
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @return String
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<String> loginUser(String username, String password) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
|
||||
return loginUserRequestCreation(username, password).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username/password supplied
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @return ResponseEntity<String>
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<String>> loginUserWithHttpInfo(String username, String password) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<String> localVarReturnType = new ParameterizedTypeReference<String>() {};
|
||||
return loginUserRequestCreation(username, password).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* <p><b>200</b> - successful operation
|
||||
* <p><b>400</b> - Invalid username/password supplied
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec loginUserWithResponseSpec(String username, String password) throws WebClientResponseException {
|
||||
return loginUserRequestCreation(username, password);
|
||||
}
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec logoutUserRequestCreation() throws WebClientResponseException {
|
||||
Object postBody = null;
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = { };
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user/logout", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> logoutUser() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return logoutUserRequestCreation().bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> logoutUserWithHttpInfo() throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return logoutUserRequestCreation().toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* <p><b>0</b> - successful operation
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec logoutUserWithResponseSpec() throws WebClientResponseException {
|
||||
return logoutUserRequestCreation();
|
||||
}
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid user supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
private ResponseSpec updateUserRequestCreation(String username, User user) throws WebClientResponseException {
|
||||
Object postBody = user;
|
||||
// verify the required parameter 'username' is set
|
||||
if (username == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// verify the required parameter 'user' is set
|
||||
if (user == null) {
|
||||
throw new WebClientResponseException("Missing the required parameter 'user' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);
|
||||
}
|
||||
// create path and map variables
|
||||
final Map<String, Object> pathParams = new HashMap<String, Object>();
|
||||
|
||||
pathParams.put("username", username);
|
||||
|
||||
final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
final HttpHeaders headerParams = new HttpHeaders();
|
||||
final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();
|
||||
|
||||
final String[] localVarAccepts = { };
|
||||
final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return apiClient.invokeAPI("/user/{username}", HttpMethod.PUT, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid user supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<Void> updateUser(String username, User user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return updateUserRequestCreation(username, user).bodyToMono(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid user supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public Mono<ResponseEntity<Void>> updateUserWithHttpInfo(String username, User user) throws WebClientResponseException {
|
||||
ParameterizedTypeReference<Void> localVarReturnType = new ParameterizedTypeReference<Void>() {};
|
||||
return updateUserRequestCreation(username, user).toEntity(localVarReturnType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* <p><b>400</b> - Invalid user supplied
|
||||
* <p><b>404</b> - User not found
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
* @return ResponseSpec
|
||||
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
|
||||
*/
|
||||
public ResponseSpec updateUserWithResponseSpec(String username, User user) throws WebClientResponseException {
|
||||
return updateUserRequestCreation(username, user);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ApiKeyAuth implements Authentication {
|
||||
private final String location;
|
||||
private final String paramName;
|
||||
|
||||
private String apiKey;
|
||||
private String apiKeyPrefix;
|
||||
|
||||
public ApiKeyAuth(String location, String paramName) {
|
||||
this.location = location;
|
||||
this.paramName = paramName;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public String getApiKey() {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
public void setApiKey(String apiKey) {
|
||||
this.apiKey = apiKey;
|
||||
}
|
||||
|
||||
public String getApiKeyPrefix() {
|
||||
return apiKeyPrefix;
|
||||
}
|
||||
|
||||
public void setApiKeyPrefix(String apiKeyPrefix) {
|
||||
this.apiKeyPrefix = apiKeyPrefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams) {
|
||||
if (apiKey == null) {
|
||||
return;
|
||||
}
|
||||
String value;
|
||||
if (apiKeyPrefix != null) {
|
||||
value = apiKeyPrefix + " " + apiKey;
|
||||
} else {
|
||||
value = apiKey;
|
||||
}
|
||||
if (location.equals("query")) {
|
||||
queryParams.add(paramName, value);
|
||||
} else if (location.equals("header")) {
|
||||
headerParams.add(paramName, value);
|
||||
} else if (location.equals("cookie")) {
|
||||
cookieParams.add(paramName, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
public interface Authentication {
|
||||
/**
|
||||
* Apply authentication settings to header and / or query parameters.
|
||||
* @param queryParams The query parameters for the request
|
||||
* @param headerParams The header parameters for the request
|
||||
* @param cookieParams The cookie parameters for the request
|
||||
*/
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HttpBasicAuth implements Authentication {
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams) {
|
||||
if (username == null && password == null) {
|
||||
return;
|
||||
}
|
||||
String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
|
||||
headerParams.add(HttpHeaders.AUTHORIZATION, "Basic " + Base64Utils.encodeToString(str.getBytes(StandardCharsets.UTF_8)));
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.Base64Utils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class HttpBearerAuth implements Authentication {
|
||||
private final String scheme;
|
||||
private String bearerToken;
|
||||
|
||||
public HttpBearerAuth(String scheme) {
|
||||
this.scheme = scheme;
|
||||
}
|
||||
|
||||
public String getBearerToken() {
|
||||
return bearerToken;
|
||||
}
|
||||
|
||||
public void setBearerToken(String bearerToken) {
|
||||
this.bearerToken = bearerToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams) {
|
||||
if (bearerToken == null) {
|
||||
return;
|
||||
}
|
||||
headerParams.add(HttpHeaders.AUTHORIZATION, (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken);
|
||||
}
|
||||
|
||||
private static String upperCaseBearer(String scheme) {
|
||||
return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class OAuth implements Authentication {
|
||||
private String accessToken;
|
||||
|
||||
public String getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
public void setAccessToken(String accessToken) {
|
||||
this.accessToken = accessToken;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyToParams(MultiValueMap<String, String> queryParams, HttpHeaders headerParams, MultiValueMap<String, String> cookieParams) {
|
||||
if (accessToken != null) {
|
||||
headerParams.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
public enum OAuthFlow {
|
||||
accessCode, implicit, password, application
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY,
|
||||
AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY
|
||||
})
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AdditionalPropertiesClass {
|
||||
public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property";
|
||||
private Map<String, String> mapProperty = null;
|
||||
|
||||
public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property";
|
||||
private Map<String, Map<String, String>> mapOfMapProperty = null;
|
||||
|
||||
public AdditionalPropertiesClass() {
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass mapProperty(Map<String, String> mapProperty) {
|
||||
|
||||
this.mapProperty = mapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) {
|
||||
if (this.mapProperty == null) {
|
||||
this.mapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapProperty.put(key, mapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapProperty
|
||||
* @return mapProperty
|
||||
**/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, String> getMapProperty() {
|
||||
return mapProperty;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setMapProperty(Map<String, String> mapProperty) {
|
||||
this.mapProperty = mapProperty;
|
||||
}
|
||||
|
||||
|
||||
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String, String> mapOfMapPropertyItem) {
|
||||
if (this.mapOfMapProperty == null) {
|
||||
this.mapOfMapProperty = new HashMap<>();
|
||||
}
|
||||
this.mapOfMapProperty.put(key, mapOfMapPropertyItem);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mapOfMapProperty
|
||||
* @return mapOfMapProperty
|
||||
**/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public Map<String, Map<String, String>> getMapOfMapProperty() {
|
||||
return mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setMapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.mapOfMapProperty = mapOfMapProperty;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
|
||||
return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) &&
|
||||
Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(mapProperty, mapOfMapProperty);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AdditionalPropertiesClass {\n");
|
||||
sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n");
|
||||
sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.SingleRefType;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* AllOfWithSingleRef
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
AllOfWithSingleRef.JSON_PROPERTY_USERNAME,
|
||||
AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE
|
||||
})
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class AllOfWithSingleRef {
|
||||
public static final String JSON_PROPERTY_USERNAME = "username";
|
||||
private String username;
|
||||
|
||||
public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType";
|
||||
private SingleRefType singleRefType;
|
||||
|
||||
public AllOfWithSingleRef() {
|
||||
}
|
||||
|
||||
public AllOfWithSingleRef username(String username) {
|
||||
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get username
|
||||
* @return username
|
||||
**/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_USERNAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_USERNAME)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
|
||||
public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) {
|
||||
|
||||
this.singleRefType = singleRefType;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get singleRefType
|
||||
* @return singleRefType
|
||||
**/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public SingleRefType getSingleRefType() {
|
||||
return singleRefType;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSingleRefType(SingleRefType singleRefType) {
|
||||
this.singleRefType = singleRefType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o;
|
||||
return Objects.equals(this.username, allOfWithSingleRef.username) &&
|
||||
Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(username, singleRefType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class AllOfWithSingleRef {\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.model.Cat;
|
||||
import org.openapitools.client.model.Dog;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
Animal.JSON_PROPERTY_CLASS_NAME,
|
||||
Animal.JSON_PROPERTY_COLOR
|
||||
})
|
||||
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
@JsonIgnoreProperties(
|
||||
value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization
|
||||
allowSetters = true // allows the className to be set during deserialization
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true)
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = Cat.class, name = "Cat"),
|
||||
@JsonSubTypes.Type(value = Dog.class, name = "Dog"),
|
||||
})
|
||||
|
||||
public class Animal {
|
||||
public static final String JSON_PROPERTY_CLASS_NAME = "className";
|
||||
protected String className;
|
||||
|
||||
public static final String JSON_PROPERTY_COLOR = "color";
|
||||
private String color = "red";
|
||||
|
||||
public Animal() {
|
||||
}
|
||||
|
||||
public Animal className(String className) {
|
||||
|
||||
this.className = className;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get className
|
||||
* @return className
|
||||
**/
|
||||
@jakarta.annotation.Nonnull
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
|
||||
public String getClassName() {
|
||||
return className;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
|
||||
@JsonInclude(value = JsonInclude.Include.ALWAYS)
|
||||
public void setClassName(String className) {
|
||||
this.className = className;
|
||||
}
|
||||
|
||||
|
||||
public Animal color(String color) {
|
||||
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color
|
||||
* @return color
|
||||
**/
|
||||
@jakarta.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_COLOR)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Animal animal = (Animal) o;
|
||||
return Objects.equals(this.className, animal.className) &&
|
||||
Objects.equals(this.color, animal.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(className, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class Animal {\n");
|
||||
sb.append(" className: ").append(toIndentedString(className)).append("\n");
|
||||
sb.append(" color: ").append(toIndentedString(color)).append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given object to string with each line indented by 4 spaces
|
||||
* (except the first line).
|
||||
*/
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) {
|
||||
return "null";
|
||||
}
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user