// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'slack_data.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

DataSlack _$DataSlackFromJson(Map<String, dynamic> json) => DataSlack(
      json['channel'] as String,
    )
      ..text = json['text'] as String?
      ..blocks = (json['blocks'] as List<dynamic>?)
          ?.map((e) => SlackBlock.fromJson(e as Map<String, dynamic>))
          .toList()
      ..attachments = (json['attachments'] as List<dynamic>?)
          ?.map((e) => SlackAttachment.fromJson(e as Map<String, dynamic>))
          .toList()
      ..link_names = json['link_names'] as bool?;

Map<String, dynamic> _$DataSlackToJson(DataSlack instance) => <String, dynamic>{
      'channel': instance.channel,
      'text': instance.text,
      'blocks': instance.blocks,
      'attachments': instance.attachments,
      'link_names': instance.link_names,
    };

SlackBlock _$SlackBlockFromJson(Map<String, dynamic> json) => SlackBlock()
  ..type = $enumDecode(_$SlackBlockTypeEnumMap, json['type'])
  ..block_id = json['block_id'] as String?;

Map<String, dynamic> _$SlackBlockToJson(SlackBlock instance) =>
    <String, dynamic>{
      'type': _$SlackBlockTypeEnumMap[instance.type]!,
      'block_id': instance.block_id,
    };

const _$SlackBlockTypeEnumMap = {
  SlackBlockType.header: 'header',
  SlackBlockType.section: 'section',
  SlackBlockType.divider: 'divider',
  SlackBlockType.actions: 'actions',
};

SlackBlockHeader _$SlackBlockHeaderFromJson(Map<String, dynamic> json) =>
    SlackBlockHeader()
      ..type = $enumDecode(_$SlackBlockTypeEnumMap, json['type'])
      ..block_id = json['block_id'] as String?
      ..text = json['text'] == null
          ? null
          : SlackBlockText.fromJson(json['text'] as Map<String, dynamic>);

Map<String, dynamic> _$SlackBlockHeaderToJson(SlackBlockHeader instance) =>
    <String, dynamic>{
      'type': _$SlackBlockTypeEnumMap[instance.type]!,
      'block_id': instance.block_id,
      'text': instance.text,
    };

SlackBlockSection _$SlackBlockSectionFromJson(Map<String, dynamic> json) =>
    SlackBlockSection()
      ..type = $enumDecode(_$SlackBlockTypeEnumMap, json['type'])
      ..block_id = json['block_id'] as String?
      ..text = json['text'] == null
          ? null
          : SlackBlockText.fromJson(json['text'] as Map<String, dynamic>)
      ..fields = (json['fields'] as List<dynamic>?)
          ?.map((e) => SlackBlockText.fromJson(e as Map<String, dynamic>))
          .toList()
      ..accessory = json['accessory'] == null
          ? null
          : SlackAccessory.fromJson(json['accessory'] as Map<String, dynamic>);

Map<String, dynamic> _$SlackBlockSectionToJson(SlackBlockSection instance) =>
    <String, dynamic>{
      'type': _$SlackBlockTypeEnumMap[instance.type]!,
      'block_id': instance.block_id,
      'text': instance.text,
      'fields': instance.fields,
      'accessory': instance.accessory,
    };

SlackAccessory _$SlackAccessoryFromJson(Map<String, dynamic> json) =>
    SlackAccessory()
      ..type = $enumDecode(_$SlackActionTypeEnumMap, json['type'])
      ..text = json['text'] == null
          ? null
          : SlackBlockText.fromJson(json['text'] as Map<String, dynamic>)
      ..image_url = json['image_url'] as String?
      ..alt_text = json['alt_text'] as String?
      ..value = json['value'] as String?
      ..url = json['url'] as String?;

Map<String, dynamic> _$SlackAccessoryToJson(SlackAccessory instance) =>
    <String, dynamic>{
      'type': _$SlackActionTypeEnumMap[instance.type]!,
      'text': instance.text,
      'image_url': instance.image_url,
      'alt_text': instance.alt_text,
      'value': instance.value,
      'url': instance.url,
    };

const _$SlackActionTypeEnumMap = {
  SlackActionType.button: 'button',
  SlackActionType.select: 'select',
  SlackActionType.image: 'image',
};

SlackBlockText _$SlackBlockTextFromJson(Map<String, dynamic> json) =>
    SlackBlockText()
      ..type = $enumDecode(_$SlackTextTypeEnumMap, json['type'])
      ..text = json['text'] as String?
      ..emoji = json['emoji'] as bool?;

Map<String, dynamic> _$SlackBlockTextToJson(SlackBlockText instance) =>
    <String, dynamic>{
      'type': _$SlackTextTypeEnumMap[instance.type]!,
      'text': instance.text,
      'emoji': instance.emoji,
    };

const _$SlackTextTypeEnumMap = {
  SlackTextType.mrkdwn: 'mrkdwn',
  SlackTextType.plain_text: 'plain_text',
};

SlackAttachment _$SlackAttachmentFromJson(Map<String, dynamic> json) =>
    SlackAttachment()
      ..fallback = json['fallback'] as String?
      ..color = json['color'] as String?
      ..author_name = json['author_name'] as String?
      ..author_link = json['author_link'] as String?
      ..author_icon = json['author_icon'] as String?
      ..title = json['title'] as String?
      ..title_link = json['title_link'] as String?
      ..pretext = json['pretext'] as String?
      ..text = json['text'] as String?
      ..image_url = json['image_url'] as String?
      ..thumb_url = json['thumb_url'] as String?
      ..footer = json['footer'] as String?
      ..footer_icon = json['footer_icon'] as String?
      ..ts = json['ts'] as String?
      ..blocks = (json['blocks'] as List<dynamic>?)
          ?.map((e) => SlackBlock.fromJson(e as Map<String, dynamic>))
          .toList()
      ..fields = (json['fields'] as List<dynamic>?)
          ?.map((e) => SlackField.fromJson(e as Map<String, dynamic>))
          .toList()
      ..actions = (json['actions'] as List<dynamic>?)
          ?.map((e) => SlackAction.fromJson(e as Map<String, dynamic>))
          .toList();

Map<String, dynamic> _$SlackAttachmentToJson(SlackAttachment instance) =>
    <String, dynamic>{
      'fallback': instance.fallback,
      'color': instance.color,
      'author_name': instance.author_name,
      'author_link': instance.author_link,
      'author_icon': instance.author_icon,
      'title': instance.title,
      'title_link': instance.title_link,
      'pretext': instance.pretext,
      'text': instance.text,
      'image_url': instance.image_url,
      'thumb_url': instance.thumb_url,
      'footer': instance.footer,
      'footer_icon': instance.footer_icon,
      'ts': instance.ts,
      'blocks': instance.blocks,
      'fields': instance.fields,
      'actions': instance.actions,
    };

SlackField _$SlackFieldFromJson(Map<String, dynamic> json) => SlackField()
  ..title = json['title'] as String?
  ..value = json['value'] as String?
  ..short = json['short'] as bool?;

Map<String, dynamic> _$SlackFieldToJson(SlackField instance) =>
    <String, dynamic>{
      'title': instance.title,
      'value': instance.value,
      'short': instance.short,
    };

SlackAction _$SlackActionFromJson(Map<String, dynamic> json) => SlackAction()
  ..type = $enumDecodeNullable(_$SlackActionTypeEnumMap, json['type'])
  ..name = json['name'] as String?
  ..text = json['text'] as String?
  ..url = json['url'] as String?
  ..value = json['value'] as String?
  ..style = $enumDecodeNullable(_$SlackActionStyleEnumMap, json['style']);

Map<String, dynamic> _$SlackActionToJson(SlackAction instance) =>
    <String, dynamic>{
      'type': _$SlackActionTypeEnumMap[instance.type],
      'name': instance.name,
      'text': instance.text,
      'url': instance.url,
      'value': instance.value,
      'style': _$SlackActionStyleEnumMap[instance.style],
    };

const _$SlackActionStyleEnumMap = {
  SlackActionStyle.danger: 'danger',
  SlackActionStyle.primary: 'primary',
};

SlackConfirm _$SlackConfirmFromJson(Map<String, dynamic> json) => SlackConfirm()
  ..title = json['title'] as String?
  ..text = json['text'] as String?
  ..ok_text = json['ok_text'] as String?
  ..dismiss_text = json['dismiss_text'] as String?;

Map<String, dynamic> _$SlackConfirmToJson(SlackConfirm instance) =>
    <String, dynamic>{
      'title': instance.title,
      'text': instance.text,
      'ok_text': instance.ok_text,
      'dismiss_text': instance.dismiss_text,
    };
