Skip to content

Commit

Permalink
chore(dynamite_petstore_example): regenerate specs
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolas Rimikis <[email protected]>
  • Loading branch information
Leptopoda committed Nov 16, 2023
1 parent 6ce1a27 commit 82ae490
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 92 deletions.
112 changes: 110 additions & 2 deletions packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,65 @@ abstract class NewPet implements NewPetInterface, Built<NewPet, NewPetBuilder> {
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end

static Serializer<NewPet> get serializer => _$newPetSerializer;
@BuiltValueSerializer(custom: true)
static Serializer<NewPet> get serializer => _$NewPetSerializer();
}

class _$NewPetSerializer implements StructuredSerializer<NewPet> {
const _$NewPetSerializer();

@override
Iterable<Type> get types => const [NewPet, _$NewPet];

@override
String get wireName => r'NewPet';

@override
Iterable<Object?> serialize(
Serializers serializers,
NewPet object, {
FullType specifiedType = FullType.unspecified,
}) {
final result = <Object?>[
'name',
serializers.serialize(object.name, specifiedType: const FullType(String)),
];
Object? value;
value = object.tag;
if (value != null) {
result
..add('tag')
..add(
serializers.serialize(value, specifiedType: const FullType(String)),
);
}

return result;
}

@override
NewPet deserialize(
Serializers serializers,
Iterable<Object?> serialized, {
FullType specifiedType = FullType.unspecified,
}) {
final result = NewPetBuilder();

final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current! as String;
iterator.moveNext();
final value = iterator.current;
switch (key) {
case 'name':
result.name = (serializers.deserialize(value, specifiedType: const FullType(String))! as String);
case 'tag':
result.tag = (serializers.deserialize(value, specifiedType: const FullType(String)) as String);
}
}

return result.build();
}
}

@BuiltValue(instantiable: false)
Expand Down Expand Up @@ -377,7 +435,57 @@ abstract class Error implements ErrorInterface, Built<Error, ErrorBuilder> {
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end

static Serializer<Error> get serializer => _$errorSerializer;
@BuiltValueSerializer(custom: true)
static Serializer<Error> get serializer => _$ErrorSerializer();
}

class _$ErrorSerializer implements StructuredSerializer<Error> {
const _$ErrorSerializer();

@override
Iterable<Type> get types => const [Error, _$Error];

@override
String get wireName => r'Error';

@override
Iterable<Object?> serialize(
Serializers serializers,
Error object, {
FullType specifiedType = FullType.unspecified,
}) {
final result = <Object?>[
'code',
serializers.serialize(object.code, specifiedType: const FullType(int)),
'message',
serializers.serialize(object.message, specifiedType: const FullType(String)),
];
return result;
}

@override
Error deserialize(
Serializers serializers,
Iterable<Object?> serialized, {
FullType specifiedType = FullType.unspecified,
}) {
final result = ErrorBuilder();

final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current! as String;
iterator.moveNext();
final value = iterator.current;
switch (key) {
case 'code':
result.code = (serializers.deserialize(value, specifiedType: const FullType(int))! as int);
case 'message':
result.message = (serializers.deserialize(value, specifiedType: const FullType(String))! as String);
}
}

return result.build();
}
}

// coverage:ignore-start
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 82ae490

Please sign in to comment.