forked from loafle/openapi-generator-original
[dart][dart-dio] Formatting improvements (#8180)
* always add trailing commas in arrays and break each line * make variables final * improve API formatting (mainly leading spaces) * remove empty lines and whitespaces * fix formatting of datatype and description and docs * consistently use single quotation marks (dart already does this)
This commit is contained in:
parent
d1eda02be6
commit
f484e0db42
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -17,15 +16,21 @@ class {{classname}} {
|
|||||||
{{classname}}(this._dio, this._serializers);
|
{{classname}}(this._dio, this._serializers);
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
/// {{summary}}
|
/// {{{summary}}}
|
||||||
///
|
///
|
||||||
/// {{notes}}
|
/// {{{notes}}}
|
||||||
Future<Response{{#returnType}}<{{{returnType}}}>{{/returnType}}>{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response{{#returnType}}<{{{returnType}}}>{{/returnType}}>{{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}}
|
||||||
|
{{{dataType}}} {{paramName}},{{#-last}} { {{/-last}}{{/requiredParams}}{{#optionalParams}}
|
||||||
|
{{{dataType}}} {{paramName}},{{/optionalParams}}
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '{{{path}}}'{{#pathParams}}.replaceAll('{' r'{{baseName}}' '}', {{{paramName}}}.toString()){{/pathParams}};
|
||||||
|
|
||||||
String _path = "{{{path}}}"{{#pathParams}}.replaceAll("{" r'{{baseName}}' "}", {{{paramName}}}.toString()){{/pathParams}};
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
{{#headerParams}}
|
{{#headerParams}}
|
||||||
@ -37,9 +42,11 @@ class {{classname}} {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [{{#consumes}}"{{{mediaType}}}"{{^-last}},{{/-last}}{{/consumes}}];
|
final List<String> contentTypes = [{{^hasConsumes}}];{{/hasConsumes}}{{#hasConsumes}}{{#consumes}}
|
||||||
|
'{{{mediaType}}}',{{/consumes}}
|
||||||
|
];{{/hasConsumes}}
|
||||||
{{#hasFormParams}}
|
{{#hasFormParams}}
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
{{#isMultipart}}
|
{{#isMultipart}}
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
@ -63,8 +70,8 @@ class {{classname}} {
|
|||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
{{/isMultipart}}
|
{{/isMultipart}}
|
||||||
{{/hasFormParams}}
|
{{/hasFormParams}}
|
||||||
|
|
||||||
{{#bodyParam}}
|
{{#bodyParam}}
|
||||||
|
|
||||||
{{#isArray}}
|
{{#isArray}}
|
||||||
const type = FullType(BuiltList, [FullType({{baseType}})]);
|
const type = FullType(BuiltList, [FullType({{baseType}})]);
|
||||||
final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type);
|
final serializedBody = _serializers.serialize({{paramName}}, specifiedType: type);
|
||||||
@ -87,15 +94,21 @@ class {{classname}} {
|
|||||||
{{/isResponseFile}}
|
{{/isResponseFile}}
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{^-last}}, {{/-last}}{{/authMethods}}],
|
'secure': [{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}}
|
||||||
|
{{#authMethods}}{
|
||||||
|
'type': '{{type}}',
|
||||||
|
'name': '{{name}}',{{#isApiKey}}
|
||||||
|
'keyName': '{{keyParamName}}',
|
||||||
|
'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}}
|
||||||
|
},{{/authMethods}}
|
||||||
|
],{{/hasAuthMethods}}
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
){{#returnType}}.then((response) {
|
){{#returnType}}.then((response) {
|
||||||
|
|
||||||
{{#isResponseFile}}
|
{{#isResponseFile}}
|
||||||
final data = response.data;
|
final data = response.data;
|
||||||
{{/isResponseFile}}
|
{{/isResponseFile}}
|
||||||
@ -127,6 +140,7 @@ class {{classname}} {
|
|||||||
);
|
);
|
||||||
}){{/returnType}};
|
}){{/returnType}};
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/operation}}
|
{{/operation}}
|
||||||
}
|
}
|
||||||
{{/operations}}
|
{{/operations}}
|
||||||
|
@ -47,7 +47,7 @@ import 'package:{{pubName}}/api.dart';
|
|||||||
|
|
||||||
var api_instance = new {{classname}}();
|
var api_instance = new {{classname}}();
|
||||||
{{#allParams}}
|
{{#allParams}}
|
||||||
var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}}
|
var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -56,7 +56,7 @@ try {
|
|||||||
print(result);
|
print(result);
|
||||||
{{/returnType}}
|
{{/returnType}}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling {{classname}}->{{operationId}}: $e\n");
|
print('Exception when calling {{classname}}->{{operationId}}: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ try {
|
|||||||
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
|
||||||
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}}
|
||||||
{{/allParams}}
|
{{/allParams}}
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
@ -15,7 +15,7 @@ class {{clientName}} {
|
|||||||
|
|
||||||
Dio dio;
|
Dio dio;
|
||||||
Serializers serializers;
|
Serializers serializers;
|
||||||
String basePath = "{{{basePath}}}";
|
String basePath = '{{{basePath}}}';
|
||||||
|
|
||||||
{{clientName}}({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
{{clientName}}({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
||||||
if (dio == null) {
|
if (dio == null) {
|
||||||
|
@ -6,17 +6,19 @@ part '{{classFilename}}.g.dart';
|
|||||||
abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builder> {
|
abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builder> {
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{#description}}/* {{{description}}} */{{/description}}
|
{{#description}}
|
||||||
|
/// {{{description}}}
|
||||||
|
{{/description}}
|
||||||
{{#isNullable}}
|
{{#isNullable}}
|
||||||
@nullable
|
@nullable
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
@BuiltValueField(wireName: r'{{baseName}}')
|
@BuiltValueField(wireName: r'{{baseName}}')
|
||||||
{{{datatypeWithEnum}}} get {{name}};
|
{{{datatypeWithEnum}}} get {{name}};
|
||||||
{{#allowableValues}}
|
{{#allowableValues}}
|
||||||
{{#min}}// range from {{min}} to {{max}}{{/min}}//{{^min}} enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}
|
// {{#min}}range from {{{min}}} to {{{max}}}{{/min}}{{^min}}enum {{name}}Enum { {{#values}} {{{.}}}, {{/values}} };{{/min}}
|
||||||
{{/allowableValues}}
|
{{/allowableValues}}
|
||||||
{{/vars}}
|
|
||||||
|
|
||||||
|
{{/vars}}
|
||||||
// Boilerplate code needed to wire-up generated code
|
// Boilerplate code needed to wire-up generated code
|
||||||
{{classname}}._();
|
{{classname}}._();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ class OffsetDateSerializer implements PrimitiveSerializer<OffsetDate> {
|
|||||||
Iterable<Type> get types => BuiltList<Type>([OffsetDate]);
|
Iterable<Type> get types => BuiltList<Type>([OffsetDate]);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get wireName => "OffsetDate";
|
String get wireName => 'OffsetDate';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
OffsetDate deserialize(Serializers serializers, Object serialized,
|
OffsetDate deserialize(Serializers serializers, Object serialized,
|
||||||
@ -28,7 +28,7 @@ class OffsetDateTimeSerializer implements PrimitiveSerializer<OffsetDateTime> {
|
|||||||
Iterable<Type> get types => BuiltList<Type>([OffsetDateTime]);
|
Iterable<Type> get types => BuiltList<Type>([OffsetDateTime]);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get wireName => "OffsetDateTime";
|
String get wireName => 'OffsetDateTime';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
OffsetDateTime deserialize(Serializers serializers, Object serialized,
|
OffsetDateTime deserialize(Serializers serializers, Object serialized,
|
||||||
|
@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -7,7 +7,9 @@ class {{{classname}}} {
|
|||||||
});
|
});
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{#description}}/// {{{description}}}{{/description}}
|
{{#description}}
|
||||||
|
/// {{{description}}}
|
||||||
|
{{/description}}
|
||||||
{{^isEnum}}
|
{{^isEnum}}
|
||||||
{{#minimum}}
|
{{#minimum}}
|
||||||
// minimum: {{{minimum}}}
|
// minimum: {{{minimum}}}
|
||||||
|
@ -11,8 +11,8 @@ Name | Type | Description | Notes
|
|||||||
**id** | **int** | | [optional] [default to null]
|
**id** | **int** | | [optional] [default to null]
|
||||||
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
||||||
**name** | **String** | | [default to null]
|
**name** | **String** | | [default to null]
|
||||||
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
||||||
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
||||||
**status** | **String** | pet status in the store | [optional] [default to null]
|
**status** | **String** | pet status in the store | [optional] [default to null]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -36,7 +36,7 @@ var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
|||||||
try {
|
try {
|
||||||
api_instance.addPet(body);
|
api_instance.addPet(body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->addPet: $e\n");
|
print('Exception when calling PetApi->addPet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ var apiKey = apiKey_example; // String |
|
|||||||
try {
|
try {
|
||||||
api_instance.deletePet(petId, apiKey);
|
api_instance.deletePet(petId, apiKey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->deletePet: $e\n");
|
print('Exception when calling PetApi->deletePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ try {
|
|||||||
var result = api_instance.findPetsByStatus(status);
|
var result = api_instance.findPetsByStatus(status);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByStatus: $e\n");
|
print('Exception when calling PetApi->findPetsByStatus: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ try {
|
|||||||
var result = api_instance.findPetsByTags(tags);
|
var result = api_instance.findPetsByTags(tags);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByTags: $e\n");
|
print('Exception when calling PetApi->findPetsByTags: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ try {
|
|||||||
var result = api_instance.getPetById(petId);
|
var result = api_instance.getPetById(petId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->getPetById: $e\n");
|
print('Exception when calling PetApi->getPetById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
|||||||
try {
|
try {
|
||||||
api_instance.updatePet(body);
|
api_instance.updatePet(body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePet: $e\n");
|
print('Exception when calling PetApi->updatePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ var status = status_example; // String | Updated status of the pet
|
|||||||
try {
|
try {
|
||||||
api_instance.updatePetWithForm(petId, name, status);
|
api_instance.updatePetWithForm(petId, name, status);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePetWithForm: $e\n");
|
print('Exception when calling PetApi->updatePetWithForm: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ try {
|
|||||||
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->uploadFile: $e\n");
|
print('Exception when calling PetApi->uploadFile: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteOrder(orderId);
|
api_instance.deleteOrder(orderId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->deleteOrder: $e\n");
|
print('Exception when calling StoreApi->deleteOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ try {
|
|||||||
var result = api_instance.getInventory();
|
var result = api_instance.getInventory();
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getInventory: $e\n");
|
print('Exception when calling StoreApi->getInventory: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ try {
|
|||||||
var result = api_instance.getOrderById(orderId);
|
var result = api_instance.getOrderById(orderId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getOrderById: $e\n");
|
print('Exception when calling StoreApi->getOrderById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ try {
|
|||||||
var result = api_instance.placeOrder(body);
|
var result = api_instance.placeOrder(body);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->placeOrder: $e\n");
|
print('Exception when calling StoreApi->placeOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ var body = new User(); // User | Created user object
|
|||||||
try {
|
try {
|
||||||
api_instance.createUser(body);
|
api_instance.createUser(body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUser: $e\n");
|
print('Exception when calling UserApi->createUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -71,12 +71,12 @@ Creates list of users with given input array
|
|||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var body = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var body = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithArrayInput(body);
|
api_instance.createUsersWithArrayInput(body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**BuiltList<User>**](User.md)| List of user object |
|
**body** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -111,12 +111,12 @@ Creates list of users with given input array
|
|||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var body = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var body = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithListInput(body);
|
api_instance.createUsersWithListInput(body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithListInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithListInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**body** | [**BuiltList<User>**](User.md)| List of user object |
|
**body** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ var username = username_example; // String | The name that needs to be deleted
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteUser(username);
|
api_instance.deleteUser(username);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->deleteUser: $e\n");
|
print('Exception when calling UserApi->deleteUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ try {
|
|||||||
var result = api_instance.getUserByName(username);
|
var result = api_instance.getUserByName(username);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->getUserByName: $e\n");
|
print('Exception when calling UserApi->getUserByName: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ try {
|
|||||||
var result = api_instance.loginUser(username, password);
|
var result = api_instance.loginUser(username, password);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->loginUser: $e\n");
|
print('Exception when calling UserApi->loginUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ var api_instance = new UserApi();
|
|||||||
try {
|
try {
|
||||||
api_instance.logoutUser();
|
api_instance.logoutUser();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->logoutUser: $e\n");
|
print('Exception when calling UserApi->logoutUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ var body = new User(); // User | Updated user object
|
|||||||
try {
|
try {
|
||||||
api_instance.updateUser(username, body);
|
api_instance.updateUser(username, body);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->updateUser: $e\n");
|
print('Exception when calling UserApi->updateUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class Openapi {
|
|||||||
|
|
||||||
Dio dio;
|
Dio dio;
|
||||||
Serializers serializers;
|
Serializers serializers;
|
||||||
String basePath = "http://petstore.swagger.io/v2";
|
String basePath = 'http://petstore.swagger.io/v2';
|
||||||
|
|
||||||
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
||||||
if (dio == null) {
|
if (dio == null) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -19,19 +18,26 @@ class PetApi {
|
|||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>addPet(Pet body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>addPet(
|
||||||
|
Pet body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -45,33 +51,43 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes a pet
|
/// Deletes a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>deletePet(int petId,{ String apiKey,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deletePet(
|
||||||
|
int petId, {
|
||||||
|
String apiKey,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'api_key'] = apiKey;
|
headerParams[r'api_key'] = apiKey;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -81,33 +97,42 @@ class PetApi {
|
|||||||
method: 'delete'.toUpperCase(),
|
method: 'delete'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by status
|
/// Finds Pets by status
|
||||||
///
|
///
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByStatus(BuiltList<String> status,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByStatus(
|
||||||
|
BuiltList<String> status, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByStatus';
|
||||||
|
|
||||||
String _path = "/pet/findByStatus";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'status'] = status;
|
queryParams[r'status'] = status;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -117,15 +142,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -141,24 +170,28 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by tags
|
/// Finds Pets by tags
|
||||||
///
|
///
|
||||||
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByTags(BuiltList<String> tags,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByTags(
|
||||||
|
BuiltList<String> tags, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByTags';
|
||||||
|
|
||||||
String _path = "/pet/findByTags";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'tags'] = tags;
|
queryParams[r'tags'] = tags;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -168,15 +201,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -192,23 +229,27 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find pet by ID
|
/// Find pet by ID
|
||||||
///
|
///
|
||||||
/// Returns a single pet
|
/// Returns a single pet
|
||||||
Future<Response<Pet>>getPetById(int petId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Pet>>getPetById(
|
||||||
|
int petId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -218,15 +259,21 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Pet);
|
final serializer = _serializers.serializerForType(Pet);
|
||||||
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -241,22 +288,30 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>updatePet(Pet body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updatePet(
|
||||||
|
Pet body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -270,37 +325,51 @@ class PetApi {
|
|||||||
method: 'put'.toUpperCase(),
|
method: 'put'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates a pet in the store with form data
|
/// Updates a pet in the store with form data
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>updatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updatePetWithForm(
|
||||||
|
int petId, {
|
||||||
|
String name,
|
||||||
|
String status,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['name'] = parameterToString(_serializers, name);
|
formData['name'] = parameterToString(_serializers, name);
|
||||||
formData['status'] = parameterToString(_serializers, status);
|
formData['status'] = parameterToString(_serializers, status);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -309,30 +378,45 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uploads an image
|
/// uploads an image
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<ApiResponse>>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<ApiResponse>>uploadFile(
|
||||||
|
int petId, {
|
||||||
|
String additionalMetadata,
|
||||||
|
Uint8List file,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["multipart/form-data"];
|
final List<String> contentTypes = [
|
||||||
|
'multipart/form-data',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
if (additionalMetadata != null) {
|
if (additionalMetadata != null) {
|
||||||
@ -343,7 +427,6 @@ class PetApi {
|
|||||||
}
|
}
|
||||||
bodyData = FormData.fromMap(formData);
|
bodyData = FormData.fromMap(formData);
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -352,15 +435,19 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(ApiResponse);
|
final serializer = _serializers.serializerForType(ApiResponse);
|
||||||
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -375,4 +462,5 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,21 +14,24 @@ class StoreApi {
|
|||||||
|
|
||||||
/// Delete purchase order by ID
|
/// Delete purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
Future<Response>deleteOrder(String orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteOrder(
|
||||||
|
String orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -41,30 +43,33 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns pet inventories by status
|
/// Returns pet inventories by status
|
||||||
///
|
///
|
||||||
/// Returns a map of status codes to quantities
|
/// Returns a map of status codes to quantities
|
||||||
Future<Response<BuiltMap<String, int>>>getInventory({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltMap<String, int>>>getInventory({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/inventory';
|
||||||
|
|
||||||
String _path = "/store/inventory";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -74,15 +79,21 @@ class StoreApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltMap;
|
const collectionType = BuiltMap;
|
||||||
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
||||||
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -98,23 +109,27 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find purchase order by ID
|
/// Find purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
Future<Response<Order>>getOrderById(int orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>getOrderById(
|
||||||
|
int orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -126,13 +141,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -147,22 +161,27 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<Order>>placeOrder(Order body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>placeOrder(
|
||||||
|
Order body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order';
|
||||||
|
|
||||||
String _path = "/store/order";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -178,13 +197,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -199,4 +217,5 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -16,19 +15,23 @@ class UserApi {
|
|||||||
/// Create user
|
/// Create user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>createUser(User body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUser(
|
||||||
|
User body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user';
|
||||||
|
|
||||||
String _path = "/user";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -44,29 +47,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithArrayInput(BuiltList<User> body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithArrayInput(
|
||||||
|
BuiltList<User> body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithArray';
|
||||||
|
|
||||||
String _path = "/user/createWithArray";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(body, specifiedType: type);
|
final serializedBody = _serializers.serialize(body, specifiedType: type);
|
||||||
@ -83,29 +91,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithListInput(BuiltList<User> body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithListInput(
|
||||||
|
BuiltList<User> body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithList';
|
||||||
|
|
||||||
String _path = "/user/createWithList";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(body, specifiedType: type);
|
final serializedBody = _serializers.serialize(body, specifiedType: type);
|
||||||
@ -122,30 +135,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete user
|
/// Delete user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>deleteUser(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteUser(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -157,30 +174,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get user by user name
|
/// Get user by user name
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<User>>getUserByName(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<User>>getUserByName(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -192,13 +213,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(User);
|
final serializer = _serializers.serializerForType(User);
|
||||||
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -213,15 +233,22 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs user into the system
|
/// Logs user into the system
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<String>>loginUser(String username,String password,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<String>>loginUser(
|
||||||
|
String username,
|
||||||
|
String password, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/login';
|
||||||
|
|
||||||
String _path = "/user/login";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'username'] = username;
|
queryParams[r'username'] = username;
|
||||||
@ -229,9 +256,7 @@ class UserApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -243,13 +268,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as String;
|
final data = response.data as String;
|
||||||
|
|
||||||
return Response<String>(
|
return Response<String>(
|
||||||
@ -263,23 +287,26 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs out current logged in user session
|
/// Logs out current logged in user session
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>logoutUser({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>logoutUser({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/logout';
|
||||||
|
|
||||||
String _path = "/user/logout";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -291,29 +318,35 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updated user
|
/// Updated user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>updateUser(String username,User body,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updateUser(
|
||||||
|
String username,
|
||||||
|
User body, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -329,11 +362,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -5,7 +5,6 @@ part 'api_response.g.dart';
|
|||||||
|
|
||||||
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'code')
|
@BuiltValueField(wireName: r'code')
|
||||||
int get code;
|
int get code;
|
||||||
|
@ -5,7 +5,6 @@ part 'category.g.dart';
|
|||||||
|
|
||||||
abstract class Category implements Built<Category, CategoryBuilder> {
|
abstract class Category implements Built<Category, CategoryBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
|
@ -6,7 +6,6 @@ part 'order.g.dart';
|
|||||||
|
|
||||||
abstract class Order implements Built<Order, OrderBuilder> {
|
abstract class Order implements Built<Order, OrderBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -22,7 +21,8 @@ abstract class Order implements Built<Order, OrderBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'shipDate')
|
@BuiltValueField(wireName: r'shipDate')
|
||||||
DateTime get shipDate;
|
DateTime get shipDate;
|
||||||
/* Order Status */
|
|
||||||
|
/// Order Status
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
OrderStatusEnum get status;
|
OrderStatusEnum get status;
|
||||||
|
@ -8,7 +8,6 @@ part 'pet.g.dart';
|
|||||||
|
|
||||||
abstract class Pet implements Built<Pet, PetBuilder> {
|
abstract class Pet implements Built<Pet, PetBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -28,7 +27,8 @@ abstract class Pet implements Built<Pet, PetBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'tags')
|
@BuiltValueField(wireName: r'tags')
|
||||||
BuiltList<Tag> get tags;
|
BuiltList<Tag> get tags;
|
||||||
/* pet status in the store */
|
|
||||||
|
/// pet status in the store
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
PetStatusEnum get status;
|
PetStatusEnum get status;
|
||||||
|
@ -5,7 +5,6 @@ part 'tag.g.dart';
|
|||||||
|
|
||||||
abstract class Tag implements Built<Tag, TagBuilder> {
|
abstract class Tag implements Built<Tag, TagBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
|
@ -5,7 +5,6 @@ part 'user.g.dart';
|
|||||||
|
|
||||||
abstract class User implements Built<User, UserBuilder> {
|
abstract class User implements Built<User, UserBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -33,7 +32,8 @@ abstract class User implements Built<User, UserBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'phone')
|
@BuiltValueField(wireName: r'phone')
|
||||||
String get phone;
|
String get phone;
|
||||||
/* User Status */
|
|
||||||
|
/// User Status
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'userStatus')
|
@BuiltValueField(wireName: r'userStatus')
|
||||||
int get userStatus;
|
int get userStatus;
|
||||||
|
@ -17,13 +17,10 @@ class ApiResponse {
|
|||||||
this.message,
|
this.message,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int code;
|
int code;
|
||||||
|
|
||||||
|
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -16,10 +16,8 @@ class Category {
|
|||||||
this.name,
|
this.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -20,22 +20,17 @@ class Order {
|
|||||||
this.complete = false,
|
this.complete = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
|
||||||
int petId;
|
int petId;
|
||||||
|
|
||||||
|
|
||||||
int quantity;
|
int quantity;
|
||||||
|
|
||||||
|
|
||||||
DateTime shipDate;
|
DateTime shipDate;
|
||||||
|
|
||||||
/// Order Status
|
/// Order Status
|
||||||
OrderStatusEnum status;
|
OrderStatusEnum status;
|
||||||
|
|
||||||
|
|
||||||
bool complete;
|
bool complete;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -20,19 +20,14 @@ class Pet {
|
|||||||
this.status,
|
this.status,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
|
||||||
Category category;
|
Category category;
|
||||||
|
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
|
|
||||||
List<String> photoUrls;
|
List<String> photoUrls;
|
||||||
|
|
||||||
|
|
||||||
List<Tag> tags;
|
List<Tag> tags;
|
||||||
|
|
||||||
/// pet status in the store
|
/// pet status in the store
|
||||||
|
@ -16,10 +16,8 @@ class Tag {
|
|||||||
this.name,
|
this.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -22,25 +22,18 @@ class User {
|
|||||||
this.userStatus,
|
this.userStatus,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
|
|
||||||
String username;
|
String username;
|
||||||
|
|
||||||
|
|
||||||
String firstName;
|
String firstName;
|
||||||
|
|
||||||
|
|
||||||
String lastName;
|
String lastName;
|
||||||
|
|
||||||
|
|
||||||
String email;
|
String email;
|
||||||
|
|
||||||
|
|
||||||
String password;
|
String password;
|
||||||
|
|
||||||
|
|
||||||
String phone;
|
String phone;
|
||||||
|
|
||||||
/// User Status
|
/// User Status
|
||||||
|
@ -11,8 +11,8 @@ Name | Type | Description | Notes
|
|||||||
**id** | **int** | | [optional] [default to null]
|
**id** | **int** | | [optional] [default to null]
|
||||||
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
||||||
**name** | **String** | | [default to null]
|
**name** | **String** | | [default to null]
|
||||||
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
||||||
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
||||||
**status** | **String** | pet status in the store | [optional] [default to null]
|
**status** | **String** | pet status in the store | [optional] [default to null]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -37,7 +37,7 @@ try {
|
|||||||
var result = api_instance.addPet(pet);
|
var result = api_instance.addPet(pet);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->addPet: $e\n");
|
print('Exception when calling PetApi->addPet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ var apiKey = apiKey_example; // String |
|
|||||||
try {
|
try {
|
||||||
api_instance.deletePet(petId, apiKey);
|
api_instance.deletePet(petId, apiKey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->deletePet: $e\n");
|
print('Exception when calling PetApi->deletePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ try {
|
|||||||
var result = api_instance.findPetsByStatus(status);
|
var result = api_instance.findPetsByStatus(status);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByStatus: $e\n");
|
print('Exception when calling PetApi->findPetsByStatus: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ try {
|
|||||||
var result = api_instance.findPetsByTags(tags);
|
var result = api_instance.findPetsByTags(tags);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByTags: $e\n");
|
print('Exception when calling PetApi->findPetsByTags: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ try {
|
|||||||
var result = api_instance.getPetById(petId);
|
var result = api_instance.getPetById(petId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->getPetById: $e\n");
|
print('Exception when calling PetApi->getPetById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ try {
|
|||||||
var result = api_instance.updatePet(pet);
|
var result = api_instance.updatePet(pet);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePet: $e\n");
|
print('Exception when calling PetApi->updatePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ var status = status_example; // String | Updated status of the pet
|
|||||||
try {
|
try {
|
||||||
api_instance.updatePetWithForm(petId, name, status);
|
api_instance.updatePetWithForm(petId, name, status);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePetWithForm: $e\n");
|
print('Exception when calling PetApi->updatePetWithForm: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ try {
|
|||||||
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->uploadFile: $e\n");
|
print('Exception when calling PetApi->uploadFile: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteOrder(orderId);
|
api_instance.deleteOrder(orderId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->deleteOrder: $e\n");
|
print('Exception when calling StoreApi->deleteOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ try {
|
|||||||
var result = api_instance.getInventory();
|
var result = api_instance.getInventory();
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getInventory: $e\n");
|
print('Exception when calling StoreApi->getInventory: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ try {
|
|||||||
var result = api_instance.getOrderById(orderId);
|
var result = api_instance.getOrderById(orderId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getOrderById: $e\n");
|
print('Exception when calling StoreApi->getOrderById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ try {
|
|||||||
var result = api_instance.placeOrder(order);
|
var result = api_instance.placeOrder(order);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->placeOrder: $e\n");
|
print('Exception when calling StoreApi->placeOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ var user = new User(); // User | Created user object
|
|||||||
try {
|
try {
|
||||||
api_instance.createUser(user);
|
api_instance.createUser(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUser: $e\n");
|
print('Exception when calling UserApi->createUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -79,12 +79,12 @@ import 'package:openapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
|
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithArrayInput(user);
|
api_instance.createUsersWithArrayInput(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -123,12 +123,12 @@ import 'package:openapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
|
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithListInput(user);
|
api_instance.createUsersWithListInput(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithListInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithListInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ var username = username_example; // String | The name that needs to be deleted
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteUser(username);
|
api_instance.deleteUser(username);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->deleteUser: $e\n");
|
print('Exception when calling UserApi->deleteUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ try {
|
|||||||
var result = api_instance.getUserByName(username);
|
var result = api_instance.getUserByName(username);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->getUserByName: $e\n");
|
print('Exception when calling UserApi->getUserByName: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ try {
|
|||||||
var result = api_instance.loginUser(username, password);
|
var result = api_instance.loginUser(username, password);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->loginUser: $e\n");
|
print('Exception when calling UserApi->loginUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ var api_instance = new UserApi();
|
|||||||
try {
|
try {
|
||||||
api_instance.logoutUser();
|
api_instance.logoutUser();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->logoutUser: $e\n");
|
print('Exception when calling UserApi->logoutUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -345,7 +345,7 @@ var user = new User(); // User | Updated user object
|
|||||||
try {
|
try {
|
||||||
api_instance.updateUser(username, user);
|
api_instance.updateUser(username, user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->updateUser: $e\n");
|
print('Exception when calling UserApi->updateUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ class Openapi {
|
|||||||
|
|
||||||
Dio dio;
|
Dio dio;
|
||||||
Serializers serializers;
|
Serializers serializers;
|
||||||
String basePath = "http://petstore.swagger.io/v2";
|
String basePath = 'http://petstore.swagger.io/v2';
|
||||||
|
|
||||||
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
||||||
if (dio == null) {
|
if (dio == null) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -19,19 +18,26 @@ class PetApi {
|
|||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<Pet>>addPet(Pet pet,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Pet>>addPet(
|
||||||
|
Pet pet, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(pet);
|
final serializedBody = _serializers.serialize(pet);
|
||||||
final jsonpet = json.encode(serializedBody);
|
final jsonpet = json.encode(serializedBody);
|
||||||
@ -45,15 +51,19 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Pet);
|
final serializer = _serializers.serializerForType(Pet);
|
||||||
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -68,24 +78,29 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes a pet
|
/// Deletes a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>deletePet(int petId,{ String apiKey,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deletePet(
|
||||||
|
int petId, {
|
||||||
|
String apiKey,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'api_key'] = apiKey;
|
headerParams[r'api_key'] = apiKey;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -95,33 +110,42 @@ class PetApi {
|
|||||||
method: 'delete'.toUpperCase(),
|
method: 'delete'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by status
|
/// Finds Pets by status
|
||||||
///
|
///
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByStatus(BuiltList<String> status,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByStatus(
|
||||||
|
BuiltList<String> status, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByStatus';
|
||||||
|
|
||||||
String _path = "/pet/findByStatus";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'status'] = status;
|
queryParams[r'status'] = status;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -131,15 +155,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -155,24 +183,28 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by tags
|
/// Finds Pets by tags
|
||||||
///
|
///
|
||||||
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByTags(BuiltList<String> tags,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByTags(
|
||||||
|
BuiltList<String> tags, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByTags';
|
||||||
|
|
||||||
String _path = "/pet/findByTags";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'tags'] = tags;
|
queryParams[r'tags'] = tags;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -182,15 +214,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -206,23 +242,27 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find pet by ID
|
/// Find pet by ID
|
||||||
///
|
///
|
||||||
/// Returns a single pet
|
/// Returns a single pet
|
||||||
Future<Response<Pet>>getPetById(int petId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Pet>>getPetById(
|
||||||
|
int petId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -232,15 +272,21 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Pet);
|
final serializer = _serializers.serializerForType(Pet);
|
||||||
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -255,22 +301,30 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<Pet>>updatePet(Pet pet,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Pet>>updatePet(
|
||||||
|
Pet pet, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(pet);
|
final serializedBody = _serializers.serialize(pet);
|
||||||
final jsonpet = json.encode(serializedBody);
|
final jsonpet = json.encode(serializedBody);
|
||||||
@ -284,15 +338,19 @@ class PetApi {
|
|||||||
method: 'put'.toUpperCase(),
|
method: 'put'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Pet);
|
final serializer = _serializers.serializerForType(Pet);
|
||||||
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -307,28 +365,37 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates a pet in the store with form data
|
/// Updates a pet in the store with form data
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>updatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updatePetWithForm(
|
||||||
|
int petId, {
|
||||||
|
String name,
|
||||||
|
String status,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['name'] = parameterToString(_serializers, name);
|
formData['name'] = parameterToString(_serializers, name);
|
||||||
formData['status'] = parameterToString(_serializers, status);
|
formData['status'] = parameterToString(_serializers, status);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -337,30 +404,45 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uploads an image
|
/// uploads an image
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<ApiResponse>>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<ApiResponse>>uploadFile(
|
||||||
|
int petId, {
|
||||||
|
String additionalMetadata,
|
||||||
|
Uint8List file,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["multipart/form-data"];
|
final List<String> contentTypes = [
|
||||||
|
'multipart/form-data',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
if (additionalMetadata != null) {
|
if (additionalMetadata != null) {
|
||||||
@ -371,7 +453,6 @@ class PetApi {
|
|||||||
}
|
}
|
||||||
bodyData = FormData.fromMap(formData);
|
bodyData = FormData.fromMap(formData);
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -380,15 +461,19 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(ApiResponse);
|
final serializer = _serializers.serializerForType(ApiResponse);
|
||||||
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -403,4 +488,5 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,21 +14,24 @@ class StoreApi {
|
|||||||
|
|
||||||
/// Delete purchase order by ID
|
/// Delete purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
Future<Response>deleteOrder(String orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteOrder(
|
||||||
|
String orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -41,30 +43,33 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns pet inventories by status
|
/// Returns pet inventories by status
|
||||||
///
|
///
|
||||||
/// Returns a map of status codes to quantities
|
/// Returns a map of status codes to quantities
|
||||||
Future<Response<BuiltMap<String, int>>>getInventory({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltMap<String, int>>>getInventory({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/inventory';
|
||||||
|
|
||||||
String _path = "/store/inventory";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -74,15 +79,21 @@ class StoreApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltMap;
|
const collectionType = BuiltMap;
|
||||||
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
||||||
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -98,23 +109,27 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find purchase order by ID
|
/// Find purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
Future<Response<Order>>getOrderById(int orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>getOrderById(
|
||||||
|
int orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{orderId}'.replaceAll('{' r'orderId' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -126,13 +141,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -147,22 +161,29 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<Order>>placeOrder(Order order,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>placeOrder(
|
||||||
|
Order order, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order';
|
||||||
|
|
||||||
String _path = "/store/order";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(order);
|
final serializedBody = _serializers.serialize(order);
|
||||||
final jsonorder = json.encode(serializedBody);
|
final jsonorder = json.encode(serializedBody);
|
||||||
@ -178,13 +199,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -199,4 +219,5 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -16,19 +15,25 @@ class UserApi {
|
|||||||
/// Create user
|
/// Create user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>createUser(User user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUser(
|
||||||
|
User user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user';
|
||||||
|
|
||||||
String _path = "/user";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(user);
|
final serializedBody = _serializers.serialize(user);
|
||||||
final jsonuser = json.encode(serializedBody);
|
final jsonuser = json.encode(serializedBody);
|
||||||
@ -42,31 +47,45 @@ class UserApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithArrayInput(BuiltList<User> user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithArrayInput(
|
||||||
|
BuiltList<User> user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithArray';
|
||||||
|
|
||||||
String _path = "/user/createWithArray";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
||||||
@ -81,31 +100,45 @@ class UserApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithListInput(BuiltList<User> user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithListInput(
|
||||||
|
BuiltList<User> user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithList';
|
||||||
|
|
||||||
String _path = "/user/createWithList";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
||||||
@ -120,32 +153,43 @@ class UserApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete user
|
/// Delete user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>deleteUser(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteUser(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -155,32 +199,43 @@ class UserApi {
|
|||||||
method: 'delete'.toUpperCase(),
|
method: 'delete'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get user by user name
|
/// Get user by user name
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<User>>getUserByName(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<User>>getUserByName(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -192,13 +247,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(User);
|
final serializer = _serializers.serializerForType(User);
|
||||||
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -213,15 +267,22 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs user into the system
|
/// Logs user into the system
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<String>>loginUser(String username,String password,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<String>>loginUser(
|
||||||
|
String username,
|
||||||
|
String password, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/login';
|
||||||
|
|
||||||
String _path = "/user/login";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'username'] = username;
|
queryParams[r'username'] = username;
|
||||||
@ -229,9 +290,7 @@ class UserApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -243,13 +302,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as String;
|
final data = response.data as String;
|
||||||
|
|
||||||
return Response<String>(
|
return Response<String>(
|
||||||
@ -263,23 +321,26 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs out current logged in user session
|
/// Logs out current logged in user session
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>logoutUser({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>logoutUser({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/logout';
|
||||||
|
|
||||||
String _path = "/user/logout";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -289,31 +350,46 @@ class UserApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updated user
|
/// Updated user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>updateUser(String username,User user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updateUser(
|
||||||
|
String username,
|
||||||
|
User user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(user);
|
final serializedBody = _serializers.serialize(user);
|
||||||
final jsonuser = json.encode(serializedBody);
|
final jsonuser = json.encode(serializedBody);
|
||||||
@ -327,13 +403,21 @@ class UserApi {
|
|||||||
method: 'put'.toUpperCase(),
|
method: 'put'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -5,7 +5,6 @@ part 'api_response.g.dart';
|
|||||||
|
|
||||||
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'code')
|
@BuiltValueField(wireName: r'code')
|
||||||
int get code;
|
int get code;
|
||||||
|
@ -5,7 +5,6 @@ part 'category.g.dart';
|
|||||||
|
|
||||||
abstract class Category implements Built<Category, CategoryBuilder> {
|
abstract class Category implements Built<Category, CategoryBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
|
@ -5,11 +5,12 @@ part 'inline_object.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject implements Built<InlineObject, InlineObjectBuilder> {
|
abstract class InlineObject implements Built<InlineObject, InlineObjectBuilder> {
|
||||||
|
|
||||||
/* Updated name of the pet */
|
/// Updated name of the pet
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'name')
|
@BuiltValueField(wireName: r'name')
|
||||||
String get name;
|
String get name;
|
||||||
/* Updated status of the pet */
|
|
||||||
|
/// Updated status of the pet
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
String get status;
|
String get status;
|
||||||
|
@ -6,11 +6,12 @@ part 'inline_object1.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject1 implements Built<InlineObject1, InlineObject1Builder> {
|
abstract class InlineObject1 implements Built<InlineObject1, InlineObject1Builder> {
|
||||||
|
|
||||||
/* Additional data to pass to server */
|
/// Additional data to pass to server
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'additionalMetadata')
|
@BuiltValueField(wireName: r'additionalMetadata')
|
||||||
String get additionalMetadata;
|
String get additionalMetadata;
|
||||||
/* file to upload */
|
|
||||||
|
/// file to upload
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'file')
|
@BuiltValueField(wireName: r'file')
|
||||||
Uint8List get file;
|
Uint8List get file;
|
||||||
|
@ -6,7 +6,6 @@ part 'order.g.dart';
|
|||||||
|
|
||||||
abstract class Order implements Built<Order, OrderBuilder> {
|
abstract class Order implements Built<Order, OrderBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -22,7 +21,8 @@ abstract class Order implements Built<Order, OrderBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'shipDate')
|
@BuiltValueField(wireName: r'shipDate')
|
||||||
DateTime get shipDate;
|
DateTime get shipDate;
|
||||||
/* Order Status */
|
|
||||||
|
/// Order Status
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
OrderStatusEnum get status;
|
OrderStatusEnum get status;
|
||||||
|
@ -8,7 +8,6 @@ part 'pet.g.dart';
|
|||||||
|
|
||||||
abstract class Pet implements Built<Pet, PetBuilder> {
|
abstract class Pet implements Built<Pet, PetBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -28,7 +27,8 @@ abstract class Pet implements Built<Pet, PetBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'tags')
|
@BuiltValueField(wireName: r'tags')
|
||||||
BuiltList<Tag> get tags;
|
BuiltList<Tag> get tags;
|
||||||
/* pet status in the store */
|
|
||||||
|
/// pet status in the store
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
PetStatusEnum get status;
|
PetStatusEnum get status;
|
||||||
|
@ -5,7 +5,6 @@ part 'tag.g.dart';
|
|||||||
|
|
||||||
abstract class Tag implements Built<Tag, TagBuilder> {
|
abstract class Tag implements Built<Tag, TagBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
|
@ -5,7 +5,6 @@ part 'user.g.dart';
|
|||||||
|
|
||||||
abstract class User implements Built<User, UserBuilder> {
|
abstract class User implements Built<User, UserBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
@ -33,7 +32,8 @@ abstract class User implements Built<User, UserBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'phone')
|
@BuiltValueField(wireName: r'phone')
|
||||||
String get phone;
|
String get phone;
|
||||||
/* User Status */
|
|
||||||
|
/// User Status
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'userStatus')
|
@BuiltValueField(wireName: r'userStatus')
|
||||||
int get userStatus;
|
int get userStatus;
|
||||||
|
@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**mapProperty** | **BuiltMap<String, String>** | | [optional] [default to const {}]
|
**mapProperty** | **BuiltMap<String, String>** | | [optional] [default to const {}]
|
||||||
**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}]
|
**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ try {
|
|||||||
var result = api_instance.call123testSpecialTags(client);
|
var result = api_instance.call123testSpecialTags(client);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n");
|
print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] [default to const []]
|
**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] [default to const []]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**arrayNumber** | **BuiltList<num>** | | [optional] [default to const []]
|
**arrayNumber** | **BuiltList<num>** | | [optional] [default to const []]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**arrayOfString** | **BuiltList<String>** | | [optional] [default to const []]
|
**arrayOfString** | **BuiltList<String>** | | [optional] [default to const []]
|
||||||
**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] [default to const []]
|
**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] [default to const []]
|
||||||
**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] [default to const []]
|
**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] [default to const []]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ try {
|
|||||||
var result = api_instance.fooGet();
|
var result = api_instance.fooGet();
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling DefaultApi->fooGet: $e\n");
|
print('Exception when calling DefaultApi->fooGet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import 'package:openapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**justSymbol** | **String** | | [optional] [default to null]
|
**justSymbol** | **String** | | [optional] [default to null]
|
||||||
**arrayEnum** | **BuiltList<String>** | | [optional] [default to const []]
|
**arrayEnum** | **BuiltList<String>** | | [optional] [default to const []]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ try {
|
|||||||
var result = api_instance.fakeHealthGet();
|
var result = api_instance.fakeHealthGet();
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeHealthGet: $e\n");
|
print('Exception when calling FakeApi->fakeHealthGet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ var header1 = header1_example; // String | header parameter
|
|||||||
try {
|
try {
|
||||||
api_instance.fakeHttpSignatureTest(pet, query1, header1);
|
api_instance.fakeHttpSignatureTest(pet, query1, header1);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeHttpSignatureTest: $e\n");
|
print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ try {
|
|||||||
var result = api_instance.fakeOuterBooleanSerialize(body);
|
var result = api_instance.fakeOuterBooleanSerialize(body);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n");
|
print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ try {
|
|||||||
var result = api_instance.fakeOuterCompositeSerialize(outerComposite);
|
var result = api_instance.fakeOuterCompositeSerialize(outerComposite);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n");
|
print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ try {
|
|||||||
var result = api_instance.fakeOuterNumberSerialize(body);
|
var result = api_instance.fakeOuterNumberSerialize(body);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n");
|
print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ try {
|
|||||||
var result = api_instance.fakeOuterStringSerialize(body);
|
var result = api_instance.fakeOuterStringSerialize(body);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->fakeOuterStringSerialize: $e\n");
|
print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
|||||||
try {
|
try {
|
||||||
api_instance.testBodyWithFileSchema(fileSchemaTestClass);
|
api_instance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testBodyWithFileSchema: $e\n");
|
print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ var user = new User(); // User |
|
|||||||
try {
|
try {
|
||||||
api_instance.testBodyWithQueryParams(query, user);
|
api_instance.testBodyWithQueryParams(query, user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testBodyWithQueryParams: $e\n");
|
print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ try {
|
|||||||
var result = api_instance.testClientModel(client);
|
var result = api_instance.testClientModel(client);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testClientModel: $e\n");
|
print('Exception when calling FakeApi->testClientModel: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ var callback = callback_example; // String | None
|
|||||||
try {
|
try {
|
||||||
api_instance.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback);
|
api_instance.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testEndpointParameters: $e\n");
|
print('Exception when calling FakeApi->testEndpointParameters: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -504,7 +504,7 @@ var enumFormString = enumFormString_example; // String | Form parameter enum tes
|
|||||||
try {
|
try {
|
||||||
api_instance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
api_instance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testEnumParameters: $e\n");
|
print('Exception when calling FakeApi->testEnumParameters: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -512,14 +512,14 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] [default to const []]
|
**enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] [default to const []]
|
||||||
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg']
|
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg']
|
||||||
**enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] [default to const []]
|
**enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] [default to const []]
|
||||||
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg']
|
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg']
|
||||||
**enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] [default to null]
|
**enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] [default to null]
|
||||||
**enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] [default to null]
|
**enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] [default to null]
|
||||||
**enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$']
|
**enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$']
|
||||||
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg']
|
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -561,7 +561,7 @@ var int64Group = 789; // int | Integer in group parameters
|
|||||||
try {
|
try {
|
||||||
api_instance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
api_instance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testGroupParameters: $e\n");
|
print('Exception when calling FakeApi->testGroupParameters: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -601,12 +601,12 @@ test inline additionalProperties
|
|||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
var api_instance = new FakeApi();
|
var api_instance = new FakeApi();
|
||||||
var requestBody = new BuiltMap<String, String>(); // BuiltMap<String, String> | request body
|
var requestBody = new BuiltMap<String, String>(); // BuiltMap<String, String> | request body
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.testInlineAdditionalProperties(requestBody);
|
api_instance.testInlineAdditionalProperties(requestBody);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testInlineAdditionalProperties: $e\n");
|
print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -614,7 +614,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**requestBody** | [**BuiltMap<String, String>**](String.md)| request body |
|
**requestBody** | [**BuiltMap<String, String>**](String.md)| request body |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -647,7 +647,7 @@ var param2 = param2_example; // String | field2
|
|||||||
try {
|
try {
|
||||||
api_instance.testJsonFormData(param, param2);
|
api_instance.testJsonFormData(param, param2);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testJsonFormData: $e\n");
|
print('Exception when calling FakeApi->testJsonFormData: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ var context = []; // BuiltList<String> |
|
|||||||
try {
|
try {
|
||||||
api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n");
|
print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -702,11 +702,11 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**pipe** | [**BuiltList<String>**](String.md)| | [default to const []]
|
**pipe** | [**BuiltList<String>**](String.md)| | [default to const []]
|
||||||
**ioutil** | [**BuiltList<String>**](String.md)| | [default to const []]
|
**ioutil** | [**BuiltList<String>**](String.md)| | [default to const []]
|
||||||
**http** | [**BuiltList<String>**](String.md)| | [default to const []]
|
**http** | [**BuiltList<String>**](String.md)| | [default to const []]
|
||||||
**url** | [**BuiltList<String>**](String.md)| | [default to const []]
|
**url** | [**BuiltList<String>**](String.md)| | [default to const []]
|
||||||
**context** | [**BuiltList<String>**](String.md)| | [default to const []]
|
**context** | [**BuiltList<String>**](String.md)| | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ try {
|
|||||||
var result = api_instance.testClassname(client);
|
var result = api_instance.testClassname(client);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling FakeClassnameTags123Api->testClassname: $e\n");
|
print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import 'package:openapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**file** | [**MultipartFile**](MultipartFile.md) | | [optional] [default to null]
|
**file** | [**MultipartFile**](MultipartFile.md) | | [optional] [default to null]
|
||||||
**files** | [**BuiltList<MultipartFile>**](MultipartFile.md) | | [optional] [default to const []]
|
**files** | [**BuiltList<MultipartFile>**](MultipartFile.md) | | [optional] [default to const []]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Name | Type | Description | Notes
|
|||||||
**uuid** | **String** | | [optional] [default to null]
|
**uuid** | **String** | | [optional] [default to null]
|
||||||
**password** | **String** | | [default to null]
|
**password** | **String** | | [default to null]
|
||||||
**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] [default to null]
|
**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] [default to null]
|
||||||
**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [default to null]
|
**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] [default to null]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**enumFormStringArray** | **BuiltList<String>** | Form parameter enum test (string array) | [optional] [default to const []]
|
**enumFormStringArray** | **BuiltList<String>** | Form parameter enum test (string array) | [optional] [default to const []]
|
||||||
**enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to '-efg']
|
**enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to '-efg']
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -8,10 +8,10 @@ import 'package:openapi/api.dart';
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}]
|
**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] [default to const {}]
|
||||||
**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] [default to const {}]
|
**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] [default to const {}]
|
||||||
**directMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}]
|
**directMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}]
|
||||||
**indirectMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}]
|
**indirectMap** | **BuiltMap<String, bool>** | | [optional] [default to const {}]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**uuid** | **String** | | [optional] [default to null]
|
**uuid** | **String** | | [optional] [default to null]
|
||||||
**dateTime** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
**dateTime** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
||||||
**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] [default to const {}]
|
**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] [default to const {}]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@ Name | Type | Description | Notes
|
|||||||
**stringProp** | **String** | | [optional] [default to null]
|
**stringProp** | **String** | | [optional] [default to null]
|
||||||
**dateProp** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
**dateProp** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
||||||
**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] [default to null]
|
||||||
**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
||||||
**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
||||||
**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] [default to const []]
|
||||||
**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
||||||
**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
||||||
**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] [default to const {}]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ Name | Type | Description | Notes
|
|||||||
**id** | **int** | | [optional] [default to null]
|
**id** | **int** | | [optional] [default to null]
|
||||||
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
**category** | [**Category**](Category.md) | | [optional] [default to null]
|
||||||
**name** | **String** | | [default to null]
|
**name** | **String** | | [default to null]
|
||||||
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
**photoUrls** | **BuiltList<String>** | | [default to const []]
|
||||||
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []]
|
||||||
**status** | **String** | pet status in the store | [optional] [default to null]
|
**status** | **String** | pet status in the store | [optional] [default to null]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -37,7 +37,7 @@ var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
|||||||
try {
|
try {
|
||||||
api_instance.addPet(pet);
|
api_instance.addPet(pet);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->addPet: $e\n");
|
print('Exception when calling PetApi->addPet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ var apiKey = apiKey_example; // String |
|
|||||||
try {
|
try {
|
||||||
api_instance.deletePet(petId, apiKey);
|
api_instance.deletePet(petId, apiKey);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->deletePet: $e\n");
|
print('Exception when calling PetApi->deletePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ try {
|
|||||||
var result = api_instance.findPetsByStatus(status);
|
var result = api_instance.findPetsByStatus(status);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByStatus: $e\n");
|
print('Exception when calling PetApi->findPetsByStatus: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ try {
|
|||||||
var result = api_instance.findPetsByTags(tags);
|
var result = api_instance.findPetsByTags(tags);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->findPetsByTags: $e\n");
|
print('Exception when calling PetApi->findPetsByTags: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
**tags** | [**BuiltList<String>**](String.md)| Tags to filter by | [default to const []]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ try {
|
|||||||
var result = api_instance.getPetById(petId);
|
var result = api_instance.getPetById(petId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->getPetById: $e\n");
|
print('Exception when calling PetApi->getPetById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ var pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
|||||||
try {
|
try {
|
||||||
api_instance.updatePet(pet);
|
api_instance.updatePet(pet);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePet: $e\n");
|
print('Exception when calling PetApi->updatePet: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ var status = status_example; // String | Updated status of the pet
|
|||||||
try {
|
try {
|
||||||
api_instance.updatePetWithForm(petId, name, status);
|
api_instance.updatePetWithForm(petId, name, status);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->updatePetWithForm: $e\n");
|
print('Exception when calling PetApi->updatePetWithForm: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ try {
|
|||||||
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
var result = api_instance.uploadFile(petId, additionalMetadata, file);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->uploadFile: $e\n");
|
print('Exception when calling PetApi->uploadFile: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ try {
|
|||||||
var result = api_instance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
var result = api_instance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling PetApi->uploadFileWithRequiredFile: $e\n");
|
print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ var orderId = orderId_example; // String | ID of the order that needs to be dele
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteOrder(orderId);
|
api_instance.deleteOrder(orderId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->deleteOrder: $e\n");
|
print('Exception when calling StoreApi->deleteOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ try {
|
|||||||
var result = api_instance.getInventory();
|
var result = api_instance.getInventory();
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getInventory: $e\n");
|
print('Exception when calling StoreApi->getInventory: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ try {
|
|||||||
var result = api_instance.getOrderById(orderId);
|
var result = api_instance.getOrderById(orderId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->getOrderById: $e\n");
|
print('Exception when calling StoreApi->getOrderById: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ try {
|
|||||||
var result = api_instance.placeOrder(order);
|
var result = api_instance.placeOrder(order);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling StoreApi->placeOrder: $e\n");
|
print('Exception when calling StoreApi->placeOrder: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ var user = new User(); // User | Created user object
|
|||||||
try {
|
try {
|
||||||
api_instance.createUser(user);
|
api_instance.createUser(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUser: $e\n");
|
print('Exception when calling UserApi->createUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -71,12 +71,12 @@ Creates list of users with given input array
|
|||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithArrayInput(user);
|
api_instance.createUsersWithArrayInput(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithArrayInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -111,12 +111,12 @@ Creates list of users with given input array
|
|||||||
import 'package:openapi/api.dart';
|
import 'package:openapi/api.dart';
|
||||||
|
|
||||||
var api_instance = new UserApi();
|
var api_instance = new UserApi();
|
||||||
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
var user = [new BuiltList<User>()]; // BuiltList<User> | List of user object
|
||||||
|
|
||||||
try {
|
try {
|
||||||
api_instance.createUsersWithListInput(user);
|
api_instance.createUsersWithListInput(user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->createUsersWithListInput: $e\n");
|
print('Exception when calling UserApi->createUsersWithListInput: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
**user** | [**BuiltList<User>**](User.md)| List of user object |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ var username = username_example; // String | The name that needs to be deleted
|
|||||||
try {
|
try {
|
||||||
api_instance.deleteUser(username);
|
api_instance.deleteUser(username);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->deleteUser: $e\n");
|
print('Exception when calling UserApi->deleteUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ try {
|
|||||||
var result = api_instance.getUserByName(username);
|
var result = api_instance.getUserByName(username);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->getUserByName: $e\n");
|
print('Exception when calling UserApi->getUserByName: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -241,7 +241,7 @@ try {
|
|||||||
var result = api_instance.loginUser(username, password);
|
var result = api_instance.loginUser(username, password);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->loginUser: $e\n");
|
print('Exception when calling UserApi->loginUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ var api_instance = new UserApi();
|
|||||||
try {
|
try {
|
||||||
api_instance.logoutUser();
|
api_instance.logoutUser();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->logoutUser: $e\n");
|
print('Exception when calling UserApi->logoutUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ var user = new User(); // User | Updated user object
|
|||||||
try {
|
try {
|
||||||
api_instance.updateUser(username, user);
|
api_instance.updateUser(username, user);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Exception when calling UserApi->updateUser: $e\n");
|
print('Exception when calling UserApi->updateUser: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class Openapi {
|
|||||||
|
|
||||||
Dio dio;
|
Dio dio;
|
||||||
Serializers serializers;
|
Serializers serializers;
|
||||||
String basePath = "http://petstore.swagger.io:80/v2";
|
String basePath = 'http://petstore.swagger.io:80/v2';
|
||||||
|
|
||||||
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
Openapi({this.dio, Serializers serializers, String basePathOverride, List<Interceptor> interceptors}) {
|
||||||
if (dio == null) {
|
if (dio == null) {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,19 +14,25 @@ class AnotherFakeApi {
|
|||||||
/// To test special tags
|
/// To test special tags
|
||||||
///
|
///
|
||||||
/// To test special tags and operation ID starting with number
|
/// To test special tags and operation ID starting with number
|
||||||
Future<Response<Client>>call123testSpecialTags(Client client,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Client>>call123testSpecialTags(
|
||||||
|
Client client, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/another-fake/dummy';
|
||||||
|
|
||||||
String _path = "/another-fake/dummy";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(client);
|
final serializedBody = _serializers.serialize(client);
|
||||||
final jsonclient = json.encode(serializedBody);
|
final jsonclient = json.encode(serializedBody);
|
||||||
@ -43,13 +48,12 @@ class AnotherFakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Client);
|
final serializer = _serializers.serializerForType(Client);
|
||||||
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -64,4 +68,5 @@ class AnotherFakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,20 +14,22 @@ class DefaultApi {
|
|||||||
///
|
///
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<InlineResponseDefault>>fooGet({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<InlineResponseDefault>>fooGet({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/foo';
|
||||||
|
|
||||||
String _path = "/foo";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -40,13 +41,12 @@ class DefaultApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(InlineResponseDefault);
|
final serializer = _serializers.serializerForType(InlineResponseDefault);
|
||||||
final data = _serializers.deserializeWith<InlineResponseDefault>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<InlineResponseDefault>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -61,4 +61,5 @@ class DefaultApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -23,20 +22,22 @@ class FakeApi {
|
|||||||
/// Health check endpoint
|
/// Health check endpoint
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<HealthCheckResult>>fakeHealthGet({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<HealthCheckResult>>fakeHealthGet({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/health';
|
||||||
|
|
||||||
String _path = "/fake/health";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -48,13 +49,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(HealthCheckResult);
|
final serializer = _serializers.serializerForType(HealthCheckResult);
|
||||||
final data = _serializers.deserializeWith<HealthCheckResult>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<HealthCheckResult>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -69,15 +69,23 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// test http signature authentication
|
/// test http signature authentication
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>fakeHttpSignatureTest(Pet pet,{ String query1,String header1,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>fakeHttpSignatureTest(
|
||||||
|
Pet pet, {
|
||||||
|
String query1,
|
||||||
|
String header1,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/http-signature-test';
|
||||||
|
|
||||||
String _path = "/fake/http-signature-test";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'header_1'] = header1;
|
headerParams[r'header_1'] = header1;
|
||||||
@ -85,8 +93,10 @@ class FakeApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(pet);
|
final serializedBody = _serializers.serialize(pet);
|
||||||
final jsonpet = json.encode(serializedBody);
|
final jsonpet = json.encode(serializedBody);
|
||||||
@ -100,31 +110,43 @@ class FakeApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "http", "name": "http_signature_test" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'http',
|
||||||
|
'name': 'http_signature_test',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// Test serialization of outer boolean types
|
/// Test serialization of outer boolean types
|
||||||
Future<Response<bool>>fakeOuterBooleanSerialize({ bool body,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<bool>>fakeOuterBooleanSerialize({
|
||||||
|
bool body,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/outer/boolean';
|
||||||
|
|
||||||
String _path = "/fake/outer/boolean";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -140,13 +162,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as bool;
|
final data = response.data as bool;
|
||||||
|
|
||||||
return Response<bool>(
|
return Response<bool>(
|
||||||
@ -160,22 +181,29 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// Test serialization of object with outer number type
|
/// Test serialization of object with outer number type
|
||||||
Future<Response<OuterComposite>>fakeOuterCompositeSerialize({ OuterComposite outerComposite,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<OuterComposite>>fakeOuterCompositeSerialize({
|
||||||
|
OuterComposite outerComposite,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/outer/composite';
|
||||||
|
|
||||||
String _path = "/fake/outer/composite";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(outerComposite);
|
final serializedBody = _serializers.serialize(outerComposite);
|
||||||
final jsonouterComposite = json.encode(serializedBody);
|
final jsonouterComposite = json.encode(serializedBody);
|
||||||
@ -191,13 +219,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(OuterComposite);
|
final serializer = _serializers.serializerForType(OuterComposite);
|
||||||
final data = _serializers.deserializeWith<OuterComposite>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<OuterComposite>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -212,22 +239,29 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// Test serialization of outer number types
|
/// Test serialization of outer number types
|
||||||
Future<Response<num>>fakeOuterNumberSerialize({ num body,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<num>>fakeOuterNumberSerialize({
|
||||||
|
num body,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/outer/number';
|
||||||
|
|
||||||
String _path = "/fake/outer/number";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -243,13 +277,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as num;
|
final data = response.data as num;
|
||||||
|
|
||||||
return Response<num>(
|
return Response<num>(
|
||||||
@ -263,22 +296,29 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// Test serialization of outer string types
|
/// Test serialization of outer string types
|
||||||
Future<Response<String>>fakeOuterStringSerialize({ String body,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<String>>fakeOuterStringSerialize({
|
||||||
|
String body,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/outer/string';
|
||||||
|
|
||||||
String _path = "/fake/outer/string";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(body);
|
final serializedBody = _serializers.serialize(body);
|
||||||
final jsonbody = json.encode(serializedBody);
|
final jsonbody = json.encode(serializedBody);
|
||||||
@ -294,13 +334,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as String;
|
final data = response.data as String;
|
||||||
|
|
||||||
return Response<String>(
|
return Response<String>(
|
||||||
@ -314,22 +353,29 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// For this test, the body for this request much reference a schema named `File`.
|
/// For this test, the body for this request much reference a schema named `File`.
|
||||||
Future<Response>testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testBodyWithFileSchema(
|
||||||
|
FileSchemaTestClass fileSchemaTestClass, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/body-with-file-schema';
|
||||||
|
|
||||||
String _path = "/fake/body-with-file-schema";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(fileSchemaTestClass);
|
final serializedBody = _serializers.serialize(fileSchemaTestClass);
|
||||||
final jsonfileSchemaTestClass = json.encode(serializedBody);
|
final jsonfileSchemaTestClass = json.encode(serializedBody);
|
||||||
@ -345,30 +391,38 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
///
|
|
||||||
///
|
|
||||||
///
|
|
||||||
Future<Response>testBodyWithQueryParams(String query,User user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
|
||||||
|
|
||||||
String _path = "/fake/body-with-query-params";
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
Future<Response>testBodyWithQueryParams(
|
||||||
|
String query,
|
||||||
|
User user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/body-with-query-params';
|
||||||
|
|
||||||
Map<String, dynamic> queryParams = {};
|
final Map<String, dynamic> queryParams = {};
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'query'] = query;
|
queryParams[r'query'] = query;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(user);
|
final serializedBody = _serializers.serialize(user);
|
||||||
final jsonuser = json.encode(serializedBody);
|
final jsonuser = json.encode(serializedBody);
|
||||||
@ -384,29 +438,36 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/// To test \"client\" model
|
|
||||||
|
/// To test \"client\" model
|
||||||
///
|
///
|
||||||
/// To test \"client\" model
|
/// To test \"client\" model
|
||||||
Future<Response<Client>>testClientModel(Client client,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Client>>testClientModel(
|
||||||
|
Client client, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake';
|
||||||
|
|
||||||
String _path = "/fake";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(client);
|
final serializedBody = _serializers.serialize(client);
|
||||||
final jsonclient = json.encode(serializedBody);
|
final jsonclient = json.encode(serializedBody);
|
||||||
@ -422,13 +483,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Client);
|
final serializer = _serializers.serializerForType(Client);
|
||||||
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -443,21 +503,42 @@ class FakeApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
///
|
///
|
||||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
Future<Response>testEndpointParameters(num number,double double_,String patternWithoutDelimiter,String byte,{ int integer,int int32,int int64,double float,String string,Uint8List binary,DateTime date,DateTime dateTime,String password,String callback,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testEndpointParameters(
|
||||||
|
num number,
|
||||||
|
double double_,
|
||||||
|
String patternWithoutDelimiter,
|
||||||
|
String byte, {
|
||||||
|
int integer,
|
||||||
|
int int32,
|
||||||
|
int int64,
|
||||||
|
double float,
|
||||||
|
String string,
|
||||||
|
Uint8List binary,
|
||||||
|
DateTime date,
|
||||||
|
DateTime dateTime,
|
||||||
|
String password,
|
||||||
|
String callback,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake';
|
||||||
|
|
||||||
String _path = "/fake";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['integer'] = parameterToString(_serializers, integer);
|
formData['integer'] = parameterToString(_serializers, integer);
|
||||||
@ -476,7 +557,6 @@ class FakeApi {
|
|||||||
formData['callback'] = parameterToString(_serializers, callback);
|
formData['callback'] = parameterToString(_serializers, callback);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -485,24 +565,42 @@ class FakeApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "http", "name": "http_basic_test" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'http',
|
||||||
|
'name': 'http_basic_test',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// To test enum parameters
|
/// To test enum parameters
|
||||||
///
|
///
|
||||||
/// To test enum parameters
|
/// To test enum parameters
|
||||||
Future<Response>testEnumParameters({ BuiltList<String> enumHeaderStringArray,String enumHeaderString,BuiltList<String> enumQueryStringArray,String enumQueryString,int enumQueryInteger,double enumQueryDouble,BuiltList<String> enumFormStringArray,String enumFormString,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testEnumParameters({
|
||||||
|
BuiltList<String> enumHeaderStringArray,
|
||||||
|
String enumHeaderString,
|
||||||
|
BuiltList<String> enumQueryStringArray,
|
||||||
|
String enumQueryString,
|
||||||
|
int enumQueryInteger,
|
||||||
|
double enumQueryDouble,
|
||||||
|
BuiltList<String> enumFormStringArray,
|
||||||
|
String enumFormString,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake';
|
||||||
|
|
||||||
String _path = "/fake";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'enum_header_string_array'] = enumHeaderStringArray;
|
headerParams[r'enum_header_string_array'] = enumHeaderStringArray;
|
||||||
@ -514,14 +612,15 @@ class FakeApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['enum_form_string_array'] = parameterToString(_serializers, enumFormStringArray);
|
formData['enum_form_string_array'] = parameterToString(_serializers, enumFormStringArray);
|
||||||
formData['enum_form_string'] = parameterToString(_serializers, enumFormString);
|
formData['enum_form_string'] = parameterToString(_serializers, enumFormString);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -532,22 +631,33 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fake endpoint to test group parameters (optional)
|
/// Fake endpoint to test group parameters (optional)
|
||||||
///
|
///
|
||||||
/// Fake endpoint to test group parameters (optional)
|
/// Fake endpoint to test group parameters (optional)
|
||||||
Future<Response>testGroupParameters(int requiredStringGroup,bool requiredBooleanGroup,int requiredInt64Group,{ int stringGroup,bool booleanGroup,int int64Group,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testGroupParameters(
|
||||||
|
int requiredStringGroup,
|
||||||
|
bool requiredBooleanGroup,
|
||||||
|
int requiredInt64Group, {
|
||||||
|
int stringGroup,
|
||||||
|
bool booleanGroup,
|
||||||
|
int int64Group,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake';
|
||||||
|
|
||||||
String _path = "/fake";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'required_boolean_group'] = requiredBooleanGroup;
|
headerParams[r'required_boolean_group'] = requiredBooleanGroup;
|
||||||
@ -559,9 +669,7 @@ class FakeApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -571,31 +679,43 @@ class FakeApi {
|
|||||||
method: 'delete'.toUpperCase(),
|
method: 'delete'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "http", "name": "bearer_test" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'http',
|
||||||
|
'name': 'bearer_test',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// test inline additionalProperties
|
/// test inline additionalProperties
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>testInlineAdditionalProperties(BuiltMap<String, String> requestBody,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testInlineAdditionalProperties(
|
||||||
|
BuiltMap<String, String> requestBody, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/inline-additionalProperties';
|
||||||
|
|
||||||
String _path = "/fake/inline-additionalProperties";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(requestBody);
|
final serializedBody = _serializers.serialize(requestBody);
|
||||||
final jsonrequestBody = json.encode(serializedBody);
|
final jsonrequestBody = json.encode(serializedBody);
|
||||||
@ -611,35 +731,43 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// test json serialization of form data
|
/// test json serialization of form data
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>testJsonFormData(String param,String param2,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testJsonFormData(
|
||||||
|
String param,
|
||||||
|
String param2, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/jsonFormData';
|
||||||
|
|
||||||
String _path = "/fake/jsonFormData";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['param'] = parameterToString(_serializers, param);
|
formData['param'] = parameterToString(_serializers, param);
|
||||||
formData['param2'] = parameterToString(_serializers, param2);
|
formData['param2'] = parameterToString(_serializers, param2);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -650,22 +778,32 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
/// To test the collection format in query parameters
|
/// To test the collection format in query parameters
|
||||||
Future<Response>testQueryParameterCollectionFormat(BuiltList<String> pipe,BuiltList<String> ioutil,BuiltList<String> http,BuiltList<String> url,BuiltList<String> context,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>testQueryParameterCollectionFormat(
|
||||||
|
BuiltList<String> pipe,
|
||||||
|
BuiltList<String> ioutil,
|
||||||
|
BuiltList<String> http,
|
||||||
|
BuiltList<String> url,
|
||||||
|
BuiltList<String> context, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/test-query-paramters';
|
||||||
|
|
||||||
String _path = "/fake/test-query-paramters";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'pipe'] = pipe;
|
queryParams[r'pipe'] = pipe;
|
||||||
@ -676,9 +814,7 @@ class FakeApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -690,11 +826,12 @@ class FakeApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,19 +14,25 @@ class FakeClassnameTags123Api {
|
|||||||
/// To test class name in snake case
|
/// To test class name in snake case
|
||||||
///
|
///
|
||||||
/// To test class name in snake case
|
/// To test class name in snake case
|
||||||
Future<Response<Client>>testClassname(Client client,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Client>>testClassname(
|
||||||
|
Client client, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake_classname_test';
|
||||||
|
|
||||||
String _path = "/fake_classname_test";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(client);
|
final serializedBody = _serializers.serialize(client);
|
||||||
final jsonclient = json.encode(serializedBody);
|
final jsonclient = json.encode(serializedBody);
|
||||||
@ -41,15 +46,21 @@ class FakeClassnameTags123Api {
|
|||||||
method: 'patch'.toUpperCase(),
|
method: 'patch'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key_query", "keyName": "api_key_query", "where": "query" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key_query',
|
||||||
|
'keyName': 'api_key_query',
|
||||||
|
'where': 'query',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Client);
|
final serializer = _serializers.serializerForType(Client);
|
||||||
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Client>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -64,4 +75,5 @@ class FakeClassnameTags123Api {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -19,19 +18,26 @@ class PetApi {
|
|||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>addPet(Pet pet,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>addPet(
|
||||||
|
Pet pet, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(pet);
|
final serializedBody = _serializers.serialize(pet);
|
||||||
final jsonpet = json.encode(serializedBody);
|
final jsonpet = json.encode(serializedBody);
|
||||||
@ -45,33 +51,43 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Deletes a pet
|
/// Deletes a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>deletePet(int petId,{ String apiKey,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deletePet(
|
||||||
|
int petId, {
|
||||||
|
String apiKey,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
headerParams[r'api_key'] = apiKey;
|
headerParams[r'api_key'] = apiKey;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -81,33 +97,42 @@ class PetApi {
|
|||||||
method: 'delete'.toUpperCase(),
|
method: 'delete'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by status
|
/// Finds Pets by status
|
||||||
///
|
///
|
||||||
/// Multiple status values can be provided with comma separated strings
|
/// Multiple status values can be provided with comma separated strings
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByStatus(BuiltList<String> status,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByStatus(
|
||||||
|
BuiltList<String> status, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByStatus';
|
||||||
|
|
||||||
String _path = "/pet/findByStatus";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'status'] = status;
|
queryParams[r'status'] = status;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -117,15 +142,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -141,24 +170,28 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds Pets by tags
|
/// Finds Pets by tags
|
||||||
///
|
///
|
||||||
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
Future<Response<BuiltList<Pet>>>findPetsByTags(BuiltList<String> tags,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltList<Pet>>>findPetsByTags(
|
||||||
|
BuiltList<String> tags, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/findByTags';
|
||||||
|
|
||||||
String _path = "/pet/findByTags";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'tags'] = tags;
|
queryParams[r'tags'] = tags;
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -168,15 +201,19 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltList;
|
const collectionType = BuiltList;
|
||||||
const type = FullType(collectionType, [FullType(Pet)]);
|
const type = FullType(collectionType, [FullType(Pet)]);
|
||||||
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltList<Pet> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -192,23 +229,27 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find pet by ID
|
/// Find pet by ID
|
||||||
///
|
///
|
||||||
/// Returns a single pet
|
/// Returns a single pet
|
||||||
Future<Response<Pet>>getPetById(int petId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Pet>>getPetById(
|
||||||
|
int petId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -218,15 +259,21 @@ class PetApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Pet);
|
final serializer = _serializers.serializerForType(Pet);
|
||||||
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Pet>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -241,22 +288,30 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>updatePet(Pet pet,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updatePet(
|
||||||
|
Pet pet, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet';
|
||||||
|
|
||||||
String _path = "/pet";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json","application/xml"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
'application/xml',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(pet);
|
final serializedBody = _serializers.serialize(pet);
|
||||||
final jsonpet = json.encode(serializedBody);
|
final jsonpet = json.encode(serializedBody);
|
||||||
@ -270,37 +325,51 @@ class PetApi {
|
|||||||
method: 'put'.toUpperCase(),
|
method: 'put'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updates a pet in the store with form data
|
/// Updates a pet in the store with form data
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>updatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updatePetWithForm(
|
||||||
|
int petId, {
|
||||||
|
String name,
|
||||||
|
String status,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
final List<String> contentTypes = [
|
||||||
|
'application/x-www-form-urlencoded',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
formData['name'] = parameterToString(_serializers, name);
|
formData['name'] = parameterToString(_serializers, name);
|
||||||
formData['status'] = parameterToString(_serializers, status);
|
formData['status'] = parameterToString(_serializers, status);
|
||||||
bodyData = formData;
|
bodyData = formData;
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -309,30 +378,45 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uploads an image
|
/// uploads an image
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<ApiResponse>>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<ApiResponse>>uploadFile(
|
||||||
|
int petId, {
|
||||||
|
String additionalMetadata,
|
||||||
|
Uint8List file,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["multipart/form-data"];
|
final List<String> contentTypes = [
|
||||||
|
'multipart/form-data',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
if (additionalMetadata != null) {
|
if (additionalMetadata != null) {
|
||||||
@ -343,7 +427,6 @@ class PetApi {
|
|||||||
}
|
}
|
||||||
bodyData = FormData.fromMap(formData);
|
bodyData = FormData.fromMap(formData);
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -352,15 +435,19 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(ApiResponse);
|
final serializer = _serializers.serializerForType(ApiResponse);
|
||||||
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -375,21 +462,31 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// uploads an image (required)
|
/// uploads an image (required)
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<ApiResponse>>uploadFileWithRequiredFile(int petId,Uint8List requiredFile,{ String additionalMetadata,CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<ApiResponse>>uploadFileWithRequiredFile(
|
||||||
|
int petId,
|
||||||
|
Uint8List requiredFile, {
|
||||||
|
String additionalMetadata,
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString());
|
||||||
|
|
||||||
String _path = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("{" r'petId' "}", petId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["multipart/form-data"];
|
final List<String> contentTypes = [
|
||||||
|
'multipart/form-data',
|
||||||
|
];
|
||||||
|
|
||||||
final Map<String, dynamic> formData = {};
|
final Map<String, dynamic> formData = {};
|
||||||
if (additionalMetadata != null) {
|
if (additionalMetadata != null) {
|
||||||
@ -400,7 +497,6 @@ class PetApi {
|
|||||||
}
|
}
|
||||||
bodyData = FormData.fromMap(formData);
|
bodyData = FormData.fromMap(formData);
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
queryParameters: queryParams,
|
queryParameters: queryParams,
|
||||||
@ -409,15 +505,19 @@ class PetApi {
|
|||||||
method: 'post'.toUpperCase(),
|
method: 'post'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "oauth2", "name": "petstore_auth" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'oauth2',
|
||||||
|
'name': 'petstore_auth',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(ApiResponse);
|
final serializer = _serializers.serializerForType(ApiResponse);
|
||||||
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<ApiResponse>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -432,4 +532,5 @@ class PetApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -15,21 +14,24 @@ class StoreApi {
|
|||||||
|
|
||||||
/// Delete purchase order by ID
|
/// Delete purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
Future<Response>deleteOrder(String orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteOrder(
|
||||||
|
String orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{order_id}".replaceAll("{" r'order_id' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -41,30 +43,33 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns pet inventories by status
|
/// Returns pet inventories by status
|
||||||
///
|
///
|
||||||
/// Returns a map of status codes to quantities
|
/// Returns a map of status codes to quantities
|
||||||
Future<Response<BuiltMap<String, int>>>getInventory({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<BuiltMap<String, int>>>getInventory({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/inventory';
|
||||||
|
|
||||||
String _path = "/store/inventory";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -74,15 +79,21 @@ class StoreApi {
|
|||||||
method: 'get'.toUpperCase(),
|
method: 'get'.toUpperCase(),
|
||||||
headers: headerParams,
|
headers: headerParams,
|
||||||
extra: {
|
extra: {
|
||||||
'secure': [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }],
|
'secure': [
|
||||||
|
{
|
||||||
|
'type': 'apiKey',
|
||||||
|
'name': 'api_key',
|
||||||
|
'keyName': 'api_key',
|
||||||
|
'where': 'header',
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
],
|
||||||
|
},
|
||||||
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
const collectionType = BuiltMap;
|
const collectionType = BuiltMap;
|
||||||
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
const type = FullType(collectionType, [FullType(String), FullType(int)]);
|
||||||
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
final BuiltMap<String, int> data = _serializers.deserialize(response.data is String ? jsonDecode(response.data) : response.data, specifiedType: type);
|
||||||
@ -98,23 +109,27 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find purchase order by ID
|
/// Find purchase order by ID
|
||||||
///
|
///
|
||||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
Future<Response<Order>>getOrderById(int orderId,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>getOrderById(
|
||||||
|
int orderId, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString());
|
||||||
|
|
||||||
String _path = "/store/order/{order_id}".replaceAll("{" r'order_id' "}", orderId.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -126,13 +141,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -147,22 +161,29 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<Order>>placeOrder(Order order,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<Order>>placeOrder(
|
||||||
|
Order order, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/store/order';
|
||||||
|
|
||||||
String _path = "/store/order";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(order);
|
final serializedBody = _serializers.serialize(order);
|
||||||
final jsonorder = json.encode(serializedBody);
|
final jsonorder = json.encode(serializedBody);
|
||||||
@ -178,13 +199,12 @@ class StoreApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(Order);
|
final serializer = _serializers.serializerForType(Order);
|
||||||
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<Order>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -199,4 +219,5 @@ class StoreApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:built_value/serializer.dart';
|
import 'package:built_value/serializer.dart';
|
||||||
@ -16,19 +15,25 @@ class UserApi {
|
|||||||
/// Create user
|
/// Create user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>createUser(User user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUser(
|
||||||
|
User user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user';
|
||||||
|
|
||||||
String _path = "/user";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(user);
|
final serializedBody = _serializers.serialize(user);
|
||||||
final jsonuser = json.encode(serializedBody);
|
final jsonuser = json.encode(serializedBody);
|
||||||
@ -44,29 +49,36 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithArrayInput(BuiltList<User> user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithArrayInput(
|
||||||
|
BuiltList<User> user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithArray';
|
||||||
|
|
||||||
String _path = "/user/createWithArray";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
||||||
@ -83,29 +95,36 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>createUsersWithListInput(BuiltList<User> user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>createUsersWithListInput(
|
||||||
|
BuiltList<User> user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/createWithList';
|
||||||
|
|
||||||
String _path = "/user/createWithList";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
const type = FullType(BuiltList, [FullType(User)]);
|
const type = FullType(BuiltList, [FullType(User)]);
|
||||||
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
final serializedBody = _serializers.serialize(user, specifiedType: type);
|
||||||
@ -122,30 +141,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete user
|
/// Delete user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>deleteUser(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>deleteUser(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -157,30 +180,34 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get user by user name
|
/// Get user by user name
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<User>>getUserByName(String username,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<User>>getUserByName(
|
||||||
|
String username, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -192,13 +219,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final serializer = _serializers.serializerForType(User);
|
final serializer = _serializers.serializerForType(User);
|
||||||
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
final data = _serializers.deserializeWith<User>(serializer, response.data is String ? jsonDecode(response.data) : response.data);
|
||||||
|
|
||||||
@ -213,15 +239,22 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs user into the system
|
/// Logs user into the system
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response<String>>loginUser(String username,String password,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response<String>>loginUser(
|
||||||
|
String username,
|
||||||
|
String password, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/login';
|
||||||
|
|
||||||
String _path = "/user/login";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams[r'username'] = username;
|
queryParams[r'username'] = username;
|
||||||
@ -229,9 +262,7 @@ class UserApi {
|
|||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -243,13 +274,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
).then((response) {
|
).then((response) {
|
||||||
|
|
||||||
final data = response.data as String;
|
final data = response.data as String;
|
||||||
|
|
||||||
return Response<String>(
|
return Response<String>(
|
||||||
@ -263,23 +293,26 @@ class UserApi {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Logs out current logged in user session
|
/// Logs out current logged in user session
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
Future<Response>logoutUser({ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>logoutUser({
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/logout';
|
||||||
|
|
||||||
String _path = "/user/logout";
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = [];
|
final List<String> contentTypes = [];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return _dio.request(
|
return _dio.request(
|
||||||
_path,
|
_path,
|
||||||
@ -291,29 +324,37 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Updated user
|
/// Updated user
|
||||||
///
|
///
|
||||||
/// This can only be done by the logged in user.
|
/// This can only be done by the logged in user.
|
||||||
Future<Response>updateUser(String username,User user,{ CancelToken cancelToken, Map<String, String> headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async {
|
Future<Response>updateUser(
|
||||||
|
String username,
|
||||||
|
User user, {
|
||||||
|
CancelToken cancelToken,
|
||||||
|
Map<String, String> headers,
|
||||||
|
ProgressCallback onSendProgress,
|
||||||
|
ProgressCallback onReceiveProgress,
|
||||||
|
}) async {
|
||||||
|
final String _path = '/user/{username}'.replaceAll('{' r'username' '}', username.toString());
|
||||||
|
|
||||||
String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString());
|
final Map<String, dynamic> queryParams = {};
|
||||||
|
final Map<String, String> headerParams = Map.from(headers ?? {});
|
||||||
Map<String, dynamic> queryParams = {};
|
|
||||||
Map<String, String> headerParams = Map.from(headers ?? {});
|
|
||||||
dynamic bodyData;
|
dynamic bodyData;
|
||||||
|
|
||||||
queryParams.removeWhere((key, value) => value == null);
|
queryParams.removeWhere((key, value) => value == null);
|
||||||
headerParams.removeWhere((key, value) => value == null);
|
headerParams.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
List<String> contentTypes = ["application/json"];
|
final List<String> contentTypes = [
|
||||||
|
'application/json',
|
||||||
|
];
|
||||||
|
|
||||||
final serializedBody = _serializers.serialize(user);
|
final serializedBody = _serializers.serialize(user);
|
||||||
final jsonuser = json.encode(serializedBody);
|
final jsonuser = json.encode(serializedBody);
|
||||||
@ -329,11 +370,12 @@ class UserApi {
|
|||||||
extra: {
|
extra: {
|
||||||
'secure': [],
|
'secure': [],
|
||||||
},
|
},
|
||||||
contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json",
|
contentType: contentTypes.isNotEmpty ? contentTypes[0] : 'application/json',
|
||||||
),
|
),
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
onSendProgress: onSendProgress,
|
onSendProgress: onSendProgress,
|
||||||
onReceiveProgress: onReceiveProgress,
|
onReceiveProgress: onReceiveProgress,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}
|
||||||
|
@ -6,7 +6,6 @@ part 'additional_properties_class.g.dart';
|
|||||||
|
|
||||||
abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
|
abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'map_property')
|
@BuiltValueField(wireName: r'map_property')
|
||||||
BuiltMap<String, String> get mapProperty;
|
BuiltMap<String, String> get mapProperty;
|
||||||
|
@ -5,7 +5,6 @@ part 'animal.g.dart';
|
|||||||
|
|
||||||
abstract class Animal implements Built<Animal, AnimalBuilder> {
|
abstract class Animal implements Built<Animal, AnimalBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'className')
|
@BuiltValueField(wireName: r'className')
|
||||||
String get className;
|
String get className;
|
||||||
|
@ -5,7 +5,6 @@ part 'api_response.g.dart';
|
|||||||
|
|
||||||
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'code')
|
@BuiltValueField(wireName: r'code')
|
||||||
int get code;
|
int get code;
|
||||||
|
@ -6,7 +6,6 @@ part 'array_of_array_of_number_only.g.dart';
|
|||||||
|
|
||||||
abstract class ArrayOfArrayOfNumberOnly implements Built<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilder> {
|
abstract class ArrayOfArrayOfNumberOnly implements Built<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'ArrayArrayNumber')
|
@BuiltValueField(wireName: r'ArrayArrayNumber')
|
||||||
BuiltList<BuiltList<num>> get arrayArrayNumber;
|
BuiltList<BuiltList<num>> get arrayArrayNumber;
|
||||||
|
@ -6,7 +6,6 @@ part 'array_of_number_only.g.dart';
|
|||||||
|
|
||||||
abstract class ArrayOfNumberOnly implements Built<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilder> {
|
abstract class ArrayOfNumberOnly implements Built<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'ArrayNumber')
|
@BuiltValueField(wireName: r'ArrayNumber')
|
||||||
BuiltList<num> get arrayNumber;
|
BuiltList<num> get arrayNumber;
|
||||||
|
@ -7,7 +7,6 @@ part 'array_test.g.dart';
|
|||||||
|
|
||||||
abstract class ArrayTest implements Built<ArrayTest, ArrayTestBuilder> {
|
abstract class ArrayTest implements Built<ArrayTest, ArrayTestBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'array_of_string')
|
@BuiltValueField(wireName: r'array_of_string')
|
||||||
BuiltList<String> get arrayOfString;
|
BuiltList<String> get arrayOfString;
|
||||||
|
@ -5,7 +5,6 @@ part 'capitalization.g.dart';
|
|||||||
|
|
||||||
abstract class Capitalization implements Built<Capitalization, CapitalizationBuilder> {
|
abstract class Capitalization implements Built<Capitalization, CapitalizationBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'smallCamel')
|
@BuiltValueField(wireName: r'smallCamel')
|
||||||
String get smallCamel;
|
String get smallCamel;
|
||||||
@ -25,7 +24,8 @@ abstract class Capitalization implements Built<Capitalization, CapitalizationBui
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'SCA_ETH_Flow_Points')
|
@BuiltValueField(wireName: r'SCA_ETH_Flow_Points')
|
||||||
String get sCAETHFlowPoints;
|
String get sCAETHFlowPoints;
|
||||||
/* Name of the pet */
|
|
||||||
|
/// Name of the pet
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'ATT_NAME')
|
@BuiltValueField(wireName: r'ATT_NAME')
|
||||||
String get ATT_NAME;
|
String get ATT_NAME;
|
||||||
|
@ -7,7 +7,6 @@ part 'cat.g.dart';
|
|||||||
|
|
||||||
abstract class Cat implements Built<Cat, CatBuilder> {
|
abstract class Cat implements Built<Cat, CatBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'className')
|
@BuiltValueField(wireName: r'className')
|
||||||
String get className;
|
String get className;
|
||||||
|
@ -5,7 +5,6 @@ part 'cat_all_of.g.dart';
|
|||||||
|
|
||||||
abstract class CatAllOf implements Built<CatAllOf, CatAllOfBuilder> {
|
abstract class CatAllOf implements Built<CatAllOf, CatAllOfBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'declawed')
|
@BuiltValueField(wireName: r'declawed')
|
||||||
bool get declawed;
|
bool get declawed;
|
||||||
|
@ -5,7 +5,6 @@ part 'category.g.dart';
|
|||||||
|
|
||||||
abstract class Category implements Built<Category, CategoryBuilder> {
|
abstract class Category implements Built<Category, CategoryBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'id')
|
@BuiltValueField(wireName: r'id')
|
||||||
int get id;
|
int get id;
|
||||||
|
@ -5,7 +5,6 @@ part 'class_model.g.dart';
|
|||||||
|
|
||||||
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
|
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'_class')
|
@BuiltValueField(wireName: r'_class')
|
||||||
String get class_;
|
String get class_;
|
||||||
|
@ -5,7 +5,6 @@ part 'client.g.dart';
|
|||||||
|
|
||||||
abstract class Client implements Built<Client, ClientBuilder> {
|
abstract class Client implements Built<Client, ClientBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'client')
|
@BuiltValueField(wireName: r'client')
|
||||||
String get client;
|
String get client;
|
||||||
|
@ -7,7 +7,6 @@ part 'dog.g.dart';
|
|||||||
|
|
||||||
abstract class Dog implements Built<Dog, DogBuilder> {
|
abstract class Dog implements Built<Dog, DogBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'className')
|
@BuiltValueField(wireName: r'className')
|
||||||
String get className;
|
String get className;
|
||||||
|
@ -5,7 +5,6 @@ part 'dog_all_of.g.dart';
|
|||||||
|
|
||||||
abstract class DogAllOf implements Built<DogAllOf, DogAllOfBuilder> {
|
abstract class DogAllOf implements Built<DogAllOf, DogAllOfBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'breed')
|
@BuiltValueField(wireName: r'breed')
|
||||||
String get breed;
|
String get breed;
|
||||||
|
@ -6,11 +6,10 @@ part 'enum_arrays.g.dart';
|
|||||||
|
|
||||||
abstract class EnumArrays implements Built<EnumArrays, EnumArraysBuilder> {
|
abstract class EnumArrays implements Built<EnumArrays, EnumArraysBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'just_symbol')
|
@BuiltValueField(wireName: r'just_symbol')
|
||||||
EnumArraysJustSymbolEnum get justSymbol;
|
EnumArraysJustSymbolEnum get justSymbol;
|
||||||
// enum justSymbolEnum { >=, $, };
|
// enum justSymbolEnum { >=, $, };
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'array_enum')
|
@BuiltValueField(wireName: r'array_enum')
|
||||||
|
@ -10,7 +10,6 @@ part 'enum_test.g.dart';
|
|||||||
|
|
||||||
abstract class EnumTest implements Built<EnumTest, EnumTestBuilder> {
|
abstract class EnumTest implements Built<EnumTest, EnumTestBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'enum_string')
|
@BuiltValueField(wireName: r'enum_string')
|
||||||
EnumTestEnumStringEnum get enumString;
|
EnumTestEnumStringEnum get enumString;
|
||||||
|
@ -5,7 +5,7 @@ part 'file.g.dart';
|
|||||||
|
|
||||||
abstract class File implements Built<File, FileBuilder> {
|
abstract class File implements Built<File, FileBuilder> {
|
||||||
|
|
||||||
/* Test capitalization */
|
/// Test capitalization
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'sourceURI')
|
@BuiltValueField(wireName: r'sourceURI')
|
||||||
String get sourceURI;
|
String get sourceURI;
|
||||||
|
@ -7,7 +7,6 @@ part 'file_schema_test_class.g.dart';
|
|||||||
|
|
||||||
abstract class FileSchemaTestClass implements Built<FileSchemaTestClass, FileSchemaTestClassBuilder> {
|
abstract class FileSchemaTestClass implements Built<FileSchemaTestClass, FileSchemaTestClassBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'file')
|
@BuiltValueField(wireName: r'file')
|
||||||
MultipartFile get file;
|
MultipartFile get file;
|
||||||
|
@ -5,7 +5,6 @@ part 'foo.g.dart';
|
|||||||
|
|
||||||
abstract class Foo implements Built<Foo, FooBuilder> {
|
abstract class Foo implements Built<Foo, FooBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'bar')
|
@BuiltValueField(wireName: r'bar')
|
||||||
String get bar;
|
String get bar;
|
||||||
|
@ -6,7 +6,6 @@ part 'format_test.g.dart';
|
|||||||
|
|
||||||
abstract class FormatTest implements Built<FormatTest, FormatTestBuilder> {
|
abstract class FormatTest implements Built<FormatTest, FormatTestBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'integer')
|
@BuiltValueField(wireName: r'integer')
|
||||||
int get integer;
|
int get integer;
|
||||||
@ -62,11 +61,13 @@ abstract class FormatTest implements Built<FormatTest, FormatTestBuilder> {
|
|||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'password')
|
@BuiltValueField(wireName: r'password')
|
||||||
String get password;
|
String get password;
|
||||||
/* A string that is a 10 digit number. Can have leading zeros. */
|
|
||||||
|
/// A string that is a 10 digit number. Can have leading zeros.
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'pattern_with_digits')
|
@BuiltValueField(wireName: r'pattern_with_digits')
|
||||||
String get patternWithDigits;
|
String get patternWithDigits;
|
||||||
/* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */
|
|
||||||
|
/// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'pattern_with_digits_and_delimiter')
|
@BuiltValueField(wireName: r'pattern_with_digits_and_delimiter')
|
||||||
String get patternWithDigitsAndDelimiter;
|
String get patternWithDigitsAndDelimiter;
|
||||||
|
@ -5,7 +5,6 @@ part 'has_only_read_only.g.dart';
|
|||||||
|
|
||||||
abstract class HasOnlyReadOnly implements Built<HasOnlyReadOnly, HasOnlyReadOnlyBuilder> {
|
abstract class HasOnlyReadOnly implements Built<HasOnlyReadOnly, HasOnlyReadOnlyBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'bar')
|
@BuiltValueField(wireName: r'bar')
|
||||||
String get bar;
|
String get bar;
|
||||||
|
@ -5,7 +5,6 @@ part 'health_check_result.g.dart';
|
|||||||
|
|
||||||
abstract class HealthCheckResult implements Built<HealthCheckResult, HealthCheckResultBuilder> {
|
abstract class HealthCheckResult implements Built<HealthCheckResult, HealthCheckResultBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'NullableMessage')
|
@BuiltValueField(wireName: r'NullableMessage')
|
||||||
String get nullableMessage;
|
String get nullableMessage;
|
||||||
|
@ -5,11 +5,12 @@ part 'inline_object.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject implements Built<InlineObject, InlineObjectBuilder> {
|
abstract class InlineObject implements Built<InlineObject, InlineObjectBuilder> {
|
||||||
|
|
||||||
/* Updated name of the pet */
|
/// Updated name of the pet
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'name')
|
@BuiltValueField(wireName: r'name')
|
||||||
String get name;
|
String get name;
|
||||||
/* Updated status of the pet */
|
|
||||||
|
/// Updated status of the pet
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'status')
|
@BuiltValueField(wireName: r'status')
|
||||||
String get status;
|
String get status;
|
||||||
|
@ -6,11 +6,12 @@ part 'inline_object1.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject1 implements Built<InlineObject1, InlineObject1Builder> {
|
abstract class InlineObject1 implements Built<InlineObject1, InlineObject1Builder> {
|
||||||
|
|
||||||
/* Additional data to pass to server */
|
/// Additional data to pass to server
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'additionalMetadata')
|
@BuiltValueField(wireName: r'additionalMetadata')
|
||||||
String get additionalMetadata;
|
String get additionalMetadata;
|
||||||
/* file to upload */
|
|
||||||
|
/// file to upload
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'file')
|
@BuiltValueField(wireName: r'file')
|
||||||
Uint8List get file;
|
Uint8List get file;
|
||||||
|
@ -6,12 +6,13 @@ part 'inline_object2.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject2 implements Built<InlineObject2, InlineObject2Builder> {
|
abstract class InlineObject2 implements Built<InlineObject2, InlineObject2Builder> {
|
||||||
|
|
||||||
/* Form parameter enum test (string array) */
|
/// Form parameter enum test (string array)
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'enum_form_string_array')
|
@BuiltValueField(wireName: r'enum_form_string_array')
|
||||||
BuiltList<InlineObject2EnumFormStringArrayEnum> get enumFormStringArray;
|
BuiltList<InlineObject2EnumFormStringArrayEnum> get enumFormStringArray;
|
||||||
// enum enumFormStringArrayEnum { >, $, };
|
// enum enumFormStringArrayEnum { >, $, };
|
||||||
/* Form parameter enum test (string) */
|
|
||||||
|
/// Form parameter enum test (string)
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'enum_form_string')
|
@BuiltValueField(wireName: r'enum_form_string')
|
||||||
InlineObject2EnumFormStringEnum get enumFormString;
|
InlineObject2EnumFormStringEnum get enumFormString;
|
||||||
|
@ -6,59 +6,72 @@ part 'inline_object3.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject3 implements Built<InlineObject3, InlineObject3Builder> {
|
abstract class InlineObject3 implements Built<InlineObject3, InlineObject3Builder> {
|
||||||
|
|
||||||
/* None */
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'integer')
|
@BuiltValueField(wireName: r'integer')
|
||||||
int get integer;
|
int get integer;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'int32')
|
@BuiltValueField(wireName: r'int32')
|
||||||
int get int32;
|
int get int32;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'int64')
|
@BuiltValueField(wireName: r'int64')
|
||||||
int get int64;
|
int get int64;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'number')
|
@BuiltValueField(wireName: r'number')
|
||||||
num get number;
|
num get number;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'float')
|
@BuiltValueField(wireName: r'float')
|
||||||
double get float;
|
double get float;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'double')
|
@BuiltValueField(wireName: r'double')
|
||||||
double get double_;
|
double get double_;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'string')
|
@BuiltValueField(wireName: r'string')
|
||||||
String get string;
|
String get string;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'pattern_without_delimiter')
|
@BuiltValueField(wireName: r'pattern_without_delimiter')
|
||||||
String get patternWithoutDelimiter;
|
String get patternWithoutDelimiter;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'byte')
|
@BuiltValueField(wireName: r'byte')
|
||||||
String get byte;
|
String get byte;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'binary')
|
@BuiltValueField(wireName: r'binary')
|
||||||
Uint8List get binary;
|
Uint8List get binary;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'date')
|
@BuiltValueField(wireName: r'date')
|
||||||
DateTime get date;
|
DateTime get date;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'dateTime')
|
@BuiltValueField(wireName: r'dateTime')
|
||||||
DateTime get dateTime;
|
DateTime get dateTime;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'password')
|
@BuiltValueField(wireName: r'password')
|
||||||
String get password;
|
String get password;
|
||||||
/* None */
|
|
||||||
|
/// None
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'callback')
|
@BuiltValueField(wireName: r'callback')
|
||||||
String get callback;
|
String get callback;
|
||||||
|
@ -5,11 +5,12 @@ part 'inline_object4.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject4 implements Built<InlineObject4, InlineObject4Builder> {
|
abstract class InlineObject4 implements Built<InlineObject4, InlineObject4Builder> {
|
||||||
|
|
||||||
/* field1 */
|
/// field1
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'param')
|
@BuiltValueField(wireName: r'param')
|
||||||
String get param;
|
String get param;
|
||||||
/* field2 */
|
|
||||||
|
/// field2
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'param2')
|
@BuiltValueField(wireName: r'param2')
|
||||||
String get param2;
|
String get param2;
|
||||||
|
@ -6,11 +6,12 @@ part 'inline_object5.g.dart';
|
|||||||
|
|
||||||
abstract class InlineObject5 implements Built<InlineObject5, InlineObject5Builder> {
|
abstract class InlineObject5 implements Built<InlineObject5, InlineObject5Builder> {
|
||||||
|
|
||||||
/* Additional data to pass to server */
|
/// Additional data to pass to server
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'additionalMetadata')
|
@BuiltValueField(wireName: r'additionalMetadata')
|
||||||
String get additionalMetadata;
|
String get additionalMetadata;
|
||||||
/* file to upload */
|
|
||||||
|
/// file to upload
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'requiredFile')
|
@BuiltValueField(wireName: r'requiredFile')
|
||||||
Uint8List get requiredFile;
|
Uint8List get requiredFile;
|
||||||
|
@ -6,7 +6,6 @@ part 'inline_response_default.g.dart';
|
|||||||
|
|
||||||
abstract class InlineResponseDefault implements Built<InlineResponseDefault, InlineResponseDefaultBuilder> {
|
abstract class InlineResponseDefault implements Built<InlineResponseDefault, InlineResponseDefaultBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'string')
|
@BuiltValueField(wireName: r'string')
|
||||||
Foo get string;
|
Foo get string;
|
||||||
|
@ -6,7 +6,6 @@ part 'map_test.g.dart';
|
|||||||
|
|
||||||
abstract class MapTest implements Built<MapTest, MapTestBuilder> {
|
abstract class MapTest implements Built<MapTest, MapTestBuilder> {
|
||||||
|
|
||||||
|
|
||||||
@nullable
|
@nullable
|
||||||
@BuiltValueField(wireName: r'map_map_of_string')
|
@BuiltValueField(wireName: r'map_map_of_string')
|
||||||
BuiltMap<String, BuiltMap<String, String>> get mapMapOfString;
|
BuiltMap<String, BuiltMap<String, String>> get mapMapOfString;
|
||||||
|
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