[dart][dart-dio] Correctly type responses and futures (#8195)

* don't rely on implicit dynamics
* this is a requirement for NNBD
* add space between return type and some method names
This commit is contained in:
Peter Leibiger 2020-12-15 17:52:47 +01:00 committed by GitHub
parent 95b719814c
commit ddd11abb87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 162 additions and 162 deletions

View File

@ -19,7 +19,7 @@ class {{classname}} {
/// {{{summary}}}
///
/// {{{notes}}}
Future<Response{{#returnType}}<{{{returnType}}}>{{/returnType}}>{{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}}
Future<Response<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> {{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}}
{{{dataType}}} {{paramName}},{{#-last}} { {{/-last}}{{/requiredParams}}{{#optionalParams}}
{{{dataType}}} {{paramName}},{{/optionalParams}}
CancelToken cancelToken,

View File

@ -49,7 +49,7 @@ class {{{classname}}} {
///
{{/-last}}
{{/allParams}}
{{#returnType}}Future<Response> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
Future<Response> {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
{{#hasParams}}
// Verify required params are set.
{{#allParams}}
@ -175,7 +175,7 @@ class {{{classname}}} {
///
{{/-last}}
{{/allParams}}
{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async {
final response = await {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{{paramName}}}: {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} {{/hasOptionalParams}});
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -18,7 +18,7 @@ class PetApi {
/// Add a new pet to the store
///
///
Future<Response>addPet(
Future<Response<void>> addPet(
Pet body, {
CancelToken cancelToken,
Map<String, String> headers,
@ -69,7 +69,7 @@ class PetApi {
/// Deletes a pet
///
///
Future<Response>deletePet(
Future<Response<void>> deletePet(
int petId, {
String apiKey,
CancelToken cancelToken,
@ -292,7 +292,7 @@ class PetApi {
/// Update an existing pet
///
///
Future<Response>updatePet(
Future<Response<void>> updatePet(
Pet body, {
CancelToken cancelToken,
Map<String, String> headers,
@ -343,7 +343,7 @@ class PetApi {
/// Updates a pet in the store with form data
///
///
Future<Response>updatePetWithForm(
Future<Response<void>> updatePetWithForm(
int petId, {
String name,
String status,

View File

@ -15,7 +15,7 @@ class StoreApi {
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Future<Response>deleteOrder(
Future<Response<void>> deleteOrder(
String orderId, {
CancelToken cancelToken,
Map<String, String> headers,

View File

@ -15,7 +15,7 @@ class UserApi {
/// Create user
///
/// This can only be done by the logged in user.
Future<Response>createUser(
Future<Response<void>> createUser(
User body, {
CancelToken cancelToken,
Map<String, String> headers,
@ -58,7 +58,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithArrayInput(
Future<Response<void>> createUsersWithArrayInput(
BuiltList<User> body, {
CancelToken cancelToken,
Map<String, String> headers,
@ -102,7 +102,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithListInput(
Future<Response<void>> createUsersWithListInput(
BuiltList<User> body, {
CancelToken cancelToken,
Map<String, String> headers,
@ -146,7 +146,7 @@ class UserApi {
/// Delete user
///
/// This can only be done by the logged in user.
Future<Response>deleteUser(
Future<Response<void>> deleteUser(
String username, {
CancelToken cancelToken,
Map<String, String> headers,
@ -291,7 +291,7 @@ class UserApi {
/// Logs out current logged in user session
///
///
Future<Response>logoutUser({
Future<Response<void>> logoutUser({
CancelToken cancelToken,
Map<String, String> headers,
ProgressCallback onSendProgress,
@ -329,7 +329,7 @@ class UserApi {
/// Updated user
///
/// This can only be done by the logged in user.
Future<Response>updateUser(
Future<Response<void>> updateUser(
String username,
User body, {
CancelToken cancelToken,

View File

@ -23,7 +23,7 @@ class PetApi {
///
/// * [Pet] body (required):
/// Pet object that needs to be added to the store
Future addPetWithHttpInfo(Pet body) async {
Future<Response> addPetWithHttpInfo(Pet body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
@ -71,7 +71,7 @@ class PetApi {
///
/// * [Pet] body (required):
/// Pet object that needs to be added to the store
Future addPet(Pet body) async {
Future<void> addPet(Pet body) async {
final response = await addPetWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -88,7 +88,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePetWithHttpInfo(int petId, { String apiKey }) async {
Future<Response> deletePetWithHttpInfo(int petId, { String apiKey }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -143,7 +143,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePet(int petId, { String apiKey }) async {
Future<void> deletePet(int petId, { String apiKey }) async {
final response = await deletePetWithHttpInfo(petId, apiKey: apiKey );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -389,7 +389,7 @@ class PetApi {
///
/// * [Pet] body (required):
/// Pet object that needs to be added to the store
Future updatePetWithHttpInfo(Pet body) async {
Future<Response> updatePetWithHttpInfo(Pet body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
@ -437,7 +437,7 @@ class PetApi {
///
/// * [Pet] body (required):
/// Pet object that needs to be added to the store
Future updatePet(Pet body) async {
Future<void> updatePet(Pet body) async {
final response = await updatePetWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -458,7 +458,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
Future<Response> updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -527,7 +527,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithForm(int petId, { String name, String status }) async {
Future<void> updatePetWithForm(int petId, { String name, String status }) async {
final response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrderWithHttpInfo(String orderId) async {
Future<Response> deleteOrderWithHttpInfo(String orderId) async {
// Verify required params are set.
if (orderId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: orderId');
@ -76,7 +76,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrder(String orderId) async {
Future<void> deleteOrder(String orderId) async {
final response = await deleteOrderWithHttpInfo(orderId);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class UserApi {
///
/// * [User] body (required):
/// Created user object
Future createUserWithHttpInfo(User body) async {
Future<Response> createUserWithHttpInfo(User body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
@ -75,7 +75,7 @@ class UserApi {
///
/// * [User] body (required):
/// Created user object
Future createUser(User body) async {
Future<void> createUser(User body) async {
final response = await createUserWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -90,7 +90,7 @@ class UserApi {
///
/// * [List<User>] body (required):
/// List of user object
Future createUsersWithArrayInputWithHttpInfo(List<User> body) async {
Future<Response> createUsersWithArrayInputWithHttpInfo(List<User> body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
@ -138,7 +138,7 @@ class UserApi {
///
/// * [List<User>] body (required):
/// List of user object
Future createUsersWithArrayInput(List<User> body) async {
Future<void> createUsersWithArrayInput(List<User> body) async {
final response = await createUsersWithArrayInputWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -153,7 +153,7 @@ class UserApi {
///
/// * [List<User>] body (required):
/// List of user object
Future createUsersWithListInputWithHttpInfo(List<User> body) async {
Future<Response> createUsersWithListInputWithHttpInfo(List<User> body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
@ -201,7 +201,7 @@ class UserApi {
///
/// * [List<User>] body (required):
/// List of user object
Future createUsersWithListInput(List<User> body) async {
Future<void> createUsersWithListInput(List<User> body) async {
final response = await createUsersWithListInputWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -218,7 +218,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUserWithHttpInfo(String username) async {
Future<Response> deleteUserWithHttpInfo(String username) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -269,7 +269,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUser(String username) async {
Future<void> deleteUser(String username) async {
final response = await deleteUserWithHttpInfo(username);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -432,7 +432,7 @@ class UserApi {
/// Logs out current logged in user session
///
/// Note: This method returns the HTTP [Response].
Future logoutUserWithHttpInfo() async {
Future<Response> logoutUserWithHttpInfo() async {
final path = '/user/logout'.replaceAll('{format}', 'json');
Object postBody;
@ -470,7 +470,7 @@ class UserApi {
}
/// Logs out current logged in user session
Future logoutUser() async {
Future<void> logoutUser() async {
final response = await logoutUserWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -490,7 +490,7 @@ class UserApi {
///
/// * [User] body (required):
/// Updated user object
Future updateUserWithHttpInfo(String username, User body) async {
Future<Response> updateUserWithHttpInfo(String username, User body) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -547,7 +547,7 @@ class UserApi {
///
/// * [User] body (required):
/// Updated user object
Future updateUser(String username, User body) async {
Future<void> updateUser(String username, User body) async {
final response = await updateUserWithHttpInfo(username, body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -82,7 +82,7 @@ class PetApi {
/// Deletes a pet
///
///
Future<Response>deletePet(
Future<Response<void>> deletePet(
int petId, {
String apiKey,
CancelToken cancelToken,
@ -369,7 +369,7 @@ class PetApi {
/// Updates a pet in the store with form data
///
///
Future<Response>updatePetWithForm(
Future<Response<void>> updatePetWithForm(
int petId, {
String name,
String status,

View File

@ -15,7 +15,7 @@ class StoreApi {
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Future<Response>deleteOrder(
Future<Response<void>> deleteOrder(
String orderId, {
CancelToken cancelToken,
Map<String, String> headers,

View File

@ -15,7 +15,7 @@ class UserApi {
/// Create user
///
/// This can only be done by the logged in user.
Future<Response>createUser(
Future<Response<void>> createUser(
User user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -67,7 +67,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithArrayInput(
Future<Response<void>> createUsersWithArrayInput(
BuiltList<User> user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -120,7 +120,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithListInput(
Future<Response<void>> createUsersWithListInput(
BuiltList<User> user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -173,7 +173,7 @@ class UserApi {
/// Delete user
///
/// This can only be done by the logged in user.
Future<Response>deleteUser(
Future<Response<void>> deleteUser(
String username, {
CancelToken cancelToken,
Map<String, String> headers,
@ -325,7 +325,7 @@ class UserApi {
/// Logs out current logged in user session
///
///
Future<Response>logoutUser({
Future<Response<void>> logoutUser({
CancelToken cancelToken,
Map<String, String> headers,
ProgressCallback onSendProgress,
@ -370,7 +370,7 @@ class UserApi {
/// Updated user
///
/// This can only be done by the logged in user.
Future<Response>updateUser(
Future<Response<void>> updateUser(
String username,
User user, {
CancelToken cancelToken,

View File

@ -73,7 +73,7 @@ class FakeApi {
/// test http signature authentication
///
///
Future<Response>fakeHttpSignatureTest(
Future<Response<void>> fakeHttpSignatureTest(
Pet pet, {
String query1,
String header1,
@ -357,7 +357,7 @@ class FakeApi {
///
///
/// For this test, the body for this request much reference a schema named `File`.
Future<Response>testBodyWithFileSchema(
Future<Response<void>> testBodyWithFileSchema(
FileSchemaTestClass fileSchemaTestClass, {
CancelToken cancelToken,
Map<String, String> headers,
@ -402,7 +402,7 @@ class FakeApi {
///
///
///
Future<Response>testBodyWithQueryParams(
Future<Response<void>> testBodyWithQueryParams(
String query,
User user, {
CancelToken cancelToken,
@ -507,7 +507,7 @@ class FakeApi {
/// Fake endpoint for testing various parameters
///
/// Fake endpoint for testing various parameters
Future<Response>testEndpointParameters(
Future<Response<void>> testEndpointParameters(
num number,
double double_,
String patternWithoutDelimiter,
@ -583,7 +583,7 @@ class FakeApi {
/// To test enum parameters
///
/// To test enum parameters
Future<Response>testEnumParameters({
Future<Response<void>> testEnumParameters({
BuiltList<String> enumHeaderStringArray,
String enumHeaderString,
BuiltList<String> enumQueryStringArray,
@ -642,7 +642,7 @@ class FakeApi {
/// Fake endpoint to test group parameters (optional)
///
/// Fake endpoint to test group parameters (optional)
Future<Response>testGroupParameters(
Future<Response<void>> testGroupParameters(
int requiredStringGroup,
bool requiredBooleanGroup,
int requiredInt64Group, {
@ -697,7 +697,7 @@ class FakeApi {
/// test inline additionalProperties
///
///
Future<Response>testInlineAdditionalProperties(
Future<Response<void>> testInlineAdditionalProperties(
BuiltMap<String, String> requestBody, {
CancelToken cancelToken,
Map<String, String> headers,
@ -742,7 +742,7 @@ class FakeApi {
/// test json serialization of form data
///
///
Future<Response>testJsonFormData(
Future<Response<void>> testJsonFormData(
String param,
String param2, {
CancelToken cancelToken,
@ -789,7 +789,7 @@ class FakeApi {
///
///
/// To test the collection format in query parameters
Future<Response>testQueryParameterCollectionFormat(
Future<Response<void>> testQueryParameterCollectionFormat(
BuiltList<String> pipe,
BuiltList<String> ioutil,
BuiltList<String> http,

View File

@ -18,7 +18,7 @@ class PetApi {
/// Add a new pet to the store
///
///
Future<Response>addPet(
Future<Response<void>> addPet(
Pet pet, {
CancelToken cancelToken,
Map<String, String> headers,
@ -69,7 +69,7 @@ class PetApi {
/// Deletes a pet
///
///
Future<Response>deletePet(
Future<Response<void>> deletePet(
int petId, {
String apiKey,
CancelToken cancelToken,
@ -292,7 +292,7 @@ class PetApi {
/// Update an existing pet
///
///
Future<Response>updatePet(
Future<Response<void>> updatePet(
Pet pet, {
CancelToken cancelToken,
Map<String, String> headers,
@ -343,7 +343,7 @@ class PetApi {
/// Updates a pet in the store with form data
///
///
Future<Response>updatePetWithForm(
Future<Response<void>> updatePetWithForm(
int petId, {
String name,
String status,

View File

@ -15,7 +15,7 @@ class StoreApi {
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Future<Response>deleteOrder(
Future<Response<void>> deleteOrder(
String orderId, {
CancelToken cancelToken,
Map<String, String> headers,

View File

@ -15,7 +15,7 @@ class UserApi {
/// Create user
///
/// This can only be done by the logged in user.
Future<Response>createUser(
Future<Response<void>> createUser(
User user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -60,7 +60,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithArrayInput(
Future<Response<void>> createUsersWithArrayInput(
BuiltList<User> user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -106,7 +106,7 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response>createUsersWithListInput(
Future<Response<void>> createUsersWithListInput(
BuiltList<User> user, {
CancelToken cancelToken,
Map<String, String> headers,
@ -152,7 +152,7 @@ class UserApi {
/// Delete user
///
/// This can only be done by the logged in user.
Future<Response>deleteUser(
Future<Response<void>> deleteUser(
String username, {
CancelToken cancelToken,
Map<String, String> headers,
@ -297,7 +297,7 @@ class UserApi {
/// Logs out current logged in user session
///
///
Future<Response>logoutUser({
Future<Response<void>> logoutUser({
CancelToken cancelToken,
Map<String, String> headers,
ProgressCallback onSendProgress,
@ -335,7 +335,7 @@ class UserApi {
/// Updated user
///
/// This can only be done by the logged in user.
Future<Response>updateUser(
Future<Response<void>> updateUser(
String username,
User user, {
CancelToken cancelToken,

View File

@ -95,7 +95,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePetWithHttpInfo(int petId, { String apiKey }) async {
Future<Response> deletePetWithHttpInfo(int petId, { String apiKey }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -150,7 +150,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePet(int petId, { String apiKey }) async {
Future<void> deletePet(int petId, { String apiKey }) async {
final response = await deletePetWithHttpInfo(petId, apiKey: apiKey );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -472,7 +472,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
Future<Response> updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -541,7 +541,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithForm(int petId, { String name, String status }) async {
Future<void> updatePetWithForm(int petId, { String name, String status }) async {
final response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrderWithHttpInfo(String orderId) async {
Future<Response> deleteOrderWithHttpInfo(String orderId) async {
// Verify required params are set.
if (orderId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: orderId');
@ -76,7 +76,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrder(String orderId) async {
Future<void> deleteOrder(String orderId) async {
final response = await deleteOrderWithHttpInfo(orderId);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class UserApi {
///
/// * [User] user (required):
/// Created user object
Future createUserWithHttpInfo(User user) async {
Future<Response> createUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -75,7 +75,7 @@ class UserApi {
///
/// * [User] user (required):
/// Created user object
Future createUser(User user) async {
Future<void> createUser(User user) async {
final response = await createUserWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -90,7 +90,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithArrayInputWithHttpInfo(List<User> user) async {
Future<Response> createUsersWithArrayInputWithHttpInfo(List<User> user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -138,7 +138,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithArrayInput(List<User> user) async {
Future<void> createUsersWithArrayInput(List<User> user) async {
final response = await createUsersWithArrayInputWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -153,7 +153,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithListInputWithHttpInfo(List<User> user) async {
Future<Response> createUsersWithListInputWithHttpInfo(List<User> user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -201,7 +201,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithListInput(List<User> user) async {
Future<void> createUsersWithListInput(List<User> user) async {
final response = await createUsersWithListInputWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -218,7 +218,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUserWithHttpInfo(String username) async {
Future<Response> deleteUserWithHttpInfo(String username) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -269,7 +269,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUser(String username) async {
Future<void> deleteUser(String username) async {
final response = await deleteUserWithHttpInfo(username);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -432,7 +432,7 @@ class UserApi {
/// Logs out current logged in user session
///
/// Note: This method returns the HTTP [Response].
Future logoutUserWithHttpInfo() async {
Future<Response> logoutUserWithHttpInfo() async {
final path = '/user/logout'.replaceAll('{format}', 'json');
Object postBody;
@ -470,7 +470,7 @@ class UserApi {
}
/// Logs out current logged in user session
Future logoutUser() async {
Future<void> logoutUser() async {
final response = await logoutUserWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -490,7 +490,7 @@ class UserApi {
///
/// * [User] user (required):
/// Updated user object
Future updateUserWithHttpInfo(String username, User user) async {
Future<Response> updateUserWithHttpInfo(String username, User user) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -547,7 +547,7 @@ class UserApi {
///
/// * [User] user (required):
/// Updated user object
Future updateUser(String username, User user) async {
Future<void> updateUser(String username, User user) async {
final response = await updateUserWithHttpInfo(username, user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -84,7 +84,7 @@ class FakeApi {
///
/// * [String] header1:
/// header parameter
Future fakeHttpSignatureTestWithHttpInfo(Pet pet, { String query1, String header1 }) async {
Future<Response> fakeHttpSignatureTestWithHttpInfo(Pet pet, { String query1, String header1 }) async {
// Verify required params are set.
if (pet == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pet');
@ -146,7 +146,7 @@ class FakeApi {
///
/// * [String] header1:
/// header parameter
Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async {
Future<void> fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async {
final response = await fakeHttpSignatureTestWithHttpInfo(pet, query1: query1, header1: header1 );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -428,7 +428,7 @@ class FakeApi {
/// Parameters:
///
/// * [FileSchemaTestClass] fileSchemaTestClass (required):
Future testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) async {
Future<Response> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) async {
// Verify required params are set.
if (fileSchemaTestClass == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: fileSchemaTestClass');
@ -475,7 +475,7 @@ class FakeApi {
/// Parameters:
///
/// * [FileSchemaTestClass] fileSchemaTestClass (required):
Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async {
Future<void> testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async {
final response = await testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -488,7 +488,7 @@ class FakeApi {
/// * [String] query (required):
///
/// * [User] user (required):
Future testBodyWithQueryParamsWithHttpInfo(String query, User user) async {
Future<Response> testBodyWithQueryParamsWithHttpInfo(String query, User user) async {
// Verify required params are set.
if (query == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: query');
@ -540,7 +540,7 @@ class FakeApi {
/// * [String] query (required):
///
/// * [User] user (required):
Future testBodyWithQueryParams(String query, User user) async {
Future<void> testBodyWithQueryParams(String query, User user) async {
final response = await testBodyWithQueryParamsWithHttpInfo(query, user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -670,7 +670,7 @@ class FakeApi {
///
/// * [String] callback:
/// None
Future testEndpointParametersWithHttpInfo(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async {
Future<Response> testEndpointParametersWithHttpInfo(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async {
// Verify required params are set.
if (number == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: number');
@ -864,7 +864,7 @@ class FakeApi {
///
/// * [String] callback:
/// None
Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async {
Future<void> testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, MultipartFile binary, DateTime date, DateTime dateTime, String password, String callback }) async {
final response = await testEndpointParametersWithHttpInfo(number, double_, patternWithoutDelimiter, byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -902,7 +902,7 @@ class FakeApi {
///
/// * [String] enumFormString:
/// Form parameter enum test (string)
Future testEnumParametersWithHttpInfo({ List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List<String> enumFormStringArray, String enumFormString }) async {
Future<Response> testEnumParametersWithHttpInfo({ List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List<String> enumFormStringArray, String enumFormString }) async {
// Verify required params are set.
final path = '/fake'.replaceAll('{format}', 'json');
@ -1004,7 +1004,7 @@ class FakeApi {
///
/// * [String] enumFormString:
/// Form parameter enum test (string)
Future testEnumParameters({ List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List<String> enumFormStringArray, String enumFormString }) async {
Future<void> testEnumParameters({ List<String> enumHeaderStringArray, String enumHeaderString, List<String> enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, List<String> enumFormStringArray, String enumFormString }) async {
final response = await testEnumParametersWithHttpInfo( enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -1036,7 +1036,7 @@ class FakeApi {
///
/// * [int] int64Group:
/// Integer in group parameters
Future testGroupParametersWithHttpInfo(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async {
Future<Response> testGroupParametersWithHttpInfo(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async {
// Verify required params are set.
if (requiredStringGroup == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: requiredStringGroup');
@ -1121,7 +1121,7 @@ class FakeApi {
///
/// * [int] int64Group:
/// Integer in group parameters
Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async {
Future<void> testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async {
final response = await testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -1136,7 +1136,7 @@ class FakeApi {
///
/// * [Map<String, String>] requestBody (required):
/// request body
Future testInlineAdditionalPropertiesWithHttpInfo(Map<String, String> requestBody) async {
Future<Response> testInlineAdditionalPropertiesWithHttpInfo(Map<String, String> requestBody) async {
// Verify required params are set.
if (requestBody == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: requestBody');
@ -1184,7 +1184,7 @@ class FakeApi {
///
/// * [Map<String, String>] requestBody (required):
/// request body
Future testInlineAdditionalProperties(Map<String, String> requestBody) async {
Future<void> testInlineAdditionalProperties(Map<String, String> requestBody) async {
final response = await testInlineAdditionalPropertiesWithHttpInfo(requestBody);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -1202,7 +1202,7 @@ class FakeApi {
///
/// * [String] param2 (required):
/// field2
Future testJsonFormDataWithHttpInfo(String param, String param2) async {
Future<Response> testJsonFormDataWithHttpInfo(String param, String param2) async {
// Verify required params are set.
if (param == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: param');
@ -1270,7 +1270,7 @@ class FakeApi {
///
/// * [String] param2 (required):
/// field2
Future testJsonFormData(String param, String param2) async {
Future<void> testJsonFormData(String param, String param2) async {
final response = await testJsonFormDataWithHttpInfo(param, param2);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -1292,7 +1292,7 @@ class FakeApi {
/// * [List<String>] url (required):
///
/// * [List<String>] context (required):
Future testQueryParameterCollectionFormatWithHttpInfo(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) async {
Future<Response> testQueryParameterCollectionFormatWithHttpInfo(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) async {
// Verify required params are set.
if (pipe == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pipe');
@ -1365,7 +1365,7 @@ class FakeApi {
/// * [List<String>] url (required):
///
/// * [List<String>] context (required):
Future testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) async {
Future<void> testQueryParameterCollectionFormat(List<String> pipe, List<String> ioutil, List<String> http, List<String> url, List<String> context) async {
final response = await testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -23,7 +23,7 @@ class PetApi {
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future addPetWithHttpInfo(Pet pet) async {
Future<Response> addPetWithHttpInfo(Pet pet) async {
// Verify required params are set.
if (pet == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pet');
@ -71,7 +71,7 @@ class PetApi {
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future addPet(Pet pet) async {
Future<void> addPet(Pet pet) async {
final response = await addPetWithHttpInfo(pet);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -88,7 +88,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePetWithHttpInfo(int petId, { String apiKey }) async {
Future<Response> deletePetWithHttpInfo(int petId, { String apiKey }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -143,7 +143,7 @@ class PetApi {
/// Pet id to delete
///
/// * [String] apiKey:
Future deletePet(int petId, { String apiKey }) async {
Future<void> deletePet(int petId, { String apiKey }) async {
final response = await deletePetWithHttpInfo(petId, apiKey: apiKey );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -389,7 +389,7 @@ class PetApi {
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future updatePetWithHttpInfo(Pet pet) async {
Future<Response> updatePetWithHttpInfo(Pet pet) async {
// Verify required params are set.
if (pet == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pet');
@ -437,7 +437,7 @@ class PetApi {
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future updatePet(Pet pet) async {
Future<void> updatePet(Pet pet) async {
final response = await updatePetWithHttpInfo(pet);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -458,7 +458,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
Future<Response> updatePetWithFormWithHttpInfo(int petId, { String name, String status }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
@ -527,7 +527,7 @@ class PetApi {
///
/// * [String] status:
/// Updated status of the pet
Future updatePetWithForm(int petId, { String name, String status }) async {
Future<void> updatePetWithForm(int petId, { String name, String status }) async {
final response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrderWithHttpInfo(String orderId) async {
Future<Response> deleteOrderWithHttpInfo(String orderId) async {
// Verify required params are set.
if (orderId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: orderId');
@ -76,7 +76,7 @@ class StoreApi {
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future deleteOrder(String orderId) async {
Future<void> deleteOrder(String orderId) async {
final response = await deleteOrderWithHttpInfo(orderId);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));

View File

@ -25,7 +25,7 @@ class UserApi {
///
/// * [User] user (required):
/// Created user object
Future createUserWithHttpInfo(User user) async {
Future<Response> createUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -75,7 +75,7 @@ class UserApi {
///
/// * [User] user (required):
/// Created user object
Future createUser(User user) async {
Future<void> createUser(User user) async {
final response = await createUserWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -90,7 +90,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithArrayInputWithHttpInfo(List<User> user) async {
Future<Response> createUsersWithArrayInputWithHttpInfo(List<User> user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -138,7 +138,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithArrayInput(List<User> user) async {
Future<void> createUsersWithArrayInput(List<User> user) async {
final response = await createUsersWithArrayInputWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -153,7 +153,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithListInputWithHttpInfo(List<User> user) async {
Future<Response> createUsersWithListInputWithHttpInfo(List<User> user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
@ -201,7 +201,7 @@ class UserApi {
///
/// * [List<User>] user (required):
/// List of user object
Future createUsersWithListInput(List<User> user) async {
Future<void> createUsersWithListInput(List<User> user) async {
final response = await createUsersWithListInputWithHttpInfo(user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -218,7 +218,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUserWithHttpInfo(String username) async {
Future<Response> deleteUserWithHttpInfo(String username) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -269,7 +269,7 @@ class UserApi {
///
/// * [String] username (required):
/// The name that needs to be deleted
Future deleteUser(String username) async {
Future<void> deleteUser(String username) async {
final response = await deleteUserWithHttpInfo(username);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -432,7 +432,7 @@ class UserApi {
/// Logs out current logged in user session
///
/// Note: This method returns the HTTP [Response].
Future logoutUserWithHttpInfo() async {
Future<Response> logoutUserWithHttpInfo() async {
final path = '/user/logout'.replaceAll('{format}', 'json');
Object postBody;
@ -470,7 +470,7 @@ class UserApi {
}
/// Logs out current logged in user session
Future logoutUser() async {
Future<void> logoutUser() async {
final response = await logoutUserWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));
@ -490,7 +490,7 @@ class UserApi {
///
/// * [User] user (required):
/// Updated user object
Future updateUserWithHttpInfo(String username, User user) async {
Future<Response> updateUserWithHttpInfo(String username, User user) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
@ -547,7 +547,7 @@ class UserApi {
///
/// * [User] user (required):
/// Updated user object
Future updateUser(String username, User user) async {
Future<void> updateUser(String username, User user) async {
final response = await updateUserWithHttpInfo(username, user);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response));