[dart][dart-dio] Remove sample formatting from dart-dio-next (#9121)

This commit is contained in:
Peter Leibiger 2021-03-31 10:45:47 +02:00 committed by GitHub
parent 628e3d1914
commit 47e292c0e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 3016 additions and 3126 deletions

View File

@ -23,7 +23,6 @@ function installDart {
sudo apt-get update
sudo apt-get install dart
export PATH="$PATH:/usr/lib/dart/bin"
export DART_POST_PROCESS="dart format"
}
if [ "$NODE_INDEX" = "1" ]; then

View File

@ -2,6 +2,5 @@ generatorName: dart-dio-next
outputDir: samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
enablePostProcessFile: "true"
additionalProperties:
hideGenerationTimestamp: "true"

View File

@ -22,7 +22,6 @@ The following environment variables are supported by their respective generators
* `CPP_POST_PROCESS_FILE`
* `CSHARP_POST_PROCESS_FILE`
* `C_POST_PROCESS_FILE`
* `DART_POST_PROCESS`
* `DART_POST_PROCESS_FILE`
* `FSHARP_POST_PROCESS_FILE`
* `GO_POST_PROCESS_FILE`

View File

@ -692,33 +692,4 @@ public abstract class AbstractDartCodegen extends DefaultCodegen {
}
}
}
@Override
public void postProcess() {
if (isEnablePostProcessFile()) {
// Using the condition here to have way to still disable this
// for older Dart generators in CI by default.
// Post processing the whole dart output is much faster then individual files.
// Setting this variable to "dart format" is the suggested way of doing this.
final String dartPostProcess = System.getenv("DART_POST_PROCESS");
if (!StringUtils.isEmpty(dartPostProcess)) {
final String command = dartPostProcess + " " + getOutputDir();
try {
Process p = Runtime.getRuntime().exec(command);
int exitValue = p.waitFor();
if (exitValue != 0) {
LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
} else {
LOGGER.info("Successfully executed: {}", command);
}
} catch (InterruptedException | IOException e) {
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
// Restore interrupted state
Thread.currentThread().interrupt();
}
}
}
super.postProcess();
}
}

View File

@ -47,28 +47,19 @@ class Openapi {
void setOAuthToken(String name, String token) {
if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor)
as OAuthInterceptor)
.tokens[name] = token;
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token;
}
}
void setBasicAuth(String name, String username, String password) {
if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor)
as BasicAuthInterceptor)
.authInfo[name] = BasicAuthInfo(username, password);
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
}
}
void setApiKey(String name, String apiKey) {
if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
(this
.dio
.interceptors
.firstWhere((element) => element is ApiKeyAuthInterceptor)
as ApiKeyAuthInterceptor)
.apiKeys[name] = apiKey;
(this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
}
}

View File

@ -10,6 +10,7 @@ import 'package:dio/dio.dart';
import 'package:openapi/src/model/model_client.dart';
class AnotherFakeApi {
final Dio _dio;
final Serializers _serializers;
@ -19,7 +20,7 @@ class AnotherFakeApi {
/// To test special tags
///
/// To test special tags and operation ID starting with number
Future<Response<ModelClient>> call123testSpecialTags({
Future<Response<ModelClient>> call123testSpecialTags({
required ModelClient modelClient,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -44,16 +45,18 @@ class AnotherFakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(ModelClient);
_bodyData = _serializers.serialize(modelClient, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -81,6 +84,7 @@ class AnotherFakeApi {
_response.data!,
specifiedType: _responseType,
) as ModelClient;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -101,4 +105,5 @@ class AnotherFakeApi {
extra: _response.extra,
);
}
}

View File

@ -10,16 +10,17 @@ import 'package:dio/dio.dart';
import 'package:openapi/src/model/inline_response_default.dart';
class DefaultApi {
final Dio _dio;
final Serializers _serializers;
const DefaultApi(this._dio, this._serializers);
///
///
///
///
Future<Response<InlineResponseDefault>> fooGet({
///
Future<Response<InlineResponseDefault>> fooGet({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@ -43,7 +44,8 @@ class DefaultApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -62,6 +64,7 @@ class DefaultApi {
_response.data!,
specifiedType: _responseType,
) as InlineResponseDefault;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -82,4 +85,5 @@ class DefaultApi {
extra: _response.extra,
);
}
}

View File

@ -19,6 +19,7 @@ import 'dart:typed_data';
import 'package:built_collection/built_collection.dart';
class FakeApi {
final Dio _dio;
final Serializers _serializers;
@ -27,8 +28,8 @@ class FakeApi {
/// Health check endpoint
///
///
Future<Response<HealthCheckResult>> fakeHealthGet({
///
Future<Response<HealthCheckResult>> fakeHealthGet({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@ -52,7 +53,8 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -71,6 +73,7 @@ class FakeApi {
_response.data!,
specifiedType: _responseType,
) as HealthCheckResult;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -94,8 +97,8 @@ class FakeApi {
/// test http signature authentication
///
///
Future<Response<void>> fakeHttpSignatureTest({
///
Future<Response<void>> fakeHttpSignatureTest({
required Pet pet,
String? query1,
String? header1,
@ -138,9 +141,10 @@ class FakeApi {
try {
const _type = FullType(Pet);
_bodyData = _serializers.serialize(pet, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -163,10 +167,10 @@ class FakeApi {
return _response;
}
///
///
///
/// Test serialization of outer boolean types
Future<Response<bool>> fakeOuterBooleanSerialize({
Future<Response<bool>> fakeOuterBooleanSerialize({
bool? body,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -191,15 +195,17 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = body;
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -223,6 +229,7 @@ class FakeApi {
try {
_responseData = _response.data as bool;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -244,10 +251,10 @@ class FakeApi {
);
}
///
///
///
/// Test serialization of object with outer number type
Future<Response<OuterComposite>> fakeOuterCompositeSerialize({
Future<Response<OuterComposite>> fakeOuterCompositeSerialize({
OuterComposite? outerComposite,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -272,18 +279,18 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(OuterComposite);
_bodyData = outerComposite == null
? null
: _serializers.serialize(outerComposite, specifiedType: _type);
} catch (error) {
_bodyData = outerComposite == null ? null : _serializers.serialize(outerComposite, specifiedType: _type);
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -311,6 +318,7 @@ class FakeApi {
_response.data!,
specifiedType: _responseType,
) as OuterComposite;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -332,10 +340,10 @@ class FakeApi {
);
}
///
///
///
/// Test serialization of outer number types
Future<Response<num>> fakeOuterNumberSerialize({
Future<Response<num>> fakeOuterNumberSerialize({
num? body,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -360,15 +368,17 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = body;
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -392,6 +402,7 @@ class FakeApi {
try {
_responseData = _response.data as num;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -413,10 +424,10 @@ class FakeApi {
);
}
///
///
///
/// Test serialization of outer string types
Future<Response<String>> fakeOuterStringSerialize({
Future<Response<String>> fakeOuterStringSerialize({
String? body,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -441,15 +452,17 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = body;
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -473,6 +486,7 @@ class FakeApi {
try {
_responseData = _response.data as String;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -494,11 +508,10 @@ class FakeApi {
);
}
///
///
///
/// Test serialization of enum (int) properties with examples
Future<Response<OuterObjectWithEnumProperty>>
fakePropertyEnumIntegerSerialize({
Future<Response<OuterObjectWithEnumProperty>> fakePropertyEnumIntegerSerialize({
required OuterObjectWithEnumProperty outerObjectWithEnumProperty,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -523,17 +536,18 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(OuterObjectWithEnumProperty);
_bodyData = _serializers.serialize(outerObjectWithEnumProperty,
specifiedType: _type);
} catch (error) {
_bodyData = _serializers.serialize(outerObjectWithEnumProperty, specifiedType: _type);
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -561,6 +575,7 @@ class FakeApi {
_response.data!,
specifiedType: _responseType,
) as OuterObjectWithEnumProperty;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -582,10 +597,10 @@ class FakeApi {
);
}
///
///
///
/// For this test, the body for this request much reference a schema named `File`.
Future<Response<void>> testBodyWithFileSchema({
Future<Response<void>> testBodyWithFileSchema({
required FileSchemaTestClass fileSchemaTestClass,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -610,17 +625,18 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(FileSchemaTestClass);
_bodyData =
_serializers.serialize(fileSchemaTestClass, specifiedType: _type);
} catch (error) {
_bodyData = _serializers.serialize(fileSchemaTestClass, specifiedType: _type);
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -643,10 +659,10 @@ class FakeApi {
return _response;
}
///
///
///
///
Future<Response<void>> testBodyWithQueryParams({
///
Future<Response<void>> testBodyWithQueryParams({
required String query,
required User user,
CancelToken? cancelToken,
@ -681,9 +697,10 @@ class FakeApi {
try {
const _type = FullType(User);
_bodyData = _serializers.serialize(user, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -709,7 +726,7 @@ class FakeApi {
/// To test \"client\" model
///
/// To test \"client\" model
Future<Response<ModelClient>> testClientModel({
Future<Response<ModelClient>> testClientModel({
required ModelClient modelClient,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -734,16 +751,18 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(ModelClient);
_bodyData = _serializers.serialize(modelClient, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -771,6 +790,7 @@ class FakeApi {
_response.data!,
specifiedType: _responseType,
) as ModelClient;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -792,10 +812,10 @@ class FakeApi {
);
}
/// Fake endpoint for testing various parameters
/// Fake endpoint for testing various parameters
///
/// Fake endpoint for testing various parameters
Future<Response<void>> testEndpointParameters({
/// Fake endpoint for testing various parameters
Future<Response<void>> testEndpointParameters({
required num number,
required double double_,
required String patternWithoutDelimiter,
@ -838,53 +858,32 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = <String, dynamic>{
if (integer != null)
r'integer':
encodeFormParameter(_serializers, integer, const FullType(int)),
if (int32 != null)
r'int32':
encodeFormParameter(_serializers, int32, const FullType(int)),
if (int64 != null)
r'int64':
encodeFormParameter(_serializers, int64, const FullType(int)),
r'number':
encodeFormParameter(_serializers, number, const FullType(num)),
if (float != null)
r'float':
encodeFormParameter(_serializers, float, const FullType(double)),
r'double':
encodeFormParameter(_serializers, double_, const FullType(double)),
if (string != null)
r'string':
encodeFormParameter(_serializers, string, const FullType(String)),
r'pattern_without_delimiter': encodeFormParameter(
_serializers, patternWithoutDelimiter, const FullType(String)),
r'byte':
encodeFormParameter(_serializers, byte, const FullType(String)),
if (binary != null)
r'binary': MultipartFile.fromBytes(binary, filename: r'binary'),
if (date != null)
r'date':
encodeFormParameter(_serializers, date, const FullType(DateTime)),
if (dateTime != null)
r'dateTime': encodeFormParameter(
_serializers, dateTime, const FullType(DateTime)),
if (password != null)
r'password': encodeFormParameter(
_serializers, password, const FullType(String)),
if (callback != null)
r'callback': encodeFormParameter(
_serializers, callback, const FullType(String)),
if (integer != null) r'integer': encodeFormParameter(_serializers, integer, const FullType(int)),
if (int32 != null) r'int32': encodeFormParameter(_serializers, int32, const FullType(int)),
if (int64 != null) r'int64': encodeFormParameter(_serializers, int64, const FullType(int)),
r'number': encodeFormParameter(_serializers, number, const FullType(num)),
if (float != null) r'float': encodeFormParameter(_serializers, float, const FullType(double)),
r'double': encodeFormParameter(_serializers, double_, const FullType(double)),
if (string != null) r'string': encodeFormParameter(_serializers, string, const FullType(String)),
r'pattern_without_delimiter': encodeFormParameter(_serializers, patternWithoutDelimiter, const FullType(String)),
r'byte': encodeFormParameter(_serializers, byte, const FullType(String)),
if (binary != null) r'binary': MultipartFile.fromBytes(binary, filename: r'binary'),
if (date != null) r'date': encodeFormParameter(_serializers, date, const FullType(DateTime)),
if (dateTime != null) r'dateTime': encodeFormParameter(_serializers, dateTime, const FullType(DateTime)),
if (password != null) r'password': encodeFormParameter(_serializers, password, const FullType(String)),
if (callback != null) r'callback': encodeFormParameter(_serializers, callback, const FullType(String)),
};
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -910,7 +909,7 @@ class FakeApi {
/// To test enum parameters
///
/// To test enum parameters
Future<Response<void>> testEnumParameters({
Future<Response<void>> testEnumParameters({
BuiltList<String>? enumHeaderStringArray,
String? enumHeaderString,
BuiltList<String>? enumQueryStringArray,
@ -930,8 +929,7 @@ class FakeApi {
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
if (enumHeaderStringArray != null)
r'enum_header_string_array': enumHeaderStringArray,
if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray,
if (enumHeaderString != null) r'enum_header_string': enumHeaderString,
...?headers,
},
@ -946,8 +944,7 @@ class FakeApi {
);
final _queryParameters = <String, dynamic>{
if (enumQueryStringArray != null)
r'enum_query_string_array': enumQueryStringArray,
if (enumQueryStringArray != null) r'enum_query_string_array': enumQueryStringArray,
if (enumQueryString != null) r'enum_query_string': enumQueryString,
if (enumQueryInteger != null) r'enum_query_integer': enumQueryInteger,
if (enumQueryDouble != null) r'enum_query_double': enumQueryDouble,
@ -957,18 +954,13 @@ class FakeApi {
try {
_bodyData = <String, dynamic>{
if (enumFormStringArray != null)
r'enum_form_string_array': encodeFormParameter(
_serializers,
enumFormStringArray,
const FullType(BuiltList, [FullType(String)])),
if (enumFormString != null)
r'enum_form_string': encodeFormParameter(
_serializers, enumFormString, const FullType(String)),
if (enumFormStringArray != null) r'enum_form_string_array': encodeFormParameter(_serializers, enumFormStringArray, const FullType(BuiltList, [FullType(String)])),
if (enumFormString != null) r'enum_form_string': encodeFormParameter(_serializers, enumFormString, const FullType(String)),
};
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -994,7 +986,7 @@ class FakeApi {
/// Fake endpoint to test group parameters (optional)
///
/// Fake endpoint to test group parameters (optional)
Future<Response<void>> testGroupParameters({
Future<Response<void>> testGroupParameters({
required int requiredStringGroup,
required bool requiredBooleanGroup,
required int requiredInt64Group,
@ -1052,8 +1044,8 @@ class FakeApi {
/// test inline additionalProperties
///
///
Future<Response<void>> testInlineAdditionalProperties({
///
Future<Response<void>> testInlineAdditionalProperties({
required BuiltMap<String, String> requestBody,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -1078,16 +1070,18 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(BuiltMap, [FullType(String), FullType(String)]);
_bodyData = _serializers.serialize(requestBody, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -1112,8 +1106,8 @@ class FakeApi {
/// test json serialization of form data
///
///
Future<Response<void>> testJsonFormData({
///
Future<Response<void>> testJsonFormData({
required String param,
required String param2,
CancelToken? cancelToken,
@ -1139,20 +1133,20 @@ class FakeApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = <String, dynamic>{
r'param':
encodeFormParameter(_serializers, param, const FullType(String)),
r'param2':
encodeFormParameter(_serializers, param2, const FullType(String)),
r'param': encodeFormParameter(_serializers, param, const FullType(String)),
r'param2': encodeFormParameter(_serializers, param2, const FullType(String)),
};
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -1175,10 +1169,10 @@ class FakeApi {
return _response;
}
///
///
///
/// To test the collection format in query parameters
Future<Response<void>> testQueryParameterCollectionFormat({
Future<Response<void>> testQueryParameterCollectionFormat({
required BuiltList<String> pipe,
required BuiltList<String> ioutil,
required BuiltList<String> http,
@ -1226,4 +1220,5 @@ class FakeApi {
return _response;
}
}

View File

@ -10,6 +10,7 @@ import 'package:dio/dio.dart';
import 'package:openapi/src/model/model_client.dart';
class FakeClassnameTags123Api {
final Dio _dio;
final Serializers _serializers;
@ -19,7 +20,7 @@ class FakeClassnameTags123Api {
/// To test class name in snake case
///
/// To test class name in snake case
Future<Response<ModelClient>> testClassname({
Future<Response<ModelClient>> testClassname({
required ModelClient modelClient,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -51,16 +52,18 @@ class FakeClassnameTags123Api {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(ModelClient);
_bodyData = _serializers.serialize(modelClient, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -88,6 +91,7 @@ class FakeClassnameTags123Api {
_response.data!,
specifiedType: _responseType,
) as ModelClient;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -108,4 +112,5 @@ class FakeClassnameTags123Api {
extra: _response.extra,
);
}
}

View File

@ -14,6 +14,7 @@ import 'dart:typed_data';
import 'package:built_collection/built_collection.dart';
class PetApi {
final Dio _dio;
final Serializers _serializers;
@ -22,8 +23,8 @@ class PetApi {
/// Add a new pet to the store
///
///
Future<Response<void>> addPet({
///
Future<Response<void>> addPet({
required Pet pet,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -54,16 +55,18 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(Pet);
_bodyData = _serializers.serialize(pet, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -88,8 +91,8 @@ class PetApi {
/// Deletes a pet
///
///
Future<Response<void>> deletePet({
///
Future<Response<void>> deletePet({
required int petId,
String? apiKey,
CancelToken? cancelToken,
@ -99,8 +102,7 @@ class PetApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path =
r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
@ -122,7 +124,8 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -139,7 +142,7 @@ class PetApi {
/// Finds Pets by status
///
/// Multiple status values can be provided with comma separated strings
Future<Response<BuiltList<Pet>>> findPetsByStatus({
Future<Response<BuiltList<Pet>>> findPetsByStatus({
required BuiltList<String> status,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -190,6 +193,7 @@ class PetApi {
_response.data!,
specifiedType: _responseType,
) as BuiltList<Pet>;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -214,7 +218,7 @@ class PetApi {
/// Finds Pets by tags
///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Future<Response<BuiltSet<Pet>>> findPetsByTags({
Future<Response<BuiltSet<Pet>>> findPetsByTags({
required BuiltSet<String> tags,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -265,6 +269,7 @@ class PetApi {
_response.data!,
specifiedType: _responseType,
) as BuiltSet<Pet>;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -289,7 +294,7 @@ class PetApi {
/// Find pet by ID
///
/// Returns a single pet
Future<Response<Pet>> getPetById({
Future<Response<Pet>> getPetById({
required int petId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -298,8 +303,7 @@ class PetApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path =
r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
@ -322,7 +326,8 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -341,6 +346,7 @@ class PetApi {
_response.data!,
specifiedType: _responseType,
) as Pet;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -364,8 +370,8 @@ class PetApi {
/// Update an existing pet
///
///
Future<Response<void>> updatePet({
///
Future<Response<void>> updatePet({
required Pet pet,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -396,16 +402,18 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(Pet);
_bodyData = _serializers.serialize(pet, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -430,8 +438,8 @@ class PetApi {
/// Updates a pet in the store with form data
///
///
Future<Response<void>> updatePetWithForm({
///
Future<Response<void>> updatePetWithForm({
required int petId,
String? name,
String? status,
@ -442,8 +450,7 @@ class PetApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path =
r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
@ -464,22 +471,20 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = <String, dynamic>{
if (name != null)
r'name':
encodeFormParameter(_serializers, name, const FullType(String)),
if (status != null)
r'status':
encodeFormParameter(_serializers, status, const FullType(String)),
if (name != null) r'name': encodeFormParameter(_serializers, name, const FullType(String)),
if (status != null) r'status': encodeFormParameter(_serializers, status, const FullType(String)),
};
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -504,8 +509,8 @@ class PetApi {
/// uploads an image
///
///
Future<Response<ApiResponse>> uploadFile({
///
Future<Response<ApiResponse>> uploadFile({
required int petId,
String? additionalMetadata,
Uint8List? file,
@ -516,8 +521,7 @@ class PetApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/pet/{petId}/uploadImage'
.replaceAll('{' r'petId' '}', petId.toString());
final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
@ -538,21 +542,20 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = FormData.fromMap(<String, dynamic>{
if (additionalMetadata != null)
r'additionalMetadata': encodeFormParameter(
_serializers, additionalMetadata, const FullType(String)),
if (file != null)
r'file': MultipartFile.fromBytes(file, filename: r'file'),
if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)),
if (file != null) r'file': MultipartFile.fromBytes(file, filename: r'file'),
});
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -580,6 +583,7 @@ class PetApi {
_response.data!,
specifiedType: _responseType,
) as ApiResponse;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -603,8 +607,8 @@ class PetApi {
/// uploads an image (required)
///
///
Future<Response<ApiResponse>> uploadFileWithRequiredFile({
///
Future<Response<ApiResponse>> uploadFileWithRequiredFile({
required int petId,
required Uint8List requiredFile,
String? additionalMetadata,
@ -615,8 +619,7 @@ class PetApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/fake/{petId}/uploadImageWithRequiredFile'
.replaceAll('{' r'petId' '}', petId.toString());
final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
@ -637,21 +640,20 @@ class PetApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
_bodyData = FormData.fromMap(<String, dynamic>{
if (additionalMetadata != null)
r'additionalMetadata': encodeFormParameter(
_serializers, additionalMetadata, const FullType(String)),
r'requiredFile':
MultipartFile.fromBytes(requiredFile, filename: r'requiredFile'),
if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)),
r'requiredFile': MultipartFile.fromBytes(requiredFile, filename: r'requiredFile'),
});
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -679,6 +681,7 @@ class PetApi {
_response.data!,
specifiedType: _responseType,
) as ApiResponse;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -699,4 +702,5 @@ class PetApi {
extra: _response.extra,
);
}
}

View File

@ -11,6 +11,7 @@ import 'package:openapi/src/model/order.dart';
import 'package:built_collection/built_collection.dart';
class StoreApi {
final Dio _dio;
final Serializers _serializers;
@ -20,7 +21,7 @@ class StoreApi {
/// Delete purchase order by ID
///
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Future<Response<void>> deleteOrder({
Future<Response<void>> deleteOrder({
required String orderId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -29,8 +30,7 @@ class StoreApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/store/order/{order_id}'
.replaceAll('{' r'order_id' '}', orderId.toString());
final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
@ -46,7 +46,8 @@ class StoreApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -63,7 +64,7 @@ class StoreApi {
/// Returns pet inventories by status
///
/// Returns a map of status codes to quantities
Future<Response<BuiltMap<String, int>>> getInventory({
Future<Response<BuiltMap<String, int>>> getInventory({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@ -94,7 +95,8 @@ class StoreApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -108,12 +110,12 @@ class StoreApi {
BuiltMap<String, int> _responseData;
try {
const _responseType =
FullType(BuiltMap, [FullType(String), FullType(int)]);
const _responseType = FullType(BuiltMap, [FullType(String), FullType(int)]);
_responseData = _serializers.deserialize(
_response.data!,
specifiedType: _responseType,
) as BuiltMap<String, int>;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -138,7 +140,7 @@ class StoreApi {
/// Find purchase order by ID
///
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Future<Response<Order>> getOrderById({
Future<Response<Order>> getOrderById({
required int orderId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -147,8 +149,7 @@ class StoreApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/store/order/{order_id}'
.replaceAll('{' r'order_id' '}', orderId.toString());
final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
@ -164,7 +165,8 @@ class StoreApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -183,6 +185,7 @@ class StoreApi {
_response.data!,
specifiedType: _responseType,
) as Order;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -206,8 +209,8 @@ class StoreApi {
/// Place an order for a pet
///
///
Future<Response<Order>> placeOrder({
///
Future<Response<Order>> placeOrder({
required Order order,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -232,16 +235,18 @@ class StoreApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(Order);
_bodyData = _serializers.serialize(order, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -269,6 +274,7 @@ class StoreApi {
_response.data!,
specifiedType: _responseType,
) as Order;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -289,4 +295,5 @@ class StoreApi {
extra: _response.extra,
);
}
}

View File

@ -11,6 +11,7 @@ import 'package:openapi/src/model/user.dart';
import 'package:built_collection/built_collection.dart';
class UserApi {
final Dio _dio;
final Serializers _serializers;
@ -20,7 +21,7 @@ class UserApi {
/// Create user
///
/// This can only be done by the logged in user.
Future<Response<void>> createUser({
Future<Response<void>> createUser({
required User user,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -45,16 +46,18 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(User);
_bodyData = _serializers.serialize(user, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -79,8 +82,8 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response<void>> createUsersWithArrayInput({
///
Future<Response<void>> createUsersWithArrayInput({
required BuiltList<User> user,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -105,16 +108,18 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(BuiltList, [FullType(User)]);
_bodyData = _serializers.serialize(user, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -139,8 +144,8 @@ class UserApi {
/// Creates list of users with given input array
///
///
Future<Response<void>> createUsersWithListInput({
///
Future<Response<void>> createUsersWithListInput({
required BuiltList<User> user,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -165,16 +170,18 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(BuiltList, [FullType(User)]);
_bodyData = _serializers.serialize(user, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -200,7 +207,7 @@ class UserApi {
/// Delete user
///
/// This can only be done by the logged in user.
Future<Response<void>> deleteUser({
Future<Response<void>> deleteUser({
required String username,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -209,8 +216,7 @@ class UserApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/user/{username}'
.replaceAll('{' r'username' '}', username.toString());
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
@ -226,7 +232,8 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -242,8 +249,8 @@ class UserApi {
/// Get user by user name
///
///
Future<Response<User>> getUserByName({
///
Future<Response<User>> getUserByName({
required String username,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
@ -252,8 +259,7 @@ class UserApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/user/{username}'
.replaceAll('{' r'username' '}', username.toString());
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
@ -269,7 +275,8 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -288,6 +295,7 @@ class UserApi {
_response.data!,
specifiedType: _responseType,
) as User;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -311,8 +319,8 @@ class UserApi {
/// Logs user into the system
///
///
Future<Response<String>> loginUser({
///
Future<Response<String>> loginUser({
required String username,
required String password,
CancelToken? cancelToken,
@ -356,6 +364,7 @@ class UserApi {
try {
_responseData = _response.data as String;
} catch (error) {
throw DioError(
requestOptions: _response.requestOptions,
@ -379,8 +388,8 @@ class UserApi {
/// Logs out current logged in user session
///
///
Future<Response<void>> logoutUser({
///
Future<Response<void>> logoutUser({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@ -404,7 +413,8 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
final _response = await _dio.request<Object>(
_path,
@ -421,7 +431,7 @@ class UserApi {
/// Updated user
///
/// This can only be done by the logged in user.
Future<Response<void>> updateUser({
Future<Response<void>> updateUser({
required String username,
required User user,
CancelToken? cancelToken,
@ -431,8 +441,7 @@ class UserApi {
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/user/{username}'
.replaceAll('{' r'username' '}', username.toString());
final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString());
final _options = Options(
method: r'PUT',
headers: <String, dynamic>{
@ -448,16 +457,18 @@ class UserApi {
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{};
final _queryParameters = <String, dynamic>{
};
dynamic _bodyData;
try {
const _type = FullType(User);
_bodyData = _serializers.serialize(user, specifiedType: _type);
} catch (error) {
} catch(error) {
throw DioError(
requestOptions: _options.compose(
requestOptions: _options.compose(
_dio.options,
_path,
queryParameters: _queryParameters,
@ -479,4 +490,5 @@ class UserApi {
return _response;
}
}

View File

@ -10,8 +10,7 @@ import 'package:built_value/serializer.dart';
/// Format the given form parameter object into something that Dio can handle.
/// Returns primitive or String.
/// Returns List/Map if the value is BuildList/BuiltMap.
dynamic encodeFormParameter(
Serializers serializers, dynamic value, FullType type) {
dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) {
if (value == null) {
return '';
}

View File

@ -2,6 +2,7 @@
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
import 'package:openapi/src/auth/auth.dart';

View File

@ -27,8 +27,7 @@ class BasicAuthInterceptor extends AuthInterceptor {
final authName = info['name'] as String;
final basicAuthInfo = authInfo[authName];
if (basicAuthInfo != null) {
final basicAuth =
'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
options.headers['Authorization'] = basicAuth;
break;
}

View File

@ -8,90 +8,73 @@ import 'package:built_value/serializer.dart';
part 'additional_properties_class.g.dart';
abstract class AdditionalPropertiesClass
implements
Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
@BuiltValueField(wireName: r'map_property')
BuiltMap<String, String>? get mapProperty;
@BuiltValueField(wireName: r'map_of_map_property')
BuiltMap<String, BuiltMap<String, String>>? get mapOfMapProperty;
AdditionalPropertiesClass._();
abstract class AdditionalPropertiesClass implements Built<AdditionalPropertiesClass, AdditionalPropertiesClassBuilder> {
@BuiltValueField(wireName: r'map_property')
BuiltMap<String, String>? get mapProperty;
static void _initializeBuilder(AdditionalPropertiesClassBuilder b) => b;
@BuiltValueField(wireName: r'map_of_map_property')
BuiltMap<String, BuiltMap<String, String>>? get mapOfMapProperty;
factory AdditionalPropertiesClass(
[void updates(AdditionalPropertiesClassBuilder b)]) =
_$AdditionalPropertiesClass;
AdditionalPropertiesClass._();
@BuiltValueSerializer(custom: true)
static Serializer<AdditionalPropertiesClass> get serializer =>
_$AdditionalPropertiesClassSerializer();
static void _initializeBuilder(AdditionalPropertiesClassBuilder b) => b;
factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass;
@BuiltValueSerializer(custom: true)
static Serializer<AdditionalPropertiesClass> get serializer => _$AdditionalPropertiesClassSerializer();
}
class _$AdditionalPropertiesClassSerializer
implements StructuredSerializer<AdditionalPropertiesClass> {
@override
final Iterable<Type> types = const [
AdditionalPropertiesClass,
_$AdditionalPropertiesClass
];
class _$AdditionalPropertiesClassSerializer implements StructuredSerializer<AdditionalPropertiesClass> {
@override
final Iterable<Type> types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass];
@override
final String wireName = r'AdditionalPropertiesClass';
@override
final String wireName = r'AdditionalPropertiesClass';
@override
Iterable<Object?> serialize(
Serializers serializers, AdditionalPropertiesClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.mapProperty != null) {
result
..add(r'map_property')
..add(serializers.serialize(object.mapProperty,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(String)])));
@override
Iterable<Object?> serialize(Serializers serializers, AdditionalPropertiesClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.mapProperty != null) {
result
..add(r'map_property')
..add(serializers.serialize(object.mapProperty,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)])));
}
if (object.mapOfMapProperty != null) {
result
..add(r'map_of_map_property')
..add(serializers.serialize(object.mapOfMapProperty,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])));
}
return result;
}
if (object.mapOfMapProperty != null) {
result
..add(r'map_of_map_property')
..add(serializers.serialize(object.mapOfMapProperty,
specifiedType: const FullType(BuiltMap, [
FullType(String),
FullType(BuiltMap, [FullType(String), FullType(String)])
])));
}
return result;
}
@override
AdditionalPropertiesClass deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = AdditionalPropertiesClassBuilder();
@override
AdditionalPropertiesClass deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = AdditionalPropertiesClassBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'map_property':
result.mapProperty.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(String)]))
as BuiltMap<String, String>);
break;
case r'map_of_map_property':
result.mapOfMapProperty.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [
FullType(String),
FullType(BuiltMap, [FullType(String), FullType(String)])
])) as BuiltMap<String, BuiltMap<String, String>>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'map_property':
result.mapProperty.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)])) as BuiltMap<String, String>);
break;
case r'map_of_map_property':
result.mapOfMapProperty.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap<String, BuiltMap<String, String>>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,68 +7,72 @@ import 'package:built_value/serializer.dart';
part 'animal.g.dart';
abstract class Animal implements Built<Animal, AnimalBuilder> {
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'color')
String? get color;
@BuiltValueField(wireName: r'color')
String? get color;
Animal._();
Animal._();
static void _initializeBuilder(AnimalBuilder b) => b..color = 'red';
static void _initializeBuilder(AnimalBuilder b) => b
..color = 'red';
factory Animal([void updates(AnimalBuilder b)]) = _$Animal;
factory Animal([void updates(AnimalBuilder b)]) = _$Animal;
@BuiltValueSerializer(custom: true)
static Serializer<Animal> get serializer => _$AnimalSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Animal> get serializer => _$AnimalSerializer();
}
class _$AnimalSerializer implements StructuredSerializer<Animal> {
@override
final Iterable<Type> types = const [Animal, _$Animal];
@override
final Iterable<Type> types = const [Animal, _$Animal];
@override
final String wireName = r'Animal';
@override
final String wireName = r'Animal';
@override
Iterable<Object?> serialize(Serializers serializers, Animal object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, Animal object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
Animal deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = AnimalBuilder();
@override
Animal deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = AnimalBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,83 +7,86 @@ import 'package:built_value/serializer.dart';
part 'api_response.g.dart';
abstract class ApiResponse implements Built<ApiResponse, ApiResponseBuilder> {
@BuiltValueField(wireName: r'code')
int? get code;
@BuiltValueField(wireName: r'code')
int? get code;
@BuiltValueField(wireName: r'type')
String? get type;
@BuiltValueField(wireName: r'type')
String? get type;
@BuiltValueField(wireName: r'message')
String? get message;
@BuiltValueField(wireName: r'message')
String? get message;
ApiResponse._();
ApiResponse._();
static void _initializeBuilder(ApiResponseBuilder b) => b;
static void _initializeBuilder(ApiResponseBuilder b) => b;
factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse;
factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse;
@BuiltValueSerializer(custom: true)
static Serializer<ApiResponse> get serializer => _$ApiResponseSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ApiResponse> get serializer => _$ApiResponseSerializer();
}
class _$ApiResponseSerializer implements StructuredSerializer<ApiResponse> {
@override
final Iterable<Type> types = const [ApiResponse, _$ApiResponse];
@override
final Iterable<Type> types = const [ApiResponse, _$ApiResponse];
@override
final String wireName = r'ApiResponse';
@override
final String wireName = r'ApiResponse';
@override
Iterable<Object?> serialize(Serializers serializers, ApiResponse object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.code != null) {
result
..add(r'code')
..add(serializers.serialize(object.code,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, ApiResponse object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.code != null) {
result
..add(r'code')
..add(serializers.serialize(object.code,
specifiedType: const FullType(int)));
}
if (object.type != null) {
result
..add(r'type')
..add(serializers.serialize(object.type,
specifiedType: const FullType(String)));
}
if (object.message != null) {
result
..add(r'message')
..add(serializers.serialize(object.message,
specifiedType: const FullType(String)));
}
return result;
}
if (object.type != null) {
result
..add(r'type')
..add(serializers.serialize(object.type,
specifiedType: const FullType(String)));
}
if (object.message != null) {
result
..add(r'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 = ApiResponseBuilder();
@override
ApiResponse deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ApiResponseBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'code':
result.code = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'type':
result.type = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'message':
result.message = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'code':
result.code = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'type':
result.type = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'message':
result.message = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,72 +8,60 @@ import 'package:built_value/serializer.dart';
part 'array_of_array_of_number_only.g.dart';
abstract class ArrayOfArrayOfNumberOnly
implements
Built<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilder> {
@BuiltValueField(wireName: r'ArrayArrayNumber')
BuiltList<BuiltList<num>>? get arrayArrayNumber;
ArrayOfArrayOfNumberOnly._();
static void _initializeBuilder(ArrayOfArrayOfNumberOnlyBuilder b) => b;
abstract class ArrayOfArrayOfNumberOnly implements Built<ArrayOfArrayOfNumberOnly, ArrayOfArrayOfNumberOnlyBuilder> {
@BuiltValueField(wireName: r'ArrayArrayNumber')
BuiltList<BuiltList<num>>? get arrayArrayNumber;
factory ArrayOfArrayOfNumberOnly(
[void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) =
_$ArrayOfArrayOfNumberOnly;
ArrayOfArrayOfNumberOnly._();
@BuiltValueSerializer(custom: true)
static Serializer<ArrayOfArrayOfNumberOnly> get serializer =>
_$ArrayOfArrayOfNumberOnlySerializer();
static void _initializeBuilder(ArrayOfArrayOfNumberOnlyBuilder b) => b;
factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly;
@BuiltValueSerializer(custom: true)
static Serializer<ArrayOfArrayOfNumberOnly> get serializer => _$ArrayOfArrayOfNumberOnlySerializer();
}
class _$ArrayOfArrayOfNumberOnlySerializer
implements StructuredSerializer<ArrayOfArrayOfNumberOnly> {
@override
final Iterable<Type> types = const [
ArrayOfArrayOfNumberOnly,
_$ArrayOfArrayOfNumberOnly
];
class _$ArrayOfArrayOfNumberOnlySerializer implements StructuredSerializer<ArrayOfArrayOfNumberOnly> {
@override
final Iterable<Type> types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly];
@override
final String wireName = r'ArrayOfArrayOfNumberOnly';
@override
final String wireName = r'ArrayOfArrayOfNumberOnly';
@override
Iterable<Object?> serialize(
Serializers serializers, ArrayOfArrayOfNumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayArrayNumber != null) {
result
..add(r'ArrayArrayNumber')
..add(serializers.serialize(object.arrayArrayNumber,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(num)])
])));
@override
Iterable<Object?> serialize(Serializers serializers, ArrayOfArrayOfNumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayArrayNumber != null) {
result
..add(r'ArrayArrayNumber')
..add(serializers.serialize(object.arrayArrayNumber,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])])));
}
return result;
}
return result;
}
@override
ArrayOfArrayOfNumberOnly deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayOfArrayOfNumberOnlyBuilder();
@override
ArrayOfArrayOfNumberOnly deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayOfArrayOfNumberOnlyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'ArrayArrayNumber':
result.arrayArrayNumber.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(num)])
])) as BuiltList<BuiltList<num>>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'ArrayArrayNumber':
result.arrayArrayNumber.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])])) as BuiltList<BuiltList<num>>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,63 +8,60 @@ import 'package:built_value/serializer.dart';
part 'array_of_number_only.g.dart';
abstract class ArrayOfNumberOnly
implements Built<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilder> {
@BuiltValueField(wireName: r'ArrayNumber')
BuiltList<num>? get arrayNumber;
ArrayOfNumberOnly._();
static void _initializeBuilder(ArrayOfNumberOnlyBuilder b) => b;
abstract class ArrayOfNumberOnly implements Built<ArrayOfNumberOnly, ArrayOfNumberOnlyBuilder> {
@BuiltValueField(wireName: r'ArrayNumber')
BuiltList<num>? get arrayNumber;
factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) =
_$ArrayOfNumberOnly;
ArrayOfNumberOnly._();
@BuiltValueSerializer(custom: true)
static Serializer<ArrayOfNumberOnly> get serializer =>
_$ArrayOfNumberOnlySerializer();
static void _initializeBuilder(ArrayOfNumberOnlyBuilder b) => b;
factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly;
@BuiltValueSerializer(custom: true)
static Serializer<ArrayOfNumberOnly> get serializer => _$ArrayOfNumberOnlySerializer();
}
class _$ArrayOfNumberOnlySerializer
implements StructuredSerializer<ArrayOfNumberOnly> {
@override
final Iterable<Type> types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly];
class _$ArrayOfNumberOnlySerializer implements StructuredSerializer<ArrayOfNumberOnly> {
@override
final Iterable<Type> types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly];
@override
final String wireName = r'ArrayOfNumberOnly';
@override
final String wireName = r'ArrayOfNumberOnly';
@override
Iterable<Object?> serialize(Serializers serializers, ArrayOfNumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayNumber != null) {
result
..add(r'ArrayNumber')
..add(serializers.serialize(object.arrayNumber,
specifiedType: const FullType(BuiltList, [FullType(num)])));
@override
Iterable<Object?> serialize(Serializers serializers, ArrayOfNumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayNumber != null) {
result
..add(r'ArrayNumber')
..add(serializers.serialize(object.arrayNumber,
specifiedType: const FullType(BuiltList, [FullType(num)])));
}
return result;
}
return result;
}
@override
ArrayOfNumberOnly deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayOfNumberOnlyBuilder();
@override
ArrayOfNumberOnly deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayOfNumberOnlyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'ArrayNumber':
result.arrayNumber.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(num)]))
as BuiltList<num>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'ArrayNumber':
result.arrayNumber.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(num)])) as BuiltList<num>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -9,92 +9,86 @@ import 'package:built_value/serializer.dart';
part 'array_test.g.dart';
abstract class ArrayTest implements Built<ArrayTest, ArrayTestBuilder> {
@BuiltValueField(wireName: r'array_of_string')
BuiltList<String>? get arrayOfString;
@BuiltValueField(wireName: r'array_of_string')
BuiltList<String>? get arrayOfString;
@BuiltValueField(wireName: r'array_array_of_integer')
BuiltList<BuiltList<int>>? get arrayArrayOfInteger;
@BuiltValueField(wireName: r'array_array_of_integer')
BuiltList<BuiltList<int>>? get arrayArrayOfInteger;
@BuiltValueField(wireName: r'array_array_of_model')
BuiltList<BuiltList<ReadOnlyFirst>>? get arrayArrayOfModel;
@BuiltValueField(wireName: r'array_array_of_model')
BuiltList<BuiltList<ReadOnlyFirst>>? get arrayArrayOfModel;
ArrayTest._();
ArrayTest._();
static void _initializeBuilder(ArrayTestBuilder b) => b;
static void _initializeBuilder(ArrayTestBuilder b) => b;
factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest;
factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest;
@BuiltValueSerializer(custom: true)
static Serializer<ArrayTest> get serializer => _$ArrayTestSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ArrayTest> get serializer => _$ArrayTestSerializer();
}
class _$ArrayTestSerializer implements StructuredSerializer<ArrayTest> {
@override
final Iterable<Type> types = const [ArrayTest, _$ArrayTest];
@override
final Iterable<Type> types = const [ArrayTest, _$ArrayTest];
@override
final String wireName = r'ArrayTest';
@override
final String wireName = r'ArrayTest';
@override
Iterable<Object?> serialize(Serializers serializers, ArrayTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayOfString != null) {
result
..add(r'array_of_string')
..add(serializers.serialize(object.arrayOfString,
specifiedType: const FullType(BuiltList, [FullType(String)])));
@override
Iterable<Object?> serialize(Serializers serializers, ArrayTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.arrayOfString != null) {
result
..add(r'array_of_string')
..add(serializers.serialize(object.arrayOfString,
specifiedType: const FullType(BuiltList, [FullType(String)])));
}
if (object.arrayArrayOfInteger != null) {
result
..add(r'array_array_of_integer')
..add(serializers.serialize(object.arrayArrayOfInteger,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])])));
}
if (object.arrayArrayOfModel != null) {
result
..add(r'array_array_of_model')
..add(serializers.serialize(object.arrayArrayOfModel,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])])));
}
return result;
}
if (object.arrayArrayOfInteger != null) {
result
..add(r'array_array_of_integer')
..add(serializers.serialize(object.arrayArrayOfInteger,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(int)])
])));
}
if (object.arrayArrayOfModel != null) {
result
..add(r'array_array_of_model')
..add(serializers.serialize(object.arrayArrayOfModel,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(ReadOnlyFirst)])
])));
}
return result;
}
@override
ArrayTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayTestBuilder();
@override
ArrayTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ArrayTestBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'array_of_string':
result.arrayOfString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(String)]))
as BuiltList<String>);
break;
case r'array_array_of_integer':
result.arrayArrayOfInteger.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(int)])
])) as BuiltList<BuiltList<int>>);
break;
case r'array_array_of_model':
result.arrayArrayOfModel.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [
FullType(BuiltList, [FullType(ReadOnlyFirst)])
])) as BuiltList<BuiltList<ReadOnlyFirst>>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'array_of_string':
result.arrayOfString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(String)])) as BuiltList<String>);
break;
case r'array_array_of_integer':
result.arrayArrayOfInteger.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])])) as BuiltList<BuiltList<int>>);
break;
case r'array_array_of_model':
result.arrayArrayOfModel.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])])) as BuiltList<BuiltList<ReadOnlyFirst>>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,128 +7,126 @@ import 'package:built_value/serializer.dart';
part 'capitalization.g.dart';
abstract class Capitalization
implements Built<Capitalization, CapitalizationBuilder> {
@BuiltValueField(wireName: r'smallCamel')
String? get smallCamel;
@BuiltValueField(wireName: r'CapitalCamel')
String? get capitalCamel;
@BuiltValueField(wireName: r'small_Snake')
String? get smallSnake;
abstract class Capitalization implements Built<Capitalization, CapitalizationBuilder> {
@BuiltValueField(wireName: r'smallCamel')
String? get smallCamel;
@BuiltValueField(wireName: r'Capital_Snake')
String? get capitalSnake;
@BuiltValueField(wireName: r'CapitalCamel')
String? get capitalCamel;
@BuiltValueField(wireName: r'SCA_ETH_Flow_Points')
String? get sCAETHFlowPoints;
@BuiltValueField(wireName: r'small_Snake')
String? get smallSnake;
/// Name of the pet
@BuiltValueField(wireName: r'ATT_NAME')
String? get ATT_NAME;
@BuiltValueField(wireName: r'Capital_Snake')
String? get capitalSnake;
Capitalization._();
@BuiltValueField(wireName: r'SCA_ETH_Flow_Points')
String? get sCAETHFlowPoints;
static void _initializeBuilder(CapitalizationBuilder b) => b;
/// Name of the pet
@BuiltValueField(wireName: r'ATT_NAME')
String? get ATT_NAME;
factory Capitalization([void updates(CapitalizationBuilder b)]) =
_$Capitalization;
Capitalization._();
@BuiltValueSerializer(custom: true)
static Serializer<Capitalization> get serializer =>
_$CapitalizationSerializer();
static void _initializeBuilder(CapitalizationBuilder b) => b;
factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization;
@BuiltValueSerializer(custom: true)
static Serializer<Capitalization> get serializer => _$CapitalizationSerializer();
}
class _$CapitalizationSerializer
implements StructuredSerializer<Capitalization> {
@override
final Iterable<Type> types = const [Capitalization, _$Capitalization];
class _$CapitalizationSerializer implements StructuredSerializer<Capitalization> {
@override
final Iterable<Type> types = const [Capitalization, _$Capitalization];
@override
final String wireName = r'Capitalization';
@override
final String wireName = r'Capitalization';
@override
Iterable<Object?> serialize(Serializers serializers, Capitalization object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.smallCamel != null) {
result
..add(r'smallCamel')
..add(serializers.serialize(object.smallCamel,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, Capitalization object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.smallCamel != null) {
result
..add(r'smallCamel')
..add(serializers.serialize(object.smallCamel,
specifiedType: const FullType(String)));
}
if (object.capitalCamel != null) {
result
..add(r'CapitalCamel')
..add(serializers.serialize(object.capitalCamel,
specifiedType: const FullType(String)));
}
if (object.smallSnake != null) {
result
..add(r'small_Snake')
..add(serializers.serialize(object.smallSnake,
specifiedType: const FullType(String)));
}
if (object.capitalSnake != null) {
result
..add(r'Capital_Snake')
..add(serializers.serialize(object.capitalSnake,
specifiedType: const FullType(String)));
}
if (object.sCAETHFlowPoints != null) {
result
..add(r'SCA_ETH_Flow_Points')
..add(serializers.serialize(object.sCAETHFlowPoints,
specifiedType: const FullType(String)));
}
if (object.ATT_NAME != null) {
result
..add(r'ATT_NAME')
..add(serializers.serialize(object.ATT_NAME,
specifiedType: const FullType(String)));
}
return result;
}
if (object.capitalCamel != null) {
result
..add(r'CapitalCamel')
..add(serializers.serialize(object.capitalCamel,
specifiedType: const FullType(String)));
}
if (object.smallSnake != null) {
result
..add(r'small_Snake')
..add(serializers.serialize(object.smallSnake,
specifiedType: const FullType(String)));
}
if (object.capitalSnake != null) {
result
..add(r'Capital_Snake')
..add(serializers.serialize(object.capitalSnake,
specifiedType: const FullType(String)));
}
if (object.sCAETHFlowPoints != null) {
result
..add(r'SCA_ETH_Flow_Points')
..add(serializers.serialize(object.sCAETHFlowPoints,
specifiedType: const FullType(String)));
}
if (object.ATT_NAME != null) {
result
..add(r'ATT_NAME')
..add(serializers.serialize(object.ATT_NAME,
specifiedType: const FullType(String)));
}
return result;
}
@override
Capitalization deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CapitalizationBuilder();
@override
Capitalization deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CapitalizationBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'smallCamel':
result.smallCamel = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'CapitalCamel':
result.capitalCamel = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'small_Snake':
result.smallSnake = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'Capital_Snake':
result.capitalSnake = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'SCA_ETH_Flow_Points':
result.sCAETHFlowPoints = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'ATT_NAME':
result.ATT_NAME = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'smallCamel':
result.smallCamel = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'CapitalCamel':
result.capitalCamel = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'small_Snake':
result.smallSnake = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'Capital_Snake':
result.capitalSnake = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'SCA_ETH_Flow_Points':
result.sCAETHFlowPoints = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'ATT_NAME':
result.ATT_NAME = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -12,80 +12,82 @@ part 'cat.g.dart';
// ignore_for_file: unused_import
abstract class Cat implements Built<Cat, CatBuilder> {
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'color')
String? get color;
@BuiltValueField(wireName: r'color')
String? get color;
@BuiltValueField(wireName: r'declawed')
bool? get declawed;
@BuiltValueField(wireName: r'declawed')
bool? get declawed;
Cat._();
Cat._();
static void _initializeBuilder(CatBuilder b) => b..color = 'red';
static void _initializeBuilder(CatBuilder b) => b
..color = 'red';
factory Cat([void updates(CatBuilder b)]) = _$Cat;
factory Cat([void updates(CatBuilder b)]) = _$Cat;
@BuiltValueSerializer(custom: true)
static Serializer<Cat> get serializer => _$CatSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Cat> get serializer => _$CatSerializer();
}
class _$CatSerializer implements StructuredSerializer<Cat> {
@override
final Iterable<Type> types = const [Cat, _$Cat];
@override
final Iterable<Type> types = const [Cat, _$Cat];
@override
final String wireName = r'Cat';
@override
final String wireName = r'Cat';
@override
Iterable<Object?> serialize(Serializers serializers, Cat object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, Cat object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
}
if (object.declawed != null) {
result
..add(r'declawed')
..add(serializers.serialize(object.declawed,
specifiedType: const FullType(bool)));
}
return result;
}
if (object.declawed != null) {
result
..add(r'declawed')
..add(serializers.serialize(object.declawed,
specifiedType: const FullType(bool)));
}
return result;
}
@override
Cat deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CatBuilder();
@override
Cat deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CatBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'declawed':
result.declawed = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'declawed':
result.declawed = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'cat_all_of.g.dart';
abstract class CatAllOf implements Built<CatAllOf, CatAllOfBuilder> {
@BuiltValueField(wireName: r'declawed')
bool? get declawed;
@BuiltValueField(wireName: r'declawed')
bool? get declawed;
CatAllOf._();
CatAllOf._();
static void _initializeBuilder(CatAllOfBuilder b) => b;
static void _initializeBuilder(CatAllOfBuilder b) => b;
factory CatAllOf([void updates(CatAllOfBuilder b)]) = _$CatAllOf;
factory CatAllOf([void updates(CatAllOfBuilder b)]) = _$CatAllOf;
@BuiltValueSerializer(custom: true)
static Serializer<CatAllOf> get serializer => _$CatAllOfSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<CatAllOf> get serializer => _$CatAllOfSerializer();
}
class _$CatAllOfSerializer implements StructuredSerializer<CatAllOf> {
@override
final Iterable<Type> types = const [CatAllOf, _$CatAllOf];
@override
final Iterable<Type> types = const [CatAllOf, _$CatAllOf];
@override
final String wireName = r'CatAllOf';
@override
final String wireName = r'CatAllOf';
@override
Iterable<Object?> serialize(Serializers serializers, CatAllOf object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.declawed != null) {
result
..add(r'declawed')
..add(serializers.serialize(object.declawed,
specifiedType: const FullType(bool)));
@override
Iterable<Object?> serialize(Serializers serializers, CatAllOf object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.declawed != null) {
result
..add(r'declawed')
..add(serializers.serialize(object.declawed,
specifiedType: const FullType(bool)));
}
return result;
}
return result;
}
@override
CatAllOf deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CatAllOfBuilder();
@override
CatAllOf deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CatAllOfBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'declawed':
result.declawed = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'declawed':
result.declawed = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,68 +7,72 @@ import 'package:built_value/serializer.dart';
part 'category.g.dart';
abstract class Category implements Built<Category, CategoryBuilder> {
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'name')
String get name;
@BuiltValueField(wireName: r'name')
String get name;
Category._();
Category._();
static void _initializeBuilder(CategoryBuilder b) => b..name = 'default-name';
static void _initializeBuilder(CategoryBuilder b) => b
..name = 'default-name';
factory Category([void updates(CategoryBuilder b)]) = _$Category;
factory Category([void updates(CategoryBuilder b)]) = _$Category;
@BuiltValueSerializer(custom: true)
static Serializer<Category> get serializer => _$CategorySerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Category> get serializer => _$CategorySerializer();
}
class _$CategorySerializer implements StructuredSerializer<Category> {
@override
final Iterable<Type> types = const [Category, _$Category];
@override
final Iterable<Type> types = const [Category, _$Category];
@override
final String wireName = r'Category';
@override
final String wireName = r'Category';
@override
Iterable<Object?> serialize(Serializers serializers, Category object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Category object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
}
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
return result;
}
result
..add(r'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 = CategoryBuilder();
@override
Category deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CategoryBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'class_model.g.dart';
abstract class ClassModel implements Built<ClassModel, ClassModelBuilder> {
@BuiltValueField(wireName: r'_class')
String? get class_;
@BuiltValueField(wireName: r'_class')
String? get class_;
ClassModel._();
ClassModel._();
static void _initializeBuilder(ClassModelBuilder b) => b;
static void _initializeBuilder(ClassModelBuilder b) => b;
factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel;
factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel;
@BuiltValueSerializer(custom: true)
static Serializer<ClassModel> get serializer => _$ClassModelSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ClassModel> get serializer => _$ClassModelSerializer();
}
class _$ClassModelSerializer implements StructuredSerializer<ClassModel> {
@override
final Iterable<Type> types = const [ClassModel, _$ClassModel];
@override
final Iterable<Type> types = const [ClassModel, _$ClassModel];
@override
final String wireName = r'ClassModel';
@override
final String wireName = r'ClassModel';
@override
Iterable<Object?> serialize(Serializers serializers, ClassModel object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.class_ != null) {
result
..add(r'_class')
..add(serializers.serialize(object.class_,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, ClassModel object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.class_ != null) {
result
..add(r'_class')
..add(serializers.serialize(object.class_,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
ClassModel deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ClassModelBuilder();
@override
ClassModel deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ClassModelBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'_class':
result.class_ = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'_class':
result.class_ = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -12,80 +12,82 @@ part 'dog.g.dart';
// ignore_for_file: unused_import
abstract class Dog implements Built<Dog, DogBuilder> {
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'className')
String get className;
@BuiltValueField(wireName: r'color')
String? get color;
@BuiltValueField(wireName: r'color')
String? get color;
@BuiltValueField(wireName: r'breed')
String? get breed;
@BuiltValueField(wireName: r'breed')
String? get breed;
Dog._();
Dog._();
static void _initializeBuilder(DogBuilder b) => b..color = 'red';
static void _initializeBuilder(DogBuilder b) => b
..color = 'red';
factory Dog([void updates(DogBuilder b)]) = _$Dog;
factory Dog([void updates(DogBuilder b)]) = _$Dog;
@BuiltValueSerializer(custom: true)
static Serializer<Dog> get serializer => _$DogSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Dog> get serializer => _$DogSerializer();
}
class _$DogSerializer implements StructuredSerializer<Dog> {
@override
final Iterable<Type> types = const [Dog, _$Dog];
@override
final Iterable<Type> types = const [Dog, _$Dog];
@override
final String wireName = r'Dog';
@override
final String wireName = r'Dog';
@override
Iterable<Object?> serialize(Serializers serializers, Dog object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, Dog object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'className')
..add(serializers.serialize(object.className,
specifiedType: const FullType(String)));
if (object.color != null) {
result
..add(r'color')
..add(serializers.serialize(object.color,
specifiedType: const FullType(String)));
}
if (object.breed != null) {
result
..add(r'breed')
..add(serializers.serialize(object.breed,
specifiedType: const FullType(String)));
}
return result;
}
if (object.breed != null) {
result
..add(r'breed')
..add(serializers.serialize(object.breed,
specifiedType: const FullType(String)));
}
return result;
}
@override
Dog deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = DogBuilder();
@override
Dog deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = DogBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'breed':
result.breed = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'className':
result.className = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'color':
result.color = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'breed':
result.breed = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'dog_all_of.g.dart';
abstract class DogAllOf implements Built<DogAllOf, DogAllOfBuilder> {
@BuiltValueField(wireName: r'breed')
String? get breed;
@BuiltValueField(wireName: r'breed')
String? get breed;
DogAllOf._();
DogAllOf._();
static void _initializeBuilder(DogAllOfBuilder b) => b;
static void _initializeBuilder(DogAllOfBuilder b) => b;
factory DogAllOf([void updates(DogAllOfBuilder b)]) = _$DogAllOf;
factory DogAllOf([void updates(DogAllOfBuilder b)]) = _$DogAllOf;
@BuiltValueSerializer(custom: true)
static Serializer<DogAllOf> get serializer => _$DogAllOfSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<DogAllOf> get serializer => _$DogAllOfSerializer();
}
class _$DogAllOfSerializer implements StructuredSerializer<DogAllOf> {
@override
final Iterable<Type> types = const [DogAllOf, _$DogAllOf];
@override
final Iterable<Type> types = const [DogAllOf, _$DogAllOf];
@override
final String wireName = r'DogAllOf';
@override
final String wireName = r'DogAllOf';
@override
Iterable<Object?> serialize(Serializers serializers, DogAllOf object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.breed != null) {
result
..add(r'breed')
..add(serializers.serialize(object.breed,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, DogAllOf object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.breed != null) {
result
..add(r'breed')
..add(serializers.serialize(object.breed,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
DogAllOf deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = DogAllOfBuilder();
@override
DogAllOf deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = DogAllOfBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'breed':
result.breed = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'breed':
result.breed = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,112 +8,105 @@ import 'package:built_value/serializer.dart';
part 'enum_arrays.g.dart';
abstract class EnumArrays implements Built<EnumArrays, EnumArraysBuilder> {
@BuiltValueField(wireName: r'just_symbol')
EnumArraysJustSymbolEnum? get justSymbol;
// enum justSymbolEnum { >=, $, };
@BuiltValueField(wireName: r'just_symbol')
EnumArraysJustSymbolEnum? get justSymbol;
// enum justSymbolEnum { >=, $, };
@BuiltValueField(wireName: r'array_enum')
BuiltList<EnumArraysArrayEnumEnum>? get arrayEnum;
// enum arrayEnumEnum { fish, crab, };
@BuiltValueField(wireName: r'array_enum')
BuiltList<EnumArraysArrayEnumEnum>? get arrayEnum;
// enum arrayEnumEnum { fish, crab, };
EnumArrays._();
EnumArrays._();
static void _initializeBuilder(EnumArraysBuilder b) => b;
static void _initializeBuilder(EnumArraysBuilder b) => b;
factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays;
factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays;
@BuiltValueSerializer(custom: true)
static Serializer<EnumArrays> get serializer => _$EnumArraysSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<EnumArrays> get serializer => _$EnumArraysSerializer();
}
class _$EnumArraysSerializer implements StructuredSerializer<EnumArrays> {
@override
final Iterable<Type> types = const [EnumArrays, _$EnumArrays];
@override
final Iterable<Type> types = const [EnumArrays, _$EnumArrays];
@override
final String wireName = r'EnumArrays';
@override
final String wireName = r'EnumArrays';
@override
Iterable<Object?> serialize(Serializers serializers, EnumArrays object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.justSymbol != null) {
result
..add(r'just_symbol')
..add(serializers.serialize(object.justSymbol,
specifiedType: const FullType(EnumArraysJustSymbolEnum)));
@override
Iterable<Object?> serialize(Serializers serializers, EnumArrays object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.justSymbol != null) {
result
..add(r'just_symbol')
..add(serializers.serialize(object.justSymbol,
specifiedType: const FullType(EnumArraysJustSymbolEnum)));
}
if (object.arrayEnum != null) {
result
..add(r'array_enum')
..add(serializers.serialize(object.arrayEnum,
specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)])));
}
return result;
}
if (object.arrayEnum != null) {
result
..add(r'array_enum')
..add(serializers.serialize(object.arrayEnum,
specifiedType: const FullType(
BuiltList, [FullType(EnumArraysArrayEnumEnum)])));
}
return result;
}
@override
EnumArrays deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = EnumArraysBuilder();
@override
EnumArrays deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = EnumArraysBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'just_symbol':
result.justSymbol = serializers.deserialize(value,
specifiedType: const FullType(EnumArraysJustSymbolEnum))
as EnumArraysJustSymbolEnum;
break;
case r'array_enum':
result.arrayEnum.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltList, [FullType(EnumArraysArrayEnumEnum)]))
as BuiltList<EnumArraysArrayEnumEnum>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'just_symbol':
result.justSymbol = serializers.deserialize(value,
specifiedType: const FullType(EnumArraysJustSymbolEnum)) as EnumArraysJustSymbolEnum;
break;
case r'array_enum':
result.arrayEnum.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)])) as BuiltList<EnumArraysArrayEnumEnum>);
break;
}
}
return result.build();
}
return result.build();
}
}
class EnumArraysJustSymbolEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'>=')
static const EnumArraysJustSymbolEnum greaterThanEqual =
_$enumArraysJustSymbolEnum_greaterThanEqual;
static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual;
@BuiltValueEnumConst(wireName: r'$')
static const EnumArraysJustSymbolEnum dollar =
_$enumArraysJustSymbolEnum_dollar;
static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar;
static Serializer<EnumArraysJustSymbolEnum> get serializer =>
_$enumArraysJustSymbolEnumSerializer;
static Serializer<EnumArraysJustSymbolEnum> get serializer => _$enumArraysJustSymbolEnumSerializer;
const EnumArraysJustSymbolEnum._(String name) : super(name);
const EnumArraysJustSymbolEnum._(String name): super(name);
static BuiltSet<EnumArraysJustSymbolEnum> get values =>
_$enumArraysJustSymbolEnumValues;
static EnumArraysJustSymbolEnum valueOf(String name) =>
_$enumArraysJustSymbolEnumValueOf(name);
static BuiltSet<EnumArraysJustSymbolEnum> get values => _$enumArraysJustSymbolEnumValues;
static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name);
}
class EnumArraysArrayEnumEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'fish')
static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish;
@BuiltValueEnumConst(wireName: r'crab')
static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab;
static Serializer<EnumArraysArrayEnumEnum> get serializer =>
_$enumArraysArrayEnumEnumSerializer;
static Serializer<EnumArraysArrayEnumEnum> get serializer => _$enumArraysArrayEnumEnumSerializer;
const EnumArraysArrayEnumEnum._(String name) : super(name);
const EnumArraysArrayEnumEnum._(String name): super(name);
static BuiltSet<EnumArraysArrayEnumEnum> get values =>
_$enumArraysArrayEnumEnumValues;
static EnumArraysArrayEnumEnum valueOf(String name) =>
_$enumArraysArrayEnumEnumValueOf(name);
static BuiltSet<EnumArraysArrayEnumEnum> get values => _$enumArraysArrayEnumEnumValues;
static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name);
}

View File

@ -12,166 +12,162 @@ import 'package:built_value/serializer.dart';
part 'enum_test.g.dart';
abstract class EnumTest implements Built<EnumTest, EnumTestBuilder> {
@BuiltValueField(wireName: r'enum_string')
EnumTestEnumStringEnum? get enumString;
// enum enumStringEnum { UPPER, lower, , };
@BuiltValueField(wireName: r'enum_string')
EnumTestEnumStringEnum? get enumString;
// enum enumStringEnum { UPPER, lower, , };
@BuiltValueField(wireName: r'enum_string_required')
EnumTestEnumStringRequiredEnum get enumStringRequired;
// enum enumStringRequiredEnum { UPPER, lower, , };
@BuiltValueField(wireName: r'enum_string_required')
EnumTestEnumStringRequiredEnum get enumStringRequired;
// enum enumStringRequiredEnum { UPPER, lower, , };
@BuiltValueField(wireName: r'enum_integer')
EnumTestEnumIntegerEnum? get enumInteger;
// enum enumIntegerEnum { 1, -1, };
@BuiltValueField(wireName: r'enum_integer')
EnumTestEnumIntegerEnum? get enumInteger;
// enum enumIntegerEnum { 1, -1, };
@BuiltValueField(wireName: r'enum_number')
EnumTestEnumNumberEnum? get enumNumber;
// enum enumNumberEnum { 1.1, -1.2, };
@BuiltValueField(wireName: r'enum_number')
EnumTestEnumNumberEnum? get enumNumber;
// enum enumNumberEnum { 1.1, -1.2, };
@BuiltValueField(wireName: r'outerEnum')
OuterEnum? get outerEnum;
// enum outerEnumEnum { placed, approved, delivered, };
@BuiltValueField(wireName: r'outerEnum')
OuterEnum? get outerEnum;
// enum outerEnumEnum { placed, approved, delivered, };
@BuiltValueField(wireName: r'outerEnumInteger')
OuterEnumInteger? get outerEnumInteger;
// enum outerEnumIntegerEnum { 0, 1, 2, };
@BuiltValueField(wireName: r'outerEnumInteger')
OuterEnumInteger? get outerEnumInteger;
// enum outerEnumIntegerEnum { 0, 1, 2, };
@BuiltValueField(wireName: r'outerEnumDefaultValue')
OuterEnumDefaultValue? get outerEnumDefaultValue;
// enum outerEnumDefaultValueEnum { placed, approved, delivered, };
@BuiltValueField(wireName: r'outerEnumDefaultValue')
OuterEnumDefaultValue? get outerEnumDefaultValue;
// enum outerEnumDefaultValueEnum { placed, approved, delivered, };
@BuiltValueField(wireName: r'outerEnumIntegerDefaultValue')
OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue;
// enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, };
@BuiltValueField(wireName: r'outerEnumIntegerDefaultValue')
OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue;
// enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, };
EnumTest._();
EnumTest._();
static void _initializeBuilder(EnumTestBuilder b) => b;
static void _initializeBuilder(EnumTestBuilder b) => b;
factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest;
factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest;
@BuiltValueSerializer(custom: true)
static Serializer<EnumTest> get serializer => _$EnumTestSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<EnumTest> get serializer => _$EnumTestSerializer();
}
class _$EnumTestSerializer implements StructuredSerializer<EnumTest> {
@override
final Iterable<Type> types = const [EnumTest, _$EnumTest];
@override
final Iterable<Type> types = const [EnumTest, _$EnumTest];
@override
final String wireName = r'EnumTest';
@override
final String wireName = r'EnumTest';
@override
Iterable<Object?> serialize(Serializers serializers, EnumTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.enumString != null) {
result
..add(r'enum_string')
..add(serializers.serialize(object.enumString,
specifiedType: const FullType(EnumTestEnumStringEnum)));
@override
Iterable<Object?> serialize(Serializers serializers, EnumTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.enumString != null) {
result
..add(r'enum_string')
..add(serializers.serialize(object.enumString,
specifiedType: const FullType(EnumTestEnumStringEnum)));
}
result
..add(r'enum_string_required')
..add(serializers.serialize(object.enumStringRequired,
specifiedType: const FullType(EnumTestEnumStringRequiredEnum)));
if (object.enumInteger != null) {
result
..add(r'enum_integer')
..add(serializers.serialize(object.enumInteger,
specifiedType: const FullType(EnumTestEnumIntegerEnum)));
}
if (object.enumNumber != null) {
result
..add(r'enum_number')
..add(serializers.serialize(object.enumNumber,
specifiedType: const FullType(EnumTestEnumNumberEnum)));
}
if (object.outerEnum != null) {
result
..add(r'outerEnum')
..add(serializers.serialize(object.outerEnum,
specifiedType: const FullType(OuterEnum)));
}
if (object.outerEnumInteger != null) {
result
..add(r'outerEnumInteger')
..add(serializers.serialize(object.outerEnumInteger,
specifiedType: const FullType(OuterEnumInteger)));
}
if (object.outerEnumDefaultValue != null) {
result
..add(r'outerEnumDefaultValue')
..add(serializers.serialize(object.outerEnumDefaultValue,
specifiedType: const FullType(OuterEnumDefaultValue)));
}
if (object.outerEnumIntegerDefaultValue != null) {
result
..add(r'outerEnumIntegerDefaultValue')
..add(serializers.serialize(object.outerEnumIntegerDefaultValue,
specifiedType: const FullType(OuterEnumIntegerDefaultValue)));
}
return result;
}
result
..add(r'enum_string_required')
..add(serializers.serialize(object.enumStringRequired,
specifiedType: const FullType(EnumTestEnumStringRequiredEnum)));
if (object.enumInteger != null) {
result
..add(r'enum_integer')
..add(serializers.serialize(object.enumInteger,
specifiedType: const FullType(EnumTestEnumIntegerEnum)));
}
if (object.enumNumber != null) {
result
..add(r'enum_number')
..add(serializers.serialize(object.enumNumber,
specifiedType: const FullType(EnumTestEnumNumberEnum)));
}
if (object.outerEnum != null) {
result
..add(r'outerEnum')
..add(serializers.serialize(object.outerEnum,
specifiedType: const FullType(OuterEnum)));
}
if (object.outerEnumInteger != null) {
result
..add(r'outerEnumInteger')
..add(serializers.serialize(object.outerEnumInteger,
specifiedType: const FullType(OuterEnumInteger)));
}
if (object.outerEnumDefaultValue != null) {
result
..add(r'outerEnumDefaultValue')
..add(serializers.serialize(object.outerEnumDefaultValue,
specifiedType: const FullType(OuterEnumDefaultValue)));
}
if (object.outerEnumIntegerDefaultValue != null) {
result
..add(r'outerEnumIntegerDefaultValue')
..add(serializers.serialize(object.outerEnumIntegerDefaultValue,
specifiedType: const FullType(OuterEnumIntegerDefaultValue)));
}
return result;
}
@override
EnumTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = EnumTestBuilder();
@override
EnumTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = EnumTestBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'enum_string':
result.enumString = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumStringEnum))
as EnumTestEnumStringEnum;
break;
case r'enum_string_required':
result.enumStringRequired = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumStringRequiredEnum))
as EnumTestEnumStringRequiredEnum;
break;
case r'enum_integer':
result.enumInteger = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumIntegerEnum))
as EnumTestEnumIntegerEnum;
break;
case r'enum_number':
result.enumNumber = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumNumberEnum))
as EnumTestEnumNumberEnum;
break;
case r'outerEnum':
result.outerEnum = serializers.deserialize(value,
specifiedType: const FullType(OuterEnum)) as OuterEnum;
break;
case r'outerEnumInteger':
result.outerEnumInteger = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumInteger))
as OuterEnumInteger;
break;
case r'outerEnumDefaultValue':
result.outerEnumDefaultValue = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumDefaultValue))
as OuterEnumDefaultValue;
break;
case r'outerEnumIntegerDefaultValue':
result.outerEnumIntegerDefaultValue = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumIntegerDefaultValue))
as OuterEnumIntegerDefaultValue;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'enum_string':
result.enumString = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumStringEnum)) as EnumTestEnumStringEnum;
break;
case r'enum_string_required':
result.enumStringRequired = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumStringRequiredEnum)) as EnumTestEnumStringRequiredEnum;
break;
case r'enum_integer':
result.enumInteger = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumIntegerEnum)) as EnumTestEnumIntegerEnum;
break;
case r'enum_number':
result.enumNumber = serializers.deserialize(value,
specifiedType: const FullType(EnumTestEnumNumberEnum)) as EnumTestEnumNumberEnum;
break;
case r'outerEnum':
result.outerEnum = serializers.deserialize(value,
specifiedType: const FullType(OuterEnum)) as OuterEnum;
break;
case r'outerEnumInteger':
result.outerEnumInteger = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger;
break;
case r'outerEnumDefaultValue':
result.outerEnumDefaultValue = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumDefaultValue)) as OuterEnumDefaultValue;
break;
case r'outerEnumIntegerDefaultValue':
result.outerEnumIntegerDefaultValue = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumIntegerDefaultValue)) as OuterEnumIntegerDefaultValue;
break;
}
}
return result.build();
}
return result.build();
}
}
class EnumTestEnumStringEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'UPPER')
static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER;
@BuiltValueEnumConst(wireName: r'lower')
@ -179,73 +175,58 @@ class EnumTestEnumStringEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'')
static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty;
static Serializer<EnumTestEnumStringEnum> get serializer =>
_$enumTestEnumStringEnumSerializer;
static Serializer<EnumTestEnumStringEnum> get serializer => _$enumTestEnumStringEnumSerializer;
const EnumTestEnumStringEnum._(String name) : super(name);
const EnumTestEnumStringEnum._(String name): super(name);
static BuiltSet<EnumTestEnumStringEnum> get values =>
_$enumTestEnumStringEnumValues;
static EnumTestEnumStringEnum valueOf(String name) =>
_$enumTestEnumStringEnumValueOf(name);
static BuiltSet<EnumTestEnumStringEnum> get values => _$enumTestEnumStringEnumValues;
static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name);
}
class EnumTestEnumStringRequiredEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'UPPER')
static const EnumTestEnumStringRequiredEnum UPPER =
_$enumTestEnumStringRequiredEnum_UPPER;
static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER;
@BuiltValueEnumConst(wireName: r'lower')
static const EnumTestEnumStringRequiredEnum lower =
_$enumTestEnumStringRequiredEnum_lower;
static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower;
@BuiltValueEnumConst(wireName: r'')
static const EnumTestEnumStringRequiredEnum empty =
_$enumTestEnumStringRequiredEnum_empty;
static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty;
static Serializer<EnumTestEnumStringRequiredEnum> get serializer =>
_$enumTestEnumStringRequiredEnumSerializer;
static Serializer<EnumTestEnumStringRequiredEnum> get serializer => _$enumTestEnumStringRequiredEnumSerializer;
const EnumTestEnumStringRequiredEnum._(String name) : super(name);
const EnumTestEnumStringRequiredEnum._(String name): super(name);
static BuiltSet<EnumTestEnumStringRequiredEnum> get values =>
_$enumTestEnumStringRequiredEnumValues;
static EnumTestEnumStringRequiredEnum valueOf(String name) =>
_$enumTestEnumStringRequiredEnumValueOf(name);
static BuiltSet<EnumTestEnumStringRequiredEnum> get values => _$enumTestEnumStringRequiredEnumValues;
static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name);
}
class EnumTestEnumIntegerEnum extends EnumClass {
@BuiltValueEnumConst(wireNumber: 1)
static const EnumTestEnumIntegerEnum number1 =
_$enumTestEnumIntegerEnum_number1;
static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1;
@BuiltValueEnumConst(wireNumber: -1)
static const EnumTestEnumIntegerEnum numberNegative1 =
_$enumTestEnumIntegerEnum_numberNegative1;
static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1;
static Serializer<EnumTestEnumIntegerEnum> get serializer =>
_$enumTestEnumIntegerEnumSerializer;
static Serializer<EnumTestEnumIntegerEnum> get serializer => _$enumTestEnumIntegerEnumSerializer;
const EnumTestEnumIntegerEnum._(String name) : super(name);
const EnumTestEnumIntegerEnum._(String name): super(name);
static BuiltSet<EnumTestEnumIntegerEnum> get values =>
_$enumTestEnumIntegerEnumValues;
static EnumTestEnumIntegerEnum valueOf(String name) =>
_$enumTestEnumIntegerEnumValueOf(name);
static BuiltSet<EnumTestEnumIntegerEnum> get values => _$enumTestEnumIntegerEnumValues;
static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name);
}
class EnumTestEnumNumberEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'1.1')
static const EnumTestEnumNumberEnum number1Period1 =
_$enumTestEnumNumberEnum_number1Period1;
static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1;
@BuiltValueEnumConst(wireName: r'-1.2')
static const EnumTestEnumNumberEnum numberNegative1Period2 =
_$enumTestEnumNumberEnum_numberNegative1Period2;
static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2;
static Serializer<EnumTestEnumNumberEnum> get serializer =>
_$enumTestEnumNumberEnumSerializer;
static Serializer<EnumTestEnumNumberEnum> get serializer => _$enumTestEnumNumberEnumSerializer;
const EnumTestEnumNumberEnum._(String name) : super(name);
const EnumTestEnumNumberEnum._(String name): super(name);
static BuiltSet<EnumTestEnumNumberEnum> get values =>
_$enumTestEnumNumberEnumValues;
static EnumTestEnumNumberEnum valueOf(String name) =>
_$enumTestEnumNumberEnumValueOf(name);
static BuiltSet<EnumTestEnumNumberEnum> get values => _$enumTestEnumNumberEnumValues;
static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name);
}

View File

@ -9,81 +9,73 @@ import 'package:built_value/serializer.dart';
part 'file_schema_test_class.g.dart';
abstract class FileSchemaTestClass
implements Built<FileSchemaTestClass, FileSchemaTestClassBuilder> {
@BuiltValueField(wireName: r'file')
ModelFile? get file;
@BuiltValueField(wireName: r'files')
BuiltList<ModelFile>? get files;
FileSchemaTestClass._();
abstract class FileSchemaTestClass implements Built<FileSchemaTestClass, FileSchemaTestClassBuilder> {
@BuiltValueField(wireName: r'file')
ModelFile? get file;
static void _initializeBuilder(FileSchemaTestClassBuilder b) => b;
@BuiltValueField(wireName: r'files')
BuiltList<ModelFile>? get files;
factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) =
_$FileSchemaTestClass;
FileSchemaTestClass._();
@BuiltValueSerializer(custom: true)
static Serializer<FileSchemaTestClass> get serializer =>
_$FileSchemaTestClassSerializer();
static void _initializeBuilder(FileSchemaTestClassBuilder b) => b;
factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass;
@BuiltValueSerializer(custom: true)
static Serializer<FileSchemaTestClass> get serializer => _$FileSchemaTestClassSerializer();
}
class _$FileSchemaTestClassSerializer
implements StructuredSerializer<FileSchemaTestClass> {
@override
final Iterable<Type> types = const [
FileSchemaTestClass,
_$FileSchemaTestClass
];
class _$FileSchemaTestClassSerializer implements StructuredSerializer<FileSchemaTestClass> {
@override
final Iterable<Type> types = const [FileSchemaTestClass, _$FileSchemaTestClass];
@override
final String wireName = r'FileSchemaTestClass';
@override
final String wireName = r'FileSchemaTestClass';
@override
Iterable<Object?> serialize(
Serializers serializers, FileSchemaTestClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.file != null) {
result
..add(r'file')
..add(serializers.serialize(object.file,
specifiedType: const FullType(ModelFile)));
@override
Iterable<Object?> serialize(Serializers serializers, FileSchemaTestClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.file != null) {
result
..add(r'file')
..add(serializers.serialize(object.file,
specifiedType: const FullType(ModelFile)));
}
if (object.files != null) {
result
..add(r'files')
..add(serializers.serialize(object.files,
specifiedType: const FullType(BuiltList, [FullType(ModelFile)])));
}
return result;
}
if (object.files != null) {
result
..add(r'files')
..add(serializers.serialize(object.files,
specifiedType: const FullType(BuiltList, [FullType(ModelFile)])));
}
return result;
}
@override
FileSchemaTestClass deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FileSchemaTestClassBuilder();
@override
FileSchemaTestClass deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FileSchemaTestClassBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'file':
result.file.replace(serializers.deserialize(value,
specifiedType: const FullType(ModelFile)) as ModelFile);
break;
case r'files':
result.files.replace(serializers.deserialize(value,
specifiedType:
const FullType(BuiltList, [FullType(ModelFile)]))
as BuiltList<ModelFile>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'file':
result.file.replace(serializers.deserialize(value,
specifiedType: const FullType(ModelFile)) as ModelFile);
break;
case r'files':
result.files.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(ModelFile)])) as BuiltList<ModelFile>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,61 @@ import 'package:built_value/serializer.dart';
part 'foo.g.dart';
abstract class Foo implements Built<Foo, FooBuilder> {
@BuiltValueField(wireName: r'bar')
String? get bar;
@BuiltValueField(wireName: r'bar')
String? get bar;
Foo._();
Foo._();
static void _initializeBuilder(FooBuilder b) => b..bar = 'bar';
static void _initializeBuilder(FooBuilder b) => b
..bar = 'bar';
factory Foo([void updates(FooBuilder b)]) = _$Foo;
factory Foo([void updates(FooBuilder b)]) = _$Foo;
@BuiltValueSerializer(custom: true)
static Serializer<Foo> get serializer => _$FooSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Foo> get serializer => _$FooSerializer();
}
class _$FooSerializer implements StructuredSerializer<Foo> {
@override
final Iterable<Type> types = const [Foo, _$Foo];
@override
final Iterable<Type> types = const [Foo, _$Foo];
@override
final String wireName = r'Foo';
@override
final String wireName = r'Foo';
@override
Iterable<Object?> serialize(Serializers serializers, Foo object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, Foo object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
Foo deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FooBuilder();
@override
Foo deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FooBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,246 +8,249 @@ import 'package:built_value/serializer.dart';
part 'format_test.g.dart';
abstract class FormatTest implements Built<FormatTest, FormatTestBuilder> {
@BuiltValueField(wireName: r'integer')
int? get integer;
@BuiltValueField(wireName: r'integer')
int? get integer;
@BuiltValueField(wireName: r'int32')
int? get int32;
@BuiltValueField(wireName: r'int32')
int? get int32;
@BuiltValueField(wireName: r'int64')
int? get int64;
@BuiltValueField(wireName: r'int64')
int? get int64;
@BuiltValueField(wireName: r'number')
num get number;
@BuiltValueField(wireName: r'number')
num get number;
@BuiltValueField(wireName: r'float')
double? get float;
@BuiltValueField(wireName: r'float')
double? get float;
@BuiltValueField(wireName: r'double')
double? get double_;
@BuiltValueField(wireName: r'double')
double? get double_;
@BuiltValueField(wireName: r'decimal')
double? get decimal;
@BuiltValueField(wireName: r'decimal')
double? get decimal;
@BuiltValueField(wireName: r'string')
String? get string;
@BuiltValueField(wireName: r'string')
String? get string;
@BuiltValueField(wireName: r'byte')
String get byte;
@BuiltValueField(wireName: r'byte')
String get byte;
@BuiltValueField(wireName: r'binary')
Uint8List? get binary;
@BuiltValueField(wireName: r'binary')
Uint8List? get binary;
@BuiltValueField(wireName: r'date')
DateTime get date;
@BuiltValueField(wireName: r'date')
DateTime get date;
@BuiltValueField(wireName: r'dateTime')
DateTime? get dateTime;
@BuiltValueField(wireName: r'dateTime')
DateTime? get dateTime;
@BuiltValueField(wireName: r'uuid')
String? get uuid;
@BuiltValueField(wireName: r'uuid')
String? get uuid;
@BuiltValueField(wireName: r'password')
String get password;
@BuiltValueField(wireName: r'password')
String get password;
/// A string that is a 10 digit number. Can have leading zeros.
@BuiltValueField(wireName: r'pattern_with_digits')
String? get patternWithDigits;
/// A string that is a 10 digit number. Can have leading zeros.
@BuiltValueField(wireName: r'pattern_with_digits')
String? get patternWithDigits;
/// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
@BuiltValueField(wireName: r'pattern_with_digits_and_delimiter')
String? get patternWithDigitsAndDelimiter;
/// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
@BuiltValueField(wireName: r'pattern_with_digits_and_delimiter')
String? get patternWithDigitsAndDelimiter;
FormatTest._();
FormatTest._();
static void _initializeBuilder(FormatTestBuilder b) => b;
static void _initializeBuilder(FormatTestBuilder b) => b;
factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest;
factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest;
@BuiltValueSerializer(custom: true)
static Serializer<FormatTest> get serializer => _$FormatTestSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<FormatTest> get serializer => _$FormatTestSerializer();
}
class _$FormatTestSerializer implements StructuredSerializer<FormatTest> {
@override
final Iterable<Type> types = const [FormatTest, _$FormatTest];
@override
final Iterable<Type> types = const [FormatTest, _$FormatTest];
@override
final String wireName = r'FormatTest';
@override
final String wireName = r'FormatTest';
@override
Iterable<Object?> serialize(Serializers serializers, FormatTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.integer != null) {
result
..add(r'integer')
..add(serializers.serialize(object.integer,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, FormatTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.integer != null) {
result
..add(r'integer')
..add(serializers.serialize(object.integer,
specifiedType: const FullType(int)));
}
if (object.int32 != null) {
result
..add(r'int32')
..add(serializers.serialize(object.int32,
specifiedType: const FullType(int)));
}
if (object.int64 != null) {
result
..add(r'int64')
..add(serializers.serialize(object.int64,
specifiedType: const FullType(int)));
}
result
..add(r'number')
..add(serializers.serialize(object.number,
specifiedType: const FullType(num)));
if (object.float != null) {
result
..add(r'float')
..add(serializers.serialize(object.float,
specifiedType: const FullType(double)));
}
if (object.double_ != null) {
result
..add(r'double')
..add(serializers.serialize(object.double_,
specifiedType: const FullType(double)));
}
if (object.decimal != null) {
result
..add(r'decimal')
..add(serializers.serialize(object.decimal,
specifiedType: const FullType(double)));
}
if (object.string != null) {
result
..add(r'string')
..add(serializers.serialize(object.string,
specifiedType: const FullType(String)));
}
result
..add(r'byte')
..add(serializers.serialize(object.byte,
specifiedType: const FullType(String)));
if (object.binary != null) {
result
..add(r'binary')
..add(serializers.serialize(object.binary,
specifiedType: const FullType(Uint8List)));
}
result
..add(r'date')
..add(serializers.serialize(object.date,
specifiedType: const FullType(DateTime)));
if (object.dateTime != null) {
result
..add(r'dateTime')
..add(serializers.serialize(object.dateTime,
specifiedType: const FullType(DateTime)));
}
if (object.uuid != null) {
result
..add(r'uuid')
..add(serializers.serialize(object.uuid,
specifiedType: const FullType(String)));
}
result
..add(r'password')
..add(serializers.serialize(object.password,
specifiedType: const FullType(String)));
if (object.patternWithDigits != null) {
result
..add(r'pattern_with_digits')
..add(serializers.serialize(object.patternWithDigits,
specifiedType: const FullType(String)));
}
if (object.patternWithDigitsAndDelimiter != null) {
result
..add(r'pattern_with_digits_and_delimiter')
..add(serializers.serialize(object.patternWithDigitsAndDelimiter,
specifiedType: const FullType(String)));
}
return result;
}
if (object.int32 != null) {
result
..add(r'int32')
..add(serializers.serialize(object.int32,
specifiedType: const FullType(int)));
}
if (object.int64 != null) {
result
..add(r'int64')
..add(serializers.serialize(object.int64,
specifiedType: const FullType(int)));
}
result
..add(r'number')
..add(serializers.serialize(object.number,
specifiedType: const FullType(num)));
if (object.float != null) {
result
..add(r'float')
..add(serializers.serialize(object.float,
specifiedType: const FullType(double)));
}
if (object.double_ != null) {
result
..add(r'double')
..add(serializers.serialize(object.double_,
specifiedType: const FullType(double)));
}
if (object.decimal != null) {
result
..add(r'decimal')
..add(serializers.serialize(object.decimal,
specifiedType: const FullType(double)));
}
if (object.string != null) {
result
..add(r'string')
..add(serializers.serialize(object.string,
specifiedType: const FullType(String)));
}
result
..add(r'byte')
..add(serializers.serialize(object.byte,
specifiedType: const FullType(String)));
if (object.binary != null) {
result
..add(r'binary')
..add(serializers.serialize(object.binary,
specifiedType: const FullType(Uint8List)));
}
result
..add(r'date')
..add(serializers.serialize(object.date,
specifiedType: const FullType(DateTime)));
if (object.dateTime != null) {
result
..add(r'dateTime')
..add(serializers.serialize(object.dateTime,
specifiedType: const FullType(DateTime)));
}
if (object.uuid != null) {
result
..add(r'uuid')
..add(serializers.serialize(object.uuid,
specifiedType: const FullType(String)));
}
result
..add(r'password')
..add(serializers.serialize(object.password,
specifiedType: const FullType(String)));
if (object.patternWithDigits != null) {
result
..add(r'pattern_with_digits')
..add(serializers.serialize(object.patternWithDigits,
specifiedType: const FullType(String)));
}
if (object.patternWithDigitsAndDelimiter != null) {
result
..add(r'pattern_with_digits_and_delimiter')
..add(serializers.serialize(object.patternWithDigitsAndDelimiter,
specifiedType: const FullType(String)));
}
return result;
}
@override
FormatTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FormatTestBuilder();
@override
FormatTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = FormatTestBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'integer':
result.integer = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'int32':
result.int32 = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'int64':
result.int64 = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'number':
result.number = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'float':
result.float = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'double':
result.double_ = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'decimal':
result.decimal = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'string':
result.string = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'byte':
result.byte = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'binary':
result.binary = serializers.deserialize(value,
specifiedType: const FullType(Uint8List)) as Uint8List;
break;
case r'date':
result.date = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'dateTime':
result.dateTime = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'uuid':
result.uuid = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'password':
result.password = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'pattern_with_digits':
result.patternWithDigits = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'pattern_with_digits_and_delimiter':
result.patternWithDigitsAndDelimiter = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'integer':
result.integer = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'int32':
result.int32 = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'int64':
result.int64 = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'number':
result.number = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'float':
result.float = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'double':
result.double_ = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'decimal':
result.decimal = serializers.deserialize(value,
specifiedType: const FullType(double)) as double;
break;
case r'string':
result.string = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'byte':
result.byte = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'binary':
result.binary = serializers.deserialize(value,
specifiedType: const FullType(Uint8List)) as Uint8List;
break;
case r'date':
result.date = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'dateTime':
result.dateTime = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'uuid':
result.uuid = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'password':
result.password = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'pattern_with_digits':
result.patternWithDigits = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'pattern_with_digits_and_delimiter':
result.patternWithDigitsAndDelimiter = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,75 +7,73 @@ import 'package:built_value/serializer.dart';
part 'has_only_read_only.g.dart';
abstract class HasOnlyReadOnly
implements Built<HasOnlyReadOnly, HasOnlyReadOnlyBuilder> {
@BuiltValueField(wireName: r'bar')
String? get bar;
@BuiltValueField(wireName: r'foo')
String? get foo;
HasOnlyReadOnly._();
abstract class HasOnlyReadOnly implements Built<HasOnlyReadOnly, HasOnlyReadOnlyBuilder> {
@BuiltValueField(wireName: r'bar')
String? get bar;
static void _initializeBuilder(HasOnlyReadOnlyBuilder b) => b;
@BuiltValueField(wireName: r'foo')
String? get foo;
factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) =
_$HasOnlyReadOnly;
HasOnlyReadOnly._();
@BuiltValueSerializer(custom: true)
static Serializer<HasOnlyReadOnly> get serializer =>
_$HasOnlyReadOnlySerializer();
static void _initializeBuilder(HasOnlyReadOnlyBuilder b) => b;
factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly;
@BuiltValueSerializer(custom: true)
static Serializer<HasOnlyReadOnly> get serializer => _$HasOnlyReadOnlySerializer();
}
class _$HasOnlyReadOnlySerializer
implements StructuredSerializer<HasOnlyReadOnly> {
@override
final Iterable<Type> types = const [HasOnlyReadOnly, _$HasOnlyReadOnly];
class _$HasOnlyReadOnlySerializer implements StructuredSerializer<HasOnlyReadOnly> {
@override
final Iterable<Type> types = const [HasOnlyReadOnly, _$HasOnlyReadOnly];
@override
final String wireName = r'HasOnlyReadOnly';
@override
final String wireName = r'HasOnlyReadOnly';
@override
Iterable<Object?> serialize(Serializers serializers, HasOnlyReadOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, HasOnlyReadOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
}
if (object.foo != null) {
result
..add(r'foo')
..add(serializers.serialize(object.foo,
specifiedType: const FullType(String)));
}
return result;
}
if (object.foo != null) {
result
..add(r'foo')
..add(serializers.serialize(object.foo,
specifiedType: const FullType(String)));
}
return result;
}
@override
HasOnlyReadOnly deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = HasOnlyReadOnlyBuilder();
@override
HasOnlyReadOnly deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = HasOnlyReadOnlyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'foo':
result.foo = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'foo':
result.foo = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,62 +7,60 @@ import 'package:built_value/serializer.dart';
part 'health_check_result.g.dart';
abstract class HealthCheckResult
implements Built<HealthCheckResult, HealthCheckResultBuilder> {
@BuiltValueField(wireName: r'NullableMessage')
String? get nullableMessage;
HealthCheckResult._();
static void _initializeBuilder(HealthCheckResultBuilder b) => b;
abstract class HealthCheckResult implements Built<HealthCheckResult, HealthCheckResultBuilder> {
@BuiltValueField(wireName: r'NullableMessage')
String? get nullableMessage;
factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) =
_$HealthCheckResult;
HealthCheckResult._();
@BuiltValueSerializer(custom: true)
static Serializer<HealthCheckResult> get serializer =>
_$HealthCheckResultSerializer();
static void _initializeBuilder(HealthCheckResultBuilder b) => b;
factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult;
@BuiltValueSerializer(custom: true)
static Serializer<HealthCheckResult> get serializer => _$HealthCheckResultSerializer();
}
class _$HealthCheckResultSerializer
implements StructuredSerializer<HealthCheckResult> {
@override
final Iterable<Type> types = const [HealthCheckResult, _$HealthCheckResult];
class _$HealthCheckResultSerializer implements StructuredSerializer<HealthCheckResult> {
@override
final Iterable<Type> types = const [HealthCheckResult, _$HealthCheckResult];
@override
final String wireName = r'HealthCheckResult';
@override
final String wireName = r'HealthCheckResult';
@override
Iterable<Object?> serialize(Serializers serializers, HealthCheckResult object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.nullableMessage != null) {
result
..add(r'NullableMessage')
..add(serializers.serialize(object.nullableMessage,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, HealthCheckResult object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.nullableMessage != null) {
result
..add(r'NullableMessage')
..add(serializers.serialize(object.nullableMessage,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
HealthCheckResult deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = HealthCheckResultBuilder();
@override
HealthCheckResult deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = HealthCheckResultBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'NullableMessage':
result.nullableMessage = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'NullableMessage':
result.nullableMessage = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,66 +8,60 @@ import 'package:built_value/serializer.dart';
part 'inline_response_default.g.dart';
abstract class InlineResponseDefault
implements Built<InlineResponseDefault, InlineResponseDefaultBuilder> {
@BuiltValueField(wireName: r'string')
Foo? get string;
InlineResponseDefault._();
static void _initializeBuilder(InlineResponseDefaultBuilder b) => b;
abstract class InlineResponseDefault implements Built<InlineResponseDefault, InlineResponseDefaultBuilder> {
@BuiltValueField(wireName: r'string')
Foo? get string;
factory InlineResponseDefault(
[void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault;
InlineResponseDefault._();
@BuiltValueSerializer(custom: true)
static Serializer<InlineResponseDefault> get serializer =>
_$InlineResponseDefaultSerializer();
static void _initializeBuilder(InlineResponseDefaultBuilder b) => b;
factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault;
@BuiltValueSerializer(custom: true)
static Serializer<InlineResponseDefault> get serializer => _$InlineResponseDefaultSerializer();
}
class _$InlineResponseDefaultSerializer
implements StructuredSerializer<InlineResponseDefault> {
@override
final Iterable<Type> types = const [
InlineResponseDefault,
_$InlineResponseDefault
];
class _$InlineResponseDefaultSerializer implements StructuredSerializer<InlineResponseDefault> {
@override
final Iterable<Type> types = const [InlineResponseDefault, _$InlineResponseDefault];
@override
final String wireName = r'InlineResponseDefault';
@override
final String wireName = r'InlineResponseDefault';
@override
Iterable<Object?> serialize(
Serializers serializers, InlineResponseDefault object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.string != null) {
result
..add(r'string')
..add(serializers.serialize(object.string,
specifiedType: const FullType(Foo)));
@override
Iterable<Object?> serialize(Serializers serializers, InlineResponseDefault object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.string != null) {
result
..add(r'string')
..add(serializers.serialize(object.string,
specifiedType: const FullType(Foo)));
}
return result;
}
return result;
}
@override
InlineResponseDefault deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = InlineResponseDefaultBuilder();
@override
InlineResponseDefault deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = InlineResponseDefaultBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'string':
result.string.replace(serializers.deserialize(value,
specifiedType: const FullType(Foo)) as Foo);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'string':
result.string.replace(serializers.deserialize(value,
specifiedType: const FullType(Foo)) as Foo);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,132 +8,115 @@ import 'package:built_value/serializer.dart';
part 'map_test.g.dart';
abstract class MapTest implements Built<MapTest, MapTestBuilder> {
@BuiltValueField(wireName: r'map_map_of_string')
BuiltMap<String, BuiltMap<String, String>>? get mapMapOfString;
@BuiltValueField(wireName: r'map_map_of_string')
BuiltMap<String, BuiltMap<String, String>>? get mapMapOfString;
@BuiltValueField(wireName: r'map_of_enum_string')
BuiltMap<String, MapTestMapOfEnumStringEnum>? get mapOfEnumString;
// enum mapOfEnumStringEnum { UPPER, lower, };
@BuiltValueField(wireName: r'map_of_enum_string')
BuiltMap<String, MapTestMapOfEnumStringEnum>? get mapOfEnumString;
// enum mapOfEnumStringEnum { UPPER, lower, };
@BuiltValueField(wireName: r'direct_map')
BuiltMap<String, bool>? get directMap;
@BuiltValueField(wireName: r'direct_map')
BuiltMap<String, bool>? get directMap;
@BuiltValueField(wireName: r'indirect_map')
BuiltMap<String, bool>? get indirectMap;
@BuiltValueField(wireName: r'indirect_map')
BuiltMap<String, bool>? get indirectMap;
MapTest._();
MapTest._();
static void _initializeBuilder(MapTestBuilder b) => b;
static void _initializeBuilder(MapTestBuilder b) => b;
factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest;
factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest;
@BuiltValueSerializer(custom: true)
static Serializer<MapTest> get serializer => _$MapTestSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<MapTest> get serializer => _$MapTestSerializer();
}
class _$MapTestSerializer implements StructuredSerializer<MapTest> {
@override
final Iterable<Type> types = const [MapTest, _$MapTest];
@override
final Iterable<Type> types = const [MapTest, _$MapTest];
@override
final String wireName = r'MapTest';
@override
final String wireName = r'MapTest';
@override
Iterable<Object?> serialize(Serializers serializers, MapTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.mapMapOfString != null) {
result
..add(r'map_map_of_string')
..add(serializers.serialize(object.mapMapOfString,
specifiedType: const FullType(BuiltMap, [
FullType(String),
FullType(BuiltMap, [FullType(String), FullType(String)])
])));
@override
Iterable<Object?> serialize(Serializers serializers, MapTest object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.mapMapOfString != null) {
result
..add(r'map_map_of_string')
..add(serializers.serialize(object.mapMapOfString,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])));
}
if (object.mapOfEnumString != null) {
result
..add(r'map_of_enum_string')
..add(serializers.serialize(object.mapOfEnumString,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)])));
}
if (object.directMap != null) {
result
..add(r'direct_map')
..add(serializers.serialize(object.directMap,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])));
}
if (object.indirectMap != null) {
result
..add(r'indirect_map')
..add(serializers.serialize(object.indirectMap,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])));
}
return result;
}
if (object.mapOfEnumString != null) {
result
..add(r'map_of_enum_string')
..add(serializers.serialize(object.mapOfEnumString,
specifiedType: const FullType(BuiltMap,
[FullType(String), FullType(MapTestMapOfEnumStringEnum)])));
}
if (object.directMap != null) {
result
..add(r'direct_map')
..add(serializers.serialize(object.directMap,
specifiedType:
const FullType(BuiltMap, [FullType(String), FullType(bool)])));
}
if (object.indirectMap != null) {
result
..add(r'indirect_map')
..add(serializers.serialize(object.indirectMap,
specifiedType:
const FullType(BuiltMap, [FullType(String), FullType(bool)])));
}
return result;
}
@override
MapTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = MapTestBuilder();
@override
MapTest deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = MapTestBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'map_map_of_string':
result.mapMapOfString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [
FullType(String),
FullType(BuiltMap, [FullType(String), FullType(String)])
])) as BuiltMap<String, BuiltMap<String, String>>);
break;
case r'map_of_enum_string':
result.mapOfEnumString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [
FullType(String),
FullType(MapTestMapOfEnumStringEnum)
])) as BuiltMap<String, MapTestMapOfEnumStringEnum>);
break;
case r'direct_map':
result.directMap.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(bool)]))
as BuiltMap<String, bool>);
break;
case r'indirect_map':
result.indirectMap.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(bool)]))
as BuiltMap<String, bool>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'map_map_of_string':
result.mapMapOfString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap<String, BuiltMap<String, String>>);
break;
case r'map_of_enum_string':
result.mapOfEnumString.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)])) as BuiltMap<String, MapTestMapOfEnumStringEnum>);
break;
case r'direct_map':
result.directMap.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap<String, bool>);
break;
case r'indirect_map':
result.indirectMap.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap<String, bool>);
break;
}
}
return result.build();
}
return result.build();
}
}
class MapTestMapOfEnumStringEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'UPPER')
static const MapTestMapOfEnumStringEnum UPPER =
_$mapTestMapOfEnumStringEnum_UPPER;
static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER;
@BuiltValueEnumConst(wireName: r'lower')
static const MapTestMapOfEnumStringEnum lower =
_$mapTestMapOfEnumStringEnum_lower;
static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower;
static Serializer<MapTestMapOfEnumStringEnum> get serializer =>
_$mapTestMapOfEnumStringEnumSerializer;
static Serializer<MapTestMapOfEnumStringEnum> get serializer => _$mapTestMapOfEnumStringEnumSerializer;
const MapTestMapOfEnumStringEnum._(String name) : super(name);
const MapTestMapOfEnumStringEnum._(String name): super(name);
static BuiltSet<MapTestMapOfEnumStringEnum> get values =>
_$mapTestMapOfEnumStringEnumValues;
static MapTestMapOfEnumStringEnum valueOf(String name) =>
_$mapTestMapOfEnumStringEnumValueOf(name);
static BuiltSet<MapTestMapOfEnumStringEnum> get values => _$mapTestMapOfEnumStringEnumValues;
static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name);
}

View File

@ -9,103 +9,86 @@ import 'package:built_value/serializer.dart';
part 'mixed_properties_and_additional_properties_class.g.dart';
abstract class MixedPropertiesAndAdditionalPropertiesClass
implements
Built<MixedPropertiesAndAdditionalPropertiesClass,
MixedPropertiesAndAdditionalPropertiesClassBuilder> {
@BuiltValueField(wireName: r'uuid')
String? get uuid;
@BuiltValueField(wireName: r'dateTime')
DateTime? get dateTime;
@BuiltValueField(wireName: r'map')
BuiltMap<String, Animal>? get map;
abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built<MixedPropertiesAndAdditionalPropertiesClass, MixedPropertiesAndAdditionalPropertiesClassBuilder> {
@BuiltValueField(wireName: r'uuid')
String? get uuid;
MixedPropertiesAndAdditionalPropertiesClass._();
@BuiltValueField(wireName: r'dateTime')
DateTime? get dateTime;
static void _initializeBuilder(
MixedPropertiesAndAdditionalPropertiesClassBuilder b) =>
b;
@BuiltValueField(wireName: r'map')
BuiltMap<String, Animal>? get map;
factory MixedPropertiesAndAdditionalPropertiesClass(
[void updates(
MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) =
_$MixedPropertiesAndAdditionalPropertiesClass;
MixedPropertiesAndAdditionalPropertiesClass._();
@BuiltValueSerializer(custom: true)
static Serializer<MixedPropertiesAndAdditionalPropertiesClass>
get serializer =>
_$MixedPropertiesAndAdditionalPropertiesClassSerializer();
static void _initializeBuilder(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b;
factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass;
@BuiltValueSerializer(custom: true)
static Serializer<MixedPropertiesAndAdditionalPropertiesClass> get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer();
}
class _$MixedPropertiesAndAdditionalPropertiesClassSerializer
implements
StructuredSerializer<MixedPropertiesAndAdditionalPropertiesClass> {
@override
final Iterable<Type> types = const [
MixedPropertiesAndAdditionalPropertiesClass,
_$MixedPropertiesAndAdditionalPropertiesClass
];
class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements StructuredSerializer<MixedPropertiesAndAdditionalPropertiesClass> {
@override
final Iterable<Type> types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass];
@override
final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass';
@override
final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass';
@override
Iterable<Object?> serialize(Serializers serializers,
MixedPropertiesAndAdditionalPropertiesClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.uuid != null) {
result
..add(r'uuid')
..add(serializers.serialize(object.uuid,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, MixedPropertiesAndAdditionalPropertiesClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.uuid != null) {
result
..add(r'uuid')
..add(serializers.serialize(object.uuid,
specifiedType: const FullType(String)));
}
if (object.dateTime != null) {
result
..add(r'dateTime')
..add(serializers.serialize(object.dateTime,
specifiedType: const FullType(DateTime)));
}
if (object.map != null) {
result
..add(r'map')
..add(serializers.serialize(object.map,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)])));
}
return result;
}
if (object.dateTime != null) {
result
..add(r'dateTime')
..add(serializers.serialize(object.dateTime,
specifiedType: const FullType(DateTime)));
}
if (object.map != null) {
result
..add(r'map')
..add(serializers.serialize(object.map,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(Animal)])));
}
return result;
}
@override
MixedPropertiesAndAdditionalPropertiesClass deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = MixedPropertiesAndAdditionalPropertiesClassBuilder();
@override
MixedPropertiesAndAdditionalPropertiesClass deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = MixedPropertiesAndAdditionalPropertiesClassBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'uuid':
result.uuid = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'dateTime':
result.dateTime = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'map':
result.map.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(Animal)]))
as BuiltMap<String, Animal>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'uuid':
result.uuid = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'dateTime':
result.dateTime = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'map':
result.map.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)])) as BuiltMap<String, Animal>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,75 +7,73 @@ import 'package:built_value/serializer.dart';
part 'model200_response.g.dart';
abstract class Model200Response
implements Built<Model200Response, Model200ResponseBuilder> {
@BuiltValueField(wireName: r'name')
int? get name;
@BuiltValueField(wireName: r'class')
String? get class_;
Model200Response._();
abstract class Model200Response implements Built<Model200Response, Model200ResponseBuilder> {
@BuiltValueField(wireName: r'name')
int? get name;
static void _initializeBuilder(Model200ResponseBuilder b) => b;
@BuiltValueField(wireName: r'class')
String? get class_;
factory Model200Response([void updates(Model200ResponseBuilder b)]) =
_$Model200Response;
Model200Response._();
@BuiltValueSerializer(custom: true)
static Serializer<Model200Response> get serializer =>
_$Model200ResponseSerializer();
static void _initializeBuilder(Model200ResponseBuilder b) => b;
factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response;
@BuiltValueSerializer(custom: true)
static Serializer<Model200Response> get serializer => _$Model200ResponseSerializer();
}
class _$Model200ResponseSerializer
implements StructuredSerializer<Model200Response> {
@override
final Iterable<Type> types = const [Model200Response, _$Model200Response];
class _$Model200ResponseSerializer implements StructuredSerializer<Model200Response> {
@override
final Iterable<Type> types = const [Model200Response, _$Model200Response];
@override
final String wireName = r'Model200Response';
@override
final String wireName = r'Model200Response';
@override
Iterable<Object?> serialize(Serializers serializers, Model200Response object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.name != null) {
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Model200Response object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.name != null) {
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(int)));
}
if (object.class_ != null) {
result
..add(r'class')
..add(serializers.serialize(object.class_,
specifiedType: const FullType(String)));
}
return result;
}
if (object.class_ != null) {
result
..add(r'class')
..add(serializers.serialize(object.class_,
specifiedType: const FullType(String)));
}
return result;
}
@override
Model200Response deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = Model200ResponseBuilder();
@override
Model200Response deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = Model200ResponseBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'class':
result.class_ = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'class':
result.class_ = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'model_client.g.dart';
abstract class ModelClient implements Built<ModelClient, ModelClientBuilder> {
@BuiltValueField(wireName: r'client')
String? get client;
@BuiltValueField(wireName: r'client')
String? get client;
ModelClient._();
ModelClient._();
static void _initializeBuilder(ModelClientBuilder b) => b;
static void _initializeBuilder(ModelClientBuilder b) => b;
factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient;
factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient;
@BuiltValueSerializer(custom: true)
static Serializer<ModelClient> get serializer => _$ModelClientSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ModelClient> get serializer => _$ModelClientSerializer();
}
class _$ModelClientSerializer implements StructuredSerializer<ModelClient> {
@override
final Iterable<Type> types = const [ModelClient, _$ModelClient];
@override
final Iterable<Type> types = const [ModelClient, _$ModelClient];
@override
final String wireName = r'ModelClient';
@override
final String wireName = r'ModelClient';
@override
Iterable<Object?> serialize(Serializers serializers, ModelClient object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.client != null) {
result
..add(r'client')
..add(serializers.serialize(object.client,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, ModelClient object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.client != null) {
result
..add(r'client')
..add(serializers.serialize(object.client,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
ModelClient deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelClientBuilder();
@override
ModelClient deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelClientBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'client':
result.client = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'client':
result.client = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -9,18 +9,17 @@ import 'package:built_value/serializer.dart';
part 'model_enum_class.g.dart';
class ModelEnumClass extends EnumClass {
@BuiltValueEnumConst(wireName: r'_abc')
static const ModelEnumClass abc = _$abc;
@BuiltValueEnumConst(wireName: r'-efg')
static const ModelEnumClass efg = _$efg;
@BuiltValueEnumConst(wireName: r'(xyz)')
static const ModelEnumClass leftParenthesisXyzRightParenthesis =
_$leftParenthesisXyzRightParenthesis;
static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis;
static Serializer<ModelEnumClass> get serializer =>
_$modelEnumClassSerializer;
static Serializer<ModelEnumClass> get serializer => _$modelEnumClassSerializer;
const ModelEnumClass._(String name) : super(name);
const ModelEnumClass._(String name): super(name);
static BuiltSet<ModelEnumClass> get values => _$values;
static ModelEnumClass valueOf(String name) => _$valueOf(name);
@ -33,3 +32,4 @@ class ModelEnumClass extends EnumClass {
///
/// Trigger mixin generation by writing a line like this one next to your enum.
abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin;

View File

@ -7,58 +7,61 @@ import 'package:built_value/serializer.dart';
part 'model_file.g.dart';
abstract class ModelFile implements Built<ModelFile, ModelFileBuilder> {
/// Test capitalization
@BuiltValueField(wireName: r'sourceURI')
String? get sourceURI;
/// Test capitalization
@BuiltValueField(wireName: r'sourceURI')
String? get sourceURI;
ModelFile._();
ModelFile._();
static void _initializeBuilder(ModelFileBuilder b) => b;
static void _initializeBuilder(ModelFileBuilder b) => b;
factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile;
factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile;
@BuiltValueSerializer(custom: true)
static Serializer<ModelFile> get serializer => _$ModelFileSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ModelFile> get serializer => _$ModelFileSerializer();
}
class _$ModelFileSerializer implements StructuredSerializer<ModelFile> {
@override
final Iterable<Type> types = const [ModelFile, _$ModelFile];
@override
final Iterable<Type> types = const [ModelFile, _$ModelFile];
@override
final String wireName = r'ModelFile';
@override
final String wireName = r'ModelFile';
@override
Iterable<Object?> serialize(Serializers serializers, ModelFile object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.sourceURI != null) {
result
..add(r'sourceURI')
..add(serializers.serialize(object.sourceURI,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, ModelFile object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.sourceURI != null) {
result
..add(r'sourceURI')
..add(serializers.serialize(object.sourceURI,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
ModelFile deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelFileBuilder();
@override
ModelFile deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelFileBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'sourceURI':
result.sourceURI = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'sourceURI':
result.sourceURI = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'model_list.g.dart';
abstract class ModelList implements Built<ModelList, ModelListBuilder> {
@BuiltValueField(wireName: r'123-list')
String? get n123list;
@BuiltValueField(wireName: r'123-list')
String? get n123list;
ModelList._();
ModelList._();
static void _initializeBuilder(ModelListBuilder b) => b;
static void _initializeBuilder(ModelListBuilder b) => b;
factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList;
factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList;
@BuiltValueSerializer(custom: true)
static Serializer<ModelList> get serializer => _$ModelListSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ModelList> get serializer => _$ModelListSerializer();
}
class _$ModelListSerializer implements StructuredSerializer<ModelList> {
@override
final Iterable<Type> types = const [ModelList, _$ModelList];
@override
final Iterable<Type> types = const [ModelList, _$ModelList];
@override
final String wireName = r'ModelList';
@override
final String wireName = r'ModelList';
@override
Iterable<Object?> serialize(Serializers serializers, ModelList object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.n123list != null) {
result
..add(r'123-list')
..add(serializers.serialize(object.n123list,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, ModelList object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.n123list != null) {
result
..add(r'123-list')
..add(serializers.serialize(object.n123list,
specifiedType: const FullType(String)));
}
return result;
}
return result;
}
@override
ModelList deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelListBuilder();
@override
ModelList deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelListBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'123-list':
result.n123list = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'123-list':
result.n123list = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'model_return.g.dart';
abstract class ModelReturn implements Built<ModelReturn, ModelReturnBuilder> {
@BuiltValueField(wireName: r'return')
int? get return_;
@BuiltValueField(wireName: r'return')
int? get return_;
ModelReturn._();
ModelReturn._();
static void _initializeBuilder(ModelReturnBuilder b) => b;
static void _initializeBuilder(ModelReturnBuilder b) => b;
factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn;
factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn;
@BuiltValueSerializer(custom: true)
static Serializer<ModelReturn> get serializer => _$ModelReturnSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<ModelReturn> get serializer => _$ModelReturnSerializer();
}
class _$ModelReturnSerializer implements StructuredSerializer<ModelReturn> {
@override
final Iterable<Type> types = const [ModelReturn, _$ModelReturn];
@override
final Iterable<Type> types = const [ModelReturn, _$ModelReturn];
@override
final String wireName = r'ModelReturn';
@override
final String wireName = r'ModelReturn';
@override
Iterable<Object?> serialize(Serializers serializers, ModelReturn object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.return_ != null) {
result
..add(r'return')
..add(serializers.serialize(object.return_,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, ModelReturn object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.return_ != null) {
result
..add(r'return')
..add(serializers.serialize(object.return_,
specifiedType: const FullType(int)));
}
return result;
}
return result;
}
@override
ModelReturn deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelReturnBuilder();
@override
ModelReturn deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ModelReturnBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'return':
result.return_ = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'return':
result.return_ = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,94 +7,97 @@ import 'package:built_value/serializer.dart';
part 'name.g.dart';
abstract class Name implements Built<Name, NameBuilder> {
@BuiltValueField(wireName: r'name')
int get name;
@BuiltValueField(wireName: r'name')
int get name;
@BuiltValueField(wireName: r'snake_case')
int? get snakeCase;
@BuiltValueField(wireName: r'snake_case')
int? get snakeCase;
@BuiltValueField(wireName: r'property')
String? get property;
@BuiltValueField(wireName: r'property')
String? get property;
@BuiltValueField(wireName: r'123Number')
int? get n123number;
@BuiltValueField(wireName: r'123Number')
int? get n123number;
Name._();
Name._();
static void _initializeBuilder(NameBuilder b) => b;
static void _initializeBuilder(NameBuilder b) => b;
factory Name([void updates(NameBuilder b)]) = _$Name;
factory Name([void updates(NameBuilder b)]) = _$Name;
@BuiltValueSerializer(custom: true)
static Serializer<Name> get serializer => _$NameSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Name> get serializer => _$NameSerializer();
}
class _$NameSerializer implements StructuredSerializer<Name> {
@override
final Iterable<Type> types = const [Name, _$Name];
@override
final Iterable<Type> types = const [Name, _$Name];
@override
final String wireName = r'Name';
@override
final String wireName = r'Name';
@override
Iterable<Object?> serialize(Serializers serializers, Name object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(int)));
if (object.snakeCase != null) {
result
..add(r'snake_case')
..add(serializers.serialize(object.snakeCase,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Name object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(int)));
if (object.snakeCase != null) {
result
..add(r'snake_case')
..add(serializers.serialize(object.snakeCase,
specifiedType: const FullType(int)));
}
if (object.property != null) {
result
..add(r'property')
..add(serializers.serialize(object.property,
specifiedType: const FullType(String)));
}
if (object.n123number != null) {
result
..add(r'123Number')
..add(serializers.serialize(object.n123number,
specifiedType: const FullType(int)));
}
return result;
}
if (object.property != null) {
result
..add(r'property')
..add(serializers.serialize(object.property,
specifiedType: const FullType(String)));
}
if (object.n123number != null) {
result
..add(r'123Number')
..add(serializers.serialize(object.n123number,
specifiedType: const FullType(int)));
}
return result;
}
@override
Name deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NameBuilder();
@override
Name deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NameBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'snake_case':
result.snakeCase = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'property':
result.property = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'123Number':
result.n123number = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'snake_case':
result.snakeCase = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'property':
result.property = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'123Number':
result.n123number = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -9,221 +9,203 @@ import 'package:built_value/serializer.dart';
part 'nullable_class.g.dart';
abstract class NullableClass
implements Built<NullableClass, NullableClassBuilder> {
@BuiltValueField(wireName: r'integer_prop')
int? get integerProp;
@BuiltValueField(wireName: r'number_prop')
num? get numberProp;
@BuiltValueField(wireName: r'boolean_prop')
bool? get booleanProp;
abstract class NullableClass implements Built<NullableClass, NullableClassBuilder> {
@BuiltValueField(wireName: r'integer_prop')
int? get integerProp;
@BuiltValueField(wireName: r'string_prop')
String? get stringProp;
@BuiltValueField(wireName: r'number_prop')
num? get numberProp;
@BuiltValueField(wireName: r'date_prop')
DateTime? get dateProp;
@BuiltValueField(wireName: r'boolean_prop')
bool? get booleanProp;
@BuiltValueField(wireName: r'datetime_prop')
DateTime? get datetimeProp;
@BuiltValueField(wireName: r'string_prop')
String? get stringProp;
@BuiltValueField(wireName: r'array_nullable_prop')
BuiltList<JsonObject>? get arrayNullableProp;
@BuiltValueField(wireName: r'date_prop')
DateTime? get dateProp;
@BuiltValueField(wireName: r'array_and_items_nullable_prop')
BuiltList<JsonObject>? get arrayAndItemsNullableProp;
@BuiltValueField(wireName: r'datetime_prop')
DateTime? get datetimeProp;
@BuiltValueField(wireName: r'array_items_nullable')
BuiltList<JsonObject>? get arrayItemsNullable;
@BuiltValueField(wireName: r'array_nullable_prop')
BuiltList<JsonObject>? get arrayNullableProp;
@BuiltValueField(wireName: r'object_nullable_prop')
BuiltMap<String, JsonObject>? get objectNullableProp;
@BuiltValueField(wireName: r'array_and_items_nullable_prop')
BuiltList<JsonObject>? get arrayAndItemsNullableProp;
@BuiltValueField(wireName: r'object_and_items_nullable_prop')
BuiltMap<String, JsonObject>? get objectAndItemsNullableProp;
@BuiltValueField(wireName: r'array_items_nullable')
BuiltList<JsonObject>? get arrayItemsNullable;
@BuiltValueField(wireName: r'object_items_nullable')
BuiltMap<String, JsonObject>? get objectItemsNullable;
@BuiltValueField(wireName: r'object_nullable_prop')
BuiltMap<String, JsonObject>? get objectNullableProp;
NullableClass._();
@BuiltValueField(wireName: r'object_and_items_nullable_prop')
BuiltMap<String, JsonObject>? get objectAndItemsNullableProp;
static void _initializeBuilder(NullableClassBuilder b) => b;
@BuiltValueField(wireName: r'object_items_nullable')
BuiltMap<String, JsonObject>? get objectItemsNullable;
factory NullableClass([void updates(NullableClassBuilder b)]) =
_$NullableClass;
NullableClass._();
@BuiltValueSerializer(custom: true)
static Serializer<NullableClass> get serializer =>
_$NullableClassSerializer();
static void _initializeBuilder(NullableClassBuilder b) => b;
factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass;
@BuiltValueSerializer(custom: true)
static Serializer<NullableClass> get serializer => _$NullableClassSerializer();
}
class _$NullableClassSerializer implements StructuredSerializer<NullableClass> {
@override
final Iterable<Type> types = const [NullableClass, _$NullableClass];
@override
final Iterable<Type> types = const [NullableClass, _$NullableClass];
@override
final String wireName = r'NullableClass';
@override
final String wireName = r'NullableClass';
@override
Iterable<Object?> serialize(Serializers serializers, NullableClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.integerProp != null) {
result
..add(r'integer_prop')
..add(serializers.serialize(object.integerProp,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, NullableClass object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.integerProp != null) {
result
..add(r'integer_prop')
..add(serializers.serialize(object.integerProp,
specifiedType: const FullType(int)));
}
if (object.numberProp != null) {
result
..add(r'number_prop')
..add(serializers.serialize(object.numberProp,
specifiedType: const FullType(num)));
}
if (object.booleanProp != null) {
result
..add(r'boolean_prop')
..add(serializers.serialize(object.booleanProp,
specifiedType: const FullType(bool)));
}
if (object.stringProp != null) {
result
..add(r'string_prop')
..add(serializers.serialize(object.stringProp,
specifiedType: const FullType(String)));
}
if (object.dateProp != null) {
result
..add(r'date_prop')
..add(serializers.serialize(object.dateProp,
specifiedType: const FullType(DateTime)));
}
if (object.datetimeProp != null) {
result
..add(r'datetime_prop')
..add(serializers.serialize(object.datetimeProp,
specifiedType: const FullType(DateTime)));
}
if (object.arrayNullableProp != null) {
result
..add(r'array_nullable_prop')
..add(serializers.serialize(object.arrayNullableProp,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.arrayAndItemsNullableProp != null) {
result
..add(r'array_and_items_nullable_prop')
..add(serializers.serialize(object.arrayAndItemsNullableProp,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.arrayItemsNullable != null) {
result
..add(r'array_items_nullable')
..add(serializers.serialize(object.arrayItemsNullable,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.objectNullableProp != null) {
result
..add(r'object_nullable_prop')
..add(serializers.serialize(object.objectNullableProp,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])));
}
if (object.objectAndItemsNullableProp != null) {
result
..add(r'object_and_items_nullable_prop')
..add(serializers.serialize(object.objectAndItemsNullableProp,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])));
}
if (object.objectItemsNullable != null) {
result
..add(r'object_items_nullable')
..add(serializers.serialize(object.objectItemsNullable,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])));
}
return result;
}
if (object.numberProp != null) {
result
..add(r'number_prop')
..add(serializers.serialize(object.numberProp,
specifiedType: const FullType(num)));
}
if (object.booleanProp != null) {
result
..add(r'boolean_prop')
..add(serializers.serialize(object.booleanProp,
specifiedType: const FullType(bool)));
}
if (object.stringProp != null) {
result
..add(r'string_prop')
..add(serializers.serialize(object.stringProp,
specifiedType: const FullType(String)));
}
if (object.dateProp != null) {
result
..add(r'date_prop')
..add(serializers.serialize(object.dateProp,
specifiedType: const FullType(DateTime)));
}
if (object.datetimeProp != null) {
result
..add(r'datetime_prop')
..add(serializers.serialize(object.datetimeProp,
specifiedType: const FullType(DateTime)));
}
if (object.arrayNullableProp != null) {
result
..add(r'array_nullable_prop')
..add(serializers.serialize(object.arrayNullableProp,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.arrayAndItemsNullableProp != null) {
result
..add(r'array_and_items_nullable_prop')
..add(serializers.serialize(object.arrayAndItemsNullableProp,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.arrayItemsNullable != null) {
result
..add(r'array_items_nullable')
..add(serializers.serialize(object.arrayItemsNullable,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])));
}
if (object.objectNullableProp != null) {
result
..add(r'object_nullable_prop')
..add(serializers.serialize(object.objectNullableProp,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)])));
}
if (object.objectAndItemsNullableProp != null) {
result
..add(r'object_and_items_nullable_prop')
..add(serializers.serialize(object.objectAndItemsNullableProp,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)])));
}
if (object.objectItemsNullable != null) {
result
..add(r'object_items_nullable')
..add(serializers.serialize(object.objectItemsNullable,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)])));
}
return result;
}
@override
NullableClass deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NullableClassBuilder();
@override
NullableClass deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NullableClassBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'integer_prop':
result.integerProp = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'number_prop':
result.numberProp = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'boolean_prop':
result.booleanProp = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case r'string_prop':
result.stringProp = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'date_prop':
result.dateProp = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'datetime_prop':
result.datetimeProp = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'array_nullable_prop':
result.arrayNullableProp.replace(serializers.deserialize(value,
specifiedType:
const FullType(BuiltList, [FullType(JsonObject)]))
as BuiltList<JsonObject>);
break;
case r'array_and_items_nullable_prop':
result.arrayAndItemsNullableProp.replace(serializers.deserialize(
value,
specifiedType:
const FullType(BuiltList, [FullType(JsonObject)]))
as BuiltList<JsonObject>);
break;
case r'array_items_nullable':
result.arrayItemsNullable.replace(serializers.deserialize(value,
specifiedType:
const FullType(BuiltList, [FullType(JsonObject)]))
as BuiltList<JsonObject>);
break;
case r'object_nullable_prop':
result.objectNullableProp.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)]))
as BuiltMap<String, JsonObject>);
break;
case r'object_and_items_nullable_prop':
result.objectAndItemsNullableProp.replace(serializers.deserialize(
value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)]))
as BuiltMap<String, JsonObject>);
break;
case r'object_items_nullable':
result.objectItemsNullable.replace(serializers.deserialize(value,
specifiedType: const FullType(
BuiltMap, [FullType(String), FullType(JsonObject)]))
as BuiltMap<String, JsonObject>);
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'integer_prop':
result.integerProp = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'number_prop':
result.numberProp = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'boolean_prop':
result.booleanProp = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
case r'string_prop':
result.stringProp = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'date_prop':
result.dateProp = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'datetime_prop':
result.datetimeProp = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'array_nullable_prop':
result.arrayNullableProp.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])) as BuiltList<JsonObject>);
break;
case r'array_and_items_nullable_prop':
result.arrayAndItemsNullableProp.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])) as BuiltList<JsonObject>);
break;
case r'array_items_nullable':
result.arrayItemsNullable.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(JsonObject)])) as BuiltList<JsonObject>);
break;
case r'object_nullable_prop':
result.objectNullableProp.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])) as BuiltMap<String, JsonObject>);
break;
case r'object_and_items_nullable_prop':
result.objectAndItemsNullableProp.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])) as BuiltMap<String, JsonObject>);
break;
case r'object_items_nullable':
result.objectItemsNullable.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltMap, [FullType(String), FullType(JsonObject)])) as BuiltMap<String, JsonObject>);
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,57 +7,60 @@ import 'package:built_value/serializer.dart';
part 'number_only.g.dart';
abstract class NumberOnly implements Built<NumberOnly, NumberOnlyBuilder> {
@BuiltValueField(wireName: r'JustNumber')
num? get justNumber;
@BuiltValueField(wireName: r'JustNumber')
num? get justNumber;
NumberOnly._();
NumberOnly._();
static void _initializeBuilder(NumberOnlyBuilder b) => b;
static void _initializeBuilder(NumberOnlyBuilder b) => b;
factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly;
factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly;
@BuiltValueSerializer(custom: true)
static Serializer<NumberOnly> get serializer => _$NumberOnlySerializer();
@BuiltValueSerializer(custom: true)
static Serializer<NumberOnly> get serializer => _$NumberOnlySerializer();
}
class _$NumberOnlySerializer implements StructuredSerializer<NumberOnly> {
@override
final Iterable<Type> types = const [NumberOnly, _$NumberOnly];
@override
final Iterable<Type> types = const [NumberOnly, _$NumberOnly];
@override
final String wireName = r'NumberOnly';
@override
final String wireName = r'NumberOnly';
@override
Iterable<Object?> serialize(Serializers serializers, NumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.justNumber != null) {
result
..add(r'JustNumber')
..add(serializers.serialize(object.justNumber,
specifiedType: const FullType(num)));
@override
Iterable<Object?> serialize(Serializers serializers, NumberOnly object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.justNumber != null) {
result
..add(r'JustNumber')
..add(serializers.serialize(object.justNumber,
specifiedType: const FullType(num)));
}
return result;
}
return result;
}
@override
NumberOnly deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NumberOnlyBuilder();
@override
NumberOnly deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = NumberOnlyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'JustNumber':
result.justNumber = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'JustNumber':
result.justNumber = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -8,147 +8,148 @@ import 'package:built_value/serializer.dart';
part 'order.g.dart';
abstract class Order implements Built<Order, OrderBuilder> {
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'petId')
int? get petId;
@BuiltValueField(wireName: r'petId')
int? get petId;
@BuiltValueField(wireName: r'quantity')
int? get quantity;
@BuiltValueField(wireName: r'quantity')
int? get quantity;
@BuiltValueField(wireName: r'shipDate')
DateTime? get shipDate;
@BuiltValueField(wireName: r'shipDate')
DateTime? get shipDate;
/// Order Status
@BuiltValueField(wireName: r'status')
OrderStatusEnum? get status;
// enum statusEnum { placed, approved, delivered, };
/// Order Status
@BuiltValueField(wireName: r'status')
OrderStatusEnum? get status;
// enum statusEnum { placed, approved, delivered, };
@BuiltValueField(wireName: r'complete')
bool? get complete;
@BuiltValueField(wireName: r'complete')
bool? get complete;
Order._();
Order._();
static void _initializeBuilder(OrderBuilder b) => b..complete = false;
static void _initializeBuilder(OrderBuilder b) => b
..complete = false;
factory Order([void updates(OrderBuilder b)]) = _$Order;
factory Order([void updates(OrderBuilder b)]) = _$Order;
@BuiltValueSerializer(custom: true)
static Serializer<Order> get serializer => _$OrderSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Order> get serializer => _$OrderSerializer();
}
class _$OrderSerializer implements StructuredSerializer<Order> {
@override
final Iterable<Type> types = const [Order, _$Order];
@override
final Iterable<Type> types = const [Order, _$Order];
@override
final String wireName = r'Order';
@override
final String wireName = r'Order';
@override
Iterable<Object?> serialize(Serializers serializers, Order object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Order object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
}
if (object.petId != null) {
result
..add(r'petId')
..add(serializers.serialize(object.petId,
specifiedType: const FullType(int)));
}
if (object.quantity != null) {
result
..add(r'quantity')
..add(serializers.serialize(object.quantity,
specifiedType: const FullType(int)));
}
if (object.shipDate != null) {
result
..add(r'shipDate')
..add(serializers.serialize(object.shipDate,
specifiedType: const FullType(DateTime)));
}
if (object.status != null) {
result
..add(r'status')
..add(serializers.serialize(object.status,
specifiedType: const FullType(OrderStatusEnum)));
}
if (object.complete != null) {
result
..add(r'complete')
..add(serializers.serialize(object.complete,
specifiedType: const FullType(bool)));
}
return result;
}
if (object.petId != null) {
result
..add(r'petId')
..add(serializers.serialize(object.petId,
specifiedType: const FullType(int)));
}
if (object.quantity != null) {
result
..add(r'quantity')
..add(serializers.serialize(object.quantity,
specifiedType: const FullType(int)));
}
if (object.shipDate != null) {
result
..add(r'shipDate')
..add(serializers.serialize(object.shipDate,
specifiedType: const FullType(DateTime)));
}
if (object.status != null) {
result
..add(r'status')
..add(serializers.serialize(object.status,
specifiedType: const FullType(OrderStatusEnum)));
}
if (object.complete != null) {
result
..add(r'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 = OrderBuilder();
@override
Order deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = OrderBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'petId':
result.petId = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'quantity':
result.quantity = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'shipDate':
result.shipDate = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'status':
result.status = serializers.deserialize(value,
specifiedType: const FullType(OrderStatusEnum))
as OrderStatusEnum;
break;
case r'complete':
result.complete = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'petId':
result.petId = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'quantity':
result.quantity = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'shipDate':
result.shipDate = serializers.deserialize(value,
specifiedType: const FullType(DateTime)) as DateTime;
break;
case r'status':
result.status = serializers.deserialize(value,
specifiedType: const FullType(OrderStatusEnum)) as OrderStatusEnum;
break;
case r'complete':
result.complete = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
}
return result.build();
}
return result.build();
}
}
class OrderStatusEnum extends EnumClass {
/// Order Status
@BuiltValueEnumConst(wireName: r'placed')
static const OrderStatusEnum placed = _$orderStatusEnum_placed;
/// Order Status
@BuiltValueEnumConst(wireName: r'approved')
static const OrderStatusEnum approved = _$orderStatusEnum_approved;
/// Order Status
@BuiltValueEnumConst(wireName: r'delivered')
static const OrderStatusEnum delivered = _$orderStatusEnum_delivered;
static Serializer<OrderStatusEnum> get serializer =>
_$orderStatusEnumSerializer;
static Serializer<OrderStatusEnum> get serializer => _$orderStatusEnumSerializer;
const OrderStatusEnum._(String name) : super(name);
const OrderStatusEnum._(String name): super(name);
static BuiltSet<OrderStatusEnum> get values => _$orderStatusEnumValues;
static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name);
}

View File

@ -7,88 +7,86 @@ import 'package:built_value/serializer.dart';
part 'outer_composite.g.dart';
abstract class OuterComposite
implements Built<OuterComposite, OuterCompositeBuilder> {
@BuiltValueField(wireName: r'my_number')
num? get myNumber;
@BuiltValueField(wireName: r'my_string')
String? get myString;
@BuiltValueField(wireName: r'my_boolean')
bool? get myBoolean;
abstract class OuterComposite implements Built<OuterComposite, OuterCompositeBuilder> {
@BuiltValueField(wireName: r'my_number')
num? get myNumber;
OuterComposite._();
@BuiltValueField(wireName: r'my_string')
String? get myString;
static void _initializeBuilder(OuterCompositeBuilder b) => b;
@BuiltValueField(wireName: r'my_boolean')
bool? get myBoolean;
factory OuterComposite([void updates(OuterCompositeBuilder b)]) =
_$OuterComposite;
OuterComposite._();
@BuiltValueSerializer(custom: true)
static Serializer<OuterComposite> get serializer =>
_$OuterCompositeSerializer();
static void _initializeBuilder(OuterCompositeBuilder b) => b;
factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite;
@BuiltValueSerializer(custom: true)
static Serializer<OuterComposite> get serializer => _$OuterCompositeSerializer();
}
class _$OuterCompositeSerializer
implements StructuredSerializer<OuterComposite> {
@override
final Iterable<Type> types = const [OuterComposite, _$OuterComposite];
class _$OuterCompositeSerializer implements StructuredSerializer<OuterComposite> {
@override
final Iterable<Type> types = const [OuterComposite, _$OuterComposite];
@override
final String wireName = r'OuterComposite';
@override
final String wireName = r'OuterComposite';
@override
Iterable<Object?> serialize(Serializers serializers, OuterComposite object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.myNumber != null) {
result
..add(r'my_number')
..add(serializers.serialize(object.myNumber,
specifiedType: const FullType(num)));
@override
Iterable<Object?> serialize(Serializers serializers, OuterComposite object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.myNumber != null) {
result
..add(r'my_number')
..add(serializers.serialize(object.myNumber,
specifiedType: const FullType(num)));
}
if (object.myString != null) {
result
..add(r'my_string')
..add(serializers.serialize(object.myString,
specifiedType: const FullType(String)));
}
if (object.myBoolean != null) {
result
..add(r'my_boolean')
..add(serializers.serialize(object.myBoolean,
specifiedType: const FullType(bool)));
}
return result;
}
if (object.myString != null) {
result
..add(r'my_string')
..add(serializers.serialize(object.myString,
specifiedType: const FullType(String)));
}
if (object.myBoolean != null) {
result
..add(r'my_boolean')
..add(serializers.serialize(object.myBoolean,
specifiedType: const FullType(bool)));
}
return result;
}
@override
OuterComposite deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = OuterCompositeBuilder();
@override
OuterComposite deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = OuterCompositeBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'my_number':
result.myNumber = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'my_string':
result.myString = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'my_boolean':
result.myBoolean = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'my_number':
result.myNumber = serializers.deserialize(value,
specifiedType: const FullType(num)) as num;
break;
case r'my_string':
result.myString = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'my_boolean':
result.myBoolean = serializers.deserialize(value,
specifiedType: const FullType(bool)) as bool;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -9,6 +9,7 @@ import 'package:built_value/serializer.dart';
part 'outer_enum.g.dart';
class OuterEnum extends EnumClass {
@BuiltValueEnumConst(wireName: r'placed')
static const OuterEnum placed = _$placed;
@BuiltValueEnumConst(wireName: r'approved')
@ -18,7 +19,7 @@ class OuterEnum extends EnumClass {
static Serializer<OuterEnum> get serializer => _$outerEnumSerializer;
const OuterEnum._(String name) : super(name);
const OuterEnum._(String name): super(name);
static BuiltSet<OuterEnum> get values => _$values;
static OuterEnum valueOf(String name) => _$valueOf(name);
@ -31,3 +32,4 @@ class OuterEnum extends EnumClass {
///
/// Trigger mixin generation by writing a line like this one next to your enum.
abstract class OuterEnumMixin = Object with _$OuterEnumMixin;

View File

@ -9,6 +9,7 @@ import 'package:built_value/serializer.dart';
part 'outer_enum_default_value.g.dart';
class OuterEnumDefaultValue extends EnumClass {
@BuiltValueEnumConst(wireName: r'placed')
static const OuterEnumDefaultValue placed = _$placed;
@BuiltValueEnumConst(wireName: r'approved')
@ -16,10 +17,9 @@ class OuterEnumDefaultValue extends EnumClass {
@BuiltValueEnumConst(wireName: r'delivered')
static const OuterEnumDefaultValue delivered = _$delivered;
static Serializer<OuterEnumDefaultValue> get serializer =>
_$outerEnumDefaultValueSerializer;
static Serializer<OuterEnumDefaultValue> get serializer => _$outerEnumDefaultValueSerializer;
const OuterEnumDefaultValue._(String name) : super(name);
const OuterEnumDefaultValue._(String name): super(name);
static BuiltSet<OuterEnumDefaultValue> get values => _$values;
static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name);
@ -31,5 +31,5 @@ class OuterEnumDefaultValue extends EnumClass {
/// corresponding Angular template.
///
/// Trigger mixin generation by writing a line like this one next to your enum.
abstract class OuterEnumDefaultValueMixin = Object
with _$OuterEnumDefaultValueMixin;
abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin;

View File

@ -9,6 +9,7 @@ import 'package:built_value/serializer.dart';
part 'outer_enum_integer.g.dart';
class OuterEnumInteger extends EnumClass {
@BuiltValueEnumConst(wireNumber: 0)
static const OuterEnumInteger number0 = _$number0;
@BuiltValueEnumConst(wireNumber: 1)
@ -16,10 +17,9 @@ class OuterEnumInteger extends EnumClass {
@BuiltValueEnumConst(wireNumber: 2)
static const OuterEnumInteger number2 = _$number2;
static Serializer<OuterEnumInteger> get serializer =>
_$outerEnumIntegerSerializer;
static Serializer<OuterEnumInteger> get serializer => _$outerEnumIntegerSerializer;
const OuterEnumInteger._(String name) : super(name);
const OuterEnumInteger._(String name): super(name);
static BuiltSet<OuterEnumInteger> get values => _$values;
static OuterEnumInteger valueOf(String name) => _$valueOf(name);
@ -32,3 +32,4 @@ class OuterEnumInteger extends EnumClass {
///
/// Trigger mixin generation by writing a line like this one next to your enum.
abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin;

View File

@ -9,6 +9,7 @@ import 'package:built_value/serializer.dart';
part 'outer_enum_integer_default_value.g.dart';
class OuterEnumIntegerDefaultValue extends EnumClass {
@BuiltValueEnumConst(wireNumber: 0)
static const OuterEnumIntegerDefaultValue number0 = _$number0;
@BuiltValueEnumConst(wireNumber: 1)
@ -16,10 +17,9 @@ class OuterEnumIntegerDefaultValue extends EnumClass {
@BuiltValueEnumConst(wireNumber: 2)
static const OuterEnumIntegerDefaultValue number2 = _$number2;
static Serializer<OuterEnumIntegerDefaultValue> get serializer =>
_$outerEnumIntegerDefaultValueSerializer;
static Serializer<OuterEnumIntegerDefaultValue> get serializer => _$outerEnumIntegerDefaultValueSerializer;
const OuterEnumIntegerDefaultValue._(String name) : super(name);
const OuterEnumIntegerDefaultValue._(String name): super(name);
static BuiltSet<OuterEnumIntegerDefaultValue> get values => _$values;
static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name);
@ -31,5 +31,5 @@ class OuterEnumIntegerDefaultValue extends EnumClass {
/// corresponding Angular template.
///
/// Trigger mixin generation by writing a line like this one next to your enum.
abstract class OuterEnumIntegerDefaultValueMixin = Object
with _$OuterEnumIntegerDefaultValueMixin;
abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin;

View File

@ -8,68 +8,59 @@ import 'package:built_value/serializer.dart';
part 'outer_object_with_enum_property.g.dart';
abstract class OuterObjectWithEnumProperty
implements
Built<OuterObjectWithEnumProperty, OuterObjectWithEnumPropertyBuilder> {
@BuiltValueField(wireName: r'value')
OuterEnumInteger get value;
// enum valueEnum { 0, 1, 2, };
OuterObjectWithEnumProperty._();
static void _initializeBuilder(OuterObjectWithEnumPropertyBuilder b) => b;
abstract class OuterObjectWithEnumProperty implements Built<OuterObjectWithEnumProperty, OuterObjectWithEnumPropertyBuilder> {
@BuiltValueField(wireName: r'value')
OuterEnumInteger get value;
// enum valueEnum { 0, 1, 2, };
factory OuterObjectWithEnumProperty(
[void updates(OuterObjectWithEnumPropertyBuilder b)]) =
_$OuterObjectWithEnumProperty;
OuterObjectWithEnumProperty._();
@BuiltValueSerializer(custom: true)
static Serializer<OuterObjectWithEnumProperty> get serializer =>
_$OuterObjectWithEnumPropertySerializer();
static void _initializeBuilder(OuterObjectWithEnumPropertyBuilder b) => b;
factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty;
@BuiltValueSerializer(custom: true)
static Serializer<OuterObjectWithEnumProperty> get serializer => _$OuterObjectWithEnumPropertySerializer();
}
class _$OuterObjectWithEnumPropertySerializer
implements StructuredSerializer<OuterObjectWithEnumProperty> {
@override
final Iterable<Type> types = const [
OuterObjectWithEnumProperty,
_$OuterObjectWithEnumProperty
];
class _$OuterObjectWithEnumPropertySerializer implements StructuredSerializer<OuterObjectWithEnumProperty> {
@override
final Iterable<Type> types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty];
@override
final String wireName = r'OuterObjectWithEnumProperty';
@override
final String wireName = r'OuterObjectWithEnumProperty';
@override
Iterable<Object?> serialize(
Serializers serializers, OuterObjectWithEnumProperty object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'value')
..add(serializers.serialize(object.value,
specifiedType: const FullType(OuterEnumInteger)));
return result;
}
@override
OuterObjectWithEnumProperty deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = OuterObjectWithEnumPropertyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'value':
result.value = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumInteger))
as OuterEnumInteger;
break;
}
@override
Iterable<Object?> serialize(Serializers serializers, OuterObjectWithEnumProperty object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
result
..add(r'value')
..add(serializers.serialize(object.value,
specifiedType: const FullType(OuterEnumInteger)));
return result;
}
@override
OuterObjectWithEnumProperty deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = OuterObjectWithEnumPropertyBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'value':
result.value = serializers.deserialize(value,
specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -10,143 +10,143 @@ import 'package:built_value/serializer.dart';
part 'pet.g.dart';
abstract class Pet implements Built<Pet, PetBuilder> {
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'category')
Category? get category;
@BuiltValueField(wireName: r'category')
Category? get category;
@BuiltValueField(wireName: r'name')
String get name;
@BuiltValueField(wireName: r'name')
String get name;
@BuiltValueField(wireName: r'photoUrls')
BuiltSet<String> get photoUrls;
@BuiltValueField(wireName: r'photoUrls')
BuiltSet<String> get photoUrls;
@BuiltValueField(wireName: r'tags')
BuiltList<Tag>? get tags;
@BuiltValueField(wireName: r'tags')
BuiltList<Tag>? get tags;
/// pet status in the store
@BuiltValueField(wireName: r'status')
PetStatusEnum? get status;
// enum statusEnum { available, pending, sold, };
/// pet status in the store
@BuiltValueField(wireName: r'status')
PetStatusEnum? get status;
// enum statusEnum { available, pending, sold, };
Pet._();
Pet._();
static void _initializeBuilder(PetBuilder b) => b;
static void _initializeBuilder(PetBuilder b) => b;
factory Pet([void updates(PetBuilder b)]) = _$Pet;
factory Pet([void updates(PetBuilder b)]) = _$Pet;
@BuiltValueSerializer(custom: true)
static Serializer<Pet> get serializer => _$PetSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Pet> get serializer => _$PetSerializer();
}
class _$PetSerializer implements StructuredSerializer<Pet> {
@override
final Iterable<Type> types = const [Pet, _$Pet];
@override
final Iterable<Type> types = const [Pet, _$Pet];
@override
final String wireName = r'Pet';
@override
final String wireName = r'Pet';
@override
Iterable<Object?> serialize(Serializers serializers, Pet object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Pet object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
}
if (object.category != null) {
result
..add(r'category')
..add(serializers.serialize(object.category,
specifiedType: const FullType(Category)));
}
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
result
..add(r'photoUrls')
..add(serializers.serialize(object.photoUrls,
specifiedType: const FullType(BuiltSet, [FullType(String)])));
if (object.tags != null) {
result
..add(r'tags')
..add(serializers.serialize(object.tags,
specifiedType: const FullType(BuiltList, [FullType(Tag)])));
}
if (object.status != null) {
result
..add(r'status')
..add(serializers.serialize(object.status,
specifiedType: const FullType(PetStatusEnum)));
}
return result;
}
if (object.category != null) {
result
..add(r'category')
..add(serializers.serialize(object.category,
specifiedType: const FullType(Category)));
}
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
result
..add(r'photoUrls')
..add(serializers.serialize(object.photoUrls,
specifiedType: const FullType(BuiltSet, [FullType(String)])));
if (object.tags != null) {
result
..add(r'tags')
..add(serializers.serialize(object.tags,
specifiedType: const FullType(BuiltList, [FullType(Tag)])));
}
if (object.status != null) {
result
..add(r'status')
..add(serializers.serialize(object.status,
specifiedType: const FullType(PetStatusEnum)));
}
return result;
}
@override
Pet deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = PetBuilder();
@override
Pet deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = PetBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'category':
result.category.replace(serializers.deserialize(value,
specifiedType: const FullType(Category)) as Category);
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'photoUrls':
result.photoUrls.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltSet, [FullType(String)]))
as BuiltSet<String>);
break;
case r'tags':
result.tags.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(Tag)]))
as BuiltList<Tag>);
break;
case r'status':
result.status = serializers.deserialize(value,
specifiedType: const FullType(PetStatusEnum)) as PetStatusEnum;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'category':
result.category.replace(serializers.deserialize(value,
specifiedType: const FullType(Category)) as Category);
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'photoUrls':
result.photoUrls.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltSet, [FullType(String)])) as BuiltSet<String>);
break;
case r'tags':
result.tags.replace(serializers.deserialize(value,
specifiedType: const FullType(BuiltList, [FullType(Tag)])) as BuiltList<Tag>);
break;
case r'status':
result.status = serializers.deserialize(value,
specifiedType: const FullType(PetStatusEnum)) as PetStatusEnum;
break;
}
}
return result.build();
}
return result.build();
}
}
class PetStatusEnum extends EnumClass {
/// pet status in the store
@BuiltValueEnumConst(wireName: r'available')
static const PetStatusEnum available = _$petStatusEnum_available;
/// pet status in the store
@BuiltValueEnumConst(wireName: r'pending')
static const PetStatusEnum pending = _$petStatusEnum_pending;
/// pet status in the store
@BuiltValueEnumConst(wireName: r'sold')
static const PetStatusEnum sold = _$petStatusEnum_sold;
static Serializer<PetStatusEnum> get serializer => _$petStatusEnumSerializer;
const PetStatusEnum._(String name) : super(name);
const PetStatusEnum._(String name): super(name);
static BuiltSet<PetStatusEnum> get values => _$petStatusEnumValues;
static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name);
}

View File

@ -7,74 +7,73 @@ import 'package:built_value/serializer.dart';
part 'read_only_first.g.dart';
abstract class ReadOnlyFirst
implements Built<ReadOnlyFirst, ReadOnlyFirstBuilder> {
@BuiltValueField(wireName: r'bar')
String? get bar;
@BuiltValueField(wireName: r'baz')
String? get baz;
ReadOnlyFirst._();
abstract class ReadOnlyFirst implements Built<ReadOnlyFirst, ReadOnlyFirstBuilder> {
@BuiltValueField(wireName: r'bar')
String? get bar;
static void _initializeBuilder(ReadOnlyFirstBuilder b) => b;
@BuiltValueField(wireName: r'baz')
String? get baz;
factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) =
_$ReadOnlyFirst;
ReadOnlyFirst._();
@BuiltValueSerializer(custom: true)
static Serializer<ReadOnlyFirst> get serializer =>
_$ReadOnlyFirstSerializer();
static void _initializeBuilder(ReadOnlyFirstBuilder b) => b;
factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst;
@BuiltValueSerializer(custom: true)
static Serializer<ReadOnlyFirst> get serializer => _$ReadOnlyFirstSerializer();
}
class _$ReadOnlyFirstSerializer implements StructuredSerializer<ReadOnlyFirst> {
@override
final Iterable<Type> types = const [ReadOnlyFirst, _$ReadOnlyFirst];
@override
final Iterable<Type> types = const [ReadOnlyFirst, _$ReadOnlyFirst];
@override
final String wireName = r'ReadOnlyFirst';
@override
final String wireName = r'ReadOnlyFirst';
@override
Iterable<Object?> serialize(Serializers serializers, ReadOnlyFirst object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
@override
Iterable<Object?> serialize(Serializers serializers, ReadOnlyFirst object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.bar != null) {
result
..add(r'bar')
..add(serializers.serialize(object.bar,
specifiedType: const FullType(String)));
}
if (object.baz != null) {
result
..add(r'baz')
..add(serializers.serialize(object.baz,
specifiedType: const FullType(String)));
}
return result;
}
if (object.baz != null) {
result
..add(r'baz')
..add(serializers.serialize(object.baz,
specifiedType: const FullType(String)));
}
return result;
}
@override
ReadOnlyFirst deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ReadOnlyFirstBuilder();
@override
ReadOnlyFirst deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = ReadOnlyFirstBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'baz':
result.baz = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'bar':
result.bar = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'baz':
result.baz = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,67 +7,60 @@ import 'package:built_value/serializer.dart';
part 'special_model_name.g.dart';
abstract class SpecialModelName
implements Built<SpecialModelName, SpecialModelNameBuilder> {
@BuiltValueField(wireName: r'$special[property.name]')
int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket;
SpecialModelName._();
static void _initializeBuilder(SpecialModelNameBuilder b) => b;
abstract class SpecialModelName implements Built<SpecialModelName, SpecialModelNameBuilder> {
@BuiltValueField(wireName: r'$special[property.name]')
int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket;
factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) =
_$SpecialModelName;
SpecialModelName._();
@BuiltValueSerializer(custom: true)
static Serializer<SpecialModelName> get serializer =>
_$SpecialModelNameSerializer();
static void _initializeBuilder(SpecialModelNameBuilder b) => b;
factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName;
@BuiltValueSerializer(custom: true)
static Serializer<SpecialModelName> get serializer => _$SpecialModelNameSerializer();
}
class _$SpecialModelNameSerializer
implements StructuredSerializer<SpecialModelName> {
@override
final Iterable<Type> types = const [SpecialModelName, _$SpecialModelName];
class _$SpecialModelNameSerializer implements StructuredSerializer<SpecialModelName> {
@override
final Iterable<Type> types = const [SpecialModelName, _$SpecialModelName];
@override
final String wireName = r'SpecialModelName';
@override
final String wireName = r'SpecialModelName';
@override
Iterable<Object?> serialize(Serializers serializers, SpecialModelName object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object
.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket !=
null) {
result
..add(r'$special[property.name]')
..add(serializers.serialize(
object
.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, SpecialModelName object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) {
result
..add(r'$special[property.name]')
..add(serializers.serialize(object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket,
specifiedType: const FullType(int)));
}
return result;
}
return result;
}
@override
SpecialModelName deserialize(
Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = SpecialModelNameBuilder();
@override
SpecialModelName deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = SpecialModelNameBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'$special[property.name]':
result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket =
serializers.deserialize(value, specifiedType: const FullType(int))
as int;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'$special[property.name]':
result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,70 +7,73 @@ import 'package:built_value/serializer.dart';
part 'tag.g.dart';
abstract class Tag implements Built<Tag, TagBuilder> {
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'name')
String? get name;
@BuiltValueField(wireName: r'name')
String? get name;
Tag._();
Tag._();
static void _initializeBuilder(TagBuilder b) => b;
static void _initializeBuilder(TagBuilder b) => b;
factory Tag([void updates(TagBuilder b)]) = _$Tag;
factory Tag([void updates(TagBuilder b)]) = _$Tag;
@BuiltValueSerializer(custom: true)
static Serializer<Tag> get serializer => _$TagSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<Tag> get serializer => _$TagSerializer();
}
class _$TagSerializer implements StructuredSerializer<Tag> {
@override
final Iterable<Type> types = const [Tag, _$Tag];
@override
final Iterable<Type> types = const [Tag, _$Tag];
@override
final String wireName = r'Tag';
@override
final String wireName = r'Tag';
@override
Iterable<Object?> serialize(Serializers serializers, Tag object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, Tag object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
}
if (object.name != null) {
result
..add(r'name')
..add(serializers.serialize(object.name,
specifiedType: const FullType(String)));
}
return result;
}
if (object.name != null) {
result
..add(r'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 = TagBuilder();
@override
Tag deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = TagBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'name':
result.name = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -7,149 +7,152 @@ import 'package:built_value/serializer.dart';
part 'user.g.dart';
abstract class User implements Built<User, UserBuilder> {
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'id')
int? get id;
@BuiltValueField(wireName: r'username')
String? get username;
@BuiltValueField(wireName: r'username')
String? get username;
@BuiltValueField(wireName: r'firstName')
String? get firstName;
@BuiltValueField(wireName: r'firstName')
String? get firstName;
@BuiltValueField(wireName: r'lastName')
String? get lastName;
@BuiltValueField(wireName: r'lastName')
String? get lastName;
@BuiltValueField(wireName: r'email')
String? get email;
@BuiltValueField(wireName: r'email')
String? get email;
@BuiltValueField(wireName: r'password')
String? get password;
@BuiltValueField(wireName: r'password')
String? get password;
@BuiltValueField(wireName: r'phone')
String? get phone;
@BuiltValueField(wireName: r'phone')
String? get phone;
/// User Status
@BuiltValueField(wireName: r'userStatus')
int? get userStatus;
/// User Status
@BuiltValueField(wireName: r'userStatus')
int? get userStatus;
User._();
User._();
static void _initializeBuilder(UserBuilder b) => b;
static void _initializeBuilder(UserBuilder b) => b;
factory User([void updates(UserBuilder b)]) = _$User;
factory User([void updates(UserBuilder b)]) = _$User;
@BuiltValueSerializer(custom: true)
static Serializer<User> get serializer => _$UserSerializer();
@BuiltValueSerializer(custom: true)
static Serializer<User> get serializer => _$UserSerializer();
}
class _$UserSerializer implements StructuredSerializer<User> {
@override
final Iterable<Type> types = const [User, _$User];
@override
final Iterable<Type> types = const [User, _$User];
@override
final String wireName = r'User';
@override
final String wireName = r'User';
@override
Iterable<Object?> serialize(Serializers serializers, User object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
@override
Iterable<Object?> serialize(Serializers serializers, User object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
if (object.id != null) {
result
..add(r'id')
..add(serializers.serialize(object.id,
specifiedType: const FullType(int)));
}
if (object.username != null) {
result
..add(r'username')
..add(serializers.serialize(object.username,
specifiedType: const FullType(String)));
}
if (object.firstName != null) {
result
..add(r'firstName')
..add(serializers.serialize(object.firstName,
specifiedType: const FullType(String)));
}
if (object.lastName != null) {
result
..add(r'lastName')
..add(serializers.serialize(object.lastName,
specifiedType: const FullType(String)));
}
if (object.email != null) {
result
..add(r'email')
..add(serializers.serialize(object.email,
specifiedType: const FullType(String)));
}
if (object.password != null) {
result
..add(r'password')
..add(serializers.serialize(object.password,
specifiedType: const FullType(String)));
}
if (object.phone != null) {
result
..add(r'phone')
..add(serializers.serialize(object.phone,
specifiedType: const FullType(String)));
}
if (object.userStatus != null) {
result
..add(r'userStatus')
..add(serializers.serialize(object.userStatus,
specifiedType: const FullType(int)));
}
return result;
}
if (object.username != null) {
result
..add(r'username')
..add(serializers.serialize(object.username,
specifiedType: const FullType(String)));
}
if (object.firstName != null) {
result
..add(r'firstName')
..add(serializers.serialize(object.firstName,
specifiedType: const FullType(String)));
}
if (object.lastName != null) {
result
..add(r'lastName')
..add(serializers.serialize(object.lastName,
specifiedType: const FullType(String)));
}
if (object.email != null) {
result
..add(r'email')
..add(serializers.serialize(object.email,
specifiedType: const FullType(String)));
}
if (object.password != null) {
result
..add(r'password')
..add(serializers.serialize(object.password,
specifiedType: const FullType(String)));
}
if (object.phone != null) {
result
..add(r'phone')
..add(serializers.serialize(object.phone,
specifiedType: const FullType(String)));
}
if (object.userStatus != null) {
result
..add(r'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 = UserBuilder();
@override
User deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = UserBuilder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'username':
result.username = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'firstName':
result.firstName = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'lastName':
result.lastName = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'email':
result.email = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'password':
result.password = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'phone':
result.phone = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'userStatus':
result.userStatus = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case r'id':
result.id = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
case r'username':
result.username = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'firstName':
result.firstName = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'lastName':
result.lastName = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'email':
result.email = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'password':
result.password = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'phone':
result.phone = serializers.deserialize(value,
specifiedType: const FullType(String)) as String;
break;
case r'userStatus':
result.userStatus = serializers.deserialize(value,
specifiedType: const FullType(int)) as int;
break;
}
}
return result.build();
}
return result.build();
}
}

View File

@ -41,12 +41,6 @@
</execution>
<execution>
<id>format</id>
<!--
This needs to run before the build_runner so that we don't
format by build_runner generated files.
This should fail the build if there are format changes but
requires https://github.com/dart-lang/sdk/issues/44582 to be fixed.
-->
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
@ -55,7 +49,11 @@
<executable>dart</executable>
<arguments>
<argument>format</argument>
<argument>--set-exit-if-changed</argument>
<!--
Need to format first so that analyze can be run later.
But can not break the build with set-exit-if-changed
since sample files are not formatted.
-->
<argument>--output=none</argument>
<argument>.</argument>
</arguments>