BillingPortalSession.fromJson constructor

BillingPortalSession.fromJson(
  1. Object? json
)

Implementation

factory BillingPortalSession.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return BillingPortalSession(
    configuration:
        BillingPortalConfigurationOrId.fromJson(map['configuration']),
    created:
        DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
    customer: (map['customer'] as String),
    flow: map['flow'] == null
        ? null
        : BillingPortalSessionFlow.fromJson(map['flow']),
    id: (map['id'] as String),
    livemode: (map['livemode'] as bool),
    locale: map['locale'] == null
        ? null
        : BillingPortalSessionLocale.fromJson(map['locale']),
    onBehalfOf:
        map['on_behalf_of'] == null ? null : (map['on_behalf_of'] as String),
    returnUrl:
        map['return_url'] == null ? null : (map['return_url'] as String),
    url: (map['url'] as String),
  );
}