MessagePart.fromJson constructor

MessagePart.fromJson(
  1. Map json_
)

Implementation

MessagePart.fromJson(core.Map json_)
    : this(
        body: json_.containsKey('body')
            ? MessagePartBody.fromJson(
                json_['body'] as core.Map<core.String, core.dynamic>)
            : null,
        filename: json_.containsKey('filename')
            ? json_['filename'] as core.String
            : null,
        headers: json_.containsKey('headers')
            ? (json_['headers'] as core.List)
                .map((value) => MessagePartHeader.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
        mimeType: json_.containsKey('mimeType')
            ? json_['mimeType'] as core.String
            : null,
        partId: json_.containsKey('partId')
            ? json_['partId'] as core.String
            : null,
        parts: json_.containsKey('parts')
            ? (json_['parts'] as core.List)
                .map((value) => MessagePart.fromJson(
                    value as core.Map<core.String, core.dynamic>))
                .toList()
            : null,
      );