create static method

ContentAds create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "contentAds",
  3. String? ads_unique_id,
  4. String? content_type,
  5. List<String>? medias,
  6. String? caption,
  7. List<List<InlineKeyboard>>? inline_keyboard,
})
override

Generated

Implementation

static ContentAds create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "contentAds",
  String? ads_unique_id,
  String? content_type,
  List<String>? medias,
  String? caption,
  List<List<InlineKeyboard>>? inline_keyboard,
}) {
  // ContentAds contentAds = ContentAds({
  final Map contentAds_data_create_json = {
    "@type": special_type,
    "ads_unique_id": ads_unique_id,
    "content_type": content_type,
    "medias": medias,
    "caption": caption,
    "inline_keyboard": (inline_keyboard != null)
        ? inline_keyboard
            .map((res) => res.map((e) => e.toJson()).toList().cast<Map>())
            .toList()
            .cast<List<Map>>()
        : null,
  };

  contentAds_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (contentAds_data_create_json.containsKey(key) == false) {
        contentAds_data_create_json[key] = value;
      }
    });
  }
  return ContentAds(contentAds_data_create_json);
}