CookieIssueDetails.fromJson constructor

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

Implementation

factory CookieIssueDetails.fromJson(Map<String, dynamic> json) {
  return CookieIssueDetails(
    cookie:
        json.containsKey('cookie')
            ? AffectedCookie.fromJson(json['cookie'] as Map<String, dynamic>)
            : null,
    rawCookieLine:
        json.containsKey('rawCookieLine')
            ? json['rawCookieLine'] as String
            : null,
    cookieWarningReasons:
        (json['cookieWarningReasons'] as List)
            .map((e) => CookieWarningReason.fromJson(e as String))
            .toList(),
    cookieExclusionReasons:
        (json['cookieExclusionReasons'] as List)
            .map((e) => CookieExclusionReason.fromJson(e as String))
            .toList(),
    operation: CookieOperation.fromJson(json['operation'] as String),
    siteForCookies:
        json.containsKey('siteForCookies')
            ? json['siteForCookies'] as String
            : null,
    cookieUrl:
        json.containsKey('cookieUrl') ? json['cookieUrl'] as String : null,
    request:
        json.containsKey('request')
            ? AffectedRequest.fromJson(
              json['request'] as Map<String, dynamic>,
            )
            : null,
  );
}