TF-561 Fix edit identity
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:model/identity/identity_request_dto.dart';
|
||||
|
||||
extension IdentityExtension on Identity {
|
||||
EmailAddress toEmailAddressNoName() => EmailAddress(null, email);
|
||||
|
||||
IdentityRequestDto toIdentityRequest() => IdentityRequestDto(
|
||||
name: name,
|
||||
replyTo: replyTo,
|
||||
bcc: bcc,
|
||||
textSignature: textSignature,
|
||||
htmlSignature: htmlSignature);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:jmap_dart_client/http/converter/identities/identity_id_nullable_converter.dart';
|
||||
import 'package:jmap_dart_client/http/converter/identities/signature_nullable_converter.dart';
|
||||
import 'package:jmap_dart_client/jmap/identities/identity.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_address.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'identity_request_dto.g.dart';
|
||||
|
||||
@IdentityIdNullableConverter()
|
||||
@SignatureNullableConverter()
|
||||
@JsonSerializable()
|
||||
class IdentityRequestDto with EquatableMixin {
|
||||
|
||||
@JsonKey(includeIfNull: false)
|
||||
final String? name;
|
||||
|
||||
@JsonKey(includeIfNull: false)
|
||||
final Set<EmailAddress>? bcc;
|
||||
|
||||
@JsonKey(includeIfNull: false)
|
||||
final Set<EmailAddress>? replyTo;
|
||||
|
||||
@JsonKey(includeIfNull: false)
|
||||
final Signature? textSignature;
|
||||
|
||||
@JsonKey(includeIfNull: false)
|
||||
final Signature? htmlSignature;
|
||||
|
||||
IdentityRequestDto({
|
||||
this.name,
|
||||
this.bcc,
|
||||
this.replyTo,
|
||||
this.textSignature,
|
||||
this.htmlSignature,
|
||||
});
|
||||
|
||||
factory IdentityRequestDto.fromJson(Map<String, dynamic> json) => _$IdentityRequestDtoFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$IdentityRequestDtoToJson(this);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
name,
|
||||
bcc,
|
||||
replyTo,
|
||||
textSignature,
|
||||
htmlSignature,
|
||||
];
|
||||
}
|
||||
@@ -56,6 +56,7 @@ export 'extensions/list_attachment_extension.dart';
|
||||
export 'extensions/list_presentation_email_extension.dart';
|
||||
export 'extensions/list_email_content_extension.dart';
|
||||
export 'extensions/list_identities_extension.dart';
|
||||
export 'extensions/identity_extension.dart';
|
||||
|
||||
// Download
|
||||
export 'download/download_task_id.dart';
|
||||
@@ -70,4 +71,7 @@ export 'upload/upload_request.dart';
|
||||
export 'upload/upload_response.dart';
|
||||
|
||||
// AutoComplete
|
||||
export 'autocomplete/auto_complete_pattern.dart';
|
||||
export 'autocomplete/auto_complete_pattern.dart';
|
||||
|
||||
// Identity
|
||||
export 'identity/identity_request_dto.dart';
|
||||
Reference in New Issue
Block a user