fromJson static method

MessageSendOptions? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static MessageSendOptions? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return MessageSendOptions(
    suggestedPostInfo: InputSuggestedPostInfo.fromJson(
      tdMapFromJson(json['suggested_post_info']),
    ),
    disableNotification: (json['disable_notification'] as bool?) ?? false,
    fromBackground: (json['from_background'] as bool?) ?? false,
    protectContent: (json['protect_content'] as bool?),
    allowPaidBroadcast: (json['allow_paid_broadcast'] as bool?),
    paidMessageStarCount: (json['paid_message_star_count'] as int?) ?? 0,
    updateOrderOfInstalledStickerSets:
        (json['update_order_of_installed_sticker_sets'] as bool?) ?? false,
    schedulingState: MessageSchedulingState.fromJson(
      tdMapFromJson(json['scheduling_state']),
    ),
    effectId:
        int.tryParse((json['effect_id'] as dynamic)?.toString() ?? '') ?? 0,
    sendingId: (json['sending_id'] as int?) ?? 0,
    onlyPreview: (json['only_preview'] as bool?) ?? false,
  );
}