mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 3c03bfeb7dff327df26db05d4ca49fcf5312dc7d into d6c46342693205f0dae441b45742d9c85d41cf33
This commit is contained in:
commit
0c72da66e3
@ -0,0 +1,14 @@
|
||||
generatorName: dart-dio
|
||||
outputDir: samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
|
||||
typeMappings:
|
||||
Client: "ModelClient"
|
||||
File: "ModelFile"
|
||||
EnumClass: "ModelEnumClass"
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
enumUnknownDefaultCase: "true"
|
||||
dateLibrary: "timemachine"
|
||||
reservedWordsMappings:
|
||||
class: "classField"
|
@ -303,7 +303,7 @@ public class DartDioClientCodegen extends AbstractDartCodegen {
|
||||
imports.put("OffsetDate", "package:time_machine/time_machine.dart");
|
||||
imports.put("OffsetDateTime", "package:time_machine/time_machine.dart");
|
||||
if (SERIALIZATION_LIBRARY_BUILT_VALUE.equals(library)) {
|
||||
supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "local_date_serializer.dart"));
|
||||
supportingFiles.add(new SupportingFile("serialization/built_value/offset_date_serializer.mustache", srcFolder, "offset_date_serializer.dart"));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
41
samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/.gitignore
vendored
Normal file
41
samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake-timemachine/.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# See https://dart.dev/guides/libraries/private-files
|
||||
|
||||
# Files and directories created by pub
|
||||
.dart_tool/
|
||||
.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
|
||||
|
||||
# Don’t commit files and directories created by other development environments.
|
||||
# For example, if your development environment creates any of the following files,
|
||||
# consider putting them in a global ignore file:
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
.idea/
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1,128 @@
|
||||
.gitignore
|
||||
README.md
|
||||
analysis_options.yaml
|
||||
doc/AdditionalPropertiesClass.md
|
||||
doc/AllOfWithSingleRef.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/Category.md
|
||||
doc/ChildWithNullable.md
|
||||
doc/ClassModel.md
|
||||
doc/DefaultApi.md
|
||||
doc/DeprecatedObject.md
|
||||
doc/Dog.md
|
||||
doc/EnumArrays.md
|
||||
doc/EnumTest.md
|
||||
doc/FakeApi.md
|
||||
doc/FakeBigDecimalMap200Response.md
|
||||
doc/FakeClassnameTags123Api.md
|
||||
doc/FileSchemaTestClass.md
|
||||
doc/Foo.md
|
||||
doc/FooGetDefaultResponse.md
|
||||
doc/FormatTest.md
|
||||
doc/HasOnlyReadOnly.md
|
||||
doc/HealthCheckResult.md
|
||||
doc/MapTest.md
|
||||
doc/MixedPropertiesAndAdditionalPropertiesClass.md
|
||||
doc/Model200Response.md
|
||||
doc/ModelClient.md
|
||||
doc/ModelEnumClass.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/ParentWithNullable.md
|
||||
doc/Pet.md
|
||||
doc/PetApi.md
|
||||
doc/ReadOnlyFirst.md
|
||||
doc/SingleRefType.md
|
||||
doc/SpecialModelName.md
|
||||
doc/StoreApi.md
|
||||
doc/Tag.md
|
||||
doc/TestInlineFreeformAdditionalPropertiesRequest.md
|
||||
doc/User.md
|
||||
doc/UserApi.md
|
||||
lib/openapi.dart
|
||||
lib/src/api.dart
|
||||
lib/src/api/another_fake_api.dart
|
||||
lib/src/api/default_api.dart
|
||||
lib/src/api/fake_api.dart
|
||||
lib/src/api/fake_classname_tags123_api.dart
|
||||
lib/src/api/pet_api.dart
|
||||
lib/src/api/store_api.dart
|
||||
lib/src/api/user_api.dart
|
||||
lib/src/api_util.dart
|
||||
lib/src/auth/api_key_auth.dart
|
||||
lib/src/auth/auth.dart
|
||||
lib/src/auth/basic_auth.dart
|
||||
lib/src/auth/bearer_auth.dart
|
||||
lib/src/auth/oauth.dart
|
||||
lib/src/model/additional_properties_class.dart
|
||||
lib/src/model/all_of_with_single_ref.dart
|
||||
lib/src/model/animal.dart
|
||||
lib/src/model/api_response.dart
|
||||
lib/src/model/array_of_array_of_number_only.dart
|
||||
lib/src/model/array_of_number_only.dart
|
||||
lib/src/model/array_test.dart
|
||||
lib/src/model/capitalization.dart
|
||||
lib/src/model/cat.dart
|
||||
lib/src/model/category.dart
|
||||
lib/src/model/child_with_nullable.dart
|
||||
lib/src/model/class_model.dart
|
||||
lib/src/model/deprecated_object.dart
|
||||
lib/src/model/dog.dart
|
||||
lib/src/model/enum_arrays.dart
|
||||
lib/src/model/enum_test.dart
|
||||
lib/src/model/fake_big_decimal_map200_response.dart
|
||||
lib/src/model/file_schema_test_class.dart
|
||||
lib/src/model/foo.dart
|
||||
lib/src/model/foo_get_default_response.dart
|
||||
lib/src/model/format_test.dart
|
||||
lib/src/model/has_only_read_only.dart
|
||||
lib/src/model/health_check_result.dart
|
||||
lib/src/model/map_test.dart
|
||||
lib/src/model/mixed_properties_and_additional_properties_class.dart
|
||||
lib/src/model/model200_response.dart
|
||||
lib/src/model/model_client.dart
|
||||
lib/src/model/model_enum_class.dart
|
||||
lib/src/model/model_file.dart
|
||||
lib/src/model/model_list.dart
|
||||
lib/src/model/model_return.dart
|
||||
lib/src/model/name.dart
|
||||
lib/src/model/nullable_class.dart
|
||||
lib/src/model/number_only.dart
|
||||
lib/src/model/object_with_deprecated_fields.dart
|
||||
lib/src/model/order.dart
|
||||
lib/src/model/outer_composite.dart
|
||||
lib/src/model/outer_enum.dart
|
||||
lib/src/model/outer_enum_default_value.dart
|
||||
lib/src/model/outer_enum_integer.dart
|
||||
lib/src/model/outer_enum_integer_default_value.dart
|
||||
lib/src/model/outer_object_with_enum_property.dart
|
||||
lib/src/model/parent_with_nullable.dart
|
||||
lib/src/model/pet.dart
|
||||
lib/src/model/read_only_first.dart
|
||||
lib/src/model/single_ref_type.dart
|
||||
lib/src/model/special_model_name.dart
|
||||
lib/src/model/tag.dart
|
||||
lib/src/model/test_inline_freeform_additional_properties_request.dart
|
||||
lib/src/model/user.dart
|
||||
lib/src/offset_date_serializer.dart
|
||||
lib/src/serializers.dart
|
||||
pubspec.yaml
|
@ -0,0 +1 @@
|
||||
7.13.0-SNAPSHOT
|
@ -0,0 +1,212 @@
|
||||
# openapi (EXPERIMENTAL)
|
||||
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
|
||||
- Generator version: 7.13.0-SNAPSHOT
|
||||
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen
|
||||
|
||||
## Requirements
|
||||
|
||||
* Dart 2.15.0+ or Flutter 2.8.0+
|
||||
* Dio 5.0.0+ (https://pub.dev/packages/dio)
|
||||
* timemachine option currently **DOES NOT** support sound null-safety and may not work
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
### pub.dev
|
||||
To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
openapi: 1.0.0
|
||||
```
|
||||
|
||||
### Github
|
||||
If this Dart package is published to Github, please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
openapi:
|
||||
git:
|
||||
url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
|
||||
#ref: main
|
||||
```
|
||||
|
||||
### Local development
|
||||
To use the package from your local drive, please include the following in pubspec.yaml
|
||||
```yaml
|
||||
dependencies:
|
||||
openapi:
|
||||
path: /path/to/openapi
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```dart
|
||||
import 'package:openapi/openapi.dart';
|
||||
|
||||
|
||||
final api = Openapi().getAnotherFakeApi();
|
||||
final ModelClient modelClient = ; // ModelClient | client model
|
||||
|
||||
try {
|
||||
final response = await api.call123testSpecialTags(modelClient);
|
||||
print(response);
|
||||
} catch on DioException (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*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeBigDecimalMap**](doc/FakeApi.md#fakebigdecimalmap) | **GET** /fake/BigDecimalMap |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testAdditionalPropertiesReference**](doc/FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testInlineFreeformAdditionalProperties**](doc/FakeApi.md#testinlinefreeformadditionalproperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testNullable**](doc/FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters |
|
||||
[*FakeApi*](doc/FakeApi.md) | [**testStringMapReference**](doc/FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map
|
||||
[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
|
||||
[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||
[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||
[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||
[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user
|
||||
[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||
[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||
[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||
[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md)
|
||||
- [AllOfWithSingleRef](doc/AllOfWithSingleRef.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)
|
||||
- [Category](doc/Category.md)
|
||||
- [ChildWithNullable](doc/ChildWithNullable.md)
|
||||
- [ClassModel](doc/ClassModel.md)
|
||||
- [DeprecatedObject](doc/DeprecatedObject.md)
|
||||
- [Dog](doc/Dog.md)
|
||||
- [EnumArrays](doc/EnumArrays.md)
|
||||
- [EnumTest](doc/EnumTest.md)
|
||||
- [FakeBigDecimalMap200Response](doc/FakeBigDecimalMap200Response.md)
|
||||
- [FileSchemaTestClass](doc/FileSchemaTestClass.md)
|
||||
- [Foo](doc/Foo.md)
|
||||
- [FooGetDefaultResponse](doc/FooGetDefaultResponse.md)
|
||||
- [FormatTest](doc/FormatTest.md)
|
||||
- [HasOnlyReadOnly](doc/HasOnlyReadOnly.md)
|
||||
- [HealthCheckResult](doc/HealthCheckResult.md)
|
||||
- [MapTest](doc/MapTest.md)
|
||||
- [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [Model200Response](doc/Model200Response.md)
|
||||
- [ModelClient](doc/ModelClient.md)
|
||||
- [ModelEnumClass](doc/ModelEnumClass.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)
|
||||
- [ParentWithNullable](doc/ParentWithNullable.md)
|
||||
- [Pet](doc/Pet.md)
|
||||
- [ReadOnlyFirst](doc/ReadOnlyFirst.md)
|
||||
- [SingleRefType](doc/SingleRefType.md)
|
||||
- [SpecialModelName](doc/SpecialModelName.md)
|
||||
- [Tag](doc/Tag.md)
|
||||
- [TestInlineFreeformAdditionalPropertiesRequest](doc/TestInlineFreeformAdditionalPropertiesRequest.md)
|
||||
- [User](doc/User.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### 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
|
||||
|
||||
### 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
|
||||
|
||||
### http_basic_test
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
### bearer_test
|
||||
|
||||
- **Type**: HTTP Bearer Token authentication (JWT)
|
||||
|
||||
### http_signature_test
|
||||
|
||||
- **Type**: HTTP signature authentication
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
analyzer:
|
||||
language:
|
||||
strict-inference: true
|
||||
strict-raw-types: true
|
||||
strict-casts: false
|
||||
exclude:
|
||||
- test/*.dart
|
||||
errors:
|
||||
deprecated_member_use_from_same_package: ignore
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.AdditionalPropertiesClass
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapProperty** | **BuiltMap<String, String>** | | [optional]
|
||||
**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.AllOfWithSingleRef
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**username** | **String** | | [optional]
|
||||
**singleRefType** | [**SingleRefType**](SingleRefType.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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,57 @@
|
||||
# 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 = Openapi().getAnotherFakeApi();
|
||||
final ModelClient modelClient = ; // ModelClient | client model
|
||||
|
||||
try {
|
||||
final response = api.call123testSpecialTags(modelClient);
|
||||
print(response);
|
||||
} catch on DioException (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)
|
||||
|
@ -0,0 +1,17 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# openapi.model.ArrayOfArrayOfNumberOnly
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# openapi.model.ArrayOfNumberOnly
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayNumber** | **BuiltList<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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# openapi.model.ArrayTest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayOfString** | **BuiltList<String>** | | [optional]
|
||||
**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional]
|
||||
**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.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)
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# openapi.model.ChildWithNullable
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**type** | **String** | | [optional]
|
||||
**nullableProperty** | **String** | | [optional]
|
||||
**otherProperty** | **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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# openapi.model.ClassModel
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**classField** | **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)
|
||||
|
||||
|
@ -0,0 +1,51 @@
|
||||
# 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**
|
||||
> FooGetDefaultResponse fooGet()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
final api = Openapi().getDefaultApi();
|
||||
|
||||
try {
|
||||
final response = api.fooGet();
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling DefaultApi->fooGet: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**FooGetDefaultResponse**](FooGetDefaultResponse.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)
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.EnumArrays
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justSymbol** | **String** | | [optional]
|
||||
**arrayEnum** | **BuiltList<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)
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
# 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)
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,16 @@
|
||||
# openapi.model.FakeBigDecimalMap200Response
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**someId** | **num** | | [optional]
|
||||
**someMap** | **BuiltMap<String, 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)
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
# 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 = Openapi().getFakeClassnameTags123Api();
|
||||
final ModelClient modelClient = ; // ModelClient | client model
|
||||
|
||||
try {
|
||||
final response = api.testClassname(modelClient);
|
||||
print(response);
|
||||
} catch on DioException (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)
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.FileSchemaTestClass
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**ModelFile**](ModelFile.md) | | [optional]
|
||||
**files** | [**BuiltList<ModelFile>**](ModelFile.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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# openapi.model.FooGetDefaultResponse
|
||||
|
||||
## 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)
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
# 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** | [**Uint8List**](Uint8List.md) | | [optional]
|
||||
**date** | [**OffsetDate**](OffsetDate.md) | |
|
||||
**dateTime** | [**OffsetDateTime**](OffsetDateTime.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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.HasOnlyReadOnly
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**foo** | **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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
# openapi.model.MapTest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional]
|
||||
**mapOfEnumString** | **BuiltMap<String, String>** | | [optional]
|
||||
**directMap** | **BuiltMap<String, bool>** | | [optional]
|
||||
**indirectMap** | **BuiltMap<String, 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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# openapi.model.MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | **String** | | [optional]
|
||||
**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||
**map** | [**BuiltMap<String, Animal>**](Animal.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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.Model200Response
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **int** | | [optional]
|
||||
**classField** | **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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# openapi.model.ModelEnumClass
|
||||
|
||||
## 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
# openapi.model.Name
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **int** | |
|
||||
**snakeCase** | **int** | | [optional]
|
||||
**property** | **String** | | [optional]
|
||||
**n123number** | **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)
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
# 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** | [**OffsetDate**](OffsetDate.md) | | [optional]
|
||||
**datetimeProp** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional]
|
||||
**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
|
||||
**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
|
||||
**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional]
|
||||
**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional]
|
||||
**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional]
|
||||
**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
# 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** | **BuiltList<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)
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
# 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** | [**OffsetDateTime**](OffsetDateTime.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)
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.ParentWithNullable
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**type** | **String** | | [optional]
|
||||
**nullableProperty** | **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)
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
# 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** | **BuiltSet<String>** | |
|
||||
**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional]
|
||||
**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)
|
||||
|
||||
|
@ -0,0 +1,439 @@
|
||||
# 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 = Openapi().getPetApi();
|
||||
final Pet pet = ; // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api.addPet(pet);
|
||||
} catch on DioException (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 = Openapi().getPetApi();
|
||||
final int petId = 789; // int | Pet id to delete
|
||||
final String apiKey = apiKey_example; // String |
|
||||
|
||||
try {
|
||||
api.deletePet(petId, apiKey);
|
||||
} catch on DioException (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**
|
||||
> BuiltList<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 = Openapi().getPetApi();
|
||||
final BuiltList<String> status = ; // BuiltList<String> | Status values that need to be considered for filter
|
||||
|
||||
try {
|
||||
final response = api.findPetsByStatus(status);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling PetApi->findPetsByStatus: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter |
|
||||
|
||||
### Return type
|
||||
|
||||
[**BuiltList<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**
|
||||
> BuiltSet<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 = Openapi().getPetApi();
|
||||
final BuiltSet<String> tags = ; // BuiltSet<String> | Tags to filter by
|
||||
|
||||
try {
|
||||
final response = api.findPetsByTags(tags);
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling PetApi->findPetsByTags: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**BuiltSet<String>**](String.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**BuiltSet<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 = Openapi().getPetApi();
|
||||
final int petId = 789; // int | ID of pet to return
|
||||
|
||||
try {
|
||||
final response = api.getPetById(petId);
|
||||
print(response);
|
||||
} catch on DioException (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 = Openapi().getPetApi();
|
||||
final Pet pet = ; // Pet | Pet object that needs to be added to the store
|
||||
|
||||
try {
|
||||
api.updatePet(pet);
|
||||
} catch on DioException (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 = Openapi().getPetApi();
|
||||
final int petId = 789; // int | ID of pet that needs to be updated
|
||||
final String name = name_example; // String | Updated name of the pet
|
||||
final String status = status_example; // String | Updated status of the pet
|
||||
|
||||
try {
|
||||
api.updatePetWithForm(petId, name, status);
|
||||
} catch on DioException (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 = Openapi().getPetApi();
|
||||
final int petId = 789; // int | ID of pet to update
|
||||
final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
|
||||
final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload
|
||||
|
||||
try {
|
||||
final response = api.uploadFile(petId, additionalMetadata, file);
|
||||
print(response);
|
||||
} catch on DioException (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 = Openapi().getPetApi();
|
||||
final int petId = 789; // int | ID of pet to update
|
||||
final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload
|
||||
final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server
|
||||
|
||||
try {
|
||||
final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata);
|
||||
print(response);
|
||||
} catch on DioException (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)
|
||||
|
@ -0,0 +1,16 @@
|
||||
# openapi.model.ReadOnlyFirst
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **String** | | [optional]
|
||||
**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)
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
# openapi.model.SingleRefType
|
||||
|
||||
## 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,188 @@
|
||||
# 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 = Openapi().getStoreApi();
|
||||
final String orderId = orderId_example; // String | ID of the order that needs to be deleted
|
||||
|
||||
try {
|
||||
api.deleteOrder(orderId);
|
||||
} catch on DioException (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**
|
||||
> BuiltMap<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 = Openapi().getStoreApi();
|
||||
|
||||
try {
|
||||
final response = api.getInventory();
|
||||
print(response);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling StoreApi->getInventory: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**BuiltMap<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 generate exceptions
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
final api = Openapi().getStoreApi();
|
||||
final int orderId = 789; // int | ID of pet that needs to be fetched
|
||||
|
||||
try {
|
||||
final response = api.getOrderById(orderId);
|
||||
print(response);
|
||||
} catch on DioException (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 = Openapi().getStoreApi();
|
||||
final Order order = ; // Order | order placed for purchasing the pet
|
||||
|
||||
try {
|
||||
final response = api.placeOrder(order);
|
||||
print(response);
|
||||
} catch on DioException (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)
|
||||
|
@ -0,0 +1,16 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
# openapi.model.TestInlineFreeformAdditionalPropertiesRequest
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**someProperty** | **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)
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
# 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)
|
||||
|
||||
|
@ -0,0 +1,359 @@
|
||||
# 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 = Openapi().getUserApi();
|
||||
final User user = ; // User | Created user object
|
||||
|
||||
try {
|
||||
api.createUser(user);
|
||||
} catch on DioException (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 = Openapi().getUserApi();
|
||||
final BuiltList<User> user = ; // BuiltList<User> | List of user object
|
||||
|
||||
try {
|
||||
api.createUsersWithArrayInput(user);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling UserApi->createUsersWithArrayInput: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**BuiltList<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 = Openapi().getUserApi();
|
||||
final BuiltList<User> user = ; // BuiltList<User> | List of user object
|
||||
|
||||
try {
|
||||
api.createUsersWithListInput(user);
|
||||
} catch on DioException (e) {
|
||||
print('Exception when calling UserApi->createUsersWithListInput: $e\n');
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**BuiltList<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 = Openapi().getUserApi();
|
||||
final String username = username_example; // String | The name that needs to be deleted
|
||||
|
||||
try {
|
||||
api.deleteUser(username);
|
||||
} catch on DioException (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 = Openapi().getUserApi();
|
||||
final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
try {
|
||||
final response = api.getUserByName(username);
|
||||
print(response);
|
||||
} catch on DioException (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 = Openapi().getUserApi();
|
||||
final String username = username_example; // String | The user name for login
|
||||
final String password = password_example; // String | The password for login in clear text
|
||||
|
||||
try {
|
||||
final response = api.loginUser(username, password);
|
||||
print(response);
|
||||
} catch on DioException (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 = Openapi().getUserApi();
|
||||
|
||||
try {
|
||||
api.logoutUser();
|
||||
} catch on DioException (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 = Openapi().getUserApi();
|
||||
final String username = username_example; // String | name that need to be deleted
|
||||
final User user = ; // User | Updated user object
|
||||
|
||||
try {
|
||||
api.updateUser(username, user);
|
||||
} catch on DioException (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)
|
||||
|
@ -0,0 +1,71 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
export 'package:openapi/src/api.dart';
|
||||
export 'package:openapi/src/auth/api_key_auth.dart';
|
||||
export 'package:openapi/src/auth/basic_auth.dart';
|
||||
export 'package:openapi/src/auth/bearer_auth.dart';
|
||||
export 'package:openapi/src/auth/oauth.dart';
|
||||
export 'package:openapi/src/serializers.dart';
|
||||
|
||||
|
||||
export 'package:openapi/src/api/another_fake_api.dart';
|
||||
export 'package:openapi/src/api/default_api.dart';
|
||||
export 'package:openapi/src/api/fake_api.dart';
|
||||
export 'package:openapi/src/api/fake_classname_tags123_api.dart';
|
||||
export 'package:openapi/src/api/pet_api.dart';
|
||||
export 'package:openapi/src/api/store_api.dart';
|
||||
export 'package:openapi/src/api/user_api.dart';
|
||||
|
||||
export 'package:openapi/src/model/additional_properties_class.dart';
|
||||
export 'package:openapi/src/model/all_of_with_single_ref.dart';
|
||||
export 'package:openapi/src/model/animal.dart';
|
||||
export 'package:openapi/src/model/api_response.dart';
|
||||
export 'package:openapi/src/model/array_of_array_of_number_only.dart';
|
||||
export 'package:openapi/src/model/array_of_number_only.dart';
|
||||
export 'package:openapi/src/model/array_test.dart';
|
||||
export 'package:openapi/src/model/capitalization.dart';
|
||||
export 'package:openapi/src/model/cat.dart';
|
||||
export 'package:openapi/src/model/category.dart';
|
||||
export 'package:openapi/src/model/child_with_nullable.dart';
|
||||
export 'package:openapi/src/model/class_model.dart';
|
||||
export 'package:openapi/src/model/deprecated_object.dart';
|
||||
export 'package:openapi/src/model/dog.dart';
|
||||
export 'package:openapi/src/model/enum_arrays.dart';
|
||||
export 'package:openapi/src/model/enum_test.dart';
|
||||
export 'package:openapi/src/model/fake_big_decimal_map200_response.dart';
|
||||
export 'package:openapi/src/model/file_schema_test_class.dart';
|
||||
export 'package:openapi/src/model/foo.dart';
|
||||
export 'package:openapi/src/model/foo_get_default_response.dart';
|
||||
export 'package:openapi/src/model/format_test.dart';
|
||||
export 'package:openapi/src/model/has_only_read_only.dart';
|
||||
export 'package:openapi/src/model/health_check_result.dart';
|
||||
export 'package:openapi/src/model/map_test.dart';
|
||||
export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart';
|
||||
export 'package:openapi/src/model/model200_response.dart';
|
||||
export 'package:openapi/src/model/model_client.dart';
|
||||
export 'package:openapi/src/model/model_enum_class.dart';
|
||||
export 'package:openapi/src/model/model_file.dart';
|
||||
export 'package:openapi/src/model/model_list.dart';
|
||||
export 'package:openapi/src/model/model_return.dart';
|
||||
export 'package:openapi/src/model/name.dart';
|
||||
export 'package:openapi/src/model/nullable_class.dart';
|
||||
export 'package:openapi/src/model/number_only.dart';
|
||||
export 'package:openapi/src/model/object_with_deprecated_fields.dart';
|
||||
export 'package:openapi/src/model/order.dart';
|
||||
export 'package:openapi/src/model/outer_composite.dart';
|
||||
export 'package:openapi/src/model/outer_enum.dart';
|
||||
export 'package:openapi/src/model/outer_enum_default_value.dart';
|
||||
export 'package:openapi/src/model/outer_enum_integer.dart';
|
||||
export 'package:openapi/src/model/outer_enum_integer_default_value.dart';
|
||||
export 'package:openapi/src/model/outer_object_with_enum_property.dart';
|
||||
export 'package:openapi/src/model/parent_with_nullable.dart';
|
||||
export 'package:openapi/src/model/pet.dart';
|
||||
export 'package:openapi/src/model/read_only_first.dart';
|
||||
export 'package:openapi/src/model/single_ref_type.dart';
|
||||
export 'package:openapi/src/model/special_model_name.dart';
|
||||
export 'package:openapi/src/model/tag.dart';
|
||||
export 'package:openapi/src/model/test_inline_freeform_additional_properties_request.dart';
|
||||
export 'package:openapi/src/model/user.dart';
|
||||
|
@ -0,0 +1,115 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:openapi/src/serializers.dart';
|
||||
import 'package:openapi/src/auth/api_key_auth.dart';
|
||||
import 'package:openapi/src/auth/basic_auth.dart';
|
||||
import 'package:openapi/src/auth/bearer_auth.dart';
|
||||
import 'package:openapi/src/auth/oauth.dart';
|
||||
import 'package:openapi/src/api/another_fake_api.dart';
|
||||
import 'package:openapi/src/api/default_api.dart';
|
||||
import 'package:openapi/src/api/fake_api.dart';
|
||||
import 'package:openapi/src/api/fake_classname_tags123_api.dart';
|
||||
import 'package:openapi/src/api/pet_api.dart';
|
||||
import 'package:openapi/src/api/store_api.dart';
|
||||
import 'package:openapi/src/api/user_api.dart';
|
||||
|
||||
class Openapi {
|
||||
static const String basePath = r'http://petstore.swagger.io:80/v2';
|
||||
|
||||
final Dio dio;
|
||||
final Serializers serializers;
|
||||
|
||||
Openapi({
|
||||
Dio? dio,
|
||||
Serializers? serializers,
|
||||
String? basePathOverride,
|
||||
List<Interceptor>? interceptors,
|
||||
}) : this.serializers = serializers ?? standardSerializers,
|
||||
this.dio = dio ??
|
||||
Dio(BaseOptions(
|
||||
baseUrl: basePathOverride ?? basePath,
|
||||
connectTimeout: const Duration(milliseconds: 5000),
|
||||
receiveTimeout: const Duration(milliseconds: 3000),
|
||||
)) {
|
||||
if (interceptors == null) {
|
||||
this.dio.interceptors.addAll([
|
||||
OAuthInterceptor(),
|
||||
BasicAuthInterceptor(),
|
||||
BearerAuthInterceptor(),
|
||||
ApiKeyAuthInterceptor(),
|
||||
]);
|
||||
} else {
|
||||
this.dio.interceptors.addAll(interceptors);
|
||||
}
|
||||
}
|
||||
|
||||
void setOAuthToken(String name, String token) {
|
||||
if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token;
|
||||
}
|
||||
}
|
||||
|
||||
void setBearerAuth(String name, String token) {
|
||||
if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token;
|
||||
}
|
||||
}
|
||||
|
||||
void setBasicAuth(String name, String username, String password) {
|
||||
if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
|
||||
}
|
||||
}
|
||||
|
||||
void setApiKey(String name, String apiKey) {
|
||||
if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
|
||||
(this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
AnotherFakeApi getAnotherFakeApi() {
|
||||
return AnotherFakeApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
DefaultApi getDefaultApi() {
|
||||
return DefaultApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get FakeApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
FakeApi getFakeApi() {
|
||||
return FakeApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
FakeClassnameTags123Api getFakeClassnameTags123Api() {
|
||||
return FakeClassnameTags123Api(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get PetApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
PetApi getPetApi() {
|
||||
return PetApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get StoreApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
StoreApi getStoreApi() {
|
||||
return StoreApi(dio, serializers);
|
||||
}
|
||||
|
||||
/// Get UserApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
UserApi getUserApi() {
|
||||
return UserApi(dio, serializers);
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:openapi/src/model/model_client.dart';
|
||||
|
||||
class AnotherFakeApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const AnotherFakeApi(this._dio, this._serializers);
|
||||
|
||||
/// To test special tags
|
||||
/// To test special tags and operation ID starting with number
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [modelClient] - client model
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ModelClient] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ModelClient>> call123testSpecialTags({
|
||||
required ModelClient modelClient,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/another-fake/dummy';
|
||||
final _options = Options(
|
||||
method: r'PATCH',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(ModelClient);
|
||||
_bodyData = _serializers.serialize(modelClient, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ModelClient? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(ModelClient),
|
||||
) as ModelClient;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ModelClient>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:openapi/src/model/foo_get_default_response.dart';
|
||||
|
||||
class DefaultApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const DefaultApi(this._dio, this._serializers);
|
||||
|
||||
/// fooGet
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [FooGetDefaultResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<FooGetDefaultResponse>> fooGet({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/foo';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
FooGetDefaultResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(FooGetDefaultResponse),
|
||||
) as FooGetDefaultResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<FooGetDefaultResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,123 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:openapi/src/model/model_client.dart';
|
||||
|
||||
class FakeClassnameTags123Api {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const FakeClassnameTags123Api(this._dio, this._serializers);
|
||||
|
||||
/// To test class name in snake case
|
||||
/// To test class name in snake case
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [modelClient] - client model
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ModelClient] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ModelClient>> testClassname({
|
||||
required ModelClient modelClient,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/fake_classname_test';
|
||||
final _options = Options(
|
||||
method: r'PATCH',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'apiKey',
|
||||
'name': 'api_key_query',
|
||||
'keyName': 'api_key_query',
|
||||
'where': 'query',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(ModelClient);
|
||||
_bodyData = _serializers.serialize(modelClient, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ModelClient? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(ModelClient),
|
||||
) as ModelClient;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ModelClient>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,766 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/api_util.dart';
|
||||
import 'package:openapi/src/model/api_response.dart';
|
||||
import 'package:openapi/src/model/pet.dart';
|
||||
|
||||
class PetApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const PetApi(this._dio, this._serializers);
|
||||
|
||||
/// Add a new pet to the store
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [pet] - Pet object that needs to be added to the store
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> addPet({
|
||||
required Pet pet,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(Pet);
|
||||
_bodyData = _serializers.serialize(pet, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Deletes a pet
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [petId] - Pet id to delete
|
||||
/// * [apiKey]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> deletePet({
|
||||
required int petId,
|
||||
String? apiKey,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
if (apiKey != null) r'api_key': apiKey,
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Finds Pets by status
|
||||
/// Multiple status values can be provided with comma separated strings
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [status] - Status values that need to be considered for filter
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BuiltList<Pet>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<BuiltList<Pet>>> findPetsByStatus({
|
||||
@Deprecated('status is deprecated') required BuiltList<String> status,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/findByStatus';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'status': encodeCollectionQueryParameter<String>(_serializers, status, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BuiltList<Pet>? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Pet)]),
|
||||
) as BuiltList<Pet>;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BuiltList<Pet>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Finds Pets by tags
|
||||
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [tags] - Tags to filter by
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BuiltSet<Pet>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
@Deprecated('This operation has been deprecated')
|
||||
Future<Response<BuiltSet<Pet>>> findPetsByTags({
|
||||
required BuiltSet<String> tags,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/findByTags';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'tags': encodeCollectionQueryParameter<String>(_serializers, tags, const FullType(BuiltSet, [FullType(String)]), format: ListFormat.csv,),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BuiltSet<Pet>? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(BuiltSet, [FullType(Pet)]),
|
||||
) as BuiltSet<Pet>;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BuiltSet<Pet>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Find pet by ID
|
||||
/// Returns a single pet
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [petId] - ID of pet to return
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [Pet] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<Pet>> getPetById({
|
||||
required int petId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'apiKey',
|
||||
'name': 'api_key',
|
||||
'keyName': 'api_key',
|
||||
'where': 'header',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
Pet? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(Pet),
|
||||
) as Pet;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<Pet>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Update an existing pet
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [pet] - Pet object that needs to be added to the store
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> updatePet({
|
||||
required Pet pet,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet';
|
||||
final _options = Options(
|
||||
method: r'PUT',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(Pet);
|
||||
_bodyData = _serializers.serialize(pet, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Updates a pet in the store with form data
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [petId] - ID of pet that needs to be updated
|
||||
/// * [name] - Updated name of the pet
|
||||
/// * [status] - Updated status of the pet
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> updatePetWithForm({
|
||||
required int petId,
|
||||
String? name,
|
||||
String? status,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = <String, dynamic>{
|
||||
if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)),
|
||||
if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)),
|
||||
};
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// uploads an image
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [petId] - ID of pet to update
|
||||
/// * [additionalMetadata] - Additional data to pass to server
|
||||
/// * [file] - file to upload
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ApiResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ApiResponse>> uploadFile({
|
||||
required int petId,
|
||||
String? additionalMetadata,
|
||||
MultipartFile? file,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'multipart/form-data',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = FormData.fromMap(<String, dynamic>{
|
||||
if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)),
|
||||
if (file != null) r'file': file,
|
||||
});
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ApiResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(ApiResponse),
|
||||
) as ApiResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ApiResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// uploads an image (required)
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [petId] - ID of pet to update
|
||||
/// * [requiredFile] - file to upload
|
||||
/// * [additionalMetadata] - Additional data to pass to server
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ApiResponse] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ApiResponse>> uploadFileWithRequiredFile({
|
||||
required int petId,
|
||||
required MultipartFile requiredFile,
|
||||
String? additionalMetadata,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', encodeQueryParameter(_serializers, petId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'oauth2',
|
||||
'name': 'petstore_auth',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'multipart/form-data',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = FormData.fromMap(<String, dynamic>{
|
||||
if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)),
|
||||
r'requiredFile': requiredFile,
|
||||
});
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ApiResponse? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(ApiResponse),
|
||||
) as ApiResponse;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ApiResponse>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,320 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/api_util.dart';
|
||||
import 'package:openapi/src/model/order.dart';
|
||||
|
||||
class StoreApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const StoreApi(this._dio, this._serializers);
|
||||
|
||||
/// Delete purchase order by ID
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [orderId] - ID of the order that needs to be deleted
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> deleteOrder({
|
||||
required String orderId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Returns pet inventories by status
|
||||
/// Returns a map of status codes to quantities
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BuiltMap<String, int>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<BuiltMap<String, int>>> getInventory({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/store/inventory';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'apiKey',
|
||||
'name': 'api_key',
|
||||
'keyName': 'api_key',
|
||||
'where': 'header',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BuiltMap<String, int>? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(int)]),
|
||||
) as BuiltMap<String, int>;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BuiltMap<String, int>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Find purchase order by ID
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [orderId] - ID of pet that needs to be fetched
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [Order] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<Order>> getOrderById({
|
||||
required int orderId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', encodeQueryParameter(_serializers, orderId, const FullType(int)).toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
Order? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(Order),
|
||||
) as Order;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<Order>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Place an order for a pet
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [order] - order placed for purchasing the pet
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [Order] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<Order>> placeOrder({
|
||||
required Order order,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/store/order';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(Order);
|
||||
_bodyData = _serializers.serialize(order, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
Order? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(Order),
|
||||
) as Order;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<Order>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,541 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/api_util.dart';
|
||||
import 'package:openapi/src/model/user.dart';
|
||||
import 'package:time_machine/time_machine.dart';
|
||||
|
||||
class UserApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
final Serializers _serializers;
|
||||
|
||||
const UserApi(this._dio, this._serializers);
|
||||
|
||||
/// Create user
|
||||
/// This can only be done by the logged in user.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [user] - Created user object
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> createUser({
|
||||
required User user,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(User);
|
||||
_bodyData = _serializers.serialize(user, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [user] - List of user object
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> createUsersWithArrayInput({
|
||||
required BuiltList<User> user,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/createWithArray';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(BuiltList, [FullType(User)]);
|
||||
_bodyData = _serializers.serialize(user, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Creates list of users with given input array
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [user] - List of user object
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> createUsersWithListInput({
|
||||
required BuiltList<User> user,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/createWithList';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(BuiltList, [FullType(User)]);
|
||||
_bodyData = _serializers.serialize(user, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Delete user
|
||||
/// This can only be done by the logged in user.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [username] - The name that needs to be deleted
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> deleteUser({
|
||||
required String username,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Get user by user name
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [username] - The name that needs to be fetched. Use user1 for testing.
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [User] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<User>> getUserByName({
|
||||
required String username,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
User? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : _serializers.deserialize(
|
||||
rawResponse,
|
||||
specifiedType: const FullType(User),
|
||||
) as User;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<User>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Logs user into the system
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [username] - The user name for login
|
||||
/// * [password] - The password for login in clear text
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [String] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<String>> loginUser({
|
||||
required String username,
|
||||
required String password,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/login';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
r'username': encodeQueryParameter(_serializers, username, const FullType(String)),
|
||||
r'password': encodeQueryParameter(_serializers, password, const FullType(String)),
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
String? _responseData;
|
||||
|
||||
try {
|
||||
final rawResponse = _response.data;
|
||||
_responseData = rawResponse == null ? null : rawResponse as String;
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<String>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Logs out current logged in user session
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> logoutUser({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/logout';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Updated user
|
||||
/// This can only be done by the logged in user.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [username] - name that need to be deleted
|
||||
/// * [user] - Updated user object
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> updateUser({
|
||||
required String username,
|
||||
required User user,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', encodeQueryParameter(_serializers, username, const FullType(String)).toString());
|
||||
final _options = Options(
|
||||
method: r'PUT',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
const _type = FullType(User);
|
||||
_bodyData = _serializers.serialize(user, specifiedType: _type);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
/// Format the given form parameter object into something that Dio can handle.
|
||||
/// Returns primitive or String.
|
||||
/// Returns List/Map if the value is BuildList/BuiltMap.
|
||||
dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
if (value is String || value is num || value is bool) {
|
||||
return value;
|
||||
}
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (serialized is String) {
|
||||
return serialized;
|
||||
}
|
||||
if (value is BuiltList || value is BuiltSet || value is BuiltMap) {
|
||||
return serialized;
|
||||
}
|
||||
return json.encode(serialized);
|
||||
}
|
||||
|
||||
dynamic encodeQueryParameter(
|
||||
Serializers serializers,
|
||||
dynamic value,
|
||||
FullType type,
|
||||
) {
|
||||
if (value == null) {
|
||||
return '';
|
||||
}
|
||||
if (value is String || value is num || value is bool) {
|
||||
return value;
|
||||
}
|
||||
if (value is Uint8List) {
|
||||
// Currently not sure how to serialize this
|
||||
return value;
|
||||
}
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (serialized == null) {
|
||||
return '';
|
||||
}
|
||||
if (serialized is String) {
|
||||
return serialized;
|
||||
}
|
||||
return serialized;
|
||||
}
|
||||
|
||||
ListParam<Object?> encodeCollectionQueryParameter<T>(
|
||||
Serializers serializers,
|
||||
dynamic value,
|
||||
FullType type, {
|
||||
ListFormat format = ListFormat.multi,
|
||||
}) {
|
||||
final serialized = serializers.serialize(
|
||||
value as Object,
|
||||
specifiedType: type,
|
||||
);
|
||||
if (value is BuiltList<T> || value is BuiltSet<T>) {
|
||||
return ListParam(List.of((serialized as Iterable<Object?>).cast()), format);
|
||||
}
|
||||
throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter');
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:openapi/src/auth/auth.dart';
|
||||
|
||||
class ApiKeyAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> apiKeys = {};
|
||||
|
||||
@override
|
||||
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey');
|
||||
for (final info in authInfo) {
|
||||
final authName = info['name'] as String;
|
||||
final authKeyName = info['keyName'] as String;
|
||||
final authWhere = info['where'] as String;
|
||||
final apiKey = apiKeys[authName];
|
||||
if (apiKey != null) {
|
||||
if (authWhere == 'query') {
|
||||
options.queryParameters[authKeyName] = apiKey;
|
||||
} else {
|
||||
options.headers[authKeyName] = apiKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
abstract class AuthInterceptor extends Interceptor {
|
||||
/// Get auth information on given route for the given type.
|
||||
/// Can return an empty list if type is not present on auth data or
|
||||
/// if route doesn't need authentication.
|
||||
List<Map<String, String>> getAuthInfo(RequestOptions route, bool Function(Map<String, String> secure) handles) {
|
||||
if (route.extra.containsKey('secure')) {
|
||||
final auth = route.extra['secure'] as List<Map<String, String>>;
|
||||
return auth.where((secure) => handles(secure)).toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:openapi/src/auth/auth.dart';
|
||||
|
||||
class BasicAuthInfo {
|
||||
final String username;
|
||||
final String password;
|
||||
|
||||
const BasicAuthInfo(this.username, this.password);
|
||||
}
|
||||
|
||||
class BasicAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, BasicAuthInfo> authInfo = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic');
|
||||
for (final info in metadataAuthInfo) {
|
||||
final authName = info['name'] as String;
|
||||
final basicAuthInfo = authInfo[authName];
|
||||
if (basicAuthInfo != null) {
|
||||
final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
|
||||
options.headers['Authorization'] = basicAuth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:openapi/src/auth/auth.dart';
|
||||
|
||||
class BearerAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> tokens = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer');
|
||||
for (final info in authInfo) {
|
||||
final token = tokens[info['name']];
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer ${token}';
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:openapi/src/auth/auth.dart';
|
||||
|
||||
class OAuthInterceptor extends AuthInterceptor {
|
||||
final Map<String, String> tokens = {};
|
||||
|
||||
@override
|
||||
void onRequest(
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) {
|
||||
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
|
||||
for (final info in authInfo) {
|
||||
final token = tokens[info['name']];
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer ${token}';
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.onRequest(options, handler);
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'additional_properties_class.g.dart';
|
||||
|
||||
/// AdditionalPropertiesClass
|
||||
///
|
||||
/// Properties:
|
||||
/// * [mapProperty]
|
||||
/// * [mapOfMapProperty]
|
||||
@BuiltValue()
|
||||
abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
|
||||
@BuiltValueField(wireName: r'map_property')
|
||||
BuiltMap<String, String>? get mapProperty;
|
||||
|
||||
@BuiltValueField(wireName: r'map_of_map_property')
|
||||
BuiltMap<String, BuiltMap<String, String>>? get mapOfMapProperty;
|
||||
|
||||
AdditionalPropertiesClass._();
|
||||
|
||||
factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(AdditionalPropertiesClassBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<AdditionalPropertiesClass> get serializer => _$AdditionalPropertiesClassSerializer();
|
||||
}
|
||||
|
||||
class _$AdditionalPropertiesClassSerializer implements PrimitiveSerializer<AdditionalPropertiesClass> {
|
||||
@override
|
||||
final Iterable<Type> types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass];
|
||||
|
||||
@override
|
||||
final String wireName = r'AdditionalPropertiesClass';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
AdditionalPropertiesClass object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.mapProperty != null) {
|
||||
yield r'map_property';
|
||||
yield serializers.serialize(
|
||||
object.mapProperty,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]),
|
||||
);
|
||||
}
|
||||
if (object.mapOfMapProperty != null) {
|
||||
yield r'map_of_map_property';
|
||||
yield serializers.serialize(
|
||||
object.mapOfMapProperty,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
AdditionalPropertiesClass object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AdditionalPropertiesClassBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'map_property':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]),
|
||||
) as BuiltMap<String, String>;
|
||||
result.mapProperty.replace(valueDes);
|
||||
break;
|
||||
case r'map_of_map_property':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]),
|
||||
) as BuiltMap<String, BuiltMap<String, String>>;
|
||||
result.mapOfMapProperty.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
AdditionalPropertiesClass deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = AdditionalPropertiesClassBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,128 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/single_ref_type.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'all_of_with_single_ref.g.dart';
|
||||
|
||||
/// AllOfWithSingleRef
|
||||
///
|
||||
/// Properties:
|
||||
/// * [username]
|
||||
/// * [singleRefType]
|
||||
@BuiltValue()
|
||||
abstract class AllOfWithSingleRef implements Built<AllOfWithSingleRef, AllOfWithSingleRefBuilder> {
|
||||
@BuiltValueField(wireName: r'username')
|
||||
String? get username;
|
||||
|
||||
@BuiltValueField(wireName: r'SingleRefType')
|
||||
SingleRefType? get singleRefType;
|
||||
// enum singleRefTypeEnum { admin, user, };
|
||||
|
||||
AllOfWithSingleRef._();
|
||||
|
||||
factory AllOfWithSingleRef([void updates(AllOfWithSingleRefBuilder b)]) = _$AllOfWithSingleRef;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(AllOfWithSingleRefBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<AllOfWithSingleRef> get serializer => _$AllOfWithSingleRefSerializer();
|
||||
}
|
||||
|
||||
class _$AllOfWithSingleRefSerializer implements PrimitiveSerializer<AllOfWithSingleRef> {
|
||||
@override
|
||||
final Iterable<Type> types = const [AllOfWithSingleRef, _$AllOfWithSingleRef];
|
||||
|
||||
@override
|
||||
final String wireName = r'AllOfWithSingleRef';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
AllOfWithSingleRef object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.username != null) {
|
||||
yield r'username';
|
||||
yield serializers.serialize(
|
||||
object.username,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.singleRefType != null) {
|
||||
yield r'SingleRefType';
|
||||
yield serializers.serialize(
|
||||
object.singleRefType,
|
||||
specifiedType: const FullType(SingleRefType),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
AllOfWithSingleRef object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AllOfWithSingleRefBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'username':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.username = valueDes;
|
||||
break;
|
||||
case r'SingleRefType':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(SingleRefType),
|
||||
) as SingleRefType;
|
||||
result.singleRefType = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
AllOfWithSingleRef deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = AllOfWithSingleRefBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,205 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/dog.dart';
|
||||
import 'package:openapi/src/model/cat.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'animal.g.dart';
|
||||
|
||||
/// Animal
|
||||
///
|
||||
/// Properties:
|
||||
/// * [className]
|
||||
/// * [color]
|
||||
@BuiltValue(instantiable: false)
|
||||
abstract class Animal {
|
||||
@BuiltValueField(wireName: r'className')
|
||||
String get className;
|
||||
|
||||
@BuiltValueField(wireName: r'color')
|
||||
String? get color;
|
||||
|
||||
static const String discriminatorFieldName = r'className';
|
||||
|
||||
static const Map<String, Type> discriminatorMapping = {
|
||||
r'CAT': Cat,
|
||||
r'DOG': Dog,
|
||||
};
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Animal> get serializer => _$AnimalSerializer();
|
||||
}
|
||||
|
||||
extension AnimalDiscriminatorExt on Animal {
|
||||
String? get discriminatorValue {
|
||||
if (this is Cat) {
|
||||
return r'CAT';
|
||||
}
|
||||
if (this is Dog) {
|
||||
return r'DOG';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
extension AnimalBuilderDiscriminatorExt on AnimalBuilder {
|
||||
String? get discriminatorValue {
|
||||
if (this is CatBuilder) {
|
||||
return r'CAT';
|
||||
}
|
||||
if (this is DogBuilder) {
|
||||
return r'DOG';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class _$AnimalSerializer implements PrimitiveSerializer<Animal> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Animal];
|
||||
|
||||
@override
|
||||
final String wireName = r'Animal';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Animal object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'className';
|
||||
yield serializers.serialize(
|
||||
object.className,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
if (object.color != null) {
|
||||
yield r'color';
|
||||
yield serializers.serialize(
|
||||
object.color,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Animal object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
if (object is Cat) {
|
||||
return serializers.serialize(object, specifiedType: FullType(Cat))!;
|
||||
}
|
||||
if (object is Dog) {
|
||||
return serializers.serialize(object, specifiedType: FullType(Dog))!;
|
||||
}
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Animal deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final discIndex = serializedList.indexOf(Animal.discriminatorFieldName) + 1;
|
||||
final discValue = serializers.deserialize(serializedList[discIndex], specifiedType: FullType(String)) as String;
|
||||
switch (discValue) {
|
||||
case r'CAT':
|
||||
return serializers.deserialize(serialized, specifiedType: FullType(Cat)) as Cat;
|
||||
case r'DOG':
|
||||
return serializers.deserialize(serialized, specifiedType: FullType(Dog)) as Dog;
|
||||
default:
|
||||
return serializers.deserialize(serialized, specifiedType: FullType($Animal)) as $Animal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// a concrete implementation of [Animal], since [Animal] is not instantiable
|
||||
@BuiltValue(instantiable: true)
|
||||
abstract class $Animal implements Animal, Built<$Animal, $AnimalBuilder> {
|
||||
$Animal._();
|
||||
|
||||
factory $Animal([void Function($AnimalBuilder)? updates]) = _$$Animal;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults($AnimalBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<$Animal> get serializer => _$$AnimalSerializer();
|
||||
}
|
||||
|
||||
class _$$AnimalSerializer implements PrimitiveSerializer<$Animal> {
|
||||
@override
|
||||
final Iterable<Type> types = const [$Animal, _$$Animal];
|
||||
|
||||
@override
|
||||
final String wireName = r'$Animal';
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
$Animal object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return serializers.serialize(object, specifiedType: FullType(Animal))!;
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required AnimalBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'className':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.className = valueDes;
|
||||
break;
|
||||
case r'color':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.color = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
$Animal deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = $AnimalBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,144 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'api_response.g.dart';
|
||||
|
||||
/// ApiResponse
|
||||
///
|
||||
/// Properties:
|
||||
/// * [code]
|
||||
/// * [type]
|
||||
/// * [message]
|
||||
@BuiltValue()
|
||||
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
|
||||
@BuiltValueField(wireName: r'code')
|
||||
int? get code;
|
||||
|
||||
@BuiltValueField(wireName: r'type')
|
||||
String? get type;
|
||||
|
||||
@BuiltValueField(wireName: r'message')
|
||||
String? get message;
|
||||
|
||||
ApiResponse._();
|
||||
|
||||
factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ApiResponseBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ApiResponse> get serializer => _$ApiResponseSerializer();
|
||||
}
|
||||
|
||||
class _$ApiResponseSerializer implements PrimitiveSerializer<ApiResponse> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ApiResponse, _$ApiResponse];
|
||||
|
||||
@override
|
||||
final String wireName = r'ApiResponse';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ApiResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.code != null) {
|
||||
yield r'code';
|
||||
yield serializers.serialize(
|
||||
object.code,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.type != null) {
|
||||
yield r'type';
|
||||
yield serializers.serialize(
|
||||
object.type,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.message != null) {
|
||||
yield r'message';
|
||||
yield serializers.serialize(
|
||||
object.message,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ApiResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ApiResponseBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'code':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.code = valueDes;
|
||||
break;
|
||||
case r'type':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.type = valueDes;
|
||||
break;
|
||||
case r'message':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.message = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ApiResponse deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ApiResponseBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'array_of_array_of_number_only.g.dart';
|
||||
|
||||
/// ArrayOfArrayOfNumberOnly
|
||||
///
|
||||
/// Properties:
|
||||
/// * [arrayArrayNumber]
|
||||
@BuiltValue()
|
||||
abstract class ArrayOfArrayOfNumberOnly implements Built<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilder> {
|
||||
@BuiltValueField(wireName: r'ArrayArrayNumber')
|
||||
BuiltList<BuiltList<num>>? get arrayArrayNumber;
|
||||
|
||||
ArrayOfArrayOfNumberOnly._();
|
||||
|
||||
factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ArrayOfArrayOfNumberOnly> get serializer => _$ArrayOfArrayOfNumberOnlySerializer();
|
||||
}
|
||||
|
||||
class _$ArrayOfArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayOfArrayOfNumberOnly> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly];
|
||||
|
||||
@override
|
||||
final String wireName = r'ArrayOfArrayOfNumberOnly';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ArrayOfArrayOfNumberOnly object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.arrayArrayNumber != null) {
|
||||
yield r'ArrayArrayNumber';
|
||||
yield serializers.serialize(
|
||||
object.arrayArrayNumber,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ArrayOfArrayOfNumberOnly object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ArrayOfArrayOfNumberOnlyBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'ArrayArrayNumber':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]),
|
||||
) as BuiltList<BuiltList<num>>;
|
||||
result.arrayArrayNumber.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ArrayOfArrayOfNumberOnly deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ArrayOfArrayOfNumberOnlyBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'array_of_number_only.g.dart';
|
||||
|
||||
/// ArrayOfNumberOnly
|
||||
///
|
||||
/// Properties:
|
||||
/// * [arrayNumber]
|
||||
@BuiltValue()
|
||||
abstract class ArrayOfNumberOnly implements Built<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilder> {
|
||||
@BuiltValueField(wireName: r'ArrayNumber')
|
||||
BuiltList<num>? get arrayNumber;
|
||||
|
||||
ArrayOfNumberOnly._();
|
||||
|
||||
factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ArrayOfNumberOnlyBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ArrayOfNumberOnly> get serializer => _$ArrayOfNumberOnlySerializer();
|
||||
}
|
||||
|
||||
class _$ArrayOfNumberOnlySerializer implements PrimitiveSerializer<ArrayOfNumberOnly> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly];
|
||||
|
||||
@override
|
||||
final String wireName = r'ArrayOfNumberOnly';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ArrayOfNumberOnly object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.arrayNumber != null) {
|
||||
yield r'ArrayNumber';
|
||||
yield serializers.serialize(
|
||||
object.arrayNumber,
|
||||
specifiedType: const FullType(BuiltList, [FullType(num)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ArrayOfNumberOnly object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ArrayOfNumberOnlyBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'ArrayNumber':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(num)]),
|
||||
) as BuiltList<num>;
|
||||
result.arrayNumber.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ArrayOfNumberOnly deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ArrayOfNumberOnlyBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,146 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/model/read_only_first.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'array_test.g.dart';
|
||||
|
||||
/// ArrayTest
|
||||
///
|
||||
/// Properties:
|
||||
/// * [arrayOfString]
|
||||
/// * [arrayArrayOfInteger]
|
||||
/// * [arrayArrayOfModel]
|
||||
@BuiltValue()
|
||||
abstract class ArrayTest implements Built<ArrayTest, ArrayTestBuilder> {
|
||||
@BuiltValueField(wireName: r'array_of_string')
|
||||
BuiltList<String>? get arrayOfString;
|
||||
|
||||
@BuiltValueField(wireName: r'array_array_of_integer')
|
||||
BuiltList<BuiltList<int>>? get arrayArrayOfInteger;
|
||||
|
||||
@BuiltValueField(wireName: r'array_array_of_model')
|
||||
BuiltList<BuiltList<ReadOnlyFirst>>? get arrayArrayOfModel;
|
||||
|
||||
ArrayTest._();
|
||||
|
||||
factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ArrayTestBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ArrayTest> get serializer => _$ArrayTestSerializer();
|
||||
}
|
||||
|
||||
class _$ArrayTestSerializer implements PrimitiveSerializer<ArrayTest> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ArrayTest, _$ArrayTest];
|
||||
|
||||
@override
|
||||
final String wireName = r'ArrayTest';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ArrayTest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.arrayOfString != null) {
|
||||
yield r'array_of_string';
|
||||
yield serializers.serialize(
|
||||
object.arrayOfString,
|
||||
specifiedType: const FullType(BuiltList, [FullType(String)]),
|
||||
);
|
||||
}
|
||||
if (object.arrayArrayOfInteger != null) {
|
||||
yield r'array_array_of_integer';
|
||||
yield serializers.serialize(
|
||||
object.arrayArrayOfInteger,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]),
|
||||
);
|
||||
}
|
||||
if (object.arrayArrayOfModel != null) {
|
||||
yield r'array_array_of_model';
|
||||
yield serializers.serialize(
|
||||
object.arrayArrayOfModel,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ArrayTest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ArrayTestBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'array_of_string':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(String)]),
|
||||
) as BuiltList<String>;
|
||||
result.arrayOfString.replace(valueDes);
|
||||
break;
|
||||
case r'array_array_of_integer':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]),
|
||||
) as BuiltList<BuiltList<int>>;
|
||||
result.arrayArrayOfInteger.replace(valueDes);
|
||||
break;
|
||||
case r'array_array_of_model':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]),
|
||||
) as BuiltList<BuiltList<ReadOnlyFirst>>;
|
||||
result.arrayArrayOfModel.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ArrayTest deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ArrayTestBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,199 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'capitalization.g.dart';
|
||||
|
||||
/// Capitalization
|
||||
///
|
||||
/// Properties:
|
||||
/// * [smallCamel]
|
||||
/// * [capitalCamel]
|
||||
/// * [smallSnake]
|
||||
/// * [capitalSnake]
|
||||
/// * [sCAETHFlowPoints]
|
||||
/// * [ATT_NAME] - Name of the pet
|
||||
@BuiltValue()
|
||||
abstract class Capitalization implements Built<Capitalization, CapitalizationBuilder> {
|
||||
@BuiltValueField(wireName: r'smallCamel')
|
||||
String? get smallCamel;
|
||||
|
||||
@BuiltValueField(wireName: r'CapitalCamel')
|
||||
String? get capitalCamel;
|
||||
|
||||
@BuiltValueField(wireName: r'small_Snake')
|
||||
String? get smallSnake;
|
||||
|
||||
@BuiltValueField(wireName: r'Capital_Snake')
|
||||
String? get capitalSnake;
|
||||
|
||||
@BuiltValueField(wireName: r'SCA_ETH_Flow_Points')
|
||||
String? get sCAETHFlowPoints;
|
||||
|
||||
/// Name of the pet
|
||||
@BuiltValueField(wireName: r'ATT_NAME')
|
||||
String? get ATT_NAME;
|
||||
|
||||
Capitalization._();
|
||||
|
||||
factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CapitalizationBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Capitalization> get serializer => _$CapitalizationSerializer();
|
||||
}
|
||||
|
||||
class _$CapitalizationSerializer implements PrimitiveSerializer<Capitalization> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Capitalization, _$Capitalization];
|
||||
|
||||
@override
|
||||
final String wireName = r'Capitalization';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Capitalization object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.smallCamel != null) {
|
||||
yield r'smallCamel';
|
||||
yield serializers.serialize(
|
||||
object.smallCamel,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.capitalCamel != null) {
|
||||
yield r'CapitalCamel';
|
||||
yield serializers.serialize(
|
||||
object.capitalCamel,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.smallSnake != null) {
|
||||
yield r'small_Snake';
|
||||
yield serializers.serialize(
|
||||
object.smallSnake,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.capitalSnake != null) {
|
||||
yield r'Capital_Snake';
|
||||
yield serializers.serialize(
|
||||
object.capitalSnake,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.sCAETHFlowPoints != null) {
|
||||
yield r'SCA_ETH_Flow_Points';
|
||||
yield serializers.serialize(
|
||||
object.sCAETHFlowPoints,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.ATT_NAME != null) {
|
||||
yield r'ATT_NAME';
|
||||
yield serializers.serialize(
|
||||
object.ATT_NAME,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Capitalization object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CapitalizationBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'smallCamel':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.smallCamel = valueDes;
|
||||
break;
|
||||
case r'CapitalCamel':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.capitalCamel = valueDes;
|
||||
break;
|
||||
case r'small_Snake':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.smallSnake = valueDes;
|
||||
break;
|
||||
case r'Capital_Snake':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.capitalSnake = valueDes;
|
||||
break;
|
||||
case r'SCA_ETH_Flow_Points':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.sCAETHFlowPoints = valueDes;
|
||||
break;
|
||||
case r'ATT_NAME':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.ATT_NAME = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Capitalization deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CapitalizationBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,138 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/animal.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'cat.g.dart';
|
||||
|
||||
/// Cat
|
||||
///
|
||||
/// Properties:
|
||||
/// * [className]
|
||||
/// * [color]
|
||||
/// * [declawed]
|
||||
@BuiltValue()
|
||||
abstract class Cat implements Animal, Built<Cat, CatBuilder> {
|
||||
@BuiltValueField(wireName: r'declawed')
|
||||
bool? get declawed;
|
||||
|
||||
Cat._();
|
||||
|
||||
factory Cat([void updates(CatBuilder b)]) = _$Cat;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CatBuilder b) => b..className=b.discriminatorValue
|
||||
..color = 'red';
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Cat> get serializer => _$CatSerializer();
|
||||
}
|
||||
|
||||
class _$CatSerializer implements PrimitiveSerializer<Cat> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Cat, _$Cat];
|
||||
|
||||
@override
|
||||
final String wireName = r'Cat';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Cat object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.color != null) {
|
||||
yield r'color';
|
||||
yield serializers.serialize(
|
||||
object.color,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.declawed != null) {
|
||||
yield r'declawed';
|
||||
yield serializers.serialize(
|
||||
object.declawed,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
yield r'className';
|
||||
yield serializers.serialize(
|
||||
object.className,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Cat object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CatBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'color':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.color = valueDes;
|
||||
break;
|
||||
case r'declawed':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.declawed = valueDes;
|
||||
break;
|
||||
case r'className':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.className = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Cat deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CatBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,125 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'category.g.dart';
|
||||
|
||||
/// Category
|
||||
///
|
||||
/// Properties:
|
||||
/// * [id]
|
||||
/// * [name]
|
||||
@BuiltValue()
|
||||
abstract class Category implements Built<Category, CategoryBuilder> {
|
||||
@BuiltValueField(wireName: r'id')
|
||||
int? get id;
|
||||
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String get name;
|
||||
|
||||
Category._();
|
||||
|
||||
factory Category([void updates(CategoryBuilder b)]) = _$Category;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CategoryBuilder b) => b
|
||||
..name = 'default-name';
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Category> get serializer => _$CategorySerializer();
|
||||
}
|
||||
|
||||
class _$CategorySerializer implements PrimitiveSerializer<Category> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Category, _$Category];
|
||||
|
||||
@override
|
||||
final String wireName = r'Category';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Category object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.id != null) {
|
||||
yield r'id';
|
||||
yield serializers.serialize(
|
||||
object.id,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Category object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CategoryBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'id':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.id = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Category deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CategoryBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,156 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/model/parent_with_nullable.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'child_with_nullable.g.dart';
|
||||
|
||||
/// ChildWithNullable
|
||||
///
|
||||
/// Properties:
|
||||
/// * [type]
|
||||
/// * [nullableProperty]
|
||||
/// * [otherProperty]
|
||||
@BuiltValue()
|
||||
abstract class ChildWithNullable implements ParentWithNullable, Built<ChildWithNullable, ChildWithNullableBuilder> {
|
||||
@BuiltValueField(wireName: r'otherProperty')
|
||||
String? get otherProperty;
|
||||
|
||||
ChildWithNullable._();
|
||||
|
||||
factory ChildWithNullable([void updates(ChildWithNullableBuilder b)]) = _$ChildWithNullable;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ChildWithNullableBuilder b) => b..type=b.discriminatorValue;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChildWithNullable> get serializer => _$ChildWithNullableSerializer();
|
||||
}
|
||||
|
||||
class _$ChildWithNullableSerializer implements PrimitiveSerializer<ChildWithNullable> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ChildWithNullable, _$ChildWithNullable];
|
||||
|
||||
@override
|
||||
final String wireName = r'ChildWithNullable';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ChildWithNullable object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.type != null) {
|
||||
yield r'type';
|
||||
yield serializers.serialize(
|
||||
object.type,
|
||||
specifiedType: const FullType(ParentWithNullableTypeEnum),
|
||||
);
|
||||
}
|
||||
if (object.nullableProperty != null) {
|
||||
yield r'nullableProperty';
|
||||
yield serializers.serialize(
|
||||
object.nullableProperty,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
if (object.otherProperty != null) {
|
||||
yield r'otherProperty';
|
||||
yield serializers.serialize(
|
||||
object.otherProperty,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ChildWithNullable object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ChildWithNullableBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'type':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(ParentWithNullableTypeEnum),
|
||||
) as ParentWithNullableTypeEnum;
|
||||
result.type = valueDes;
|
||||
break;
|
||||
case r'nullableProperty':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nullableProperty = valueDes;
|
||||
break;
|
||||
case r'otherProperty':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.otherProperty = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ChildWithNullable deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ChildWithNullableBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class ChildWithNullableTypeEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'ChildWithNullable')
|
||||
static const ChildWithNullableTypeEnum childWithNullable = _$childWithNullableTypeEnum_childWithNullable;
|
||||
@BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true)
|
||||
static const ChildWithNullableTypeEnum unknownDefaultOpenApi = _$childWithNullableTypeEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<ChildWithNullableTypeEnum> get serializer => _$childWithNullableTypeEnumSerializer;
|
||||
|
||||
const ChildWithNullableTypeEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<ChildWithNullableTypeEnum> get values => _$childWithNullableTypeEnumValues;
|
||||
static ChildWithNullableTypeEnum valueOf(String name) => _$childWithNullableTypeEnumValueOf(name);
|
||||
}
|
||||
|
@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'class_model.g.dart';
|
||||
|
||||
/// Model for testing model with \"_class\" property
|
||||
///
|
||||
/// Properties:
|
||||
/// * [classField]
|
||||
@BuiltValue()
|
||||
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
|
||||
@BuiltValueField(wireName: r'_class')
|
||||
String? get classField;
|
||||
|
||||
ClassModel._();
|
||||
|
||||
factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ClassModelBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ClassModel> get serializer => _$ClassModelSerializer();
|
||||
}
|
||||
|
||||
class _$ClassModelSerializer implements PrimitiveSerializer<ClassModel> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ClassModel, _$ClassModel];
|
||||
|
||||
@override
|
||||
final String wireName = r'ClassModel';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ClassModel object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.classField != null) {
|
||||
yield r'_class';
|
||||
yield serializers.serialize(
|
||||
object.classField,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ClassModel object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ClassModelBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'_class':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.classField = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ClassModel deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ClassModelBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'deprecated_object.g.dart';
|
||||
|
||||
/// DeprecatedObject
|
||||
///
|
||||
/// Properties:
|
||||
/// * [name]
|
||||
@Deprecated('DeprecatedObject has been deprecated')
|
||||
@BuiltValue()
|
||||
abstract class DeprecatedObject implements Built<DeprecatedObject, DeprecatedObjectBuilder> {
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
|
||||
DeprecatedObject._();
|
||||
|
||||
factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(DeprecatedObjectBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<DeprecatedObject> get serializer => _$DeprecatedObjectSerializer();
|
||||
}
|
||||
|
||||
class _$DeprecatedObjectSerializer implements PrimitiveSerializer<DeprecatedObject> {
|
||||
@override
|
||||
final Iterable<Type> types = const [DeprecatedObject, _$DeprecatedObject];
|
||||
|
||||
@override
|
||||
final String wireName = r'DeprecatedObject';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
DeprecatedObject object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.name != null) {
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
DeprecatedObject object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required DeprecatedObjectBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
DeprecatedObject deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = DeprecatedObjectBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,138 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/animal.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'dog.g.dart';
|
||||
|
||||
/// Dog
|
||||
///
|
||||
/// Properties:
|
||||
/// * [className]
|
||||
/// * [color]
|
||||
/// * [breed]
|
||||
@BuiltValue()
|
||||
abstract class Dog implements Animal, Built<Dog, DogBuilder> {
|
||||
@BuiltValueField(wireName: r'breed')
|
||||
String? get breed;
|
||||
|
||||
Dog._();
|
||||
|
||||
factory Dog([void updates(DogBuilder b)]) = _$Dog;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(DogBuilder b) => b..className=b.discriminatorValue
|
||||
..color = 'red';
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Dog> get serializer => _$DogSerializer();
|
||||
}
|
||||
|
||||
class _$DogSerializer implements PrimitiveSerializer<Dog> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Dog, _$Dog];
|
||||
|
||||
@override
|
||||
final String wireName = r'Dog';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Dog object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.color != null) {
|
||||
yield r'color';
|
||||
yield serializers.serialize(
|
||||
object.color,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.breed != null) {
|
||||
yield r'breed';
|
||||
yield serializers.serialize(
|
||||
object.breed,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
yield r'className';
|
||||
yield serializers.serialize(
|
||||
object.className,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Dog object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required DogBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'color':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.color = valueDes;
|
||||
break;
|
||||
case r'breed':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.breed = valueDes;
|
||||
break;
|
||||
case r'className':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.className = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Dog deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = DogBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,163 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'enum_arrays.g.dart';
|
||||
|
||||
/// EnumArrays
|
||||
///
|
||||
/// Properties:
|
||||
/// * [justSymbol]
|
||||
/// * [arrayEnum]
|
||||
@BuiltValue()
|
||||
abstract class EnumArrays implements Built<EnumArrays, EnumArraysBuilder> {
|
||||
@BuiltValueField(wireName: r'just_symbol')
|
||||
EnumArraysJustSymbolEnum? get justSymbol;
|
||||
// enum justSymbolEnum { >=, $, };
|
||||
|
||||
@BuiltValueField(wireName: r'array_enum')
|
||||
BuiltList<EnumArraysArrayEnumEnum>? get arrayEnum;
|
||||
// enum arrayEnumEnum { fish, crab, };
|
||||
|
||||
EnumArrays._();
|
||||
|
||||
factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(EnumArraysBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<EnumArrays> get serializer => _$EnumArraysSerializer();
|
||||
}
|
||||
|
||||
class _$EnumArraysSerializer implements PrimitiveSerializer<EnumArrays> {
|
||||
@override
|
||||
final Iterable<Type> types = const [EnumArrays, _$EnumArrays];
|
||||
|
||||
@override
|
||||
final String wireName = r'EnumArrays';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
EnumArrays object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.justSymbol != null) {
|
||||
yield r'just_symbol';
|
||||
yield serializers.serialize(
|
||||
object.justSymbol,
|
||||
specifiedType: const FullType(EnumArraysJustSymbolEnum),
|
||||
);
|
||||
}
|
||||
if (object.arrayEnum != null) {
|
||||
yield r'array_enum';
|
||||
yield serializers.serialize(
|
||||
object.arrayEnum,
|
||||
specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
EnumArrays object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required EnumArraysBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'just_symbol':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(EnumArraysJustSymbolEnum),
|
||||
) as EnumArraysJustSymbolEnum;
|
||||
result.justSymbol = valueDes;
|
||||
break;
|
||||
case r'array_enum':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]),
|
||||
) as BuiltList<EnumArraysArrayEnumEnum>;
|
||||
result.arrayEnum.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
EnumArrays deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = EnumArraysBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class EnumArraysJustSymbolEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'>=')
|
||||
static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual;
|
||||
@BuiltValueEnumConst(wireName: r'$')
|
||||
static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar;
|
||||
@BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true)
|
||||
static const EnumArraysJustSymbolEnum unknownDefaultOpenApi = _$enumArraysJustSymbolEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumArraysJustSymbolEnum> get serializer => _$enumArraysJustSymbolEnumSerializer;
|
||||
|
||||
const EnumArraysJustSymbolEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumArraysJustSymbolEnum> get values => _$enumArraysJustSymbolEnumValues;
|
||||
static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name);
|
||||
}
|
||||
|
||||
class EnumArraysArrayEnumEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'fish')
|
||||
static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish;
|
||||
@BuiltValueEnumConst(wireName: r'crab')
|
||||
static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab;
|
||||
@BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true)
|
||||
static const EnumArraysArrayEnumEnum unknownDefaultOpenApi = _$enumArraysArrayEnumEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumArraysArrayEnumEnum> get serializer => _$enumArraysArrayEnumEnumSerializer;
|
||||
|
||||
const EnumArraysArrayEnumEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumArraysArrayEnumEnum> get values => _$enumArraysArrayEnumEnumValues;
|
||||
static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name);
|
||||
}
|
||||
|
@ -0,0 +1,318 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/outer_enum.dart';
|
||||
import 'package:openapi/src/model/outer_enum_default_value.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/model/outer_enum_integer.dart';
|
||||
import 'package:openapi/src/model/outer_enum_integer_default_value.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'enum_test.g.dart';
|
||||
|
||||
/// EnumTest
|
||||
///
|
||||
/// Properties:
|
||||
/// * [enumString]
|
||||
/// * [enumStringRequired]
|
||||
/// * [enumInteger]
|
||||
/// * [enumNumber]
|
||||
/// * [outerEnum]
|
||||
/// * [outerEnumInteger]
|
||||
/// * [outerEnumDefaultValue]
|
||||
/// * [outerEnumIntegerDefaultValue]
|
||||
@BuiltValue()
|
||||
abstract class EnumTest implements Built<EnumTest, EnumTestBuilder> {
|
||||
@BuiltValueField(wireName: r'enum_string')
|
||||
EnumTestEnumStringEnum? get enumString;
|
||||
// enum enumStringEnum { UPPER, lower, , };
|
||||
|
||||
@BuiltValueField(wireName: r'enum_string_required')
|
||||
EnumTestEnumStringRequiredEnum get enumStringRequired;
|
||||
// enum enumStringRequiredEnum { UPPER, lower, , };
|
||||
|
||||
@BuiltValueField(wireName: r'enum_integer')
|
||||
EnumTestEnumIntegerEnum? get enumInteger;
|
||||
// enum enumIntegerEnum { 1, -1, };
|
||||
|
||||
@BuiltValueField(wireName: r'enum_number')
|
||||
EnumTestEnumNumberEnum? get enumNumber;
|
||||
// enum enumNumberEnum { 1.1, -1.2, };
|
||||
|
||||
@BuiltValueField(wireName: r'outerEnum')
|
||||
OuterEnum? get outerEnum;
|
||||
// enum outerEnumEnum { placed, approved, delivered, };
|
||||
|
||||
@BuiltValueField(wireName: r'outerEnumInteger')
|
||||
OuterEnumInteger? get outerEnumInteger;
|
||||
// enum outerEnumIntegerEnum { 0, 1, 2, };
|
||||
|
||||
@BuiltValueField(wireName: r'outerEnumDefaultValue')
|
||||
OuterEnumDefaultValue? get outerEnumDefaultValue;
|
||||
// enum outerEnumDefaultValueEnum { placed, approved, delivered, };
|
||||
|
||||
@BuiltValueField(wireName: r'outerEnumIntegerDefaultValue')
|
||||
OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue;
|
||||
// enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, };
|
||||
|
||||
EnumTest._();
|
||||
|
||||
factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(EnumTestBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<EnumTest> get serializer => _$EnumTestSerializer();
|
||||
}
|
||||
|
||||
class _$EnumTestSerializer implements PrimitiveSerializer<EnumTest> {
|
||||
@override
|
||||
final Iterable<Type> types = const [EnumTest, _$EnumTest];
|
||||
|
||||
@override
|
||||
final String wireName = r'EnumTest';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
EnumTest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.enumString != null) {
|
||||
yield r'enum_string';
|
||||
yield serializers.serialize(
|
||||
object.enumString,
|
||||
specifiedType: const FullType(EnumTestEnumStringEnum),
|
||||
);
|
||||
}
|
||||
yield r'enum_string_required';
|
||||
yield serializers.serialize(
|
||||
object.enumStringRequired,
|
||||
specifiedType: const FullType(EnumTestEnumStringRequiredEnum),
|
||||
);
|
||||
if (object.enumInteger != null) {
|
||||
yield r'enum_integer';
|
||||
yield serializers.serialize(
|
||||
object.enumInteger,
|
||||
specifiedType: const FullType(EnumTestEnumIntegerEnum),
|
||||
);
|
||||
}
|
||||
if (object.enumNumber != null) {
|
||||
yield r'enum_number';
|
||||
yield serializers.serialize(
|
||||
object.enumNumber,
|
||||
specifiedType: const FullType(EnumTestEnumNumberEnum),
|
||||
);
|
||||
}
|
||||
if (object.outerEnum != null) {
|
||||
yield r'outerEnum';
|
||||
yield serializers.serialize(
|
||||
object.outerEnum,
|
||||
specifiedType: const FullType.nullable(OuterEnum),
|
||||
);
|
||||
}
|
||||
if (object.outerEnumInteger != null) {
|
||||
yield r'outerEnumInteger';
|
||||
yield serializers.serialize(
|
||||
object.outerEnumInteger,
|
||||
specifiedType: const FullType(OuterEnumInteger),
|
||||
);
|
||||
}
|
||||
if (object.outerEnumDefaultValue != null) {
|
||||
yield r'outerEnumDefaultValue';
|
||||
yield serializers.serialize(
|
||||
object.outerEnumDefaultValue,
|
||||
specifiedType: const FullType(OuterEnumDefaultValue),
|
||||
);
|
||||
}
|
||||
if (object.outerEnumIntegerDefaultValue != null) {
|
||||
yield r'outerEnumIntegerDefaultValue';
|
||||
yield serializers.serialize(
|
||||
object.outerEnumIntegerDefaultValue,
|
||||
specifiedType: const FullType(OuterEnumIntegerDefaultValue),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
EnumTest object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required EnumTestBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'enum_string':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(EnumTestEnumStringEnum),
|
||||
) as EnumTestEnumStringEnum;
|
||||
result.enumString = valueDes;
|
||||
break;
|
||||
case r'enum_string_required':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(EnumTestEnumStringRequiredEnum),
|
||||
) as EnumTestEnumStringRequiredEnum;
|
||||
result.enumStringRequired = valueDes;
|
||||
break;
|
||||
case r'enum_integer':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(EnumTestEnumIntegerEnum),
|
||||
) as EnumTestEnumIntegerEnum;
|
||||
result.enumInteger = valueDes;
|
||||
break;
|
||||
case r'enum_number':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(EnumTestEnumNumberEnum),
|
||||
) as EnumTestEnumNumberEnum;
|
||||
result.enumNumber = valueDes;
|
||||
break;
|
||||
case r'outerEnum':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(OuterEnum),
|
||||
) as OuterEnum?;
|
||||
if (valueDes == null) continue;
|
||||
result.outerEnum = valueDes;
|
||||
break;
|
||||
case r'outerEnumInteger':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(OuterEnumInteger),
|
||||
) as OuterEnumInteger;
|
||||
result.outerEnumInteger = valueDes;
|
||||
break;
|
||||
case r'outerEnumDefaultValue':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(OuterEnumDefaultValue),
|
||||
) as OuterEnumDefaultValue;
|
||||
result.outerEnumDefaultValue = valueDes;
|
||||
break;
|
||||
case r'outerEnumIntegerDefaultValue':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(OuterEnumIntegerDefaultValue),
|
||||
) as OuterEnumIntegerDefaultValue;
|
||||
result.outerEnumIntegerDefaultValue = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
EnumTest deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = EnumTestBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class EnumTestEnumStringEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'UPPER')
|
||||
static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER;
|
||||
@BuiltValueEnumConst(wireName: r'lower')
|
||||
static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower;
|
||||
@BuiltValueEnumConst(wireName: r'')
|
||||
static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty;
|
||||
@BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true)
|
||||
static const EnumTestEnumStringEnum unknownDefaultOpenApi = _$enumTestEnumStringEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumTestEnumStringEnum> get serializer => _$enumTestEnumStringEnumSerializer;
|
||||
|
||||
const EnumTestEnumStringEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumTestEnumStringEnum> get values => _$enumTestEnumStringEnumValues;
|
||||
static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name);
|
||||
}
|
||||
|
||||
class EnumTestEnumStringRequiredEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'UPPER')
|
||||
static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER;
|
||||
@BuiltValueEnumConst(wireName: r'lower')
|
||||
static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower;
|
||||
@BuiltValueEnumConst(wireName: r'')
|
||||
static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty;
|
||||
@BuiltValueEnumConst(wireName: r'unknown_default_open_api', fallback: true)
|
||||
static const EnumTestEnumStringRequiredEnum unknownDefaultOpenApi = _$enumTestEnumStringRequiredEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumTestEnumStringRequiredEnum> get serializer => _$enumTestEnumStringRequiredEnumSerializer;
|
||||
|
||||
const EnumTestEnumStringRequiredEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumTestEnumStringRequiredEnum> get values => _$enumTestEnumStringRequiredEnumValues;
|
||||
static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name);
|
||||
}
|
||||
|
||||
class EnumTestEnumIntegerEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireNumber: 1)
|
||||
static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1;
|
||||
@BuiltValueEnumConst(wireNumber: -1)
|
||||
static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1;
|
||||
@BuiltValueEnumConst(wireNumber: 11184809, fallback: true)
|
||||
static const EnumTestEnumIntegerEnum unknownDefaultOpenApi = _$enumTestEnumIntegerEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumTestEnumIntegerEnum> get serializer => _$enumTestEnumIntegerEnumSerializer;
|
||||
|
||||
const EnumTestEnumIntegerEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumTestEnumIntegerEnum> get values => _$enumTestEnumIntegerEnumValues;
|
||||
static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name);
|
||||
}
|
||||
|
||||
class EnumTestEnumNumberEnum extends EnumClass {
|
||||
|
||||
@BuiltValueEnumConst(wireName: r'1.1')
|
||||
static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1;
|
||||
@BuiltValueEnumConst(wireName: r'-1.2')
|
||||
static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2;
|
||||
@BuiltValueEnumConst(wireName: r'11184809', fallback: true)
|
||||
static const EnumTestEnumNumberEnum unknownDefaultOpenApi = _$enumTestEnumNumberEnum_unknownDefaultOpenApi;
|
||||
|
||||
static Serializer<EnumTestEnumNumberEnum> get serializer => _$enumTestEnumNumberEnumSerializer;
|
||||
|
||||
const EnumTestEnumNumberEnum._(String name): super(name);
|
||||
|
||||
static BuiltSet<EnumTestEnumNumberEnum> get values => _$enumTestEnumNumberEnumValues;
|
||||
static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name);
|
||||
}
|
||||
|
@ -0,0 +1,127 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'fake_big_decimal_map200_response.g.dart';
|
||||
|
||||
/// FakeBigDecimalMap200Response
|
||||
///
|
||||
/// Properties:
|
||||
/// * [someId]
|
||||
/// * [someMap]
|
||||
@BuiltValue()
|
||||
abstract class FakeBigDecimalMap200Response implements Built<FakeBigDecimalMap200Response, FakeBigDecimalMap200ResponseBuilder> {
|
||||
@BuiltValueField(wireName: r'someId')
|
||||
num? get someId;
|
||||
|
||||
@BuiltValueField(wireName: r'someMap')
|
||||
BuiltMap<String, num>? get someMap;
|
||||
|
||||
FakeBigDecimalMap200Response._();
|
||||
|
||||
factory FakeBigDecimalMap200Response([void updates(FakeBigDecimalMap200ResponseBuilder b)]) = _$FakeBigDecimalMap200Response;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(FakeBigDecimalMap200ResponseBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<FakeBigDecimalMap200Response> get serializer => _$FakeBigDecimalMap200ResponseSerializer();
|
||||
}
|
||||
|
||||
class _$FakeBigDecimalMap200ResponseSerializer implements PrimitiveSerializer<FakeBigDecimalMap200Response> {
|
||||
@override
|
||||
final Iterable<Type> types = const [FakeBigDecimalMap200Response, _$FakeBigDecimalMap200Response];
|
||||
|
||||
@override
|
||||
final String wireName = r'FakeBigDecimalMap200Response';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
FakeBigDecimalMap200Response object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.someId != null) {
|
||||
yield r'someId';
|
||||
yield serializers.serialize(
|
||||
object.someId,
|
||||
specifiedType: const FullType(num),
|
||||
);
|
||||
}
|
||||
if (object.someMap != null) {
|
||||
yield r'someMap';
|
||||
yield serializers.serialize(
|
||||
object.someMap,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
FakeBigDecimalMap200Response object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required FakeBigDecimalMap200ResponseBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'someId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(num),
|
||||
) as num;
|
||||
result.someId = valueDes;
|
||||
break;
|
||||
case r'someMap':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(num)]),
|
||||
) as BuiltMap<String, num>;
|
||||
result.someMap.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
FakeBigDecimalMap200Response deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = FakeBigDecimalMap200ResponseBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,128 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:openapi/src/model/model_file.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'file_schema_test_class.g.dart';
|
||||
|
||||
/// FileSchemaTestClass
|
||||
///
|
||||
/// Properties:
|
||||
/// * [file]
|
||||
/// * [files]
|
||||
@BuiltValue()
|
||||
abstract class FileSchemaTestClass implements Built<FileSchemaTestClass, FileSchemaTestClassBuilder> {
|
||||
@BuiltValueField(wireName: r'file')
|
||||
ModelFile? get file;
|
||||
|
||||
@BuiltValueField(wireName: r'files')
|
||||
BuiltList<ModelFile>? get files;
|
||||
|
||||
FileSchemaTestClass._();
|
||||
|
||||
factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(FileSchemaTestClassBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<FileSchemaTestClass> get serializer => _$FileSchemaTestClassSerializer();
|
||||
}
|
||||
|
||||
class _$FileSchemaTestClassSerializer implements PrimitiveSerializer<FileSchemaTestClass> {
|
||||
@override
|
||||
final Iterable<Type> types = const [FileSchemaTestClass, _$FileSchemaTestClass];
|
||||
|
||||
@override
|
||||
final String wireName = r'FileSchemaTestClass';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
FileSchemaTestClass object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.file != null) {
|
||||
yield r'file';
|
||||
yield serializers.serialize(
|
||||
object.file,
|
||||
specifiedType: const FullType(ModelFile),
|
||||
);
|
||||
}
|
||||
if (object.files != null) {
|
||||
yield r'files';
|
||||
yield serializers.serialize(
|
||||
object.files,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ModelFile)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
FileSchemaTestClass object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required FileSchemaTestClassBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'file':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(ModelFile),
|
||||
) as ModelFile;
|
||||
result.file.replace(valueDes);
|
||||
break;
|
||||
case r'files':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(ModelFile)]),
|
||||
) as BuiltList<ModelFile>;
|
||||
result.files.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
FileSchemaTestClass deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = FileSchemaTestClassBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'foo.g.dart';
|
||||
|
||||
/// Foo
|
||||
///
|
||||
/// Properties:
|
||||
/// * [bar]
|
||||
@BuiltValue()
|
||||
abstract class Foo implements Built<Foo, FooBuilder> {
|
||||
@BuiltValueField(wireName: r'bar')
|
||||
String? get bar;
|
||||
|
||||
Foo._();
|
||||
|
||||
factory Foo([void updates(FooBuilder b)]) = _$Foo;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(FooBuilder b) => b
|
||||
..bar = 'bar';
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Foo> get serializer => _$FooSerializer();
|
||||
}
|
||||
|
||||
class _$FooSerializer implements PrimitiveSerializer<Foo> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Foo, _$Foo];
|
||||
|
||||
@override
|
||||
final String wireName = r'Foo';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Foo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.bar != null) {
|
||||
yield r'bar';
|
||||
yield serializers.serialize(
|
||||
object.bar,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Foo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required FooBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'bar':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.bar = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Foo deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = FooBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:openapi/src/model/foo.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
part 'foo_get_default_response.g.dart';
|
||||
|
||||
/// FooGetDefaultResponse
|
||||
///
|
||||
/// Properties:
|
||||
/// * [string]
|
||||
@BuiltValue()
|
||||
abstract class FooGetDefaultResponse implements Built<FooGetDefaultResponse, FooGetDefaultResponseBuilder> {
|
||||
@BuiltValueField(wireName: r'string')
|
||||
Foo? get string;
|
||||
|
||||
FooGetDefaultResponse._();
|
||||
|
||||
factory FooGetDefaultResponse([void updates(FooGetDefaultResponseBuilder b)]) = _$FooGetDefaultResponse;
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(FooGetDefaultResponseBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<FooGetDefaultResponse> get serializer => _$FooGetDefaultResponseSerializer();
|
||||
}
|
||||
|
||||
class _$FooGetDefaultResponseSerializer implements PrimitiveSerializer<FooGetDefaultResponse> {
|
||||
@override
|
||||
final Iterable<Type> types = const [FooGetDefaultResponse, _$FooGetDefaultResponse];
|
||||
|
||||
@override
|
||||
final String wireName = r'FooGetDefaultResponse';
|
||||
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
FooGetDefaultResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.string != null) {
|
||||
yield r'string';
|
||||
yield serializers.serialize(
|
||||
object.string,
|
||||
specifiedType: const FullType(Foo),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
FooGetDefaultResponse object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required FooGetDefaultResponseBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'string':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(Foo),
|
||||
) as Foo;
|
||||
result.string.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
FooGetDefaultResponse deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = FooGetDefaultResponseBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user