SourceTypeKlarna.fromJson constructor

SourceTypeKlarna.fromJson(
  1. Object? json
)

Implementation

factory SourceTypeKlarna.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return SourceTypeKlarna(
    backgroundImageUrl: map['background_image_url'] == null
        ? null
        : (map['background_image_url'] as String),
    clientToken:
        map['client_token'] == null ? null : (map['client_token'] as String),
    firstName:
        map['first_name'] == null ? null : (map['first_name'] as String),
    lastName: map['last_name'] == null ? null : (map['last_name'] as String),
    locale: map['locale'] == null ? null : (map['locale'] as String),
    logoUrl: map['logo_url'] == null ? null : (map['logo_url'] as String),
    pageTitle:
        map['page_title'] == null ? null : (map['page_title'] as String),
    payLaterAssetUrlsDescriptive:
        map['pay_later_asset_urls_descriptive'] == null
            ? null
            : (map['pay_later_asset_urls_descriptive'] as String),
    payLaterAssetUrlsStandard: map['pay_later_asset_urls_standard'] == null
        ? null
        : (map['pay_later_asset_urls_standard'] as String),
    payLaterName: map['pay_later_name'] == null
        ? null
        : (map['pay_later_name'] as String),
    payLaterRedirectUrl: map['pay_later_redirect_url'] == null
        ? null
        : (map['pay_later_redirect_url'] as String),
    payNowAssetUrlsDescriptive: map['pay_now_asset_urls_descriptive'] == null
        ? null
        : (map['pay_now_asset_urls_descriptive'] as String),
    payNowAssetUrlsStandard: map['pay_now_asset_urls_standard'] == null
        ? null
        : (map['pay_now_asset_urls_standard'] as String),
    payNowName:
        map['pay_now_name'] == null ? null : (map['pay_now_name'] as String),
    payNowRedirectUrl: map['pay_now_redirect_url'] == null
        ? null
        : (map['pay_now_redirect_url'] as String),
    payOverTimeAssetUrlsDescriptive:
        map['pay_over_time_asset_urls_descriptive'] == null
            ? null
            : (map['pay_over_time_asset_urls_descriptive'] as String),
    payOverTimeAssetUrlsStandard:
        map['pay_over_time_asset_urls_standard'] == null
            ? null
            : (map['pay_over_time_asset_urls_standard'] as String),
    payOverTimeName: map['pay_over_time_name'] == null
        ? null
        : (map['pay_over_time_name'] as String),
    payOverTimeRedirectUrl: map['pay_over_time_redirect_url'] == null
        ? null
        : (map['pay_over_time_redirect_url'] as String),
    paymentMethodCategories: map['payment_method_categories'] == null
        ? null
        : (map['payment_method_categories'] as String),
    purchaseCountry: map['purchase_country'] == null
        ? null
        : (map['purchase_country'] as String),
    purchaseType: map['purchase_type'] == null
        ? null
        : (map['purchase_type'] as String),
    redirectUrl:
        map['redirect_url'] == null ? null : (map['redirect_url'] as String),
    shippingDelay: map['shipping_delay'] == null
        ? null
        : (map['shipping_delay'] as num).toInt(),
    shippingFirstName: map['shipping_first_name'] == null
        ? null
        : (map['shipping_first_name'] as String),
    shippingLastName: map['shipping_last_name'] == null
        ? null
        : (map['shipping_last_name'] as String),
  );
}