decode static method

ApiHttpRequest? decode(
  1. dynamic json
)

Implementation

static ApiHttpRequest? decode(dynamic json) {
  if (json == null) {
    return null;
  }
  if (json is! Map<String, dynamic>) {
    return null;
  }

  return ApiHttpRequest(
    url: StringDecoder.decode(json['url']),
    method: ApiHttpRequestMethodExtension.decode(json['method']),
    headers: ListDecoder.decode(
        json['headers'], (element) => ApiHttpHeader.decode(element)),
    body: StringDecoder.decode(json['body']),
  );
}