[dart-dio] Fixes --model-name-suffix having no effect (#5669)

Fixes #5409
This commit is contained in:
Josh Burton
2020-04-02 16:13:23 +13:00
committed by GitHub
parent 2957dd4d45
commit 04160dab3d
20 changed files with 14 additions and 2302 deletions

View File

@@ -19,6 +19,7 @@ package org.openapitools.codegen.languages;
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 class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
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 class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
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));

View File

@@ -293,7 +293,7 @@ public class DartModelTest {
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")

View File

@@ -366,7 +366,7 @@ public class DartDioModelTest {
{"sample_name", "SampleName"},
{"sample__name", "SampleName"},
{"/sample", "Sample"},
{"\\sample", "\\Sample"},
{"\\sample", "Sample"},
{"sample.name", "SampleName"},
{"_sample", "Sample"},
};

View File

@@ -1 +1 @@
4.2.3-SNAPSHOT
4.3.0-SNAPSHOT

View File

@@ -1,17 +0,0 @@
# openapi.model.ApiResponse
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional] [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)

View File

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

View File

@@ -1,20 +0,0 @@
# openapi.model.Order
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [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)

View File

@@ -1,20 +0,0 @@
# openapi.model.Pet
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [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)

View File

@@ -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<OAuth>('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<OAuth>('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<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';
var api_instance = new PetApi();
var status = []; // List<String> | 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&lt;String&gt;**](String.md)| Status values that need to be considered for filter | [default to const []]
### Return type
[**List<Pet>**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findPetsByTags**
> List<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';
var api_instance = new PetApi();
var tags = []; // List<String> | 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&lt;String&gt;**](String.md)| Tags to filter by | [default to const []]
### Return type
[**List<Pet>**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **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';
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<OAuth>('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<OAuth>('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<OAuth>('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)

View File

@@ -1,186 +0,0 @@
# openapi.api.StoreApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io/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<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';
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<String, int>**
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
### Example
```dart
import 'package:openapi/api.dart';
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)

View File

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

View File

@@ -1,22 +0,0 @@
# openapi.model.User
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional] [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)

View File

@@ -1,349 +0,0 @@
# openapi.api.UserApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to *http://petstore.swagger.io/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&lt;User&gt;()]; // List<User> | 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&lt;User&gt;**](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&lt;User&gt;()]; // List<User> | 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&lt;User&gt;**](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)

View File

@@ -1,166 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'api_response.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<ApiResponse> _$apiResponseSerializer = new _$ApiResponseSerializer();
class _$ApiResponseSerializer implements StructuredSerializer<ApiResponse> {
@override
final Iterable<Type> types = const [ApiResponse, _$ApiResponse];
@override
final String wireName = 'ApiResponse';
@override
Iterable<Object> serialize(Serializers serializers, ApiResponse object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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, ApiResponseBuilder> {
_$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

View File

@@ -1,143 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'category.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<Category> _$categorySerializer = new _$CategorySerializer();
class _$CategorySerializer implements StructuredSerializer<Category> {
@override
final Iterable<Type> types = const [Category, _$Category];
@override
final String wireName = 'Category';
@override
Iterable<Object> serialize(Serializers serializers, Category object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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, CategoryBuilder> {
_$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

View File

@@ -1,242 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'order.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<Order> _$orderSerializer = new _$OrderSerializer();
class _$OrderSerializer implements StructuredSerializer<Order> {
@override
final Iterable<Type> types = const [Order, _$Order];
@override
final String wireName = 'Order';
@override
Iterable<Object> serialize(Serializers serializers, Order object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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, OrderBuilder> {
_$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

View File

@@ -1,265 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'pet.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<Pet> _$petSerializer = new _$PetSerializer();
class _$PetSerializer implements StructuredSerializer<Pet> {
@override
final Iterable<Type> types = const [Pet, _$Pet];
@override
final String wireName = 'Pet';
@override
Iterable<Object> serialize(Serializers serializers, Pet object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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<dynamic>);
break;
case 'tags':
result.tags.replace(serializers.deserialize(value,
specifiedType:
const FullType(BuiltList, const [const FullType(Tag)]))
as BuiltList<dynamic>);
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<String> photoUrls;
@override
final BuiltList<Tag> 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, PetBuilder> {
_$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<String> _photoUrls;
ListBuilder<String> get photoUrls =>
_$this._photoUrls ??= new ListBuilder<String>();
set photoUrls(ListBuilder<String> photoUrls) => _$this._photoUrls = photoUrls;
ListBuilder<Tag> _tags;
ListBuilder<Tag> get tags => _$this._tags ??= new ListBuilder<Tag>();
set tags(ListBuilder<Tag> 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

View File

@@ -1,143 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tag.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<Tag> _$tagSerializer = new _$TagSerializer();
class _$TagSerializer implements StructuredSerializer<Tag> {
@override
final Iterable<Type> types = const [Tag, _$Tag];
@override
final String wireName = 'Tag';
@override
Iterable<Object> serialize(Serializers serializers, Tag object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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, TagBuilder> {
_$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

View File

@@ -1,288 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user.dart';
// **************************************************************************
// BuiltValueGenerator
// **************************************************************************
Serializer<User> _$userSerializer = new _$UserSerializer();
class _$UserSerializer implements StructuredSerializer<User> {
@override
final Iterable<Type> types = const [User, _$User];
@override
final String wireName = 'User';
@override
Iterable<Object> serialize(Serializers serializers, User object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object>[];
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<Object> 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, UserBuilder> {
_$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

View File

@@ -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<String>())
..addBuilderFactory(
const FullType(BuiltList, const [const FullType(Tag)]),
() => new ListBuilder<Tag>()))
.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