ForwardingRequest.fromJson constructor
ForwardingRequest.fromJson(
- Object? json
Implementation
factory ForwardingRequest.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return ForwardingRequest(
config: (map['config'] as String),
created:
DateTime.fromMillisecondsSinceEpoch((map['created'] as int).toInt()),
id: (map['id'] as String),
livemode: (map['livemode'] as bool),
paymentMethod: (map['payment_method'] as String),
replacements: (map['replacements'] as List<Object?>)
.map((el) => ForwardingRequestReplacementsItem.fromJson(el))
.toList(),
requestContext: map['request_context'] == null
? null
: ForwardedRequestContext.fromJson(map['request_context']),
requestDetails: map['request_details'] == null
? null
: ForwardedRequestDetails.fromJson(map['request_details']),
responseDetails: map['response_details'] == null
? null
: ForwardedResponseDetails.fromJson(map['response_details']),
url: map['url'] == null ? null : (map['url'] as String),
);
}