diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index 4e966fc43cbd..c62bbaefd917 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -19,6 +19,7 @@ import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; + import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.*; @@ -366,9 +367,12 @@ public String toModelName(String name) { name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) } - // camelize the model name - // phone_number => PhoneNumber - return camelize(name); + if (typeMapping.containsValue(name)) { + return camelize(name); + } else { + // camelize the model name + return camelize(modelNamePrefix + "_" + name + "_" + modelNameSuffix); + } } @Override @@ -376,6 +380,10 @@ public String toModelFilename(String name) { return underscore(toModelName(name)); } + @Override public String toModelDocFilename(String name) { + return super.toModelDocFilename(toModelName(name)); + } + @Override public String toApiFilename(String name) { return underscore(toApiName(name)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java index 66931fa5d500..e9133bc605d5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartModelTest.java @@ -293,7 +293,7 @@ public void modelNameTest(String name, String expectedName) { final CodegenModel cm = codegen.fromModel(name, model); Assert.assertEquals(cm.name, name); - Assert.assertEquals(cm.classname, expectedName); + Assert.assertEquals(cm.classname, codegen.toModelName(expectedName)); } @Test(description = "test enum variable names for reserved words") diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java index 19cb56f510e7..aea9437cbfc1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dartdio/DartDioModelTest.java @@ -366,7 +366,7 @@ public static Object[][] primeNumbers() { {"sample_name", "SampleName"}, {"sample__name", "SampleName"}, {"/sample", "Sample"}, - {"\\sample", "\\Sample"}, + {"\\sample", "Sample"}, {"sample.name", "SampleName"}, {"_sample", "Sample"}, }; diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index 58592f031f65..bfbf77eb7fad 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.3-SNAPSHOT \ No newline at end of file +4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-dio/docs/ApiResponse.md b/samples/client/petstore/dart-dio/docs/ApiResponse.md deleted file mode 100644 index 92422f0f446e..000000000000 --- a/samples/client/petstore/dart-dio/docs/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-dio/docs/Category.md b/samples/client/petstore/dart-dio/docs/Category.md deleted file mode 100644 index cc0d1633b59c..000000000000 --- a/samples/client/petstore/dart-dio/docs/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-dio/docs/Order.md b/samples/client/petstore/dart-dio/docs/Order.md deleted file mode 100644 index 310ce6c65be3..000000000000 --- a/samples/client/petstore/dart-dio/docs/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] -**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) - - diff --git a/samples/client/petstore/dart-dio/docs/Pet.md b/samples/client/petstore/dart-dio/docs/Pet.md deleted file mode 100644 index 619e45d18483..000000000000 --- a/samples/client/petstore/dart-dio/docs/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **BuiltList<String>** | | [default to const []] -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] [default to const []] -**status** | **String** | pet status in the store | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-dio/docs/PetApi.md b/samples/client/petstore/dart-dio/docs/PetApi.md deleted file mode 100644 index e781974607c8..000000000000 --- a/samples/client/petstore/dart-dio/docs/PetApi.md +++ /dev/null @@ -1,379 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/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 - - -# **addPet** -> addPet(body) - -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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | Pet id to delete -var apiKey = apiKey_example; // String | - -try { - api_instance.deletePet(petId, apiKey); -} catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> List 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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var status = []; // List | Status values that need to be considered for filter - -try { - var result = api_instance.findPetsByStatus(status); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to const []] - -### Return type - -[**List**](Pet.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** -> List 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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var tags = []; // List | Tags to filter by - -try { - var result = api_instance.findPetsByTags(tags); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to const []] - -### Return type - -[**List**](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('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to return - -try { - var result = api_instance.getPetById(petId); - print(result); -} catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | [default to null] - -### 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(body) - -Update an existing pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.updatePet(body); -} catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet that needs to be updated -var name = name_example; // String | Updated name of the pet -var status = status_example; // String | Updated status of the pet - -try { - api_instance.updatePetWithForm(petId, name, status); -} catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] - -### 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('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to update -var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -var file = BINARY_DATA_HERE; // Uint8List | file to upload - -try { - var result = api_instance.uploadFile(petId, additionalMetadata, file); - print(result); -} catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **Uint8List**| file to upload | [optional] [default to null] - -### 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) - diff --git a/samples/client/petstore/dart-dio/docs/StoreApi.md b/samples/client/petstore/dart-dio/docs/StoreApi.md deleted file mode 100644 index 33896baac9bf..000000000000 --- a/samples/client/petstore/dart-dio/docs/StoreApi.md +++ /dev/null @@ -1,186 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **delete** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **get** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **get** /store/order/{orderId} | 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'; - -var api_instance = new StoreApi(); -var orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api_instance.deleteOrder(orderId); -} catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> Map 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('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -var api_instance = new StoreApi(); - -try { - var result = api_instance.getInventory(); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new StoreApi(); -var orderId = 789; // int | ID of pet that needs to be fetched - -try { - var result = api_instance.getOrderById(orderId); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | [default to null] - -### 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(body) - -Place an order for a pet - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet - -try { - var result = api_instance.placeOrder(body); - print(result); -} catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### 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) - diff --git a/samples/client/petstore/dart-dio/docs/Tag.md b/samples/client/petstore/dart-dio/docs/Tag.md deleted file mode 100644 index ded7b32ac3d7..000000000000 --- a/samples/client/petstore/dart-dio/docs/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-dio/docs/User.md b/samples/client/petstore/dart-dio/docs/User.md deleted file mode 100644 index 3761b70cf0b7..000000000000 --- a/samples/client/petstore/dart-dio/docs/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-dio/docs/UserApi.md b/samples/client/petstore/dart-dio/docs/UserApi.md deleted file mode 100644 index 052dc20aef76..000000000000 --- a/samples/client/petstore/dart-dio/docs/UserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/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(body) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new UserApi(); -var body = new User(); // User | Created user object - -try { - api_instance.createUser(body); -} catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### 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) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithArrayInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### 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) - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithListInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### 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) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be deleted - -try { - api_instance.deleteUser(username); -} catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] - -### 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'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - var result = api_instance.getUserByName(username); - print(result); -} catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] - -### 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'; - -var api_instance = new UserApi(); -var username = username_example; // String | The user name for login -var password = password_example; // String | The password for login in clear text - -try { - var result = api_instance.loginUser(username, password); - print(result); -} catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] - -### 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'; - -var api_instance = new UserApi(); - -try { - api_instance.logoutUser(); -} catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object - -try { - api_instance.updateUser(username, body); -} catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] - **body** | [**User**](User.md)| Updated user object | - -### 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) - diff --git a/samples/client/petstore/dart-dio/lib/model/api_response.g.dart b/samples/client/petstore/dart-dio/lib/model/api_response.g.dart deleted file mode 100644 index 3e5db8c18155..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/api_response.g.dart +++ /dev/null @@ -1,166 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'api_response.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$apiResponseSerializer = new _$ApiResponseSerializer(); - -class _$ApiResponseSerializer implements StructuredSerializer { - @override - final Iterable types = const [ApiResponse, _$ApiResponse]; - @override - final String wireName = 'ApiResponse'; - - @override - Iterable serialize(Serializers serializers, ApiResponse object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.code != null) { - result - ..add('code') - ..add(serializers.serialize(object.code, - specifiedType: const FullType(int))); - } - if (object.type != null) { - result - ..add('type') - ..add(serializers.serialize(object.type, - specifiedType: const FullType(String))); - } - if (object.message != null) { - result - ..add('message') - ..add(serializers.serialize(object.message, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ApiResponse deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new ApiResponseBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'code': - result.code = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'type': - result.type = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'message': - result.message = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - } - } - - return result.build(); - } -} - -class _$ApiResponse extends ApiResponse { - @override - final int code; - @override - final String type; - @override - final String message; - - factory _$ApiResponse([void Function(ApiResponseBuilder) updates]) => - (new ApiResponseBuilder()..update(updates)).build(); - - _$ApiResponse._({this.code, this.type, this.message}) : super._(); - - @override - ApiResponse rebuild(void Function(ApiResponseBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - ApiResponseBuilder toBuilder() => new ApiResponseBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is ApiResponse && - code == other.code && - type == other.type && - message == other.message; - } - - @override - int get hashCode { - return $jf( - $jc($jc($jc(0, code.hashCode), type.hashCode), message.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('ApiResponse') - ..add('code', code) - ..add('type', type) - ..add('message', message)) - .toString(); - } -} - -class ApiResponseBuilder implements Builder { - _$ApiResponse _$v; - - int _code; - int get code => _$this._code; - set code(int code) => _$this._code = code; - - String _type; - String get type => _$this._type; - set type(String type) => _$this._type = type; - - String _message; - String get message => _$this._message; - set message(String message) => _$this._message = message; - - ApiResponseBuilder(); - - ApiResponseBuilder get _$this { - if (_$v != null) { - _code = _$v.code; - _type = _$v.type; - _message = _$v.message; - _$v = null; - } - return this; - } - - @override - void replace(ApiResponse other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$ApiResponse; - } - - @override - void update(void Function(ApiResponseBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$ApiResponse build() { - final _$result = - _$v ?? new _$ApiResponse._(code: code, type: type, message: message); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/model/category.g.dart b/samples/client/petstore/dart-dio/lib/model/category.g.dart deleted file mode 100644 index a766a9b3db6f..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/category.g.dart +++ /dev/null @@ -1,143 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'category.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$categorySerializer = new _$CategorySerializer(); - -class _$CategorySerializer implements StructuredSerializer { - @override - final Iterable types = const [Category, _$Category]; - @override - final String wireName = 'Category'; - - @override - Iterable serialize(Serializers serializers, Category object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add('id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.name != null) { - result - ..add('name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Category deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new CategoryBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'id': - result.id = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'name': - result.name = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - } - } - - return result.build(); - } -} - -class _$Category extends Category { - @override - final int id; - @override - final String name; - - factory _$Category([void Function(CategoryBuilder) updates]) => - (new CategoryBuilder()..update(updates)).build(); - - _$Category._({this.id, this.name}) : super._(); - - @override - Category rebuild(void Function(CategoryBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - CategoryBuilder toBuilder() => new CategoryBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Category && id == other.id && name == other.name; - } - - @override - int get hashCode { - return $jf($jc($jc(0, id.hashCode), name.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('Category') - ..add('id', id) - ..add('name', name)) - .toString(); - } -} - -class CategoryBuilder implements Builder { - _$Category _$v; - - int _id; - int get id => _$this._id; - set id(int id) => _$this._id = id; - - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; - - CategoryBuilder(); - - CategoryBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _name = _$v.name; - _$v = null; - } - return this; - } - - @override - void replace(Category other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$Category; - } - - @override - void update(void Function(CategoryBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$Category build() { - final _$result = _$v ?? new _$Category._(id: id, name: name); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/model/order.g.dart b/samples/client/petstore/dart-dio/lib/model/order.g.dart deleted file mode 100644 index 5d58a6b36c1d..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/order.g.dart +++ /dev/null @@ -1,242 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'order.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$orderSerializer = new _$OrderSerializer(); - -class _$OrderSerializer implements StructuredSerializer { - @override - final Iterable types = const [Order, _$Order]; - @override - final String wireName = 'Order'; - - @override - Iterable serialize(Serializers serializers, Order object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add('id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.petId != null) { - result - ..add('petId') - ..add(serializers.serialize(object.petId, - specifiedType: const FullType(int))); - } - if (object.quantity != null) { - result - ..add('quantity') - ..add(serializers.serialize(object.quantity, - specifiedType: const FullType(int))); - } - if (object.shipDate != null) { - result - ..add('shipDate') - ..add(serializers.serialize(object.shipDate, - specifiedType: const FullType(DateTime))); - } - if (object.status != null) { - result - ..add('status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(String))); - } - if (object.complete != null) { - result - ..add('complete') - ..add(serializers.serialize(object.complete, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - Order deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new OrderBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'id': - result.id = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'petId': - result.petId = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'quantity': - result.quantity = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'shipDate': - result.shipDate = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - break; - case 'status': - result.status = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'complete': - result.complete = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - break; - } - } - - return result.build(); - } -} - -class _$Order extends Order { - @override - final int id; - @override - final int petId; - @override - final int quantity; - @override - final DateTime shipDate; - @override - final String status; - @override - final bool complete; - - factory _$Order([void Function(OrderBuilder) updates]) => - (new OrderBuilder()..update(updates)).build(); - - _$Order._( - {this.id, - this.petId, - this.quantity, - this.shipDate, - this.status, - this.complete}) - : super._(); - - @override - Order rebuild(void Function(OrderBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - OrderBuilder toBuilder() => new OrderBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Order && - id == other.id && - petId == other.petId && - quantity == other.quantity && - shipDate == other.shipDate && - status == other.status && - complete == other.complete; - } - - @override - int get hashCode { - return $jf($jc( - $jc( - $jc( - $jc($jc($jc(0, id.hashCode), petId.hashCode), - quantity.hashCode), - shipDate.hashCode), - status.hashCode), - complete.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('Order') - ..add('id', id) - ..add('petId', petId) - ..add('quantity', quantity) - ..add('shipDate', shipDate) - ..add('status', status) - ..add('complete', complete)) - .toString(); - } -} - -class OrderBuilder implements Builder { - _$Order _$v; - - int _id; - int get id => _$this._id; - set id(int id) => _$this._id = id; - - int _petId; - int get petId => _$this._petId; - set petId(int petId) => _$this._petId = petId; - - int _quantity; - int get quantity => _$this._quantity; - set quantity(int quantity) => _$this._quantity = quantity; - - DateTime _shipDate; - DateTime get shipDate => _$this._shipDate; - set shipDate(DateTime shipDate) => _$this._shipDate = shipDate; - - String _status; - String get status => _$this._status; - set status(String status) => _$this._status = status; - - bool _complete; - bool get complete => _$this._complete; - set complete(bool complete) => _$this._complete = complete; - - OrderBuilder(); - - OrderBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _petId = _$v.petId; - _quantity = _$v.quantity; - _shipDate = _$v.shipDate; - _status = _$v.status; - _complete = _$v.complete; - _$v = null; - } - return this; - } - - @override - void replace(Order other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$Order; - } - - @override - void update(void Function(OrderBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$Order build() { - final _$result = _$v ?? - new _$Order._( - id: id, - petId: petId, - quantity: quantity, - shipDate: shipDate, - status: status, - complete: complete); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/model/pet.g.dart b/samples/client/petstore/dart-dio/lib/model/pet.g.dart deleted file mode 100644 index abfeb806b47b..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/pet.g.dart +++ /dev/null @@ -1,265 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pet.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$petSerializer = new _$PetSerializer(); - -class _$PetSerializer implements StructuredSerializer { - @override - final Iterable types = const [Pet, _$Pet]; - @override - final String wireName = 'Pet'; - - @override - Iterable serialize(Serializers serializers, Pet object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add('id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.category != null) { - result - ..add('category') - ..add(serializers.serialize(object.category, - specifiedType: const FullType(Category))); - } - if (object.name != null) { - result - ..add('name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - if (object.photoUrls != null) { - result - ..add('photoUrls') - ..add(serializers.serialize(object.photoUrls, - specifiedType: - const FullType(BuiltList, const [const FullType(String)]))); - } - if (object.tags != null) { - result - ..add('tags') - ..add(serializers.serialize(object.tags, - specifiedType: - const FullType(BuiltList, const [const FullType(Tag)]))); - } - if (object.status != null) { - result - ..add('status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Pet deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new PetBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'id': - result.id = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'category': - result.category.replace(serializers.deserialize(value, - specifiedType: const FullType(Category)) as Category); - break; - case 'name': - result.name = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'photoUrls': - result.photoUrls.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(String)])) - as BuiltList); - break; - case 'tags': - result.tags.replace(serializers.deserialize(value, - specifiedType: - const FullType(BuiltList, const [const FullType(Tag)])) - as BuiltList); - break; - case 'status': - result.status = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - } - } - - return result.build(); - } -} - -class _$Pet extends Pet { - @override - final int id; - @override - final Category category; - @override - final String name; - @override - final BuiltList photoUrls; - @override - final BuiltList tags; - @override - final String status; - - factory _$Pet([void Function(PetBuilder) updates]) => - (new PetBuilder()..update(updates)).build(); - - _$Pet._( - {this.id, - this.category, - this.name, - this.photoUrls, - this.tags, - this.status}) - : super._(); - - @override - Pet rebuild(void Function(PetBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - PetBuilder toBuilder() => new PetBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Pet && - id == other.id && - category == other.category && - name == other.name && - photoUrls == other.photoUrls && - tags == other.tags && - status == other.status; - } - - @override - int get hashCode { - return $jf($jc( - $jc( - $jc($jc($jc($jc(0, id.hashCode), category.hashCode), name.hashCode), - photoUrls.hashCode), - tags.hashCode), - status.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('Pet') - ..add('id', id) - ..add('category', category) - ..add('name', name) - ..add('photoUrls', photoUrls) - ..add('tags', tags) - ..add('status', status)) - .toString(); - } -} - -class PetBuilder implements Builder { - _$Pet _$v; - - int _id; - int get id => _$this._id; - set id(int id) => _$this._id = id; - - CategoryBuilder _category; - CategoryBuilder get category => _$this._category ??= new CategoryBuilder(); - set category(CategoryBuilder category) => _$this._category = category; - - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; - - ListBuilder _photoUrls; - ListBuilder get photoUrls => - _$this._photoUrls ??= new ListBuilder(); - set photoUrls(ListBuilder photoUrls) => _$this._photoUrls = photoUrls; - - ListBuilder _tags; - ListBuilder get tags => _$this._tags ??= new ListBuilder(); - set tags(ListBuilder tags) => _$this._tags = tags; - - String _status; - String get status => _$this._status; - set status(String status) => _$this._status = status; - - PetBuilder(); - - PetBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _category = _$v.category?.toBuilder(); - _name = _$v.name; - _photoUrls = _$v.photoUrls?.toBuilder(); - _tags = _$v.tags?.toBuilder(); - _status = _$v.status; - _$v = null; - } - return this; - } - - @override - void replace(Pet other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$Pet; - } - - @override - void update(void Function(PetBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$Pet build() { - _$Pet _$result; - try { - _$result = _$v ?? - new _$Pet._( - id: id, - category: _category?.build(), - name: name, - photoUrls: _photoUrls?.build(), - tags: _tags?.build(), - status: status); - } catch (_) { - String _$failedField; - try { - _$failedField = 'category'; - _category?.build(); - - _$failedField = 'photoUrls'; - _photoUrls?.build(); - _$failedField = 'tags'; - _tags?.build(); - } catch (e) { - throw new BuiltValueNestedFieldError( - 'Pet', _$failedField, e.toString()); - } - rethrow; - } - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/model/tag.g.dart b/samples/client/petstore/dart-dio/lib/model/tag.g.dart deleted file mode 100644 index 4c8f7a9dc880..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/tag.g.dart +++ /dev/null @@ -1,143 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tag.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$tagSerializer = new _$TagSerializer(); - -class _$TagSerializer implements StructuredSerializer { - @override - final Iterable types = const [Tag, _$Tag]; - @override - final String wireName = 'Tag'; - - @override - Iterable serialize(Serializers serializers, Tag object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add('id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.name != null) { - result - ..add('name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Tag deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new TagBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'id': - result.id = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'name': - result.name = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - } - } - - return result.build(); - } -} - -class _$Tag extends Tag { - @override - final int id; - @override - final String name; - - factory _$Tag([void Function(TagBuilder) updates]) => - (new TagBuilder()..update(updates)).build(); - - _$Tag._({this.id, this.name}) : super._(); - - @override - Tag rebuild(void Function(TagBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - TagBuilder toBuilder() => new TagBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is Tag && id == other.id && name == other.name; - } - - @override - int get hashCode { - return $jf($jc($jc(0, id.hashCode), name.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('Tag') - ..add('id', id) - ..add('name', name)) - .toString(); - } -} - -class TagBuilder implements Builder { - _$Tag _$v; - - int _id; - int get id => _$this._id; - set id(int id) => _$this._id = id; - - String _name; - String get name => _$this._name; - set name(String name) => _$this._name = name; - - TagBuilder(); - - TagBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _name = _$v.name; - _$v = null; - } - return this; - } - - @override - void replace(Tag other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$Tag; - } - - @override - void update(void Function(TagBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$Tag build() { - final _$result = _$v ?? new _$Tag._(id: id, name: name); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/model/user.g.dart b/samples/client/petstore/dart-dio/lib/model/user.g.dart deleted file mode 100644 index 5a04b4804cd2..000000000000 --- a/samples/client/petstore/dart-dio/lib/model/user.g.dart +++ /dev/null @@ -1,288 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user.dart'; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializer _$userSerializer = new _$UserSerializer(); - -class _$UserSerializer implements StructuredSerializer { - @override - final Iterable types = const [User, _$User]; - @override - final String wireName = 'User'; - - @override - Iterable serialize(Serializers serializers, User object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add('id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.username != null) { - result - ..add('username') - ..add(serializers.serialize(object.username, - specifiedType: const FullType(String))); - } - if (object.firstName != null) { - result - ..add('firstName') - ..add(serializers.serialize(object.firstName, - specifiedType: const FullType(String))); - } - if (object.lastName != null) { - result - ..add('lastName') - ..add(serializers.serialize(object.lastName, - specifiedType: const FullType(String))); - } - if (object.email != null) { - result - ..add('email') - ..add(serializers.serialize(object.email, - specifiedType: const FullType(String))); - } - if (object.password != null) { - result - ..add('password') - ..add(serializers.serialize(object.password, - specifiedType: const FullType(String))); - } - if (object.phone != null) { - result - ..add('phone') - ..add(serializers.serialize(object.phone, - specifiedType: const FullType(String))); - } - if (object.userStatus != null) { - result - ..add('userStatus') - ..add(serializers.serialize(object.userStatus, - specifiedType: const FullType(int))); - } - return result; - } - - @override - User deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = new UserBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final dynamic value = iterator.current; - switch (key) { - case 'id': - result.id = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - case 'username': - result.username = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'firstName': - result.firstName = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'lastName': - result.lastName = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'email': - result.email = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'password': - result.password = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'phone': - result.phone = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - break; - case 'userStatus': - result.userStatus = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - break; - } - } - - return result.build(); - } -} - -class _$User extends User { - @override - final int id; - @override - final String username; - @override - final String firstName; - @override - final String lastName; - @override - final String email; - @override - final String password; - @override - final String phone; - @override - final int userStatus; - - factory _$User([void Function(UserBuilder) updates]) => - (new UserBuilder()..update(updates)).build(); - - _$User._( - {this.id, - this.username, - this.firstName, - this.lastName, - this.email, - this.password, - this.phone, - this.userStatus}) - : super._(); - - @override - User rebuild(void Function(UserBuilder) updates) => - (toBuilder()..update(updates)).build(); - - @override - UserBuilder toBuilder() => new UserBuilder()..replace(this); - - @override - bool operator ==(Object other) { - if (identical(other, this)) return true; - return other is User && - id == other.id && - username == other.username && - firstName == other.firstName && - lastName == other.lastName && - email == other.email && - password == other.password && - phone == other.phone && - userStatus == other.userStatus; - } - - @override - int get hashCode { - return $jf($jc( - $jc( - $jc( - $jc( - $jc( - $jc($jc($jc(0, id.hashCode), username.hashCode), - firstName.hashCode), - lastName.hashCode), - email.hashCode), - password.hashCode), - phone.hashCode), - userStatus.hashCode)); - } - - @override - String toString() { - return (newBuiltValueToStringHelper('User') - ..add('id', id) - ..add('username', username) - ..add('firstName', firstName) - ..add('lastName', lastName) - ..add('email', email) - ..add('password', password) - ..add('phone', phone) - ..add('userStatus', userStatus)) - .toString(); - } -} - -class UserBuilder implements Builder { - _$User _$v; - - int _id; - int get id => _$this._id; - set id(int id) => _$this._id = id; - - String _username; - String get username => _$this._username; - set username(String username) => _$this._username = username; - - String _firstName; - String get firstName => _$this._firstName; - set firstName(String firstName) => _$this._firstName = firstName; - - String _lastName; - String get lastName => _$this._lastName; - set lastName(String lastName) => _$this._lastName = lastName; - - String _email; - String get email => _$this._email; - set email(String email) => _$this._email = email; - - String _password; - String get password => _$this._password; - set password(String password) => _$this._password = password; - - String _phone; - String get phone => _$this._phone; - set phone(String phone) => _$this._phone = phone; - - int _userStatus; - int get userStatus => _$this._userStatus; - set userStatus(int userStatus) => _$this._userStatus = userStatus; - - UserBuilder(); - - UserBuilder get _$this { - if (_$v != null) { - _id = _$v.id; - _username = _$v.username; - _firstName = _$v.firstName; - _lastName = _$v.lastName; - _email = _$v.email; - _password = _$v.password; - _phone = _$v.phone; - _userStatus = _$v.userStatus; - _$v = null; - } - return this; - } - - @override - void replace(User other) { - if (other == null) { - throw new ArgumentError.notNull('other'); - } - _$v = other as _$User; - } - - @override - void update(void Function(UserBuilder) updates) { - if (updates != null) updates(this); - } - - @override - _$User build() { - final _$result = _$v ?? - new _$User._( - id: id, - username: username, - firstName: firstName, - lastName: lastName, - email: email, - password: password, - phone: phone, - userStatus: userStatus); - replace(_$result); - return _$result; - } -} - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new diff --git a/samples/client/petstore/dart-dio/lib/serializers.g.dart b/samples/client/petstore/dart-dio/lib/serializers.g.dart deleted file mode 100644 index 24717f2afb5a..000000000000 --- a/samples/client/petstore/dart-dio/lib/serializers.g.dart +++ /dev/null @@ -1,24 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of serializers; - -// ************************************************************************** -// BuiltValueGenerator -// ************************************************************************** - -Serializers _$serializers = (new Serializers().toBuilder() - ..add(ApiResponse.serializer) - ..add(Category.serializer) - ..add(Order.serializer) - ..add(Pet.serializer) - ..add(Tag.serializer) - ..add(User.serializer) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(String)]), - () => new ListBuilder()) - ..addBuilderFactory( - const FullType(BuiltList, const [const FullType(Tag)]), - () => new ListBuilder())) - .build(); - -// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new