Add new files in java microprofile petstore client

This commit is contained in:
William Cheng 2019-12-10 13:44:33 +08:00
parent f22f6a40a1
commit 525174f4d6
13 changed files with 1745 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,141 @@
<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>microprofile-rest-client</artifactId>
<packaging>jar</packaging>
<name>microprofile-rest-client</name>
<description>This is a sample server Petstore server. For this sample, you can use the api key &#x60;special-key&#x60; to test the authorization filters.</description>
<version>1.0.0</version>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
<!-- Eclipse MicroProfile Rest Client -->
<dependency>
<groupId>org.eclipse.microprofile.rest.client</groupId>
<artifactId>microprofile-rest-client-api</artifactId>
<version>1.2.1</version>
</dependency>
<!-- JAX-RS -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-rest-client</artifactId>
<version>1.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-config</artifactId>
<version>1.3.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>javax.json.bind</groupId>
<artifactId>javax.json.bind-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-jaxrs-version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<swagger-core-version>1.5.18</swagger-core-version>
<jetty-version>9.2.9.v20150224</jetty-version>
<junit-version>4.12</junit-version>
<logback-version>1.1.7</logback-version>
<servlet-api-version>2.5</servlet-api-version>
<cxf-version>3.2.7</cxf-version>
<jackson-jaxrs-version>2.9.7</jackson-jaxrs-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@ -0,0 +1,46 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.api;
import javax.ws.rs.core.Response;
public class ApiException extends Exception {
private static final long serialVersionUID = 1L;
private Response response;
public ApiException() {
super();
}
public ApiException(Response response) {
super("Api response has status code " + response.getStatus());
this.response = response;
}
public Response getResponse() {
return this.response;
}
}

View File

@ -0,0 +1,45 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.api;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper;
@Provider
public class ApiExceptionMapper
implements ResponseExceptionMapper<ApiException> {
@Override
public boolean handles(int status, MultivaluedMap<String, Object> headers) {
return status >= 400;
}
@Override
public ApiException toThrowable(Response response) {
return new ApiException(response);
}
}

View File

@ -0,0 +1,133 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.api;
import java.io.File;
import org.openapitools.client.model.ModelApiResponse;
import org.openapitools.client.model.Pet;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
/**
* OpenAPI Petstore
*
* <p>This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@RegisterRestClient
@RegisterProvider(ApiExceptionMapper.class)
@Path("/")
public interface PetApi {
/**
* Add a new pet to the store
*
*/
@POST
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
public void addPet(Pet body) throws ApiException, ProcessingException;
/**
* Deletes a pet
*
*/
@DELETE
@Path("/pet/{petId}")
public void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException;
/**
* Finds Pets by status
*
* Multiple status values can be provided with comma separated strings
*
*/
@GET
@Path("/pet/findByStatus")
@Produces({ "application/xml", "application/json" })
public List<Pet> findPetsByStatus(@QueryParam("status") List<String> status) throws ApiException, ProcessingException;
/**
* Finds Pets by tags
*
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
*
*/
@GET
@Path("/pet/findByTags")
@Produces({ "application/xml", "application/json" })
public List<Pet> findPetsByTags(@QueryParam("tags") List<String> tags) throws ApiException, ProcessingException;
/**
* Find pet by ID
*
* Returns a single pet
*
*/
@GET
@Path("/pet/{petId}")
@Produces({ "application/xml", "application/json" })
public Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException;
/**
* Update an existing pet
*
*/
@PUT
@Path("/pet")
@Consumes({ "application/json", "application/xml" })
public void updatePet(Pet body) throws ApiException, ProcessingException;
/**
* Updates a pet in the store with form data
*
*/
@POST
@Path("/pet/{petId}")
@Consumes({ "application/x-www-form-urlencoded" })
public void updatePetWithForm(@PathParam("petId") Long petId, @Multipart(value = "name", required = false) String name, @Multipart(value = "status", required = false) String status) throws ApiException, ProcessingException;
/**
* uploads an image
*
*/
@POST
@Path("/pet/{petId}/uploadImage")
@Consumes({ "multipart/form-data" })
@Produces({ "application/json" })
public ModelApiResponse uploadFile(@PathParam("petId") Long petId, @Multipart(value = "additionalMetadata", required = false) String additionalMetadata, @Multipart(value = "file" , required = false) Attachment fileDetail) throws ApiException, ProcessingException;
}

View File

@ -0,0 +1,94 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.Order;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
/**
* OpenAPI Petstore
*
* <p>This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@RegisterRestClient
@RegisterProvider(ApiExceptionMapper.class)
@Path("/")
public interface StoreApi {
/**
* Delete purchase order by ID
*
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
*
*/
@DELETE
@Path("/store/order/{orderId}")
public void deleteOrder(@PathParam("orderId") String orderId) throws ApiException, ProcessingException;
/**
* Returns pet inventories by status
*
* Returns a map of status codes to quantities
*
*/
@GET
@Path("/store/inventory")
@Produces({ "application/json" })
public Map<String, Integer> getInventory() throws ApiException, ProcessingException;
/**
* Find purchase order by ID
*
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
*
*/
@GET
@Path("/store/order/{orderId}")
@Produces({ "application/xml", "application/json" })
public Order getOrderById(@PathParam("orderId") Long orderId) throws ApiException, ProcessingException;
/**
* Place an order for a pet
*
*/
@POST
@Path("/store/order")
@Produces({ "application/xml", "application/json" })
public Order placeOrder(Order body) throws ApiException, ProcessingException;
}

View File

@ -0,0 +1,125 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.api;
import org.openapitools.client.model.User;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.ext.multipart.*;
import org.eclipse.microprofile.rest.client.annotation.RegisterProvider;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
/**
* OpenAPI Petstore
*
* <p>This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
*/
@RegisterRestClient
@RegisterProvider(ApiExceptionMapper.class)
@Path("/")
public interface UserApi {
/**
* Create user
*
* This can only be done by the logged in user.
*
*/
@POST
@Path("/user")
public void createUser(User body) throws ApiException, ProcessingException;
/**
* Creates list of users with given input array
*
*/
@POST
@Path("/user/createWithArray")
public void createUsersWithArrayInput(List<User> body) throws ApiException, ProcessingException;
/**
* Creates list of users with given input array
*
*/
@POST
@Path("/user/createWithList")
public void createUsersWithListInput(List<User> body) throws ApiException, ProcessingException;
/**
* Delete user
*
* This can only be done by the logged in user.
*
*/
@DELETE
@Path("/user/{username}")
public void deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException;
/**
* Get user by user name
*
*/
@GET
@Path("/user/{username}")
@Produces({ "application/xml", "application/json" })
public User getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException;
/**
* Logs user into the system
*
*/
@GET
@Path("/user/login")
@Produces({ "application/xml", "application/json" })
public String loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException;
/**
* Logs out current logged in user session
*
*/
@GET
@Path("/user/logout")
public void logoutUser() throws ApiException, ProcessingException;
/**
* Updated user
*
* This can only be done by the logged in user.
*
*/
@PUT
@Path("/user/{username}")
public void updateUser(@PathParam("username") String username, User body) throws ApiException, ProcessingException;
}

View File

@ -0,0 +1,114 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* A category for a pet
**/
public class Category {
private Long id;
private String name;
/**
* Get id
* @return id
**/
@JsonbProperty("id")
public Long getId() {
return id;
}
/**
* Set id
**/
public void setId(Long id) {
this.id = id;
}
public Category id(Long id) {
this.id = id;
return this;
}
/**
* Get name
* @return name
**/
@JsonbProperty("name")
public String getName() {
return name;
}
/**
* Set name
**/
public void setName(String name) {
this.name = name;
}
public Category name(String name) {
this.name = name;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Category {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,138 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* Describes the result of uploading an image resource
**/
public class ModelApiResponse {
private Integer code;
private String type;
private String message;
/**
* Get code
* @return code
**/
@JsonbProperty("code")
public Integer getCode() {
return code;
}
/**
* Set code
**/
public void setCode(Integer code) {
this.code = code;
}
public ModelApiResponse code(Integer code) {
this.code = code;
return this;
}
/**
* Get type
* @return type
**/
@JsonbProperty("type")
public String getType() {
return type;
}
/**
* Set type
**/
public void setType(String type) {
this.type = type;
}
public ModelApiResponse type(String type) {
this.type = type;
return this;
}
/**
* Get message
* @return message
**/
@JsonbProperty("message")
public String getMessage() {
return message;
}
/**
* Set message
**/
public void setMessage(String message) {
this.message = message;
}
public ModelApiResponse message(String message) {
this.message = message;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" code: ").append(toIndentedString(code)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,249 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import java.util.Date;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* An order for a pets from the pet store
**/
public class Order {
private Long id;
private Long petId;
private Integer quantity;
private Date shipDate;
@XmlType(name="StatusEnum")
@XmlEnum(String.class)
public enum StatusEnum {
@XmlEnumValue("placed") PLACED(String.valueOf("placed")), @XmlEnumValue("approved") APPROVED(String.valueOf("approved")), @XmlEnumValue("delivered") DELIVERED(String.valueOf("delivered"));
private String value;
StatusEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String v) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + v + "'");
}
}
/**
* Order Status
**/
private StatusEnum status;
private Boolean complete = false;
/**
* Get id
* @return id
**/
@JsonbProperty("id")
public Long getId() {
return id;
}
/**
* Set id
**/
public void setId(Long id) {
this.id = id;
}
public Order id(Long id) {
this.id = id;
return this;
}
/**
* Get petId
* @return petId
**/
@JsonbProperty("petId")
public Long getPetId() {
return petId;
}
/**
* Set petId
**/
public void setPetId(Long petId) {
this.petId = petId;
}
public Order petId(Long petId) {
this.petId = petId;
return this;
}
/**
* Get quantity
* @return quantity
**/
@JsonbProperty("quantity")
public Integer getQuantity() {
return quantity;
}
/**
* Set quantity
**/
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public Order quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
/**
* Get shipDate
* @return shipDate
**/
@JsonbProperty("shipDate")
public Date getShipDate() {
return shipDate;
}
/**
* Set shipDate
**/
public void setShipDate(Date shipDate) {
this.shipDate = shipDate;
}
public Order shipDate(Date shipDate) {
this.shipDate = shipDate;
return this;
}
/**
* Order Status
* @return status
**/
@JsonbProperty("status")
public String getStatus() {
if (status == null) {
return null;
}
return status.value();
}
/**
* Set status
**/
public void setStatus(StatusEnum status) {
this.status = status;
}
public Order status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get complete
* @return complete
**/
@JsonbProperty("complete")
public Boolean getComplete() {
return complete;
}
/**
* Set complete
**/
public void setComplete(Boolean complete) {
this.complete = complete;
}
public Order complete(Boolean complete) {
this.complete = complete;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Order {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,262 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.Category;
import org.openapitools.client.model.Tag;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* A pet for sale in the pet store
**/
public class Pet {
private Long id;
private Category category;
private String name;
private List<String> photoUrls = new ArrayList<String>();
private List<Tag> tags = null;
@XmlType(name="StatusEnum")
@XmlEnum(String.class)
public enum StatusEnum {
@XmlEnumValue("available") AVAILABLE(String.valueOf("available")), @XmlEnumValue("pending") PENDING(String.valueOf("pending")), @XmlEnumValue("sold") SOLD(String.valueOf("sold"));
private String value;
StatusEnum (String v) {
value = v;
}
public String value() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String v) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(v)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + v + "'");
}
}
/**
* pet status in the store
**/
private StatusEnum status;
/**
* Get id
* @return id
**/
@JsonbProperty("id")
public Long getId() {
return id;
}
/**
* Set id
**/
public void setId(Long id) {
this.id = id;
}
public Pet id(Long id) {
this.id = id;
return this;
}
/**
* Get category
* @return category
**/
@JsonbProperty("category")
public Category getCategory() {
return category;
}
/**
* Set category
**/
public void setCategory(Category category) {
this.category = category;
}
public Pet category(Category category) {
this.category = category;
return this;
}
/**
* Get name
* @return name
**/
@JsonbProperty("name")
public String getName() {
return name;
}
/**
* Set name
**/
public void setName(String name) {
this.name = name;
}
public Pet name(String name) {
this.name = name;
return this;
}
/**
* Get photoUrls
* @return photoUrls
**/
@JsonbProperty("photoUrls")
public List<String> getPhotoUrls() {
return photoUrls;
}
/**
* Set photoUrls
**/
public void setPhotoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
return this;
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
this.photoUrls.add(photoUrlsItem);
return this;
}
/**
* Get tags
* @return tags
**/
@JsonbProperty("tags")
public List<Tag> getTags() {
return tags;
}
/**
* Set tags
**/
public void setTags(List<Tag> tags) {
this.tags = tags;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
return this;
}
public Pet addTagsItem(Tag tagsItem) {
this.tags.add(tagsItem);
return this;
}
/**
* pet status in the store
* @return status
**/
@JsonbProperty("status")
public String getStatus() {
if (status == null) {
return null;
}
return status.value();
}
/**
* Set status
**/
public void setStatus(StatusEnum status) {
this.status = status;
}
public Pet status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Pet {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" category: ").append(toIndentedString(category)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,114 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* A tag for a pet
**/
public class Tag {
private Long id;
private String name;
/**
* Get id
* @return id
**/
@JsonbProperty("id")
public Long getId() {
return id;
}
/**
* Set id
**/
public void setId(Long id) {
this.id = id;
}
public Tag id(Long id) {
this.id = id;
return this;
}
/**
* Get name
* @return name
**/
@JsonbProperty("name")
public String getName() {
return name;
}
/**
* Set name
**/
public void setName(String name) {
this.name = name;
}
public Tag name(String name) {
this.name = name;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Tag {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,261 @@
/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* 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.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.client.model;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.json.bind.annotation.JsonbProperty;
/**
* A User who is purchasing from the pet store
**/
public class User {
private Long id;
private String username;
private String firstName;
private String lastName;
private String email;
private String password;
private String phone;
/**
* User Status
**/
private Integer userStatus;
/**
* Get id
* @return id
**/
@JsonbProperty("id")
public Long getId() {
return id;
}
/**
* Set id
**/
public void setId(Long id) {
this.id = id;
}
public User id(Long id) {
this.id = id;
return this;
}
/**
* Get username
* @return username
**/
@JsonbProperty("username")
public String getUsername() {
return username;
}
/**
* Set username
**/
public void setUsername(String username) {
this.username = username;
}
public User username(String username) {
this.username = username;
return this;
}
/**
* Get firstName
* @return firstName
**/
@JsonbProperty("firstName")
public String getFirstName() {
return firstName;
}
/**
* Set firstName
**/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public User firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* Get lastName
* @return lastName
**/
@JsonbProperty("lastName")
public String getLastName() {
return lastName;
}
/**
* Set lastName
**/
public void setLastName(String lastName) {
this.lastName = lastName;
}
public User lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Get email
* @return email
**/
@JsonbProperty("email")
public String getEmail() {
return email;
}
/**
* Set email
**/
public void setEmail(String email) {
this.email = email;
}
public User email(String email) {
this.email = email;
return this;
}
/**
* Get password
* @return password
**/
@JsonbProperty("password")
public String getPassword() {
return password;
}
/**
* Set password
**/
public void setPassword(String password) {
this.password = password;
}
public User password(String password) {
this.password = password;
return this;
}
/**
* Get phone
* @return phone
**/
@JsonbProperty("phone")
public String getPhone() {
return phone;
}
/**
* Set phone
**/
public void setPhone(String phone) {
this.phone = phone;
}
public User phone(String phone) {
this.phone = phone;
return this;
}
/**
* User Status
* @return userStatus
**/
@JsonbProperty("userStatus")
public Integer getUserStatus() {
return userStatus;
}
/**
* Set userStatus
**/
public void setUserStatus(Integer userStatus) {
this.userStatus = userStatus;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;
return this;
}
/**
* Create a string representation of this pojo.
**/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class User {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" username: ").append(toIndentedString(username)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" password: ").append(toIndentedString(password)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append(" userStatus: ").append(toIndentedString(userStatus)).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 static String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}