Dart json_serializable: remove experimental generator (#10532)

This commit is contained in:
agilob 2021-10-12 09:07:23 +01:00 committed by GitHub
parent 52713b21d4
commit 77b72bd0ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
206 changed files with 60 additions and 11908 deletions

View File

@ -1,10 +0,0 @@
generatorName: dart
outputDir: samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart2
typeMappings:
Client: "ModelClient"
File: "ModelFile"
additionalProperties:
hideGenerationTimestamp: "true"
serializationLibrary: json_serializable

View File

@ -19,7 +19,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|pubLibrary|Library name in generated code| |null|
|pubName|Name in generated pubspec| |null|
|pubVersion|Version in generated pubspec| |null|
|serializationLibrary|Specify serialization library|<dl><dt>**native_serialization**</dt><dd>Use native serializer, backwards compatible</dd><dt>**json_serializable**</dt><dd>Use json_serializable. Experimental and subject to breaking changes without further notice</dd></dl>|native_serialization|
|serializationLibrary|Specify serialization library|<dl><dt>**native_serialization**</dt><dd>Use native serializer, backwards compatible</dd></dl>|native_serialization|
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|Source folder for generated code| |null|

View File

@ -33,7 +33,6 @@ public class DartClientCodegen extends AbstractDartCodegen {
private final Logger LOGGER = LoggerFactory.getLogger(DartClientCodegen.class);
public static final String SERIALIZATION_LIBRARY_NATIVE = "native_serialization";
public static final String SERIALIZATION_LIBRARY_JSON_SERIALIZABLE = "json_serializable";
public DartClientCodegen() {
super();
@ -43,7 +42,6 @@ public class DartClientCodegen extends AbstractDartCodegen {
final Map<String, String> serializationOptions = new HashMap<>();
serializationOptions.put(SERIALIZATION_LIBRARY_NATIVE, "Use native serializer, backwards compatible");
serializationOptions.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "Use json_serializable. Experimental and subject to breaking changes without further notice");
serializationLibrary.setEnum(serializationOptions);
cliOptions.add(serializationLibrary);
}
@ -88,15 +86,7 @@ public class DartClientCodegen extends AbstractDartCodegen {
LOGGER.info("Using serialization library {}", serialization_library);
switch (serialization_library) {
case SERIALIZATION_LIBRARY_JSON_SERIALIZABLE:
additionalProperties.put(SERIALIZATION_LIBRARY_JSON_SERIALIZABLE, "true");
// json_serializable requires build.yaml
supportingFiles.add(new SupportingFile("build.yaml.mustache",
"" /* main project dir */,
"build.yaml"));
break;
case SERIALIZATION_LIBRARY_NATIVE: // fall trough to default backwards compatible generator
case SERIALIZATION_LIBRARY_NATIVE: // fall through to default backwards compatible generator
default:
additionalProperties.put(SERIALIZATION_LIBRARY_NATIVE, "true");

View File

@ -197,33 +197,7 @@ class {{{classname}}} {
{{/isMap}}
{{^isMap}}
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), '{{{returnType}}}',) as {{{returnType}}};
{{/isMap}}{{/isArray}}{{/native_serialization}}{{#json_serializable}}
{{#isArray}}
{{#uniqueItems}}
return (json.decode(response.body) as List)
.map((i) => {{{returnBaseType}}}.fromJson(i))
.toSet();
{{/uniqueItems}}
{{^uniqueItems}}
return (json.decode(response.body) as List)
.map((i) => {{{returnBaseType}}}.fromJson(i))
.toList();
{{/uniqueItems}}
{{/isArray}}
{{^isArray}}
{{#isMap}}
return {{{returnType}}}.from(json.decode(response.body));
{{/isMap}}
{{^isMap}}
{{#returnTypeIsPrimitive}}
return response.body as {{{returnBaseType}}};
{{/returnTypeIsPrimitive}}
{{^returnTypeIsPrimitive}}
return {{{returnType}}}.fromJson(json.decode(response.body));
{{/returnTypeIsPrimitive}}
{{/isMap}}
{{/isArray}}
{{/json_serializable}}
{{/isMap}}{{/isArray}}{{/native_serialization}}
}
return Future<{{{returnType}}}>.value();
{{/returnType}}

View File

@ -208,7 +208,6 @@ class ApiClient {
case '{{{classname}}}':
{{#isEnum}}
{{#native_serialization}}return {{{classname}}}TypeTransformer().decode(value);{{/native_serialization}}
{{#json_serializable}} return _$enumDecode(_${{{classname}}}EnumMap, value);{{/json_serializable}}
{{/isEnum}}
{{^isEnum}}
return {{{classname}}}.fromJson(value);

View File

@ -54,7 +54,7 @@ String parameterToString(dynamic value) {
{{#model}}
{{#isEnum}}
if (value is {{{classname}}}) {
{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}}{{#json_serializable}} return value.toString();{{/json_serializable}}
{{#native_serialization}} return {{{classname}}}TypeTransformer().encode(value).toString();{{/native_serialization}}
}
{{/isEnum}}
{{/model}}

View File

@ -7,9 +7,6 @@ import 'dart:io';
import 'package:http/http.dart';
import 'package:intl/intl.dart';
{{#json_serializable}}
import 'package:json_annotation/json_annotation.dart';
{{/json_serializable}}
import 'package:meta/meta.dart';
part 'api_client.dart';
@ -26,9 +23,6 @@ part 'auth/http_bearer_auth.dart';
{{#models}}{{#model}}part 'model/{{{classFilename}}}.dart';
{{/model}}{{/models}}
{{#json_serializable}}
part 'api.g.dart';
{{/json_serializable}}
const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
const _dateEpochMarker = 'epoch';
final _dateFormatter = DateFormat('yyyy-MM-dd');

View File

@ -1,18 +0,0 @@
targets:
$default:
builders:
json_serializable:
options:
# Options configure how source code is generated for every
# `@JsonSerializable`-annotated class in the package.
#
# The default value for each is listed.
any_map: false
checked: true
create_factory: true
create_to_json: true
disallow_unrecognized_keys: true
explicit_to_json: true
field_rename: none
ignore_unannotated: false
include_if_null: false

View File

@ -6,17 +6,11 @@
{{#native_serialization}}
{{>serialization/native/native_enum}}
{{/native_serialization}}
{{#json_serializable}}
{{>serialization/json_serializable/json_serializable_enum}}
{{/json_serializable}}
{{/isEnum}}
{{^isEnum}}
{{#native_serialization}}
{{>serialization/native/native_class}}
{{/native_serialization}}
{{#json_serializable}}
{{>serialization/json_serializable/json_serializable_class}}
{{/json_serializable}}
{{/isEnum}}
{{/model}}
{{/models}}

View File

@ -12,10 +12,5 @@ dependencies:
http: '>=0.13.0 <0.14.0'
intl: '^0.17.0'
meta: '^1.1.8'
{{#json_serializable}}
json_annotation: '^3.1.1'{{/json_serializable}}
dev_dependencies:
test: '>=1.16.0 <1.18.0'
{{#json_serializable}}
build_runner: '^1.10.9'
json_serializable: '^3.5.1'{{/json_serializable}}

View File

@ -1,67 +0,0 @@
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: true,
explicitToJson: true,
)
class {{{classname}}} {
{{>dart_constructor}}
{{#vars}}
{{#description}}
/// {{{.}}}
{{/description}}
{{^isEnum}}
{{#minimum}}
// minimum: {{{.}}}
{{/minimum}}
{{#maximum}}
// maximum: {{{.}}}
{{/maximum}}
{{/isEnum}}
{{^isBinary}}
@JsonKey(
{{#defaultValue}}defaultValue: {{{.}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}}
name: r'{{{baseName}}}',
required: {{#required}}true{{/required}}{{^required}}false{{/required}},
)
{{/isBinary}}
{{#isBinary}}
@JsonKey(ignore: true)
{{/isBinary}}
{{{datatypeWithEnum}}} {{{name}}};
{{/vars}}
@override
bool operator ==(Object other) => identical(this, other) || other is {{{classname}}} &&
{{#vars}}
other.{{{name}}} == {{{name}}}{{^-last}} &&{{/-last}}{{#-last}};{{/-last}}
{{/vars}}
@override
int get hashCode =>
{{#vars}}
({{{name}}} == null ? 0 : {{{name}}}.hashCode){{^-last}} +{{/-last}}{{#-last}};{{/-last}}
{{/vars}}
factory {{{classname}}}.fromJson(Map<String, dynamic> json) => _${{{classname}}}FromJson(json);
Map<String, dynamic> toJson() => _${{{classname}}}ToJson(this);
@override
String toString() => toJson().toString();
}
{{#vars}}
{{#isEnum}}
{{^isContainer}}
{{>serialization/json_serializable/json_serializable_enum_inline}}
{{/isContainer}}
{{#isContainer}}
{{#mostInnerItems}}
{{>serialization/json_serializable/json_serializable_enum_inline}}
{{/mostInnerItems}}
{{/isContainer}}
{{/isEnum}}
{{/vars}}

View File

@ -1,7 +0,0 @@
enum {{{classname}}} {
{{#allowableValues}}
{{#enumVars}}
{{{name}}},
{{/enumVars}}
{{/allowableValues}}
}

View File

@ -1,8 +0,0 @@
{{#description}}/// {{{.}}}{{/description}}
enum {{{enumName}}} {
{{#allowableValues}}
{{#enumVars}}
{{{name}}},
{{/enumVars}}
{{/allowableValues}}
}

View File

@ -1413,7 +1413,6 @@
<modules>
<module>samples/openapi3/client/petstore/dart2/petstore_client_lib</module>
<module>samples/openapi3/client/petstore/dart2/petstore</module>
<!--<module>samples/openapi3/client/petstore/dart2/petstore_json_serializable_client_lib_fake</module>-->
<module>samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake</module>
<module>samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake</module>
</modules>

View File

@ -72,6 +72,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
}
return Future<Pet>.value();
}
@ -203,6 +204,7 @@ class PetApi {
return (await apiClient.deserializeAsync(responseBody, 'List<Pet>') as List)
.cast<Pet>()
.toList(growable: false);
}
return Future<List<Pet>>.value();
}
@ -272,6 +274,7 @@ class PetApi {
return (await apiClient.deserializeAsync(responseBody, 'List<Pet>') as List)
.cast<Pet>()
.toList(growable: false);
}
return Future<List<Pet>>.value();
}
@ -337,6 +340,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
}
return Future<Pet>.value();
}
@ -397,6 +401,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
}
return Future<Pet>.value();
}
@ -556,6 +561,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
}
return Future<ApiResponse>.value();
}

View File

@ -119,6 +119,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Map<String, int>.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, int>'),);
}
return Future<Map<String, int>>.value();
}
@ -184,6 +185,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
}
return Future<Order>.value();
}
@ -244,6 +246,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
}
return Future<Order>.value();
}

View File

@ -294,6 +294,7 @@ class UserApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'User',) as User;
}
return Future<User>.value();
}
@ -366,6 +367,7 @@ class UserApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value();
}

View File

@ -12,7 +12,5 @@ dependencies:
http: '>=0.13.0 <0.14.0'
intl: '^0.17.0'
meta: '^1.1.8'
dev_dependencies:
test: '>=1.16.0 <1.18.0'

View File

@ -76,6 +76,7 @@ class AnotherFakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
}
return Future<ModelClient>.value();
}

View File

@ -54,6 +54,7 @@ class DefaultApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InlineResponseDefault',) as InlineResponseDefault;
}
return Future<InlineResponseDefault>.value();
}

View File

@ -57,6 +57,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HealthCheckResult',) as HealthCheckResult;
}
return Future<HealthCheckResult>.value();
}
@ -187,6 +188,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'bool',) as bool;
}
return Future<bool>.value();
}
@ -244,6 +246,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OuterComposite',) as OuterComposite;
}
return Future<OuterComposite>.value();
}
@ -301,6 +304,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'num',) as num;
}
return Future<num>.value();
}
@ -358,6 +362,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value();
}
@ -418,6 +423,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'OuterObjectWithEnumProperty',) as OuterObjectWithEnumProperty;
}
return Future<OuterObjectWithEnumProperty>.value();
}
@ -641,6 +647,7 @@ class FakeApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
}
return Future<ModelClient>.value();
}

View File

@ -76,6 +76,7 @@ class FakeClassnameTags123Api {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ModelClient',) as ModelClient;
}
return Future<ModelClient>.value();
}

View File

@ -196,6 +196,7 @@ class PetApi {
return (await apiClient.deserializeAsync(responseBody, 'List<Pet>') as List)
.cast<Pet>()
.toList(growable: false);
}
return Future<List<Pet>>.value();
}
@ -265,6 +266,7 @@ class PetApi {
return (await apiClient.deserializeAsync(responseBody, 'Set<Pet>') as List)
.cast<Pet>()
.toSet();
}
return Future<Set<Pet>>.value();
}
@ -330,6 +332,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Pet',) as Pet;
}
return Future<Pet>.value();
}
@ -542,6 +545,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
}
return Future<ApiResponse>.value();
}
@ -632,6 +636,7 @@ class PetApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiResponse',) as ApiResponse;
}
return Future<ApiResponse>.value();
}

View File

@ -119,6 +119,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Map<String, int>.from(await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Map<String, int>'),);
}
return Future<Map<String, int>>.value();
}
@ -184,6 +185,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
}
return Future<Order>.value();
}
@ -244,6 +246,7 @@ class StoreApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'Order',) as Order;
}
return Future<Order>.value();
}

View File

@ -294,6 +294,7 @@ class UserApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'User',) as User;
}
return Future<User>.value();
}
@ -366,6 +367,7 @@ class UserApi {
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value();
}

View File

@ -229,7 +229,6 @@ class ApiClient {
return EnumArrays.fromJson(value);
case 'EnumClass':
return EnumClassTypeTransformer().decode(value);
case 'EnumTest':
return EnumTest.fromJson(value);
case 'FileSchemaTestClass':
@ -272,16 +271,12 @@ class ApiClient {
return OuterComposite.fromJson(value);
case 'OuterEnum':
return OuterEnumTypeTransformer().decode(value);
case 'OuterEnumDefaultValue':
return OuterEnumDefaultValueTypeTransformer().decode(value);
case 'OuterEnumInteger':
return OuterEnumIntegerTypeTransformer().decode(value);
case 'OuterEnumIntegerDefaultValue':
return OuterEnumIntegerDefaultValueTypeTransformer().decode(value);
case 'OuterObjectWithEnumProperty':
return OuterObjectWithEnumProperty.fromJson(value);
case 'Pet':

View File

@ -12,7 +12,5 @@ dependencies:
http: '>=0.13.0 <0.14.0'
intl: '^0.17.0'
meta: '^1.1.8'
dev_dependencies:
test: '>=1.16.0 <1.18.0'

View File

@ -1,27 +0,0 @@
# See https://www.dartlang.org/tools/private-files.html
# Files and directories created by pub
.buildlog
.packages
.project
.pub/
build/
**/packages/
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
doc/api/
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
pubspec.lock

View File

@ -1,23 +0,0 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -1,122 +0,0 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
build.yaml
doc/AdditionalPropertiesClass.md
doc/Animal.md
doc/AnotherFakeApi.md
doc/ApiResponse.md
doc/ArrayOfArrayOfNumberOnly.md
doc/ArrayOfNumberOnly.md
doc/ArrayTest.md
doc/Capitalization.md
doc/Cat.md
doc/CatAllOf.md
doc/Category.md
doc/ClassModel.md
doc/DefaultApi.md
doc/DeprecatedObject.md
doc/Dog.md
doc/DogAllOf.md
doc/EnumArrays.md
doc/EnumClass.md
doc/EnumTest.md
doc/FakeApi.md
doc/FakeClassnameTags123Api.md
doc/FileSchemaTestClass.md
doc/Foo.md
doc/FormatTest.md
doc/HasOnlyReadOnly.md
doc/HealthCheckResult.md
doc/InlineResponseDefault.md
doc/MapTest.md
doc/MixedPropertiesAndAdditionalPropertiesClass.md
doc/Model200Response.md
doc/ModelClient.md
doc/ModelFile.md
doc/ModelList.md
doc/ModelReturn.md
doc/Name.md
doc/NullableClass.md
doc/NumberOnly.md
doc/ObjectWithDeprecatedFields.md
doc/Order.md
doc/OuterComposite.md
doc/OuterEnum.md
doc/OuterEnumDefaultValue.md
doc/OuterEnumInteger.md
doc/OuterEnumIntegerDefaultValue.md
doc/OuterObjectWithEnumProperty.md
doc/Pet.md
doc/PetApi.md
doc/ReadOnlyFirst.md
doc/SpecialModelName.md
doc/StoreApi.md
doc/Tag.md
doc/User.md
doc/UserApi.md
git_push.sh
lib/api.dart
lib/api/another_fake_api.dart
lib/api/default_api.dart
lib/api/fake_api.dart
lib/api/fake_classname_tags123_api.dart
lib/api/pet_api.dart
lib/api/store_api.dart
lib/api/user_api.dart
lib/api_client.dart
lib/api_exception.dart
lib/api_helper.dart
lib/auth/api_key_auth.dart
lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/additional_properties_class.dart
lib/model/animal.dart
lib/model/api_response.dart
lib/model/array_of_array_of_number_only.dart
lib/model/array_of_number_only.dart
lib/model/array_test.dart
lib/model/capitalization.dart
lib/model/cat.dart
lib/model/cat_all_of.dart
lib/model/category.dart
lib/model/class_model.dart
lib/model/deprecated_object.dart
lib/model/dog.dart
lib/model/dog_all_of.dart
lib/model/enum_arrays.dart
lib/model/enum_class.dart
lib/model/enum_test.dart
lib/model/file_schema_test_class.dart
lib/model/foo.dart
lib/model/format_test.dart
lib/model/has_only_read_only.dart
lib/model/health_check_result.dart
lib/model/inline_response_default.dart
lib/model/map_test.dart
lib/model/mixed_properties_and_additional_properties_class.dart
lib/model/model200_response.dart
lib/model/model_client.dart
lib/model/model_file.dart
lib/model/model_list.dart
lib/model/model_return.dart
lib/model/name.dart
lib/model/nullable_class.dart
lib/model/number_only.dart
lib/model/object_with_deprecated_fields.dart
lib/model/order.dart
lib/model/outer_composite.dart
lib/model/outer_enum.dart
lib/model/outer_enum_default_value.dart
lib/model/outer_enum_integer.dart
lib/model/outer_enum_integer_default_value.dart
lib/model/outer_object_with_enum_property.dart
lib/model/pet.dart
lib/model/read_only_first.dart
lib/model/special_model_name.dart
lib/model/tag.dart
lib/model/user.dart
pubspec.yaml

View File

@ -1,14 +0,0 @@
#
# AUTO-GENERATED FILE, DO NOT MODIFY!
#
# https://docs.travis-ci.com/user/languages/dart/
#
language: dart
dart:
# Install a specific stable release
- "2.2.0"
install:
- pub get
script:
- pub run test

View File

@ -1,193 +0,0 @@
# openapi
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements
Dart 2.0 or later
## Installation & Usage
### Github
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
### Local
To use the package in your local drive, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
path: /path/to/openapi
```
## Tests
TODO
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```dart
import 'package:openapi/api.dart';
final api_instance = AnotherFakeApi();
final modelClient = ModelClient(); // ModelClient | client model
try {
final result = api_instance.call123testSpecialTags(modelClient);
print(result);
} catch (e) {
print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n');
}
```
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](doc//AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](doc//DefaultApi.md#fooget) | **GET** /foo |
*FakeApi* | [**fakeHealthGet**](doc//FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](doc//FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](doc//FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**fakeOuterCompositeSerialize**](doc//FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**fakeOuterNumberSerialize**](doc//FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**fakeOuterStringSerialize**](doc//FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](doc//FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
*FakeApi* | [**testBodyWithBinary**](doc//FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
*FakeApi* | [**testBodyWithFileSchema**](doc//FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**testBodyWithQueryParams**](doc//FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**testClientModel**](doc//FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**testEndpointParameters**](doc//FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**testEnumParameters**](doc//FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**testGroupParameters**](doc//FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
*FakeApi* | [**testInlineAdditionalProperties**](doc//FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**testJsonFormData**](doc//FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
*FakeApi* | [**testQueryParameterCollectionFormat**](doc//FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
*FakeClassnameTags123Api* | [**testClassname**](doc//FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**addPet**](doc//PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**deletePet**](doc//PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](doc//PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](doc//PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](doc//PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**updatePet**](doc//PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](doc//PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](doc//PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*PetApi* | [**uploadFileWithRequiredFile**](doc//PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
*StoreApi* | [**deleteOrder**](doc//StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**getInventory**](doc//StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getOrderById**](doc//StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**placeOrder**](doc//StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](doc//UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**createUsersWithListInput**](doc//UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](doc//UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**loginUser**](doc//UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**logoutUser**](doc//UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](doc//UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
## Documentation For Models
- [AdditionalPropertiesClass](doc//AdditionalPropertiesClass.md)
- [Animal](doc//Animal.md)
- [ApiResponse](doc//ApiResponse.md)
- [ArrayOfArrayOfNumberOnly](doc//ArrayOfArrayOfNumberOnly.md)
- [ArrayOfNumberOnly](doc//ArrayOfNumberOnly.md)
- [ArrayTest](doc//ArrayTest.md)
- [Capitalization](doc//Capitalization.md)
- [Cat](doc//Cat.md)
- [CatAllOf](doc//CatAllOf.md)
- [Category](doc//Category.md)
- [ClassModel](doc//ClassModel.md)
- [DeprecatedObject](doc//DeprecatedObject.md)
- [Dog](doc//Dog.md)
- [DogAllOf](doc//DogAllOf.md)
- [EnumArrays](doc//EnumArrays.md)
- [EnumClass](doc//EnumClass.md)
- [EnumTest](doc//EnumTest.md)
- [FileSchemaTestClass](doc//FileSchemaTestClass.md)
- [Foo](doc//Foo.md)
- [FormatTest](doc//FormatTest.md)
- [HasOnlyReadOnly](doc//HasOnlyReadOnly.md)
- [HealthCheckResult](doc//HealthCheckResult.md)
- [InlineResponseDefault](doc//InlineResponseDefault.md)
- [MapTest](doc//MapTest.md)
- [MixedPropertiesAndAdditionalPropertiesClass](doc//MixedPropertiesAndAdditionalPropertiesClass.md)
- [Model200Response](doc//Model200Response.md)
- [ModelClient](doc//ModelClient.md)
- [ModelFile](doc//ModelFile.md)
- [ModelList](doc//ModelList.md)
- [ModelReturn](doc//ModelReturn.md)
- [Name](doc//Name.md)
- [NullableClass](doc//NullableClass.md)
- [NumberOnly](doc//NumberOnly.md)
- [ObjectWithDeprecatedFields](doc//ObjectWithDeprecatedFields.md)
- [Order](doc//Order.md)
- [OuterComposite](doc//OuterComposite.md)
- [OuterEnum](doc//OuterEnum.md)
- [OuterEnumDefaultValue](doc//OuterEnumDefaultValue.md)
- [OuterEnumInteger](doc//OuterEnumInteger.md)
- [OuterEnumIntegerDefaultValue](doc//OuterEnumIntegerDefaultValue.md)
- [OuterObjectWithEnumProperty](doc//OuterObjectWithEnumProperty.md)
- [Pet](doc//Pet.md)
- [ReadOnlyFirst](doc//ReadOnlyFirst.md)
- [SpecialModelName](doc//SpecialModelName.md)
- [Tag](doc//Tag.md)
- [User](doc//User.md)
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
## api_key_query
- **Type**: API key
- **API key parameter name**: api_key_query
- **Location**: URL query string
## bearer_test
- **Type**: HTTP Bearer authentication
## http_basic_test
- **Type**: HTTP Basic authentication
## http_signature_test
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account
- **read:pets**: read your pets
## Author

View File

@ -1,18 +0,0 @@
targets:
$default:
builders:
json_serializable:
options:
# Options configure how source code is generated for every
# `@JsonSerializable`-annotated class in the package.
#
# The default value for each is listed.
any_map: false
checked: true
create_factory: true
create_to_json: true
disallow_unrecognized_keys: true
explicit_to_json: true
field_rename: none
ignore_unannotated: false
include_if_null: false

View File

@ -1,16 +0,0 @@
# openapi.model.AdditionalPropertiesClass
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapProperty** | **Map<String, String>** | | [optional] [default to const {}]
**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.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)

View File

@ -1,16 +0,0 @@
# openapi.model.Animal
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional] [default to 'red']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,57 +0,0 @@
# openapi.api.AnotherFakeApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
# **call123testSpecialTags**
> ModelClient call123testSpecialTags(modelClient)
To test special tags
To test special tags and operation ID starting with number
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = AnotherFakeApi();
final modelClient = ModelClient(); // ModelClient | client model
try {
final result = api_instance.call123testSpecialTags(modelClient);
print(result);
} catch (e) {
print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,17 +0,0 @@
# openapi.model.ApiResponse
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional]
**type** | **String** | | [optional]
**message** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ArrayOfArrayOfNumberOnly
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayArrayNumber** | [**List<List<num>>**](List.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)

View File

@ -1,15 +0,0 @@
# openapi.model.ArrayOfNumberOnly
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayNumber** | **List<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)

View File

@ -1,17 +0,0 @@
# openapi.model.ArrayTest
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **List<String>** | | [optional] [default to const []]
**arrayArrayOfInteger** | [**List<List<int>>**](List.md) | | [optional] [default to const []]
**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.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)

View File

@ -1,20 +0,0 @@
# openapi.model.Capitalization
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **String** | | [optional]
**capitalCamel** | **String** | | [optional]
**smallSnake** | **String** | | [optional]
**capitalSnake** | **String** | | [optional]
**sCAETHFlowPoints** | **String** | | [optional]
**ATT_NAME** | **String** | Name of the pet | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,17 +0,0 @@
# openapi.model.Cat
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional] [default to 'red']
**declawed** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.CatAllOf
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.Category
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**name** | **String** | | [default to 'default-name']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ClassModel
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,51 +0,0 @@
# openapi.api.DefaultApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fooGet**](DefaultApi.md#fooget) | **GET** /foo |
# **fooGet**
> InlineResponseDefault fooGet()
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
try {
final result = api_instance.fooGet();
print(result);
} catch (e) {
print('Exception when calling DefaultApi->fooGet: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**InlineResponseDefault**](InlineResponseDefault.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.DeprecatedObject
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,17 +0,0 @@
# openapi.model.Dog
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **String** | |
**color** | **String** | | [optional] [default to 'red']
**breed** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.DogAllOf
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.EnumArrays
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | **String** | | [optional]
**arrayEnum** | **List<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)

View File

@ -1,14 +0,0 @@
# openapi.model.EnumClass
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,22 +0,0 @@
# openapi.model.EnumTest
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumString** | **String** | | [optional]
**enumStringRequired** | **String** | |
**enumInteger** | **int** | | [optional]
**enumNumber** | **double** | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,816 +0,0 @@
# openapi.api.FakeApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
# **fakeHealthGet**
> HealthCheckResult fakeHealthGet()
Health check endpoint
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
try {
final result = api_instance.fakeHealthGet();
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakeHealthGet: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**HealthCheckResult**](HealthCheckResult.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakeHttpSignatureTest**
> fakeHttpSignatureTest(pet, query1, header1)
test http signature authentication
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final pet = Pet(); // Pet | Pet object that needs to be added to the store
final query1 = query1_example; // String | query parameter
final header1 = header1_example; // String | header parameter
try {
api_instance.fakeHttpSignatureTest(pet, query1, header1);
} catch (e) {
print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**query1** | **String**| query parameter | [optional]
**header1** | **String**| header parameter | [optional]
### Return type
void (empty response body)
### Authorization
[http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakeOuterBooleanSerialize**
> bool fakeOuterBooleanSerialize(body)
Test serialization of outer boolean types
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = bool(); // bool | Input boolean as post body
try {
final result = api_instance.fakeOuterBooleanSerialize(body);
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **bool**| Input boolean as post body | [optional]
### Return type
**bool**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakeOuterCompositeSerialize**
> OuterComposite fakeOuterCompositeSerialize(outerComposite)
Test serialization of object with outer number type
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final outerComposite = OuterComposite(); // OuterComposite | Input composite as post body
try {
final result = api_instance.fakeOuterCompositeSerialize(outerComposite);
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakeOuterNumberSerialize**
> num fakeOuterNumberSerialize(body)
Test serialization of outer number types
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = num(); // num | Input number as post body
try {
final result = api_instance.fakeOuterNumberSerialize(body);
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **num**| Input number as post body | [optional]
### Return type
**num**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakeOuterStringSerialize**
> String fakeOuterStringSerialize(body)
Test serialization of outer string types
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = String(); // String | Input string as post body
try {
final result = api_instance.fakeOuterStringSerialize(body);
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **String**| Input string as post body | [optional]
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **fakePropertyEnumIntegerSerialize**
> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty)
Test serialization of enum (int) properties with examples
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final outerObjectWithEnumProperty = OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body
try {
final result = api_instance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty);
print(result);
} catch (e) {
print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body |
### Return type
[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testBodyWithBinary**
> testBodyWithBinary(body)
For this test, the body has to be a binary file.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = MultipartFile(); // MultipartFile | image to upload
try {
api_instance.testBodyWithBinary(body);
} catch (e) {
print('Exception when calling FakeApi->testBodyWithBinary: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **MultipartFile**| image to upload |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: image/png
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
For this test, the body for this request must reference a schema named `File`.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final fileSchemaTestClass = FileSchemaTestClass(); // FileSchemaTestClass |
try {
api_instance.testBodyWithFileSchema(fileSchemaTestClass);
} catch (e) {
print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, user)
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final query = query_example; // String |
final user = User(); // User |
try {
api_instance.testBodyWithQueryParams(query, user);
} catch (e) {
print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **String**| |
**user** | [**User**](User.md)| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testClientModel**
> ModelClient testClientModel(modelClient)
To test \"client\" model
To test \"client\" model
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final modelClient = ModelClient(); // ModelClient | client model
try {
final result = api_instance.testClientModel(modelClient);
print(result);
} catch (e) {
print('Exception when calling FakeApi->testClientModel: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testEndpointParameters**
> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP basic authorization: http_basic_test
//defaultApiClient.getAuthentication<HttpBasicAuth>('http_basic_test').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('http_basic_test').password = 'YOUR_PASSWORD';
final api_instance = FakeApi();
final number = 8.14; // num | None
final double_ = 1.2; // double | None
final patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None
final byte = BYTE_ARRAY_DATA_HERE; // String | None
final integer = 56; // int | None
final int32 = 56; // int | None
final int64 = 789; // int | None
final float = 3.4; // double | None
final string = string_example; // String | None
final binary = BINARY_DATA_HERE; // MultipartFile | None
final date = 2013-10-20; // DateTime | None
final dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None
final password = password_example; // String | None
final callback = callback_example; // String | None
try {
api_instance.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback);
} catch (e) {
print('Exception when calling FakeApi->testEndpointParameters: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **num**| None |
**double_** | **double**| None |
**patternWithoutDelimiter** | **String**| None |
**byte** | **String**| None |
**integer** | **int**| None | [optional]
**int32** | **int**| None | [optional]
**int64** | **int**| None | [optional]
**float** | **double**| None | [optional]
**string** | **String**| None | [optional]
**binary** | **MultipartFile**| None | [optional]
**date** | **DateTime**| None | [optional]
**dateTime** | **DateTime**| None | [optional]
**password** | **String**| None | [optional]
**callback** | **String**| None | [optional]
### Return type
void (empty response body)
### Authorization
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testEnumParameters**
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
To test enum parameters
To test enum parameters
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final enumHeaderStringArray = []; // List<String> | Header parameter enum test (string array)
final enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string)
final enumQueryStringArray = []; // List<String> | Query parameter enum test (string array)
final enumQueryString = enumQueryString_example; // String | Query parameter enum test (string)
final enumQueryInteger = 56; // int | Query parameter enum test (double)
final enumQueryDouble = 1.2; // double | Query parameter enum test (double)
final enumFormStringArray = []; // List<String> | Form parameter enum test (string array)
final enumFormString = enumFormString_example; // String | Form parameter enum test (string)
try {
api_instance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
} catch (e) {
print('Exception when calling FakeApi->testEnumParameters: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [default to const []]
**enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg']
**enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [default to const []]
**enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg']
**enumQueryInteger** | **int**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **double**| Query parameter enum test (double) | [optional]
**enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$']
**enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg']
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testGroupParameters**
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer_test
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer_test').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer_test').setAccessToken(yourTokenGeneratorFunction);
final api_instance = FakeApi();
final requiredStringGroup = 56; // int | Required String in group parameters
final requiredBooleanGroup = true; // bool | Required Boolean in group parameters
final requiredInt64Group = 789; // int | Required Integer in group parameters
final stringGroup = 56; // int | String in group parameters
final booleanGroup = true; // bool | Boolean in group parameters
final int64Group = 789; // int | Integer in group parameters
try {
api_instance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group);
} catch (e) {
print('Exception when calling FakeApi->testGroupParameters: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requiredStringGroup** | **int**| Required String in group parameters |
**requiredBooleanGroup** | **bool**| Required Boolean in group parameters |
**requiredInt64Group** | **int**| Required Integer in group parameters |
**stringGroup** | **int**| String in group parameters | [optional]
**booleanGroup** | **bool**| Boolean in group parameters | [optional]
**int64Group** | **int**| Integer in group parameters | [optional]
### Return type
void (empty response body)
### Authorization
[bearer_test](../README.md#bearer_test)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(requestBody)
test inline additionalProperties
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final requestBody = Map<String, String>(); // Map<String, String> | request body
try {
api_instance.testInlineAdditionalProperties(requestBody);
} catch (e) {
print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**Map<String, String>**](String.md)| request body |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testJsonFormData**
> testJsonFormData(param, param2)
test json serialization of form data
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final param = param_example; // String | field1
final param2 = param2_example; // String | field2
try {
api_instance.testJsonFormData(param, param2);
} catch (e) {
print('Exception when calling FakeApi->testJsonFormData: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **String**| field1 |
**param2** | **String**| field2 |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **testQueryParameterCollectionFormat**
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language)
To test the collection format in query parameters
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final pipe = []; // List<String> |
final ioutil = []; // List<String> |
final http = []; // List<String> |
final url = []; // List<String> |
final context = []; // List<String> |
final allowEmpty = allowEmpty_example; // String |
final language = ; // Map<String, String> |
try {
api_instance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language);
} catch (e) {
print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**List<String>**](String.md)| | [default to const []]
**ioutil** | [**List<String>**](String.md)| | [default to const []]
**http** | [**List<String>**](String.md)| | [default to const []]
**url** | [**List<String>**](String.md)| | [default to const []]
**context** | [**List<String>**](String.md)| | [default to const []]
**allowEmpty** | **String**| |
**language** | [**Map<String, String>**](String.md)| | [optional] [default to const {}]
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,61 +0,0 @@
# openapi.api.FakeClassnameTags123Api
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
# **testClassname**
> ModelClient testClassname(modelClient)
To test class name in snake case
To test class name in snake case
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key_query
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key_query').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key_query').apiKeyPrefix = 'Bearer';
final api_instance = FakeClassnameTags123Api();
final modelClient = ModelClient(); // ModelClient | client model
try {
final result = api_instance.testClassname(modelClient);
print(result);
} catch (e) {
print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
[api_key_query](../README.md#api_key_query)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.FileSchemaTestClass
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**ModelFile**](ModelFile.md) | | [optional]
**files** | [**List<ModelFile>**](ModelFile.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)

View File

@ -1,15 +0,0 @@
# openapi.model.Foo
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional] [default to 'bar']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,30 +0,0 @@
# openapi.model.FormatTest
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integer** | **int** | | [optional]
**int32** | **int** | | [optional]
**int64** | **int** | | [optional]
**number** | **num** | |
**float** | **double** | | [optional]
**double_** | **double** | | [optional]
**decimal** | **double** | | [optional]
**string** | **String** | | [optional]
**byte** | **String** | |
**binary** | [**MultipartFile**](MultipartFile.md) | | [optional]
**date** | [**DateTime**](DateTime.md) | |
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**uuid** | **String** | | [optional]
**password** | **String** | |
**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.HasOnlyReadOnly
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional] [readonly]
**foo** | **String** | | [optional] [readonly]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.HealthCheckResult
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nullableMessage** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.InlineResponseDefault
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string** | [**Foo**](Foo.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,18 +0,0 @@
# openapi.model.MapTest
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] [default to const {}]
**mapOfEnumString** | **Map<String, String>** | | [optional] [default to const {}]
**directMap** | **Map<String, bool>** | | [optional] [default to const {}]
**indirectMap** | **Map<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)

View File

@ -1,17 +0,0 @@
# openapi.model.MixedPropertiesAndAdditionalPropertiesClass
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **String** | | [optional]
**dateTime** | [**DateTime**](DateTime.md) | | [optional]
**map** | [**Map<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)

View File

@ -1,16 +0,0 @@
# openapi.model.Model200Response
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **int** | | [optional]
**class_** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ModelClient
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ModelFile
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sourceURI** | **String** | Test capitalization | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ModelList
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**n123list** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.ModelReturn
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**return_** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,18 +0,0 @@
# openapi.model.Name
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **int** | |
**snakeCase** | **int** | | [optional] [readonly]
**property** | **String** | | [optional]
**n123number** | **int** | | [optional] [readonly]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,26 +0,0 @@
# openapi.model.NullableClass
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integerProp** | **int** | | [optional]
**numberProp** | **num** | | [optional]
**booleanProp** | **bool** | | [optional]
**stringProp** | **String** | | [optional]
**dateProp** | [**DateTime**](DateTime.md) | | [optional]
**datetimeProp** | [**DateTime**](DateTime.md) | | [optional]
**arrayNullableProp** | [**List<Object>**](Object.md) | | [optional] [default to const []]
**arrayAndItemsNullableProp** | [**List<Object>**](Object.md) | | [optional] [default to const []]
**arrayItemsNullable** | [**List<Object>**](Object.md) | | [optional] [default to const []]
**objectNullableProp** | [**Map<String, Object>**](Object.md) | | [optional] [default to const {}]
**objectAndItemsNullableProp** | [**Map<String, Object>**](Object.md) | | [optional] [default to const {}]
**objectItemsNullable** | [**Map<String, Object>**](Object.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)

View File

@ -1,15 +0,0 @@
# openapi.model.NumberOnly
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justNumber** | **num** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,18 +0,0 @@
# openapi.model.ObjectWithDeprecatedFields
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **String** | | [optional]
**id** | **num** | | [optional]
**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
**bars** | **List<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)

View File

@ -1,20 +0,0 @@
# openapi.model.Order
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**petId** | **int** | | [optional]
**quantity** | **int** | | [optional]
**shipDate** | [**DateTime**](DateTime.md) | | [optional]
**status** | **String** | Order Status | [optional]
**complete** | **bool** | | [optional] [default to false]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,17 +0,0 @@
# openapi.model.OuterComposite
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**myNumber** | **num** | | [optional]
**myString** | **String** | | [optional]
**myBoolean** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,14 +0,0 @@
# openapi.model.OuterEnum
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,14 +0,0 @@
# openapi.model.OuterEnumDefaultValue
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,14 +0,0 @@
# openapi.model.OuterEnumInteger
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,14 +0,0 @@
# openapi.model.OuterEnumIntegerDefaultValue
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.OuterObjectWithEnumProperty
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | [**OuterEnumInteger**](OuterEnumInteger.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)

View File

@ -1,20 +0,0 @@
# openapi.model.Pet
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**name** | **String** | |
**photoUrls** | **Set<String>** | | [default to const {}]
**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []]
**status** | **String** | pet status in the store | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,427 +0,0 @@
# openapi.api.PetApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
# **addPet**
> addPet(pet)
Add a new pet to the store
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final pet = Pet(); // Pet | Pet object that needs to be added to the store
try {
api_instance.addPet(pet);
} catch (e) {
print('Exception when calling PetApi->addPet: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final petId = 789; // int | Pet id to delete
final apiKey = apiKey_example; // String |
try {
api_instance.deletePet(petId, apiKey);
} catch (e) {
print('Exception when calling PetApi->deletePet: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findPetsByStatus**
> List<Pet> findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final status = []; // List<String> | Status values that need to be considered for filter
try {
final result = api_instance.findPetsByStatus(status);
print(result);
} catch (e) {
print('Exception when calling PetApi->findPetsByStatus: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []]
### Return type
[**List<Pet>**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findPetsByTags**
> Set<Pet> findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final tags = []; // Set<String> | Tags to filter by
try {
final result = api_instance.findPetsByTags(tags);
print(result);
} catch (e) {
print('Exception when calling PetApi->findPetsByTags: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**Set<String>**](String.md)| Tags to filter by | [default to const {}]
### Return type
[**Set<Pet>**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getPetById**
> Pet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
final api_instance = PetApi();
final petId = 789; // int | ID of pet to return
try {
final result = api_instance.getPetById(petId);
print(result);
} catch (e) {
print('Exception when calling PetApi->getPetById: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to return |
### Return type
[**Pet**](Pet.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updatePet**
> updatePet(pet)
Update an existing pet
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final pet = Pet(); // Pet | Pet object that needs to be added to the store
try {
api_instance.updatePet(pet);
} catch (e) {
print('Exception when calling PetApi->updatePet: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updatePetWithForm**
> updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final petId = 789; // int | ID of pet that needs to be updated
final name = name_example; // String | Updated name of the pet
final status = status_example; // String | Updated status of the pet
try {
api_instance.updatePetWithForm(petId, name, status);
} catch (e) {
print('Exception when calling PetApi->updatePetWithForm: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet that needs to be updated |
**name** | **String**| Updated name of the pet | [optional]
**status** | **String**| Updated status of the pet | [optional]
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **uploadFile**
> ApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final petId = 789; // int | ID of pet to update
final additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
final file = BINARY_DATA_HERE; // MultipartFile | file to upload
try {
final result = api_instance.uploadFile(petId, additionalMetadata, file);
print(result);
} catch (e) {
print('Exception when calling PetApi->uploadFile: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **MultipartFile**| file to upload | [optional]
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **uploadFileWithRequiredFile**
> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
uploads an image (required)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure OAuth2 access token for authorization: petstore_auth
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = PetApi();
final petId = 789; // int | ID of pet to update
final requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload
final additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
try {
final result = api_instance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
print(result);
} catch (e) {
print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **int**| ID of pet to update |
**requiredFile** | **MultipartFile**| file to upload |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.ReadOnlyFirst
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **String** | | [optional] [readonly]
**baz** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,15 +0,0 @@
# openapi.model.SpecialModelName
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,186 +0,0 @@
# openapi.api.StoreApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
# **deleteOrder**
> deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = StoreApi();
final orderId = orderId_example; // String | ID of the order that needs to be deleted
try {
api_instance.deleteOrder(orderId);
} catch (e) {
print('Exception when calling StoreApi->deleteOrder: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **String**| ID of the order that needs to be deleted |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getInventory**
> Map<String, int> getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
final api_instance = StoreApi();
try {
final result = api_instance.getInventory();
print(result);
} catch (e) {
print('Exception when calling StoreApi->getInventory: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**Map<String, int>**
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = StoreApi();
final orderId = 789; // int | ID of pet that needs to be fetched
try {
final result = api_instance.getOrderById(orderId);
print(result);
} catch (e) {
print('Exception when calling StoreApi->getOrderById: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **int**| ID of pet that needs to be fetched |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **placeOrder**
> Order placeOrder(order)
Place an order for a pet
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = StoreApi();
final order = Order(); // Order | order placed for purchasing the pet
try {
final result = api_instance.placeOrder(order);
print(result);
} catch (e) {
print('Exception when calling StoreApi->placeOrder: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,16 +0,0 @@
# openapi.model.Tag
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**name** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,22 +0,0 @@
# openapi.model.User
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**username** | **String** | | [optional]
**firstName** | **String** | | [optional]
**lastName** | **String** | | [optional]
**email** | **String** | | [optional]
**password** | **String** | | [optional]
**phone** | **String** | | [optional]
**userStatus** | **int** | User Status | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,349 +0,0 @@
# openapi.api.UserApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createuser) | **POST** /user | Create user
[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
# **createUser**
> createUser(user)
Create user
This can only be done by the logged in user.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final user = User(); // User | Created user object
try {
api_instance.createUser(user);
} catch (e) {
print('Exception when calling UserApi->createUser: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**User**](User.md)| Created user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithArrayInput**
> createUsersWithArrayInput(user)
Creates list of users with given input array
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final user = [List<User>()]; // List<User> | List of user object
try {
api_instance.createUsersWithArrayInput(user);
} catch (e) {
print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List<User>**](User.md)| List of user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **createUsersWithListInput**
> createUsersWithListInput(user)
Creates list of users with given input array
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final user = [List<User>()]; // List<User> | List of user object
try {
api_instance.createUsersWithListInput(user);
} catch (e) {
print('Exception when calling UserApi->createUsersWithListInput: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**List<User>**](User.md)| List of user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **deleteUser**
> deleteUser(username)
Delete user
This can only be done by the logged in user.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final username = username_example; // String | The name that needs to be deleted
try {
api_instance.deleteUser(username);
} catch (e) {
print('Exception when calling UserApi->deleteUser: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be deleted |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getUserByName**
> User getUserByName(username)
Get user by user name
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
try {
final result = api_instance.getUserByName(username);
print(result);
} catch (e) {
print('Exception when calling UserApi->getUserByName: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
[**User**](User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **loginUser**
> String loginUser(username, password)
Logs user into the system
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final username = username_example; // String | The user name for login
final password = password_example; // String | The password for login in clear text
try {
final result = api_instance.loginUser(username, password);
print(result);
} catch (e) {
print('Exception when calling UserApi->loginUser: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| The user name for login |
**password** | **String**| The password for login in clear text |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **logoutUser**
> logoutUser()
Logs out current logged in user session
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
try {
api_instance.logoutUser();
} catch (e) {
print('Exception when calling UserApi->logoutUser: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateUser**
> updateUser(username, user)
Updated user
This can only be done by the logged in user.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = UserApi();
final username = username_example; // String | name that need to be deleted
final user = User(); // User | Updated user object
try {
api_instance.updateUser(username, user);
} catch (e) {
print('Exception when calling UserApi->updateUser: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **String**| name that need to be deleted |
**user** | [**User**](User.md)| Updated user object |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -1,57 +0,0 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -1,95 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
library openapi.api;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart';
import 'package:intl/intl.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
part 'api_client.dart';
part 'api_helper.dart';
part 'api_exception.dart';
part 'auth/authentication.dart';
part 'auth/api_key_auth.dart';
part 'auth/oauth.dart';
part 'auth/http_basic_auth.dart';
part 'auth/http_bearer_auth.dart';
part 'api/another_fake_api.dart';
part 'api/default_api.dart';
part 'api/fake_api.dart';
part 'api/fake_classname_tags123_api.dart';
part 'api/pet_api.dart';
part 'api/store_api.dart';
part 'api/user_api.dart';
part 'model/additional_properties_class.dart';
part 'model/animal.dart';
part 'model/api_response.dart';
part 'model/array_of_array_of_number_only.dart';
part 'model/array_of_number_only.dart';
part 'model/array_test.dart';
part 'model/capitalization.dart';
part 'model/cat.dart';
part 'model/cat_all_of.dart';
part 'model/category.dart';
part 'model/class_model.dart';
part 'model/deprecated_object.dart';
part 'model/dog.dart';
part 'model/dog_all_of.dart';
part 'model/enum_arrays.dart';
part 'model/enum_class.dart';
part 'model/enum_test.dart';
part 'model/file_schema_test_class.dart';
part 'model/foo.dart';
part 'model/format_test.dart';
part 'model/has_only_read_only.dart';
part 'model/health_check_result.dart';
part 'model/inline_response_default.dart';
part 'model/map_test.dart';
part 'model/mixed_properties_and_additional_properties_class.dart';
part 'model/model200_response.dart';
part 'model/model_client.dart';
part 'model/model_file.dart';
part 'model/model_list.dart';
part 'model/model_return.dart';
part 'model/name.dart';
part 'model/nullable_class.dart';
part 'model/number_only.dart';
part 'model/object_with_deprecated_fields.dart';
part 'model/order.dart';
part 'model/outer_composite.dart';
part 'model/outer_enum.dart';
part 'model/outer_enum_default_value.dart';
part 'model/outer_enum_integer.dart';
part 'model/outer_enum_integer_default_value.dart';
part 'model/outer_object_with_enum_property.dart';
part 'model/pet.dart';
part 'model/read_only_first.dart';
part 'model/special_model_name.dart';
part 'model/tag.dart';
part 'model/user.dart';
part 'api.g.dart';
const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
const _dateEpochMarker = 'epoch';
final _dateFormatter = DateFormat('yyyy-MM-dd');
final _regList = RegExp(r'^List<(.*)>$');
final _regSet = RegExp(r'^Set<(.*)>$');
final _regMap = RegExp(r'^Map<String,(.*)>$');
ApiClient defaultApiClient = ApiClient();

View File

@ -1,83 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AnotherFakeApi {
AnotherFakeApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// To test special tags
///
/// To test special tags and operation ID starting with number
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [ModelClient] modelClient (required):
/// client model
Future<Response> call123testSpecialTagsWithHttpInfo(ModelClient modelClient,) async {
// Verify required params are set.
if (modelClient == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: modelClient');
}
// ignore: prefer_const_declarations
final path = r'/another-fake/dummy';
// ignore: prefer_final_locals
Object postBody = modelClient;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// To test special tags
///
/// To test special tags and operation ID starting with number
///
/// Parameters:
///
/// * [ModelClient] modelClient (required):
/// client model
Future<ModelClient> call123testSpecialTags(ModelClient modelClient,) async {
final response = await call123testSpecialTagsWithHttpInfo(modelClient,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return ModelClient.fromJson(json.decode(response.body));
}
return Future<ModelClient>.value();
}
}

View File

@ -1,61 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DefaultApi {
DefaultApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /foo' operation and returns the [Response].
Future<Response> fooGetWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/foo';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
Future<InlineResponseDefault> fooGet() async {
final response = await fooGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return InlineResponseDefault.fromJson(json.decode(response.body));
}
return Future<InlineResponseDefault>.value();
}
}

View File

@ -1,83 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class FakeClassnameTags123Api {
FakeClassnameTags123Api([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// To test class name in snake case
///
/// To test class name in snake case
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [ModelClient] modelClient (required):
/// client model
Future<Response> testClassnameWithHttpInfo(ModelClient modelClient,) async {
// Verify required params are set.
if (modelClient == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: modelClient');
}
// ignore: prefer_const_declarations
final path = r'/fake_classname_test';
// ignore: prefer_final_locals
Object postBody = modelClient;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['api_key_query'];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// To test class name in snake case
///
/// To test class name in snake case
///
/// Parameters:
///
/// * [ModelClient] modelClient (required):
/// client model
Future<ModelClient> testClassname(ModelClient modelClient,) async {
final response = await testClassnameWithHttpInfo(modelClient,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return ModelClient.fromJson(json.decode(response.body));
}
return Future<ModelClient>.value();
}
}

View File

@ -1,641 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PetApi {
PetApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Add a new pet to the store
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future<Response> addPetWithHttpInfo(Pet pet,) async {
// Verify required params are set.
if (pet == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pet');
}
// ignore: prefer_const_declarations
final path = r'/pet';
// ignore: prefer_final_locals
Object postBody = pet;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['petstore_auth'];
const contentTypes = <String>['application/json', 'application/xml'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Add a new pet to the store
///
/// Parameters:
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future<void> addPet(Pet pet,) async {
final response = await addPetWithHttpInfo(pet,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Deletes a pet
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] petId (required):
/// Pet id to delete
///
/// * [String] apiKey:
Future<Response> deletePetWithHttpInfo(int petId, { String apiKey, }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
}
// ignore: prefer_const_declarations
final path = r'/pet/{petId}'
.replaceAll('{petId}', petId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (apiKey != null) {
headerParams[r'api_key'] = parameterToString(apiKey);
}
const authNames = <String>['petstore_auth'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Deletes a pet
///
/// Parameters:
///
/// * [int] petId (required):
/// Pet id to delete
///
/// * [String] apiKey:
Future<void> deletePet(int petId, { String apiKey, }) async {
final response = await deletePetWithHttpInfo(petId, apiKey: apiKey, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Finds Pets by status
///
/// Multiple status values can be provided with comma separated strings
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [List<String>] status (required):
/// Status values that need to be considered for filter
Future<Response> findPetsByStatusWithHttpInfo(List<String> status,) async {
// Verify required params are set.
if (status == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: status');
}
// ignore: prefer_const_declarations
final path = r'/pet/findByStatus';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'status', status));
const authNames = <String>['petstore_auth'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Finds Pets by status
///
/// Multiple status values can be provided with comma separated strings
///
/// Parameters:
///
/// * [List<String>] status (required):
/// Status values that need to be considered for filter
Future<List<Pet>> findPetsByStatus(List<String> status,) async {
final response = await findPetsByStatusWithHttpInfo(status,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (json.decode(response.body) as List)
.map((i) => Pet.fromJson(i))
.toList();
}
return Future<List<Pet>>.value();
}
/// Finds Pets by tags
///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [Set<String>] tags (required):
/// Tags to filter by
Future<Response> findPetsByTagsWithHttpInfo(Set<String> tags,) async {
// Verify required params are set.
if (tags == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: tags');
}
// ignore: prefer_const_declarations
final path = r'/pet/findByTags';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'tags', tags));
const authNames = <String>['petstore_auth'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Finds Pets by tags
///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
///
/// Parameters:
///
/// * [Set<String>] tags (required):
/// Tags to filter by
Future<Set<Pet>> findPetsByTags(Set<String> tags,) async {
final response = await findPetsByTagsWithHttpInfo(tags,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return (json.decode(response.body) as List)
.map((i) => Pet.fromJson(i))
.toSet();
}
return Future<Set<Pet>>.value();
}
/// Find pet by ID
///
/// Returns a single pet
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to return
Future<Response> getPetByIdWithHttpInfo(int petId,) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
}
// ignore: prefer_const_declarations
final path = r'/pet/{petId}'
.replaceAll('{petId}', petId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['api_key'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Find pet by ID
///
/// Returns a single pet
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to return
Future<Pet> getPetById(int petId,) async {
final response = await getPetByIdWithHttpInfo(petId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Pet.fromJson(json.decode(response.body));
}
return Future<Pet>.value();
}
/// Update an existing pet
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future<Response> updatePetWithHttpInfo(Pet pet,) async {
// Verify required params are set.
if (pet == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: pet');
}
// ignore: prefer_const_declarations
final path = r'/pet';
// ignore: prefer_final_locals
Object postBody = pet;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['petstore_auth'];
const contentTypes = <String>['application/json', 'application/xml'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Update an existing pet
///
/// Parameters:
///
/// * [Pet] pet (required):
/// Pet object that needs to be added to the store
Future<void> updatePet(Pet pet,) async {
final response = await updatePetWithHttpInfo(pet,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Updates a pet in the store with form data
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet that needs to be updated
///
/// * [String] name:
/// Updated name of the pet
///
/// * [String] status:
/// Updated status of the pet
Future<Response> updatePetWithFormWithHttpInfo(int petId, { String name, String status, }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
}
// ignore: prefer_const_declarations
final path = r'/pet/{petId}'
.replaceAll('{petId}', petId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['petstore_auth'];
const contentTypes = <String>['application/x-www-form-urlencoded'];
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Updates a pet in the store with form data
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet that needs to be updated
///
/// * [String] name:
/// Updated name of the pet
///
/// * [String] status:
/// Updated status of the pet
Future<void> updatePetWithForm(int petId, { String name, String status, }) async {
final response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// uploads an image
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to update
///
/// * [String] additionalMetadata:
/// Additional data to pass to server
///
/// * [MultipartFile] file:
/// file to upload
Future<Response> uploadFileWithHttpInfo(int petId, { String additionalMetadata, MultipartFile file, }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
}
// ignore: prefer_const_declarations
final path = r'/pet/{petId}/uploadImage'
.replaceAll('{petId}', petId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['petstore_auth'];
const contentTypes = <String>['multipart/form-data'];
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// uploads an image
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to update
///
/// * [String] additionalMetadata:
/// Additional data to pass to server
///
/// * [MultipartFile] file:
/// file to upload
Future<ApiResponse> uploadFile(int petId, { String additionalMetadata, MultipartFile file, }) async {
final response = await uploadFileWithHttpInfo(petId, additionalMetadata: additionalMetadata, file: file, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return ApiResponse.fromJson(json.decode(response.body));
}
return Future<ApiResponse>.value();
}
/// uploads an image (required)
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to update
///
/// * [MultipartFile] requiredFile (required):
/// file to upload
///
/// * [String] additionalMetadata:
/// Additional data to pass to server
Future<Response> uploadFileWithRequiredFileWithHttpInfo(int petId, MultipartFile requiredFile, { String additionalMetadata, }) async {
// Verify required params are set.
if (petId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: petId');
}
if (requiredFile == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: requiredFile');
}
// ignore: prefer_const_declarations
final path = r'/fake/{petId}/uploadImageWithRequiredFile'
.replaceAll('{petId}', petId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['petstore_auth'];
const contentTypes = <String>['multipart/form-data'];
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (requiredFile != null) {
hasFields = true;
mp.fields[r'requiredFile'] = requiredFile.field;
mp.files.add(requiredFile);
}
if (hasFields) {
postBody = mp;
}
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// uploads an image (required)
///
/// Parameters:
///
/// * [int] petId (required):
/// ID of pet to update
///
/// * [MultipartFile] requiredFile (required):
/// file to upload
///
/// * [String] additionalMetadata:
/// Additional data to pass to server
Future<ApiResponse> uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata, }) async {
final response = await uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata: additionalMetadata, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return ApiResponse.fromJson(json.decode(response.body));
}
return Future<ApiResponse>.value();
}
}

View File

@ -1,253 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class StoreApi {
StoreApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future<Response> deleteOrderWithHttpInfo(String orderId,) async {
// Verify required params are set.
if (orderId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: orderId');
}
// ignore: prefer_const_declarations
final path = r'/store/order/{order_id}'
.replaceAll('{order_id}', orderId);
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
///
/// Parameters:
///
/// * [String] orderId (required):
/// ID of the order that needs to be deleted
Future<void> deleteOrder(String orderId,) async {
final response = await deleteOrderWithHttpInfo(orderId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Returns pet inventories by status
///
/// Returns a map of status codes to quantities
///
/// Note: This method returns the HTTP [Response].
Future<Response> getInventoryWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/store/inventory';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>['api_key'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Returns pet inventories by status
///
/// Returns a map of status codes to quantities
Future<Map<String, int>> getInventory() async {
final response = await getInventoryWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Map<String, int>.from(json.decode(response.body));
}
return Future<Map<String, int>>.value();
}
/// Find purchase order by ID
///
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [int] orderId (required):
/// ID of pet that needs to be fetched
Future<Response> getOrderByIdWithHttpInfo(int orderId,) async {
// Verify required params are set.
if (orderId == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: orderId');
}
// ignore: prefer_const_declarations
final path = r'/store/order/{order_id}'
.replaceAll('{order_id}', orderId.toString());
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Find purchase order by ID
///
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
///
/// Parameters:
///
/// * [int] orderId (required):
/// ID of pet that needs to be fetched
Future<Order> getOrderById(int orderId,) async {
final response = await getOrderByIdWithHttpInfo(orderId,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Order.fromJson(json.decode(response.body));
}
return Future<Order>.value();
}
/// Place an order for a pet
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [Order] order (required):
/// order placed for purchasing the pet
Future<Response> placeOrderWithHttpInfo(Order order,) async {
// Verify required params are set.
if (order == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: order');
}
// ignore: prefer_const_declarations
final path = r'/store/order';
// ignore: prefer_final_locals
Object postBody = order;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Place an order for a pet
///
/// Parameters:
///
/// * [Order] order (required):
/// order placed for purchasing the pet
Future<Order> placeOrder(Order order,) async {
final response = await placeOrderWithHttpInfo(order,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return Order.fromJson(json.decode(response.body));
}
return Future<Order>.value();
}
}

View File

@ -1,479 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class UserApi {
UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create user
///
/// This can only be done by the logged in user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [User] user (required):
/// Created user object
Future<Response> createUserWithHttpInfo(User user,) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
// ignore: prefer_const_declarations
final path = r'/user';
// ignore: prefer_final_locals
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Create user
///
/// This can only be done by the logged in user.
///
/// Parameters:
///
/// * [User] user (required):
/// Created user object
Future<void> createUser(User user,) async {
final response = await createUserWithHttpInfo(user,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Creates list of users with given input array
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [List<User>] user (required):
/// List of user object
Future<Response> createUsersWithArrayInputWithHttpInfo(List<User> user,) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
// ignore: prefer_const_declarations
final path = r'/user/createWithArray';
// ignore: prefer_final_locals
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Creates list of users with given input array
///
/// Parameters:
///
/// * [List<User>] user (required):
/// List of user object
Future<void> createUsersWithArrayInput(List<User> user,) async {
final response = await createUsersWithArrayInputWithHttpInfo(user,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Creates list of users with given input array
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [List<User>] user (required):
/// List of user object
Future<Response> createUsersWithListInputWithHttpInfo(List<User> user,) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
// ignore: prefer_const_declarations
final path = r'/user/createWithList';
// ignore: prefer_final_locals
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Creates list of users with given input array
///
/// Parameters:
///
/// * [List<User>] user (required):
/// List of user object
Future<void> createUsersWithListInput(List<User> user,) async {
final response = await createUsersWithListInputWithHttpInfo(user,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Delete user
///
/// This can only be done by the logged in user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] username (required):
/// The name that needs to be deleted
Future<Response> deleteUserWithHttpInfo(String username,) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
}
// ignore: prefer_const_declarations
final path = r'/user/{username}'
.replaceAll('{username}', username);
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Delete user
///
/// This can only be done by the logged in user.
///
/// Parameters:
///
/// * [String] username (required):
/// The name that needs to be deleted
Future<void> deleteUser(String username,) async {
final response = await deleteUserWithHttpInfo(username,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Get user by user name
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] username (required):
/// The name that needs to be fetched. Use user1 for testing.
Future<Response> getUserByNameWithHttpInfo(String username,) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
}
// ignore: prefer_const_declarations
final path = r'/user/{username}'
.replaceAll('{username}', username);
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Get user by user name
///
/// Parameters:
///
/// * [String] username (required):
/// The name that needs to be fetched. Use user1 for testing.
Future<User> getUserByName(String username,) async {
final response = await getUserByNameWithHttpInfo(username,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return User.fromJson(json.decode(response.body));
}
return Future<User>.value();
}
/// Logs user into the system
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] username (required):
/// The user name for login
///
/// * [String] password (required):
/// The password for login in clear text
Future<Response> loginUserWithHttpInfo(String username, String password,) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
}
if (password == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: password');
}
// ignore: prefer_const_declarations
final path = r'/user/login';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_convertParametersForCollectionFormat('', 'username', username));
queryParams.addAll(_convertParametersForCollectionFormat('', 'password', password));
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Logs user into the system
///
/// Parameters:
///
/// * [String] username (required):
/// The user name for login
///
/// * [String] password (required):
/// The password for login in clear text
Future<String> loginUser(String username, String password,) async {
final response = await loginUserWithHttpInfo(username, password,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) {
return response.body as String;
}
return Future<String>.value();
}
/// Logs out current logged in user session
///
/// Note: This method returns the HTTP [Response].
Future<Response> logoutUserWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/user/logout';
// ignore: prefer_final_locals
Object postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Logs out current logged in user session
Future<void> logoutUser() async {
final response = await logoutUserWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Updated user
///
/// This can only be done by the logged in user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] username (required):
/// name that need to be deleted
///
/// * [User] user (required):
/// Updated user object
Future<Response> updateUserWithHttpInfo(String username, User user,) async {
// Verify required params are set.
if (username == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: username');
}
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
// ignore: prefer_const_declarations
final path = r'/user/{username}'
.replaceAll('{username}', username);
// ignore: prefer_final_locals
Object postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const authNames = <String>[];
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes[0],
authNames,
);
}
/// Updated user
///
/// This can only be done by the logged in user.
///
/// Parameters:
///
/// * [String] username (required):
/// name that need to be deleted
///
/// * [User] user (required):
/// Updated user object
Future<void> updateUser(String username, User user,) async {
final response = await updateUserWithHttpInfo(username, user,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
}

View File

@ -1,173 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ApiClient {
ApiClient({this.basePath = 'http://petstore.swagger.io:80/v2'}) {
// Setup authentications (key: authentication name, value: authentication).
_authentications[r'api_key'] = ApiKeyAuth('header', 'api_key');
_authentications[r'api_key_query'] = ApiKeyAuth('query', 'api_key_query');
_authentications[r'bearer_test'] = HttpBearerAuth();
_authentications[r'http_basic_test'] = HttpBasicAuth();
_authentications[r'petstore_auth'] = OAuth();
}
final String basePath;
var _client = Client();
/// Returns the current HTTP [Client] instance to use in this class.
///
/// The return value is guaranteed to never be null.
Client get client => _client;
/// Requests to use a new HTTP [Client] in this class.
///
/// If the [newClient] is null, an [ArgumentError] is thrown.
set client(Client newClient) {
if (newClient == null) {
throw ArgumentError('New client instance cannot be null.');
}
_client = newClient;
}
final _defaultHeaderMap = <String, String>{};
final _authentications = <String, Authentication>{};
void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value;
}
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
/// Returns an unmodifiable [Map] of the authentications, since none should be added
/// or deleted.
Map<String, Authentication> get authentications => Map.unmodifiable(_authentications);
T getAuthentication<T extends Authentication>(String name) {
final authentication = _authentications[name];
return authentication is T ? authentication : null;
}
// We don't use a Map<String, String> for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times.
Future<Response> invokeAPI(
String path,
String method,
List<QueryParam> queryParams,
Object body,
Map<String, String> headerParams,
Map<String, String> formParams,
String nullableContentType,
List<String> authNames,
) async {
_updateParamsForAuth(authNames, queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap);
final urlEncodedQueryParams = queryParams
.where((param) => param.value != null)
.map((param) => '$param');
final queryString = urlEncodedQueryParams.isNotEmpty
? '?${urlEncodedQueryParams.join('&')}'
: '';
final uri = Uri.parse('$basePath$path$queryString');
if (nullableContentType != null) {
headerParams['Content-Type'] = nullableContentType;
}
try {
// Special case for uploading a single file which isn't a 'multipart/form-data'.
if (
body is MultipartFile && (nullableContentType == null ||
!nullableContentType.toLowerCase().startsWith('multipart/form-data'))
) {
final request = StreamedRequest(method, uri);
request.headers.addAll(headerParams);
request.contentLength = body.length;
body.finalize().listen(
request.sink.add,
onDone: request.sink.close,
// ignore: avoid_types_on_closure_parameters
onError: (Object error, StackTrace trace) => request.sink.close(),
cancelOnError: true,
);
final response = await _client.send(request);
return Response.fromStream(response);
}
if (body is MultipartRequest) {
final request = MultipartRequest(method, uri);
request.fields.addAll(body.fields);
request.files.addAll(body.files);
request.headers.addAll(body.headers);
request.headers.addAll(headerParams);
final response = await _client.send(request);
return Response.fromStream(response);
}
final msgBody = nullableContentType == 'application/x-www-form-urlencoded'
? formParams
: await serializeAsync(body);
final nullableHeaderParams = headerParams.isEmpty ? null : headerParams;
switch(method) {
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
}
} on SocketException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,);
} on TlsException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,);
} on IOException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,);
} on ClientException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,);
} on Exception catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,);
}
throw ApiException(HttpStatus.badRequest, 'Invalid HTTP operation: $method $path',);
}
// ignore: deprecated_member_use_from_same_package
Future<String> serializeAsync(Object value) async => serialize(value);
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
String serialize(Object value) => value == null ? '' : json.encode(value);
/// Update query and header parameters based on authentication settings.
/// @param authNames The authentications to apply
void _updateParamsForAuth(
List<String> authNames,
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
for(final authName in authNames) {
final auth = _authentications[authName];
if (auth == null) {
throw ArgumentError('Authentication undefined: $authName');
}
auth.applyToParams(queryParams, headerParams);
}
}
}
/// Primarily intended for use in an isolate.
Future<String> serializeAsync(Object value) async => value == null ? '' : json.encode(value);

View File

@ -1,33 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ApiException implements Exception {
ApiException(this.code, this.message);
ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);
int code = 0;
String message;
Exception innerException;
StackTrace stackTrace;
@override
String toString() {
if (message == null) {
return 'ApiException';
}
if (innerException == null) {
return 'ApiException $code: $message';
}
return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace';
}
}

View File

@ -1,121 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QueryParam {
const QueryParam(this.name, this.value);
final String name;
final String value;
@override
String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}';
}
// Ported from the Java version.
Iterable<QueryParam> _convertParametersForCollectionFormat(
String collectionFormat,
String name,
dynamic value,
) {
final params = <QueryParam>[];
// preconditions
if (name != null && name.isNotEmpty && value != null) {
if (value is List) {
if (collectionFormat == 'multi') {
return value.map((dynamic v) => QueryParam(name, parameterToString(v)),);
}
// Default collection format is 'csv'.
if (collectionFormat == null || collectionFormat.isEmpty) {
// ignore: parameter_assignments
collectionFormat = 'csv';
}
final delimiter = _delimiters[collectionFormat] ?? ',';
params.add(QueryParam(name, value.map<dynamic>(parameterToString).join(delimiter)),);
} else {
params.add(QueryParam(name, parameterToString(value),));
}
}
return params;
}
/// Format the given parameter object into a [String].
String parameterToString(dynamic value) {
if (value == null) {
return '';
}
if (value is DateTime) {
return value.toUtc().toIso8601String();
}
if (value is EnumClass) {
return value.toString();
}
if (value is OuterEnum) {
return value.toString();
}
if (value is OuterEnumDefaultValue) {
return value.toString();
}
if (value is OuterEnumInteger) {
return value.toString();
}
if (value is OuterEnumIntegerDefaultValue) {
return value.toString();
}
return value.toString();
}
/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json'
/// content type. Otherwise, returns the decoded body as decoded by dart:http package.
Future<String> _decodeBodyBytes(Response response) async {
final contentType = response.headers['content-type'];
return contentType != null && contentType.toLowerCase().startsWith('application/json')
? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes)
: response.body;
}
/// Returns a valid [T] value found at the specified Map [key], null otherwise.
T mapValueOfType<T>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is T ? value : null;
}
/// Returns a valid Map<K, V> found at the specified Map [key], null otherwise.
Map<K, V> mapCastOfType<K, V>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is Map ? value.cast<K, V>() : null;
}
/// Returns a valid [DateTime] found at the specified Map [key], null otherwise.
DateTime mapDateTime(dynamic map, String key, [String pattern]) {
final dynamic value = map is Map ? map[key] : null;
if (value != null) {
int millis;
if (value is int) {
millis = value;
} else if (value is String) {
if (pattern == _dateEpochMarker) {
millis = int.tryParse(value);
} else {
return DateTime.tryParse(value);
}
}
if (millis != null) {
return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true);
}
}
return null;
}

Some files were not shown because too many files have changed in this diff Show More