All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.swaggertools.demo.client.PetsClient Maven / Gradle / Ivy
package org.swaggertools.demo.client;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Long;
import java.lang.String;
import java.util.List;
import java.util.Map;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.ResponseExtractor;
import org.springframework.web.client.RestTemplate;
import org.swaggertools.demo.model.Pet;
public class PetsClient extends BaseClient {
public PetsClient(RestTemplate restTemplate) {
super(restTemplate);
}
public PetsClient(RestTemplate restTemplate, String basePath) {
super(restTemplate, basePath);
}
public PetsClient(RestTemplate restTemplate, String basePath,
Map> headers) {
super(restTemplate, basePath, headers);
}
public List listPets(Integer limit) {
ParameterizedTypeReference> typeRef = new ParameterizedTypeReference>(){};
ResponseEntity> response = invokeAPI("/pets", "GET", createUrlVariables(), createQueryParameters("limit", limit), null, typeRef);
return response.getBody();
}
public Pet createPet(Pet requestBody) {
ParameterizedTypeReference typeRef = new ParameterizedTypeReference(){};
ResponseEntity response = invokeAPI("/pets", "POST", createUrlVariables(), createQueryParameters(), requestBody, typeRef);
return response.getBody();
}
public Pet getPetById(Long petId, Boolean details) {
ParameterizedTypeReference typeRef = new ParameterizedTypeReference(){};
ResponseEntity response = invokeAPI("/pets/{petId}", "GET", createUrlVariables("petId", petId), createQueryParameters("details", details), null, typeRef);
return response.getBody();
}
public void updatePet(Long petId, Pet requestBody) {
ParameterizedTypeReference typeRef = VOID;
invokeAPI("/pets/{petId}", "PUT", createUrlVariables("petId", petId), createQueryParameters(), requestBody, typeRef);
}
public void deletePetById(Long petId) {
ParameterizedTypeReference typeRef = VOID;
invokeAPI("/pets/{petId}", "DELETE", createUrlVariables("petId", petId), createQueryParameters(), null, typeRef);
}
public void getPetEvents(Long petId, ResponseExtractor responseExtractor) {
executeAPI("/pets/{petId}/events", "GET", createUrlVariables("petId", petId), createQueryParameters(), null, responseExtractor);
}
}