HttpRetryPolicy.fromJson constructor

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

Implementation

factory HttpRetryPolicy.fromJson(Map<String, dynamic> json) {
  return HttpRetryPolicy(
    maxRetries: json['maxRetries'] as int,
    perRetryTimeout:
        Duration.fromJson(json['perRetryTimeout'] as Map<String, dynamic>),
    httpRetryEvents: (json['httpRetryEvents'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    tcpRetryEvents: (json['tcpRetryEvents'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toTcpRetryPolicyEvent())
        .toList(),
  );
}