001package Torello.Browser.BrowserAPI; 002 003import java.util.*; 004import javax.json.*; 005import javax.json.stream.*; 006import java.io.*; 007 008import java.lang.reflect.Method; 009import java.lang.reflect.Parameter; 010import java.util.function.Function; 011 012import Torello.Browser.BrowserEvent; 013import Torello.Browser.JavaScriptAPI.*; 014import Torello.Browser.helper.*; 015 016import Torello.Java.Additional.*; 017import Torello.Java.JSON.*; 018 019import static Torello.Java.JSON.JFlag.*; 020 021import Torello.Java.StrCmpr; 022import Torello.JavaDoc.StaticFunctional; 023import Torello.JavaDoc.JDHeaderBackgroundImg; 024import Torello.JavaDoc.Excuse; 025 026/** 027 * <SPAN CLASS=COPIEDJDK><B>Audits domain allows investigation of page violations and possible improvements.</B></SPAN> 028 * 029 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE> 030 */ 031@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION}) 032@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE") 033public class Audits 034{ 035 // ******************************************************************************************** 036 // ******************************************************************************************** 037 // Class Header Stuff 038 // ******************************************************************************************** 039 // ******************************************************************************************** 040 041 042 // No Pubic Constructors 043 private Audits () { } 044 045 // These two Vector's are used by all the "Methods" exported by this class. java.lang.reflect 046 // is used to generate the JSON String's. It saves thousands of lines of Auto-Generated Code. 047 private static final Map<String, Vector<String>> parameterNames = new HashMap<>(); 048 private static final Map<String, Vector<Class<?>>> parameterTypes = new HashMap<>(); 049 050 // Some Methods do not take any parameters - for instance all the "enable()" and "disable()" 051 // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now, 052 // offically, two empty-vectors. One for String's, and the other for Classes. 053 054 private static final Vector<String> EMPTY_VEC_STR = new Vector<>(); 055 private static final Vector<Class<?>> EMPTY_VEC_CLASS = new Vector<>(); 056 057 static 058 { 059 for (Method m : Audits.class.getMethods()) 060 { 061 // This doesn't work! The parameter names are all "arg0" ... "argN" 062 // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter! 063 // 064 // Vector<String> parameterNamesList = new Vector<>(); -- NOPE! 065 066 Vector<Class<?>> parameterTypesList = new Vector<>(); 067 068 for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType()); 069 070 parameterTypes.put( 071 m.getName(), 072 (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS 073 ); 074 } 075 } 076 077 static 078 { 079 Vector<String> v = null; 080 081 v = new Vector<String>(4); 082 parameterNames.put("getEncodedResponse", v); 083 Collections.addAll(v, new String[] 084 { "requestId", "encoding", "quality", "sizeOnly", }); 085 086 parameterNames.put("disable", EMPTY_VEC_STR); 087 088 parameterNames.put("enable", EMPTY_VEC_STR); 089 090 v = new Vector<String>(1); 091 parameterNames.put("checkContrast", v); 092 Collections.addAll(v, new String[] 093 { "reportAAA", }); 094 095 parameterNames.put("checkFormsIssues", EMPTY_VEC_STR); 096 } 097 098 099 // ******************************************************************************************** 100 // ******************************************************************************************** 101 // Types - Static Inner Classes 102 // ******************************************************************************************** 103 // ******************************************************************************************** 104 105 // public static class IssueId => String 106 107 /** <CODE>[No Description Provided by Google]</CODE> */ 108 public static final String[] CookieExclusionReason = 109 { 110 "ExcludeSameSiteUnspecifiedTreatedAsLax", "ExcludeSameSiteNoneInsecure", 111 "ExcludeSameSiteLax", "ExcludeSameSiteStrict", "ExcludeInvalidSameParty", 112 "ExcludeSamePartyCrossPartyContext", "ExcludeDomainNonASCII", 113 "ExcludeThirdPartyCookieBlockedInFirstPartySet", "ExcludeThirdPartyPhaseout", 114 "ExcludePortMismatch", "ExcludeSchemeMismatch", 115 }; 116 117 /** <CODE>[No Description Provided by Google]</CODE> */ 118 public static final String[] CookieWarningReason = 119 { 120 "WarnSameSiteUnspecifiedCrossSiteContext", "WarnSameSiteNoneInsecure", 121 "WarnSameSiteUnspecifiedLaxAllowUnsafe", "WarnSameSiteStrictLaxDowngradeStrict", 122 "WarnSameSiteStrictCrossDowngradeStrict", "WarnSameSiteStrictCrossDowngradeLax", 123 "WarnSameSiteLaxCrossDowngradeStrict", "WarnSameSiteLaxCrossDowngradeLax", 124 "WarnAttributeValueExceedsMaxSize", "WarnDomainNonASCII", "WarnThirdPartyPhaseout", 125 "WarnCrossSiteRedirectDowngradeChangesInclusion", "WarnDeprecationTrialMetadata", 126 "WarnThirdPartyCookieHeuristic", 127 }; 128 129 /** <CODE>[No Description Provided by Google]</CODE> */ 130 public static final String[] CookieOperation = 131 { "SetCookie", "ReadCookie", }; 132 133 /** Represents the category of insight that a cookie issue falls under. */ 134 public static final String[] InsightType = 135 { "GitHubResource", "GracePeriod", "Heuristics", }; 136 137 /** <CODE>[No Description Provided by Google]</CODE> */ 138 public static final String[] MixedContentResolutionStatus = 139 { "MixedContentBlocked", "MixedContentAutomaticallyUpgraded", "MixedContentWarning", }; 140 141 /** <CODE>[No Description Provided by Google]</CODE> */ 142 public static final String[] MixedContentResourceType = 143 { 144 "AttributionSrc", "Audio", "Beacon", "CSPReport", "Download", "EventSource", "Favicon", 145 "Font", "Form", "Frame", "Image", "Import", "JSON", "Manifest", "Ping", "PluginData", 146 "PluginResource", "Prefetch", "Resource", "Script", "ServiceWorker", "SharedWorker", 147 "SpeculationRules", "Stylesheet", "Track", "Video", "Worker", "XMLHttpRequest", "XSLT", 148 }; 149 150 /** 151 * Enum indicating the reason a response has been blocked. These reasons are 152 * refinements of the net error BLOCKED_BY_RESPONSE. 153 */ 154 public static final String[] BlockedByResponseReason = 155 { 156 "CoepFrameResourceNeedsCoepHeader", "CoopSandboxedIFrameCannotNavigateToCoopPage", 157 "CorpNotSameOrigin", "CorpNotSameOriginAfterDefaultedToSameOriginByCoep", 158 "CorpNotSameOriginAfterDefaultedToSameOriginByDip", 159 "CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip", "CorpNotSameSite", 160 "SRIMessageSignatureMismatch", 161 }; 162 163 /** <CODE>[No Description Provided by Google]</CODE> */ 164 public static final String[] HeavyAdResolutionStatus = 165 { "HeavyAdBlocked", "HeavyAdWarning", }; 166 167 /** <CODE>[No Description Provided by Google]</CODE> */ 168 public static final String[] HeavyAdReason = 169 { "NetworkTotalLimit", "CpuTotalLimit", "CpuPeakLimit", }; 170 171 /** <CODE>[No Description Provided by Google]</CODE> */ 172 public static final String[] ContentSecurityPolicyViolationType = 173 { 174 "kInlineViolation", "kEvalViolation", "kURLViolation", "kSRIViolation", 175 "kTrustedTypesSinkViolation", "kTrustedTypesPolicyViolation", "kWasmEvalViolation", 176 }; 177 178 /** <CODE>[No Description Provided by Google]</CODE> */ 179 public static final String[] SharedArrayBufferIssueType = 180 { "TransferIssue", "CreationIssue", }; 181 182 /** <CODE>[No Description Provided by Google]</CODE> */ 183 public static final String[] AttributionReportingIssueType = 184 { 185 "PermissionPolicyDisabled", "UntrustworthyReportingOrigin", "InsecureContext", 186 "InvalidHeader", "InvalidRegisterTriggerHeader", "SourceAndTriggerHeaders", 187 "SourceIgnored", "TriggerIgnored", "OsSourceIgnored", "OsTriggerIgnored", 188 "InvalidRegisterOsSourceHeader", "InvalidRegisterOsTriggerHeader", "WebAndOsHeaders", 189 "NoWebOrOsSupport", "NavigationRegistrationWithoutTransientUserActivation", 190 "InvalidInfoHeader", "NoRegisterSourceHeader", "NoRegisterTriggerHeader", 191 "NoRegisterOsSourceHeader", "NoRegisterOsTriggerHeader", 192 "NavigationRegistrationUniqueScopeAlreadySet", 193 }; 194 195 /** <CODE>[No Description Provided by Google]</CODE> */ 196 public static final String[] SharedDictionaryError = 197 { 198 "UseErrorCrossOriginNoCorsRequest", "UseErrorDictionaryLoadFailure", 199 "UseErrorMatchingDictionaryNotUsed", "UseErrorUnexpectedContentDictionaryHeader", 200 "WriteErrorCossOriginNoCorsRequest", "WriteErrorDisallowedBySettings", 201 "WriteErrorExpiredResponse", "WriteErrorFeatureDisabled", 202 "WriteErrorInsufficientResources", "WriteErrorInvalidMatchField", 203 "WriteErrorInvalidStructuredHeader", "WriteErrorNavigationRequest", 204 "WriteErrorNoMatchField", "WriteErrorNonListMatchDestField", "WriteErrorNonSecureContext", 205 "WriteErrorNonStringIdField", "WriteErrorNonStringInMatchDestList", 206 "WriteErrorNonStringMatchField", "WriteErrorNonTokenTypeField", "WriteErrorRequestAborted", 207 "WriteErrorShuttingDown", "WriteErrorTooLongIdField", "WriteErrorUnsupportedType", 208 }; 209 210 /** <CODE>[No Description Provided by Google]</CODE> */ 211 public static final String[] SRIMessageSignatureError = 212 { 213 "MissingSignatureHeader", "MissingSignatureInputHeader", "InvalidSignatureHeader", 214 "InvalidSignatureInputHeader", "SignatureHeaderValueIsNotByteSequence", 215 "SignatureHeaderValueIsParameterized", "SignatureHeaderValueIsIncorrectLength", 216 "SignatureInputHeaderMissingLabel", "SignatureInputHeaderValueNotInnerList", 217 "SignatureInputHeaderValueMissingComponents", "SignatureInputHeaderInvalidComponentType", 218 "SignatureInputHeaderInvalidComponentName", 219 "SignatureInputHeaderInvalidHeaderComponentParameter", 220 "SignatureInputHeaderInvalidDerivedComponentParameter", "SignatureInputHeaderKeyIdLength", 221 "SignatureInputHeaderInvalidParameter", "SignatureInputHeaderMissingRequiredParameters", 222 "ValidationFailedSignatureExpired", "ValidationFailedInvalidLength", 223 "ValidationFailedSignatureMismatch", "ValidationFailedIntegrityMismatch", 224 }; 225 226 /** <CODE>[No Description Provided by Google]</CODE> */ 227 public static final String[] UnencodedDigestError = 228 { 229 "MalformedDictionary", "UnknownAlgorithm", "IncorrectDigestType", "IncorrectDigestLength", 230 }; 231 232 /** <CODE>[No Description Provided by Google]</CODE> */ 233 public static final String[] GenericIssueErrorType = 234 { 235 "FormLabelForNameError", "FormDuplicateIdForInputError", "FormInputWithNoLabelError", 236 "FormAutocompleteAttributeEmptyError", "FormEmptyIdAndNameAttributesForInputError", 237 "FormAriaLabelledByToNonExistingId", 238 "FormInputAssignedAutocompleteValueToIdOrNameAttributeError", 239 "FormLabelHasNeitherForNorNestedInput", "FormLabelForMatchesNonExistingIdError", 240 "FormInputHasWrongButWellIntendedAutocompleteValueError", "ResponseWasBlockedByORB", 241 }; 242 243 /** <CODE>[No Description Provided by Google]</CODE> */ 244 public static final String[] ClientHintIssueReason = 245 { "MetaTagAllowListInvalidOrigin", "MetaTagModifiedHTML", }; 246 247 /** 248 * Represents the failure reason when a federated authentication reason fails. 249 * Should be updated alongside RequestIdTokenStatus in 250 * third_party/blink/public/mojom/devtools/inspector_issue.mojom to include 251 * all cases except for success. 252 */ 253 public static final String[] FederatedAuthRequestIssueReason = 254 { 255 "ShouldEmbargo", "TooManyRequests", "WellKnownHttpNotFound", "WellKnownNoResponse", 256 "WellKnownInvalidResponse", "WellKnownListEmpty", "WellKnownInvalidContentType", 257 "ConfigNotInWellKnown", "WellKnownTooBig", "ConfigHttpNotFound", "ConfigNoResponse", 258 "ConfigInvalidResponse", "ConfigInvalidContentType", "ClientMetadataHttpNotFound", 259 "ClientMetadataNoResponse", "ClientMetadataInvalidResponse", 260 "ClientMetadataInvalidContentType", "IdpNotPotentiallyTrustworthy", "DisabledInSettings", 261 "DisabledInFlags", "ErrorFetchingSignin", "InvalidSigninResponse", "AccountsHttpNotFound", 262 "AccountsNoResponse", "AccountsInvalidResponse", "AccountsListEmpty", 263 "AccountsInvalidContentType", "IdTokenHttpNotFound", "IdTokenNoResponse", 264 "IdTokenInvalidResponse", "IdTokenIdpErrorResponse", "IdTokenCrossSiteIdpErrorResponse", 265 "IdTokenInvalidRequest", "IdTokenInvalidContentType", "ErrorIdToken", "Canceled", 266 "RpPageNotVisible", "SilentMediationFailure", "ThirdPartyCookiesBlocked", 267 "NotSignedInWithIdp", "MissingTransientUserActivation", "ReplacedByActiveMode", 268 "InvalidFieldsSpecified", "RelyingPartyOriginIsOpaque", "TypeNotMatching", 269 "UiDismissedNoEmbargo", "CorsError", "SuppressedBySegmentationPlatform", 270 }; 271 272 /** 273 * Represents the failure reason when a getUserInfo() call fails. 274 * Should be updated alongside FederatedAuthUserInfoRequestResult in 275 * third_party/blink/public/mojom/devtools/inspector_issue.mojom. 276 */ 277 public static final String[] FederatedAuthUserInfoRequestIssueReason = 278 { 279 "NotSameOrigin", "NotIframe", "NotPotentiallyTrustworthy", "NoApiPermission", 280 "NotSignedInWithIdp", "NoAccountSharingPermission", "InvalidConfigOrWellKnown", 281 "InvalidAccountsResponse", "NoReturningUserFromFetchedAccounts", 282 }; 283 284 /** <CODE>[No Description Provided by Google]</CODE> */ 285 public static final String[] PartitioningBlobURLInfo = 286 { "BlockedCrossPartitionFetching", "EnforceNoopenerForNavigation", }; 287 288 /** <CODE>[No Description Provided by Google]</CODE> */ 289 public static final String[] ElementAccessibilityIssueReason = 290 { 291 "DisallowedSelectChild", "DisallowedOptGroupChild", "NonPhrasingContentOptionChild", 292 "InteractiveContentOptionChild", "InteractiveContentLegendChild", 293 "InteractiveContentSummaryDescendant", 294 }; 295 296 /** <CODE>[No Description Provided by Google]</CODE> */ 297 public static final String[] StyleSheetLoadingIssueReason = 298 { "LateImportRule", "RequestFailed", }; 299 300 /** <CODE>[No Description Provided by Google]</CODE> */ 301 public static final String[] PropertyRuleIssueReason = 302 { "InvalidSyntax", "InvalidInitialValue", "InvalidInherits", "InvalidName", }; 303 304 /** <CODE>[No Description Provided by Google]</CODE> */ 305 public static final String[] UserReidentificationIssueType = 306 { "BlockedFrameNavigation", "BlockedSubresource", "NoisedCanvasReadback", }; 307 308 /** 309 * A unique identifier for the type of issue. Each type may use one of the 310 * optional fields in InspectorIssueDetails to convey more specific 311 * information about the kind of issue. 312 */ 313 public static final String[] InspectorIssueCode = 314 { 315 "CookieIssue", "MixedContentIssue", "BlockedByResponseIssue", "HeavyAdIssue", 316 "ContentSecurityPolicyIssue", "SharedArrayBufferIssue", "LowTextContrastIssue", 317 "CorsIssue", "AttributionReportingIssue", "QuirksModeIssue", "PartitioningBlobURLIssue", 318 "NavigatorUserAgentIssue", "GenericIssue", "DeprecationIssue", "ClientHintIssue", 319 "FederatedAuthRequestIssue", "BounceTrackingIssue", "CookieDeprecationMetadataIssue", 320 "StylesheetLoadingIssue", "FederatedAuthUserInfoRequestIssue", "PropertyRuleIssue", 321 "SharedDictionaryIssue", "ElementAccessibilityIssue", "SRIMessageSignatureIssue", 322 "UnencodedDigestIssue", "UserReidentificationIssue", 323 }; 324 325 /** Information about a cookie that is affected by an inspector issue. */ 326 public static class AffectedCookie 327 extends BaseType 328 implements java.io.Serializable 329 { 330 /** For Object Serialization. java.io.Serializable */ 331 protected static final long serialVersionUID = 1; 332 333 public boolean[] optionals() 334 { return new boolean[] { false, false, false, }; } 335 336 /** The following three properties uniquely identify a cookie */ 337 public final String name; 338 339 /** <CODE>[No Description Provided by Google]</CODE> */ 340 public final String path; 341 342 /** <CODE>[No Description Provided by Google]</CODE> */ 343 public final String domain; 344 345 /** 346 * Constructor 347 * 348 * @param name The following three properties uniquely identify a cookie 349 * 350 * @param path - 351 * 352 * @param domain - 353 */ 354 public AffectedCookie(String name, String path, String domain) 355 { 356 // Exception-Check(s) to ensure that if any parameters which are not declared as 357 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 358 359 if (name == null) THROWS.throwNPE("name"); 360 if (path == null) THROWS.throwNPE("path"); 361 if (domain == null) THROWS.throwNPE("domain"); 362 363 this.name = name; 364 this.path = path; 365 this.domain = domain; 366 } 367 368 /** 369 * JSON Object Constructor 370 * @param jo A Json-Object having data about an instance of {@code 'AffectedCookie'}. 371 */ 372 public AffectedCookie (JsonObject jo) 373 { 374 this.name = ReadJSON.getString(jo, "name", false, true); 375 this.path = ReadJSON.getString(jo, "path", false, true); 376 this.domain = ReadJSON.getString(jo, "domain", false, true); 377 } 378 379 380 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 381 public boolean equals(Object other) 382 { 383 if (this == other) return true; 384 if (other == null) return false; 385 if (other.getClass() != this.getClass()) return false; 386 387 AffectedCookie o = (AffectedCookie) other; 388 389 return 390 Objects.equals(this.name, o.name) 391 && Objects.equals(this.path, o.path) 392 && Objects.equals(this.domain, o.domain); 393 } 394 395 /** Generates a Hash-Code for {@code 'this'} instance */ 396 public int hashCode() 397 { 398 return 399 Objects.hashCode(this.name) 400 + Objects.hashCode(this.path) 401 + Objects.hashCode(this.domain); 402 } 403 } 404 405 /** Information about a request that is affected by an inspector issue. */ 406 public static class AffectedRequest 407 extends BaseType 408 implements java.io.Serializable 409 { 410 /** For Object Serialization. java.io.Serializable */ 411 protected static final long serialVersionUID = 1; 412 413 public boolean[] optionals() 414 { return new boolean[] { true, false, }; } 415 416 /** 417 * The unique request id. 418 * <BR /><B CLASS=Opt>OPTIONAL</B> 419 */ 420 public final String requestId; 421 422 /** <CODE>[No Description Provided by Google]</CODE> */ 423 public final String url; 424 425 /** 426 * Constructor 427 * 428 * @param requestId The unique request id. 429 * <BR /><B CLASS=Opt>OPTIONAL</B> 430 * 431 * @param url - 432 */ 433 public AffectedRequest(String requestId, String url) 434 { 435 // Exception-Check(s) to ensure that if any parameters which are not declared as 436 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 437 438 if (url == null) THROWS.throwNPE("url"); 439 440 this.requestId = requestId; 441 this.url = url; 442 } 443 444 /** 445 * JSON Object Constructor 446 * @param jo A Json-Object having data about an instance of {@code 'AffectedRequest'}. 447 */ 448 public AffectedRequest (JsonObject jo) 449 { 450 this.requestId = ReadJSON.getString(jo, "requestId", true, false); 451 this.url = ReadJSON.getString(jo, "url", false, true); 452 } 453 454 455 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 456 public boolean equals(Object other) 457 { 458 if (this == other) return true; 459 if (other == null) return false; 460 if (other.getClass() != this.getClass()) return false; 461 462 AffectedRequest o = (AffectedRequest) other; 463 464 return 465 Objects.equals(this.requestId, o.requestId) 466 && Objects.equals(this.url, o.url); 467 } 468 469 /** Generates a Hash-Code for {@code 'this'} instance */ 470 public int hashCode() 471 { 472 return 473 Objects.hashCode(this.requestId) 474 + Objects.hashCode(this.url); 475 } 476 } 477 478 /** Information about the frame affected by an inspector issue. */ 479 public static class AffectedFrame 480 extends BaseType 481 implements java.io.Serializable 482 { 483 /** For Object Serialization. java.io.Serializable */ 484 protected static final long serialVersionUID = 1; 485 486 public boolean[] optionals() 487 { return new boolean[] { false, }; } 488 489 /** <CODE>[No Description Provided by Google]</CODE> */ 490 public final String frameId; 491 492 /** 493 * Constructor 494 * 495 * @param frameId - 496 */ 497 public AffectedFrame(String frameId) 498 { 499 // Exception-Check(s) to ensure that if any parameters which are not declared as 500 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 501 502 if (frameId == null) THROWS.throwNPE("frameId"); 503 504 this.frameId = frameId; 505 } 506 507 /** 508 * JSON Object Constructor 509 * @param jo A Json-Object having data about an instance of {@code 'AffectedFrame'}. 510 */ 511 public AffectedFrame (JsonObject jo) 512 { 513 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 514 } 515 516 517 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 518 public boolean equals(Object other) 519 { 520 if (this == other) return true; 521 if (other == null) return false; 522 if (other.getClass() != this.getClass()) return false; 523 524 AffectedFrame o = (AffectedFrame) other; 525 526 return 527 Objects.equals(this.frameId, o.frameId); 528 } 529 530 /** Generates a Hash-Code for {@code 'this'} instance */ 531 public int hashCode() 532 { 533 return 534 Objects.hashCode(this.frameId); 535 } 536 } 537 538 /** Information about the suggested solution to a cookie issue. */ 539 public static class CookieIssueInsight 540 extends BaseType 541 implements java.io.Serializable 542 { 543 /** For Object Serialization. java.io.Serializable */ 544 protected static final long serialVersionUID = 1; 545 546 public boolean[] optionals() 547 { return new boolean[] { false, true, }; } 548 549 /** <CODE>[No Description Provided by Google]</CODE> */ 550 public final String type; 551 552 /** 553 * Link to table entry in third-party cookie migration readiness list. 554 * <BR /><B CLASS=Opt>OPTIONAL</B> 555 */ 556 public final String tableEntryUrl; 557 558 /** 559 * Constructor 560 * 561 * @param type - 562 * 563 * @param tableEntryUrl Link to table entry in third-party cookie migration readiness list. 564 * <BR /><B CLASS=Opt>OPTIONAL</B> 565 */ 566 public CookieIssueInsight(String type, String tableEntryUrl) 567 { 568 // Exception-Check(s) to ensure that if any parameters which are not declared as 569 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 570 571 if (type == null) THROWS.throwNPE("type"); 572 573 // Exception-Check(s) to ensure that if any parameters which must adhere to a 574 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 575 576 THROWS.checkIAE("type", type, "Audits.InsightType", Audits.InsightType); 577 578 this.type = type; 579 this.tableEntryUrl = tableEntryUrl; 580 } 581 582 /** 583 * JSON Object Constructor 584 * @param jo A Json-Object having data about an instance of {@code 'CookieIssueInsight'}. 585 */ 586 public CookieIssueInsight (JsonObject jo) 587 { 588 this.type = ReadJSON.getString(jo, "type", false, true); 589 this.tableEntryUrl = ReadJSON.getString(jo, "tableEntryUrl", true, false); 590 } 591 592 593 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 594 public boolean equals(Object other) 595 { 596 if (this == other) return true; 597 if (other == null) return false; 598 if (other.getClass() != this.getClass()) return false; 599 600 CookieIssueInsight o = (CookieIssueInsight) other; 601 602 return 603 Objects.equals(this.type, o.type) 604 && Objects.equals(this.tableEntryUrl, o.tableEntryUrl); 605 } 606 607 /** Generates a Hash-Code for {@code 'this'} instance */ 608 public int hashCode() 609 { 610 return 611 Objects.hashCode(this.type) 612 + Objects.hashCode(this.tableEntryUrl); 613 } 614 } 615 616 /** 617 * This information is currently necessary, as the front-end has a difficult 618 * time finding a specific cookie. With this, we can convey specific error 619 * information without the cookie. 620 */ 621 public static class CookieIssueDetails 622 extends BaseType 623 implements java.io.Serializable 624 { 625 /** For Object Serialization. java.io.Serializable */ 626 protected static final long serialVersionUID = 1; 627 628 public boolean[] optionals() 629 { return new boolean[] { true, true, false, false, false, true, true, true, true, }; } 630 631 /** 632 * If AffectedCookie is not set then rawCookieLine contains the raw 633 * Set-Cookie header string. This hints at a problem where the 634 * cookie line is syntactically or semantically malformed in a way 635 * that no valid cookie could be created. 636 * <BR /><B CLASS=Opt>OPTIONAL</B> 637 */ 638 public final Audits.AffectedCookie cookie; 639 640 /** 641 * <CODE>[No Description Provided by Google]</CODE> 642 * <BR /><B CLASS=Opt>OPTIONAL</B> 643 */ 644 public final String rawCookieLine; 645 646 /** <CODE>[No Description Provided by Google]</CODE> */ 647 public final String[] cookieWarningReasons; 648 649 /** <CODE>[No Description Provided by Google]</CODE> */ 650 public final String[] cookieExclusionReasons; 651 652 /** 653 * Optionally identifies the site-for-cookies and the cookie url, which 654 * may be used by the front-end as additional context. 655 */ 656 public final String operation; 657 658 /** 659 * <CODE>[No Description Provided by Google]</CODE> 660 * <BR /><B CLASS=Opt>OPTIONAL</B> 661 */ 662 public final String siteForCookies; 663 664 /** 665 * <CODE>[No Description Provided by Google]</CODE> 666 * <BR /><B CLASS=Opt>OPTIONAL</B> 667 */ 668 public final String cookieUrl; 669 670 /** 671 * <CODE>[No Description Provided by Google]</CODE> 672 * <BR /><B CLASS=Opt>OPTIONAL</B> 673 */ 674 public final Audits.AffectedRequest request; 675 676 /** 677 * The recommended solution to the issue. 678 * <BR /><B CLASS=Opt>OPTIONAL</B> 679 */ 680 public final Audits.CookieIssueInsight insight; 681 682 /** 683 * Constructor 684 * 685 * @param cookie 686 * If AffectedCookie is not set then rawCookieLine contains the raw 687 * Set-Cookie header string. This hints at a problem where the 688 * cookie line is syntactically or semantically malformed in a way 689 * that no valid cookie could be created. 690 * <BR /><B CLASS=Opt>OPTIONAL</B> 691 * 692 * @param rawCookieLine - 693 * <BR /><B CLASS=Opt>OPTIONAL</B> 694 * 695 * @param cookieWarningReasons - 696 * 697 * @param cookieExclusionReasons - 698 * 699 * @param operation 700 * Optionally identifies the site-for-cookies and the cookie url, which 701 * may be used by the front-end as additional context. 702 * 703 * @param siteForCookies - 704 * <BR /><B CLASS=Opt>OPTIONAL</B> 705 * 706 * @param cookieUrl - 707 * <BR /><B CLASS=Opt>OPTIONAL</B> 708 * 709 * @param request - 710 * <BR /><B CLASS=Opt>OPTIONAL</B> 711 * 712 * @param insight The recommended solution to the issue. 713 * <BR /><B CLASS=Opt>OPTIONAL</B> 714 */ 715 public CookieIssueDetails( 716 Audits.AffectedCookie cookie, String rawCookieLine, String[] cookieWarningReasons, 717 String[] cookieExclusionReasons, String operation, String siteForCookies, 718 String cookieUrl, Audits.AffectedRequest request, Audits.CookieIssueInsight insight 719 ) 720 { 721 // Exception-Check(s) to ensure that if any parameters which are not declared as 722 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 723 724 if (cookieWarningReasons == null) THROWS.throwNPE("cookieWarningReasons"); 725 if (cookieExclusionReasons == null) THROWS.throwNPE("cookieExclusionReasons"); 726 if (operation == null) THROWS.throwNPE("operation"); 727 728 // Exception-Check(s) to ensure that if any parameters which must adhere to a 729 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 730 731 THROWS.checkIAE("operation", operation, "Audits.CookieOperation", Audits.CookieOperation); 732 733 this.cookie = cookie; 734 this.rawCookieLine = rawCookieLine; 735 this.cookieWarningReasons = cookieWarningReasons; 736 this.cookieExclusionReasons = cookieExclusionReasons; 737 this.operation = operation; 738 this.siteForCookies = siteForCookies; 739 this.cookieUrl = cookieUrl; 740 this.request = request; 741 this.insight = insight; 742 } 743 744 /** 745 * JSON Object Constructor 746 * @param jo A Json-Object having data about an instance of {@code 'CookieIssueDetails'}. 747 */ 748 public CookieIssueDetails (JsonObject jo) 749 { 750 this.cookie = ReadJSON.getObject(jo, "cookie", Audits.AffectedCookie.class, true, false); 751 this.rawCookieLine = ReadJSON.getString(jo, "rawCookieLine", true, false); 752 this.cookieWarningReasons = (jo.getJsonArray("cookieWarningReasons") == null) 753 ? null 754 : RJArrIntoStream.strArr(jo.getJsonArray("cookieWarningReasons"), null, 0).toArray(String[]::new); 755 756 this.cookieExclusionReasons = (jo.getJsonArray("cookieExclusionReasons") == null) 757 ? null 758 : RJArrIntoStream.strArr(jo.getJsonArray("cookieExclusionReasons"), null, 0).toArray(String[]::new); 759 760 this.operation = ReadJSON.getString(jo, "operation", false, true); 761 this.siteForCookies = ReadJSON.getString(jo, "siteForCookies", true, false); 762 this.cookieUrl = ReadJSON.getString(jo, "cookieUrl", true, false); 763 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, true, false); 764 this.insight = ReadJSON.getObject(jo, "insight", Audits.CookieIssueInsight.class, true, false); 765 } 766 767 768 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 769 public boolean equals(Object other) 770 { 771 if (this == other) return true; 772 if (other == null) return false; 773 if (other.getClass() != this.getClass()) return false; 774 775 CookieIssueDetails o = (CookieIssueDetails) other; 776 777 return 778 Objects.equals(this.cookie, o.cookie) 779 && Objects.equals(this.rawCookieLine, o.rawCookieLine) 780 && Arrays.deepEquals(this.cookieWarningReasons, o.cookieWarningReasons) 781 && Arrays.deepEquals(this.cookieExclusionReasons, o.cookieExclusionReasons) 782 && Objects.equals(this.operation, o.operation) 783 && Objects.equals(this.siteForCookies, o.siteForCookies) 784 && Objects.equals(this.cookieUrl, o.cookieUrl) 785 && Objects.equals(this.request, o.request) 786 && Objects.equals(this.insight, o.insight); 787 } 788 789 /** Generates a Hash-Code for {@code 'this'} instance */ 790 public int hashCode() 791 { 792 return 793 this.cookie.hashCode() 794 + Objects.hashCode(this.rawCookieLine) 795 + Arrays.deepHashCode(this.cookieWarningReasons) 796 + Arrays.deepHashCode(this.cookieExclusionReasons) 797 + Objects.hashCode(this.operation) 798 + Objects.hashCode(this.siteForCookies) 799 + Objects.hashCode(this.cookieUrl) 800 + this.request.hashCode() 801 + this.insight.hashCode(); 802 } 803 } 804 805 /** <CODE>[No Description Provided by Google]</CODE> */ 806 public static class MixedContentIssueDetails 807 extends BaseType 808 implements java.io.Serializable 809 { 810 /** For Object Serialization. java.io.Serializable */ 811 protected static final long serialVersionUID = 1; 812 813 public boolean[] optionals() 814 { return new boolean[] { true, false, false, false, true, true, }; } 815 816 /** 817 * The type of resource causing the mixed content issue (css, js, iframe, 818 * form,...). Marked as optional because it is mapped to from 819 * blink::mojom::RequestContextType, which will be replaced 820 * by network::mojom::RequestDestination 821 * <BR /><B CLASS=Opt>OPTIONAL</B> 822 */ 823 public final String resourceType; 824 825 /** The way the mixed content issue is being resolved. */ 826 public final String resolutionStatus; 827 828 /** The unsafe http url causing the mixed content issue. */ 829 public final String insecureURL; 830 831 /** The url responsible for the call to an unsafe url. */ 832 public final String mainResourceURL; 833 834 /** 835 * The mixed content request. 836 * Does not always exist (e.g. for unsafe form submission urls). 837 * <BR /><B CLASS=Opt>OPTIONAL</B> 838 */ 839 public final Audits.AffectedRequest request; 840 841 /** 842 * Optional because not every mixed content issue is necessarily linked to a frame. 843 * <BR /><B CLASS=Opt>OPTIONAL</B> 844 */ 845 public final Audits.AffectedFrame frame; 846 847 /** 848 * Constructor 849 * 850 * @param resourceType 851 * The type of resource causing the mixed content issue (css, js, iframe, 852 * form,...). Marked as optional because it is mapped to from 853 * blink::mojom::RequestContextType, which will be replaced 854 * by network::mojom::RequestDestination 855 * <BR /><B CLASS=Opt>OPTIONAL</B> 856 * 857 * @param resolutionStatus The way the mixed content issue is being resolved. 858 * 859 * @param insecureURL The unsafe http url causing the mixed content issue. 860 * 861 * @param mainResourceURL The url responsible for the call to an unsafe url. 862 * 863 * @param request 864 * The mixed content request. 865 * Does not always exist (e.g. for unsafe form submission urls). 866 * <BR /><B CLASS=Opt>OPTIONAL</B> 867 * 868 * @param frame Optional because not every mixed content issue is necessarily linked to a frame. 869 * <BR /><B CLASS=Opt>OPTIONAL</B> 870 */ 871 public MixedContentIssueDetails( 872 String resourceType, String resolutionStatus, String insecureURL, 873 String mainResourceURL, Audits.AffectedRequest request, Audits.AffectedFrame frame 874 ) 875 { 876 // Exception-Check(s) to ensure that if any parameters which are not declared as 877 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 878 879 if (resolutionStatus == null) THROWS.throwNPE("resolutionStatus"); 880 if (insecureURL == null) THROWS.throwNPE("insecureURL"); 881 if (mainResourceURL == null) THROWS.throwNPE("mainResourceURL"); 882 883 // Exception-Check(s) to ensure that if any parameters which must adhere to a 884 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 885 886 THROWS.checkIAE("resourceType", resourceType, "Audits.MixedContentResourceType", Audits.MixedContentResourceType); 887 THROWS.checkIAE("resolutionStatus", resolutionStatus, "Audits.MixedContentResolutionStatus", Audits.MixedContentResolutionStatus); 888 889 this.resourceType = resourceType; 890 this.resolutionStatus = resolutionStatus; 891 this.insecureURL = insecureURL; 892 this.mainResourceURL = mainResourceURL; 893 this.request = request; 894 this.frame = frame; 895 } 896 897 /** 898 * JSON Object Constructor 899 * @param jo A Json-Object having data about an instance of {@code 'MixedContentIssueDetails'}. 900 */ 901 public MixedContentIssueDetails (JsonObject jo) 902 { 903 this.resourceType = ReadJSON.getString(jo, "resourceType", true, false); 904 this.resolutionStatus = ReadJSON.getString(jo, "resolutionStatus", false, true); 905 this.insecureURL = ReadJSON.getString(jo, "insecureURL", false, true); 906 this.mainResourceURL = ReadJSON.getString(jo, "mainResourceURL", false, true); 907 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, true, false); 908 this.frame = ReadJSON.getObject(jo, "frame", Audits.AffectedFrame.class, true, false); 909 } 910 911 912 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 913 public boolean equals(Object other) 914 { 915 if (this == other) return true; 916 if (other == null) return false; 917 if (other.getClass() != this.getClass()) return false; 918 919 MixedContentIssueDetails o = (MixedContentIssueDetails) other; 920 921 return 922 Objects.equals(this.resourceType, o.resourceType) 923 && Objects.equals(this.resolutionStatus, o.resolutionStatus) 924 && Objects.equals(this.insecureURL, o.insecureURL) 925 && Objects.equals(this.mainResourceURL, o.mainResourceURL) 926 && Objects.equals(this.request, o.request) 927 && Objects.equals(this.frame, o.frame); 928 } 929 930 /** Generates a Hash-Code for {@code 'this'} instance */ 931 public int hashCode() 932 { 933 return 934 Objects.hashCode(this.resourceType) 935 + Objects.hashCode(this.resolutionStatus) 936 + Objects.hashCode(this.insecureURL) 937 + Objects.hashCode(this.mainResourceURL) 938 + this.request.hashCode() 939 + this.frame.hashCode(); 940 } 941 } 942 943 /** 944 * Details for a request that has been blocked with the BLOCKED_BY_RESPONSE 945 * code. Currently only used for COEP/COOP, but may be extended to include 946 * some CSP errors in the future. 947 */ 948 public static class BlockedByResponseIssueDetails 949 extends BaseType 950 implements java.io.Serializable 951 { 952 /** For Object Serialization. java.io.Serializable */ 953 protected static final long serialVersionUID = 1; 954 955 public boolean[] optionals() 956 { return new boolean[] { false, true, true, false, }; } 957 958 /** <CODE>[No Description Provided by Google]</CODE> */ 959 public final Audits.AffectedRequest request; 960 961 /** 962 * <CODE>[No Description Provided by Google]</CODE> 963 * <BR /><B CLASS=Opt>OPTIONAL</B> 964 */ 965 public final Audits.AffectedFrame parentFrame; 966 967 /** 968 * <CODE>[No Description Provided by Google]</CODE> 969 * <BR /><B CLASS=Opt>OPTIONAL</B> 970 */ 971 public final Audits.AffectedFrame blockedFrame; 972 973 /** <CODE>[No Description Provided by Google]</CODE> */ 974 public final String reason; 975 976 /** 977 * Constructor 978 * 979 * @param request - 980 * 981 * @param parentFrame - 982 * <BR /><B CLASS=Opt>OPTIONAL</B> 983 * 984 * @param blockedFrame - 985 * <BR /><B CLASS=Opt>OPTIONAL</B> 986 * 987 * @param reason - 988 */ 989 public BlockedByResponseIssueDetails( 990 Audits.AffectedRequest request, Audits.AffectedFrame parentFrame, 991 Audits.AffectedFrame blockedFrame, String reason 992 ) 993 { 994 // Exception-Check(s) to ensure that if any parameters which are not declared as 995 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 996 997 if (request == null) THROWS.throwNPE("request"); 998 if (reason == null) THROWS.throwNPE("reason"); 999 1000 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1001 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1002 1003 THROWS.checkIAE("reason", reason, "Audits.BlockedByResponseReason", Audits.BlockedByResponseReason); 1004 1005 this.request = request; 1006 this.parentFrame = parentFrame; 1007 this.blockedFrame = blockedFrame; 1008 this.reason = reason; 1009 } 1010 1011 /** 1012 * JSON Object Constructor 1013 * @param jo A Json-Object having data about an instance of {@code 'BlockedByResponseIssueDetails'}. 1014 */ 1015 public BlockedByResponseIssueDetails (JsonObject jo) 1016 { 1017 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, false, true); 1018 this.parentFrame = ReadJSON.getObject(jo, "parentFrame", Audits.AffectedFrame.class, true, false); 1019 this.blockedFrame = ReadJSON.getObject(jo, "blockedFrame", Audits.AffectedFrame.class, true, false); 1020 this.reason = ReadJSON.getString(jo, "reason", false, true); 1021 } 1022 1023 1024 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1025 public boolean equals(Object other) 1026 { 1027 if (this == other) return true; 1028 if (other == null) return false; 1029 if (other.getClass() != this.getClass()) return false; 1030 1031 BlockedByResponseIssueDetails o = (BlockedByResponseIssueDetails) other; 1032 1033 return 1034 Objects.equals(this.request, o.request) 1035 && Objects.equals(this.parentFrame, o.parentFrame) 1036 && Objects.equals(this.blockedFrame, o.blockedFrame) 1037 && Objects.equals(this.reason, o.reason); 1038 } 1039 1040 /** Generates a Hash-Code for {@code 'this'} instance */ 1041 public int hashCode() 1042 { 1043 return 1044 this.request.hashCode() 1045 + this.parentFrame.hashCode() 1046 + this.blockedFrame.hashCode() 1047 + Objects.hashCode(this.reason); 1048 } 1049 } 1050 1051 /** <CODE>[No Description Provided by Google]</CODE> */ 1052 public static class HeavyAdIssueDetails 1053 extends BaseType 1054 implements java.io.Serializable 1055 { 1056 /** For Object Serialization. java.io.Serializable */ 1057 protected static final long serialVersionUID = 1; 1058 1059 public boolean[] optionals() 1060 { return new boolean[] { false, false, false, }; } 1061 1062 /** The resolution status, either blocking the content or warning. */ 1063 public final String resolution; 1064 1065 /** The reason the ad was blocked, total network or cpu or peak cpu. */ 1066 public final String reason; 1067 1068 /** The frame that was blocked. */ 1069 public final Audits.AffectedFrame frame; 1070 1071 /** 1072 * Constructor 1073 * 1074 * @param resolution The resolution status, either blocking the content or warning. 1075 * 1076 * @param reason The reason the ad was blocked, total network or cpu or peak cpu. 1077 * 1078 * @param frame The frame that was blocked. 1079 */ 1080 public HeavyAdIssueDetails(String resolution, String reason, Audits.AffectedFrame frame) 1081 { 1082 // Exception-Check(s) to ensure that if any parameters which are not declared as 1083 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1084 1085 if (resolution == null) THROWS.throwNPE("resolution"); 1086 if (reason == null) THROWS.throwNPE("reason"); 1087 if (frame == null) THROWS.throwNPE("frame"); 1088 1089 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1090 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1091 1092 THROWS.checkIAE("resolution", resolution, "Audits.HeavyAdResolutionStatus", Audits.HeavyAdResolutionStatus); 1093 THROWS.checkIAE("reason", reason, "Audits.HeavyAdReason", Audits.HeavyAdReason); 1094 1095 this.resolution = resolution; 1096 this.reason = reason; 1097 this.frame = frame; 1098 } 1099 1100 /** 1101 * JSON Object Constructor 1102 * @param jo A Json-Object having data about an instance of {@code 'HeavyAdIssueDetails'}. 1103 */ 1104 public HeavyAdIssueDetails (JsonObject jo) 1105 { 1106 this.resolution = ReadJSON.getString(jo, "resolution", false, true); 1107 this.reason = ReadJSON.getString(jo, "reason", false, true); 1108 this.frame = ReadJSON.getObject(jo, "frame", Audits.AffectedFrame.class, false, true); 1109 } 1110 1111 1112 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1113 public boolean equals(Object other) 1114 { 1115 if (this == other) return true; 1116 if (other == null) return false; 1117 if (other.getClass() != this.getClass()) return false; 1118 1119 HeavyAdIssueDetails o = (HeavyAdIssueDetails) other; 1120 1121 return 1122 Objects.equals(this.resolution, o.resolution) 1123 && Objects.equals(this.reason, o.reason) 1124 && Objects.equals(this.frame, o.frame); 1125 } 1126 1127 /** Generates a Hash-Code for {@code 'this'} instance */ 1128 public int hashCode() 1129 { 1130 return 1131 Objects.hashCode(this.resolution) 1132 + Objects.hashCode(this.reason) 1133 + this.frame.hashCode(); 1134 } 1135 } 1136 1137 /** <CODE>[No Description Provided by Google]</CODE> */ 1138 public static class SourceCodeLocation 1139 extends BaseType 1140 implements java.io.Serializable 1141 { 1142 /** For Object Serialization. java.io.Serializable */ 1143 protected static final long serialVersionUID = 1; 1144 1145 public boolean[] optionals() 1146 { return new boolean[] { true, false, false, false, }; } 1147 1148 /** 1149 * <CODE>[No Description Provided by Google]</CODE> 1150 * <BR /><B CLASS=Opt>OPTIONAL</B> 1151 */ 1152 public final String scriptId; 1153 1154 /** <CODE>[No Description Provided by Google]</CODE> */ 1155 public final String url; 1156 1157 /** <CODE>[No Description Provided by Google]</CODE> */ 1158 public final int lineNumber; 1159 1160 /** <CODE>[No Description Provided by Google]</CODE> */ 1161 public final int columnNumber; 1162 1163 /** 1164 * Constructor 1165 * 1166 * @param scriptId - 1167 * <BR /><B CLASS=Opt>OPTIONAL</B> 1168 * 1169 * @param url - 1170 * 1171 * @param lineNumber - 1172 * 1173 * @param columnNumber - 1174 */ 1175 public SourceCodeLocation(String scriptId, String url, int lineNumber, int columnNumber) 1176 { 1177 // Exception-Check(s) to ensure that if any parameters which are not declared as 1178 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1179 1180 if (url == null) THROWS.throwNPE("url"); 1181 1182 this.scriptId = scriptId; 1183 this.url = url; 1184 this.lineNumber = lineNumber; 1185 this.columnNumber = columnNumber; 1186 } 1187 1188 /** 1189 * JSON Object Constructor 1190 * @param jo A Json-Object having data about an instance of {@code 'SourceCodeLocation'}. 1191 */ 1192 public SourceCodeLocation (JsonObject jo) 1193 { 1194 this.scriptId = ReadJSON.getString(jo, "scriptId", true, false); 1195 this.url = ReadJSON.getString(jo, "url", false, true); 1196 this.lineNumber = ReadPrimJSON.getInt(jo, "lineNumber"); 1197 this.columnNumber = ReadPrimJSON.getInt(jo, "columnNumber"); 1198 } 1199 1200 1201 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1202 public boolean equals(Object other) 1203 { 1204 if (this == other) return true; 1205 if (other == null) return false; 1206 if (other.getClass() != this.getClass()) return false; 1207 1208 SourceCodeLocation o = (SourceCodeLocation) other; 1209 1210 return 1211 Objects.equals(this.scriptId, o.scriptId) 1212 && Objects.equals(this.url, o.url) 1213 && (this.lineNumber == o.lineNumber) 1214 && (this.columnNumber == o.columnNumber); 1215 } 1216 1217 /** Generates a Hash-Code for {@code 'this'} instance */ 1218 public int hashCode() 1219 { 1220 return 1221 Objects.hashCode(this.scriptId) 1222 + Objects.hashCode(this.url) 1223 + this.lineNumber 1224 + this.columnNumber; 1225 } 1226 } 1227 1228 /** <CODE>[No Description Provided by Google]</CODE> */ 1229 public static class ContentSecurityPolicyIssueDetails 1230 extends BaseType 1231 implements java.io.Serializable 1232 { 1233 /** For Object Serialization. java.io.Serializable */ 1234 protected static final long serialVersionUID = 1; 1235 1236 public boolean[] optionals() 1237 { return new boolean[] { true, false, false, false, true, true, true, }; } 1238 1239 /** 1240 * The url not included in allowed sources. 1241 * <BR /><B CLASS=Opt>OPTIONAL</B> 1242 */ 1243 public final String blockedURL; 1244 1245 /** Specific directive that is violated, causing the CSP issue. */ 1246 public final String violatedDirective; 1247 1248 /** <CODE>[No Description Provided by Google]</CODE> */ 1249 public final boolean isReportOnly; 1250 1251 /** <CODE>[No Description Provided by Google]</CODE> */ 1252 public final String contentSecurityPolicyViolationType; 1253 1254 /** 1255 * <CODE>[No Description Provided by Google]</CODE> 1256 * <BR /><B CLASS=Opt>OPTIONAL</B> 1257 */ 1258 public final Audits.AffectedFrame frameAncestor; 1259 1260 /** 1261 * <CODE>[No Description Provided by Google]</CODE> 1262 * <BR /><B CLASS=Opt>OPTIONAL</B> 1263 */ 1264 public final Audits.SourceCodeLocation sourceCodeLocation; 1265 1266 /** 1267 * <CODE>[No Description Provided by Google]</CODE> 1268 * <BR /><B CLASS=Opt>OPTIONAL</B> 1269 */ 1270 public final Integer violatingNodeId; 1271 1272 /** 1273 * Constructor 1274 * 1275 * @param blockedURL The url not included in allowed sources. 1276 * <BR /><B CLASS=Opt>OPTIONAL</B> 1277 * 1278 * @param violatedDirective Specific directive that is violated, causing the CSP issue. 1279 * 1280 * @param isReportOnly - 1281 * 1282 * @param contentSecurityPolicyViolationType - 1283 * 1284 * @param frameAncestor - 1285 * <BR /><B CLASS=Opt>OPTIONAL</B> 1286 * 1287 * @param sourceCodeLocation - 1288 * <BR /><B CLASS=Opt>OPTIONAL</B> 1289 * 1290 * @param violatingNodeId - 1291 * <BR /><B CLASS=Opt>OPTIONAL</B> 1292 */ 1293 public ContentSecurityPolicyIssueDetails( 1294 String blockedURL, String violatedDirective, boolean isReportOnly, 1295 String contentSecurityPolicyViolationType, Audits.AffectedFrame frameAncestor, 1296 Audits.SourceCodeLocation sourceCodeLocation, Integer violatingNodeId 1297 ) 1298 { 1299 // Exception-Check(s) to ensure that if any parameters which are not declared as 1300 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1301 1302 if (violatedDirective == null) THROWS.throwNPE("violatedDirective"); 1303 if (contentSecurityPolicyViolationType == null) THROWS.throwNPE("contentSecurityPolicyViolationType"); 1304 1305 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1306 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1307 1308 THROWS.checkIAE("contentSecurityPolicyViolationType", contentSecurityPolicyViolationType, "Audits.ContentSecurityPolicyViolationType", Audits.ContentSecurityPolicyViolationType); 1309 1310 this.blockedURL = blockedURL; 1311 this.violatedDirective = violatedDirective; 1312 this.isReportOnly = isReportOnly; 1313 this.contentSecurityPolicyViolationType = contentSecurityPolicyViolationType; 1314 this.frameAncestor = frameAncestor; 1315 this.sourceCodeLocation = sourceCodeLocation; 1316 this.violatingNodeId = violatingNodeId; 1317 } 1318 1319 /** 1320 * JSON Object Constructor 1321 * @param jo A Json-Object having data about an instance of {@code 'ContentSecurityPolicyIssueDetails'}. 1322 */ 1323 public ContentSecurityPolicyIssueDetails (JsonObject jo) 1324 { 1325 this.blockedURL = ReadJSON.getString(jo, "blockedURL", true, false); 1326 this.violatedDirective = ReadJSON.getString(jo, "violatedDirective", false, true); 1327 this.isReportOnly = ReadPrimJSON.getBoolean(jo, "isReportOnly"); 1328 this.contentSecurityPolicyViolationType = ReadJSON.getString(jo, "contentSecurityPolicyViolationType", false, true); 1329 this.frameAncestor = ReadJSON.getObject(jo, "frameAncestor", Audits.AffectedFrame.class, true, false); 1330 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, true, false); 1331 this.violatingNodeId = ReadBoxedJSON.getInteger(jo, "violatingNodeId", true); 1332 } 1333 1334 1335 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1336 public boolean equals(Object other) 1337 { 1338 if (this == other) return true; 1339 if (other == null) return false; 1340 if (other.getClass() != this.getClass()) return false; 1341 1342 ContentSecurityPolicyIssueDetails o = (ContentSecurityPolicyIssueDetails) other; 1343 1344 return 1345 Objects.equals(this.blockedURL, o.blockedURL) 1346 && Objects.equals(this.violatedDirective, o.violatedDirective) 1347 && (this.isReportOnly == o.isReportOnly) 1348 && Objects.equals(this.contentSecurityPolicyViolationType, o.contentSecurityPolicyViolationType) 1349 && Objects.equals(this.frameAncestor, o.frameAncestor) 1350 && Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 1351 && Objects.equals(this.violatingNodeId, o.violatingNodeId); 1352 } 1353 1354 /** Generates a Hash-Code for {@code 'this'} instance */ 1355 public int hashCode() 1356 { 1357 return 1358 Objects.hashCode(this.blockedURL) 1359 + Objects.hashCode(this.violatedDirective) 1360 + (this.isReportOnly ? 1 : 0) 1361 + Objects.hashCode(this.contentSecurityPolicyViolationType) 1362 + this.frameAncestor.hashCode() 1363 + this.sourceCodeLocation.hashCode() 1364 + Objects.hashCode(this.violatingNodeId); 1365 } 1366 } 1367 1368 /** 1369 * Details for a issue arising from an SAB being instantiated in, or 1370 * transferred to a context that is not cross-origin isolated. 1371 */ 1372 public static class SharedArrayBufferIssueDetails 1373 extends BaseType 1374 implements java.io.Serializable 1375 { 1376 /** For Object Serialization. java.io.Serializable */ 1377 protected static final long serialVersionUID = 1; 1378 1379 public boolean[] optionals() 1380 { return new boolean[] { false, false, false, }; } 1381 1382 /** <CODE>[No Description Provided by Google]</CODE> */ 1383 public final Audits.SourceCodeLocation sourceCodeLocation; 1384 1385 /** <CODE>[No Description Provided by Google]</CODE> */ 1386 public final boolean isWarning; 1387 1388 /** <CODE>[No Description Provided by Google]</CODE> */ 1389 public final String type; 1390 1391 /** 1392 * Constructor 1393 * 1394 * @param sourceCodeLocation - 1395 * 1396 * @param isWarning - 1397 * 1398 * @param type - 1399 */ 1400 public SharedArrayBufferIssueDetails 1401 (Audits.SourceCodeLocation sourceCodeLocation, boolean isWarning, String type) 1402 { 1403 // Exception-Check(s) to ensure that if any parameters which are not declared as 1404 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1405 1406 if (sourceCodeLocation == null) THROWS.throwNPE("sourceCodeLocation"); 1407 if (type == null) THROWS.throwNPE("type"); 1408 1409 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1410 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1411 1412 THROWS.checkIAE("type", type, "Audits.SharedArrayBufferIssueType", Audits.SharedArrayBufferIssueType); 1413 1414 this.sourceCodeLocation = sourceCodeLocation; 1415 this.isWarning = isWarning; 1416 this.type = type; 1417 } 1418 1419 /** 1420 * JSON Object Constructor 1421 * @param jo A Json-Object having data about an instance of {@code 'SharedArrayBufferIssueDetails'}. 1422 */ 1423 public SharedArrayBufferIssueDetails (JsonObject jo) 1424 { 1425 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, false, true); 1426 this.isWarning = ReadPrimJSON.getBoolean(jo, "isWarning"); 1427 this.type = ReadJSON.getString(jo, "type", false, true); 1428 } 1429 1430 1431 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1432 public boolean equals(Object other) 1433 { 1434 if (this == other) return true; 1435 if (other == null) return false; 1436 if (other.getClass() != this.getClass()) return false; 1437 1438 SharedArrayBufferIssueDetails o = (SharedArrayBufferIssueDetails) other; 1439 1440 return 1441 Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 1442 && (this.isWarning == o.isWarning) 1443 && Objects.equals(this.type, o.type); 1444 } 1445 1446 /** Generates a Hash-Code for {@code 'this'} instance */ 1447 public int hashCode() 1448 { 1449 return 1450 this.sourceCodeLocation.hashCode() 1451 + (this.isWarning ? 1 : 0) 1452 + Objects.hashCode(this.type); 1453 } 1454 } 1455 1456 /** <CODE>[No Description Provided by Google]</CODE> */ 1457 public static class LowTextContrastIssueDetails 1458 extends BaseType 1459 implements java.io.Serializable 1460 { 1461 /** For Object Serialization. java.io.Serializable */ 1462 protected static final long serialVersionUID = 1; 1463 1464 public boolean[] optionals() 1465 { return new boolean[] { false, false, false, false, false, false, false, }; } 1466 1467 /** <CODE>[No Description Provided by Google]</CODE> */ 1468 public final int violatingNodeId; 1469 1470 /** <CODE>[No Description Provided by Google]</CODE> */ 1471 public final String violatingNodeSelector; 1472 1473 /** <CODE>[No Description Provided by Google]</CODE> */ 1474 public final Number contrastRatio; 1475 1476 /** <CODE>[No Description Provided by Google]</CODE> */ 1477 public final Number thresholdAA; 1478 1479 /** <CODE>[No Description Provided by Google]</CODE> */ 1480 public final Number thresholdAAA; 1481 1482 /** <CODE>[No Description Provided by Google]</CODE> */ 1483 public final String fontSize; 1484 1485 /** <CODE>[No Description Provided by Google]</CODE> */ 1486 public final String fontWeight; 1487 1488 /** 1489 * Constructor 1490 * 1491 * @param violatingNodeId - 1492 * 1493 * @param violatingNodeSelector - 1494 * 1495 * @param contrastRatio - 1496 * 1497 * @param thresholdAA - 1498 * 1499 * @param thresholdAAA - 1500 * 1501 * @param fontSize - 1502 * 1503 * @param fontWeight - 1504 */ 1505 public LowTextContrastIssueDetails( 1506 int violatingNodeId, String violatingNodeSelector, Number contrastRatio, 1507 Number thresholdAA, Number thresholdAAA, String fontSize, String fontWeight 1508 ) 1509 { 1510 // Exception-Check(s) to ensure that if any parameters which are not declared as 1511 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1512 1513 if (violatingNodeSelector == null) THROWS.throwNPE("violatingNodeSelector"); 1514 if (contrastRatio == null) THROWS.throwNPE("contrastRatio"); 1515 if (thresholdAA == null) THROWS.throwNPE("thresholdAA"); 1516 if (thresholdAAA == null) THROWS.throwNPE("thresholdAAA"); 1517 if (fontSize == null) THROWS.throwNPE("fontSize"); 1518 if (fontWeight == null) THROWS.throwNPE("fontWeight"); 1519 1520 this.violatingNodeId = violatingNodeId; 1521 this.violatingNodeSelector = violatingNodeSelector; 1522 this.contrastRatio = contrastRatio; 1523 this.thresholdAA = thresholdAA; 1524 this.thresholdAAA = thresholdAAA; 1525 this.fontSize = fontSize; 1526 this.fontWeight = fontWeight; 1527 } 1528 1529 /** 1530 * JSON Object Constructor 1531 * @param jo A Json-Object having data about an instance of {@code 'LowTextContrastIssueDetails'}. 1532 */ 1533 public LowTextContrastIssueDetails (JsonObject jo) 1534 { 1535 this.violatingNodeId = ReadPrimJSON.getInt(jo, "violatingNodeId"); 1536 this.violatingNodeSelector = ReadJSON.getString(jo, "violatingNodeSelector", false, true); 1537 this.contrastRatio = ReadNumberJSON.get(jo, "contrastRatio", false, true); 1538 this.thresholdAA = ReadNumberJSON.get(jo, "thresholdAA", false, true); 1539 this.thresholdAAA = ReadNumberJSON.get(jo, "thresholdAAA", false, true); 1540 this.fontSize = ReadJSON.getString(jo, "fontSize", false, true); 1541 this.fontWeight = ReadJSON.getString(jo, "fontWeight", false, true); 1542 } 1543 1544 1545 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1546 public boolean equals(Object other) 1547 { 1548 if (this == other) return true; 1549 if (other == null) return false; 1550 if (other.getClass() != this.getClass()) return false; 1551 1552 LowTextContrastIssueDetails o = (LowTextContrastIssueDetails) other; 1553 1554 return 1555 Objects.equals(this.violatingNodeId, o.violatingNodeId) 1556 && Objects.equals(this.violatingNodeSelector, o.violatingNodeSelector) 1557 && Objects.equals(this.contrastRatio, o.contrastRatio) 1558 && Objects.equals(this.thresholdAA, o.thresholdAA) 1559 && Objects.equals(this.thresholdAAA, o.thresholdAAA) 1560 && Objects.equals(this.fontSize, o.fontSize) 1561 && Objects.equals(this.fontWeight, o.fontWeight); 1562 } 1563 1564 /** Generates a Hash-Code for {@code 'this'} instance */ 1565 public int hashCode() 1566 { 1567 return 1568 this.violatingNodeId 1569 + Objects.hashCode(this.violatingNodeSelector) 1570 + Objects.hashCode(this.contrastRatio) 1571 + Objects.hashCode(this.thresholdAA) 1572 + Objects.hashCode(this.thresholdAAA) 1573 + Objects.hashCode(this.fontSize) 1574 + Objects.hashCode(this.fontWeight); 1575 } 1576 } 1577 1578 /** 1579 * Details for a CORS related issue, e.g. a warning or error related to 1580 * CORS RFC1918 enforcement. 1581 */ 1582 public static class CorsIssueDetails 1583 extends BaseType 1584 implements java.io.Serializable 1585 { 1586 /** For Object Serialization. java.io.Serializable */ 1587 protected static final long serialVersionUID = 1; 1588 1589 public boolean[] optionals() 1590 { return new boolean[] { false, false, false, true, true, true, true, }; } 1591 1592 /** <CODE>[No Description Provided by Google]</CODE> */ 1593 public final Network.CorsErrorStatus corsErrorStatus; 1594 1595 /** <CODE>[No Description Provided by Google]</CODE> */ 1596 public final boolean isWarning; 1597 1598 /** <CODE>[No Description Provided by Google]</CODE> */ 1599 public final Audits.AffectedRequest request; 1600 1601 /** 1602 * <CODE>[No Description Provided by Google]</CODE> 1603 * <BR /><B CLASS=Opt>OPTIONAL</B> 1604 */ 1605 public final Audits.SourceCodeLocation location; 1606 1607 /** 1608 * <CODE>[No Description Provided by Google]</CODE> 1609 * <BR /><B CLASS=Opt>OPTIONAL</B> 1610 */ 1611 public final String initiatorOrigin; 1612 1613 /** 1614 * <CODE>[No Description Provided by Google]</CODE> 1615 * <BR /><B CLASS=Opt>OPTIONAL</B> 1616 */ 1617 public final String resourceIPAddressSpace; 1618 1619 /** 1620 * <CODE>[No Description Provided by Google]</CODE> 1621 * <BR /><B CLASS=Opt>OPTIONAL</B> 1622 */ 1623 public final Network.ClientSecurityState clientSecurityState; 1624 1625 /** 1626 * Constructor 1627 * 1628 * @param corsErrorStatus - 1629 * 1630 * @param isWarning - 1631 * 1632 * @param request - 1633 * 1634 * @param location - 1635 * <BR /><B CLASS=Opt>OPTIONAL</B> 1636 * 1637 * @param initiatorOrigin - 1638 * <BR /><B CLASS=Opt>OPTIONAL</B> 1639 * 1640 * @param resourceIPAddressSpace - 1641 * <BR /><B CLASS=Opt>OPTIONAL</B> 1642 * 1643 * @param clientSecurityState - 1644 * <BR /><B CLASS=Opt>OPTIONAL</B> 1645 */ 1646 public CorsIssueDetails( 1647 Network.CorsErrorStatus corsErrorStatus, boolean isWarning, 1648 Audits.AffectedRequest request, Audits.SourceCodeLocation location, 1649 String initiatorOrigin, String resourceIPAddressSpace, 1650 Network.ClientSecurityState clientSecurityState 1651 ) 1652 { 1653 // Exception-Check(s) to ensure that if any parameters which are not declared as 1654 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1655 1656 if (corsErrorStatus == null) THROWS.throwNPE("corsErrorStatus"); 1657 if (request == null) THROWS.throwNPE("request"); 1658 1659 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1660 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1661 1662 THROWS.checkIAE("resourceIPAddressSpace", resourceIPAddressSpace, "Network.IPAddressSpace", Network.IPAddressSpace); 1663 1664 this.corsErrorStatus = corsErrorStatus; 1665 this.isWarning = isWarning; 1666 this.request = request; 1667 this.location = location; 1668 this.initiatorOrigin = initiatorOrigin; 1669 this.resourceIPAddressSpace = resourceIPAddressSpace; 1670 this.clientSecurityState = clientSecurityState; 1671 } 1672 1673 /** 1674 * JSON Object Constructor 1675 * @param jo A Json-Object having data about an instance of {@code 'CorsIssueDetails'}. 1676 */ 1677 public CorsIssueDetails (JsonObject jo) 1678 { 1679 this.corsErrorStatus = ReadJSON.getObject(jo, "corsErrorStatus", Network.CorsErrorStatus.class, false, true); 1680 this.isWarning = ReadPrimJSON.getBoolean(jo, "isWarning"); 1681 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, false, true); 1682 this.location = ReadJSON.getObject(jo, "location", Audits.SourceCodeLocation.class, true, false); 1683 this.initiatorOrigin = ReadJSON.getString(jo, "initiatorOrigin", true, false); 1684 this.resourceIPAddressSpace = ReadJSON.getString(jo, "resourceIPAddressSpace", true, false); 1685 this.clientSecurityState = ReadJSON.getObject(jo, "clientSecurityState", Network.ClientSecurityState.class, true, false); 1686 } 1687 1688 1689 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1690 public boolean equals(Object other) 1691 { 1692 if (this == other) return true; 1693 if (other == null) return false; 1694 if (other.getClass() != this.getClass()) return false; 1695 1696 CorsIssueDetails o = (CorsIssueDetails) other; 1697 1698 return 1699 Objects.equals(this.corsErrorStatus, o.corsErrorStatus) 1700 && (this.isWarning == o.isWarning) 1701 && Objects.equals(this.request, o.request) 1702 && Objects.equals(this.location, o.location) 1703 && Objects.equals(this.initiatorOrigin, o.initiatorOrigin) 1704 && Objects.equals(this.resourceIPAddressSpace, o.resourceIPAddressSpace) 1705 && Objects.equals(this.clientSecurityState, o.clientSecurityState); 1706 } 1707 1708 /** Generates a Hash-Code for {@code 'this'} instance */ 1709 public int hashCode() 1710 { 1711 return 1712 this.corsErrorStatus.hashCode() 1713 + (this.isWarning ? 1 : 0) 1714 + this.request.hashCode() 1715 + this.location.hashCode() 1716 + Objects.hashCode(this.initiatorOrigin) 1717 + Objects.hashCode(this.resourceIPAddressSpace) 1718 + this.clientSecurityState.hashCode(); 1719 } 1720 } 1721 1722 /** 1723 * Details for issues around "Attribution Reporting API" usage. 1724 * Explainer: https://github.com/WICG/attribution-reporting-api 1725 */ 1726 public static class AttributionReportingIssueDetails 1727 extends BaseType 1728 implements java.io.Serializable 1729 { 1730 /** For Object Serialization. java.io.Serializable */ 1731 protected static final long serialVersionUID = 1; 1732 1733 public boolean[] optionals() 1734 { return new boolean[] { false, true, true, true, }; } 1735 1736 /** <CODE>[No Description Provided by Google]</CODE> */ 1737 public final String violationType; 1738 1739 /** 1740 * <CODE>[No Description Provided by Google]</CODE> 1741 * <BR /><B CLASS=Opt>OPTIONAL</B> 1742 */ 1743 public final Audits.AffectedRequest request; 1744 1745 /** 1746 * <CODE>[No Description Provided by Google]</CODE> 1747 * <BR /><B CLASS=Opt>OPTIONAL</B> 1748 */ 1749 public final Integer violatingNodeId; 1750 1751 /** 1752 * <CODE>[No Description Provided by Google]</CODE> 1753 * <BR /><B CLASS=Opt>OPTIONAL</B> 1754 */ 1755 public final String invalidParameter; 1756 1757 /** 1758 * Constructor 1759 * 1760 * @param violationType - 1761 * 1762 * @param request - 1763 * <BR /><B CLASS=Opt>OPTIONAL</B> 1764 * 1765 * @param violatingNodeId - 1766 * <BR /><B CLASS=Opt>OPTIONAL</B> 1767 * 1768 * @param invalidParameter - 1769 * <BR /><B CLASS=Opt>OPTIONAL</B> 1770 */ 1771 public AttributionReportingIssueDetails( 1772 String violationType, Audits.AffectedRequest request, Integer violatingNodeId, 1773 String invalidParameter 1774 ) 1775 { 1776 // Exception-Check(s) to ensure that if any parameters which are not declared as 1777 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1778 1779 if (violationType == null) THROWS.throwNPE("violationType"); 1780 1781 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1782 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1783 1784 THROWS.checkIAE("violationType", violationType, "Audits.AttributionReportingIssueType", Audits.AttributionReportingIssueType); 1785 1786 this.violationType = violationType; 1787 this.request = request; 1788 this.violatingNodeId = violatingNodeId; 1789 this.invalidParameter = invalidParameter; 1790 } 1791 1792 /** 1793 * JSON Object Constructor 1794 * @param jo A Json-Object having data about an instance of {@code 'AttributionReportingIssueDetails'}. 1795 */ 1796 public AttributionReportingIssueDetails (JsonObject jo) 1797 { 1798 this.violationType = ReadJSON.getString(jo, "violationType", false, true); 1799 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, true, false); 1800 this.violatingNodeId = ReadBoxedJSON.getInteger(jo, "violatingNodeId", true); 1801 this.invalidParameter = ReadJSON.getString(jo, "invalidParameter", true, false); 1802 } 1803 1804 1805 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1806 public boolean equals(Object other) 1807 { 1808 if (this == other) return true; 1809 if (other == null) return false; 1810 if (other.getClass() != this.getClass()) return false; 1811 1812 AttributionReportingIssueDetails o = (AttributionReportingIssueDetails) other; 1813 1814 return 1815 Objects.equals(this.violationType, o.violationType) 1816 && Objects.equals(this.request, o.request) 1817 && Objects.equals(this.violatingNodeId, o.violatingNodeId) 1818 && Objects.equals(this.invalidParameter, o.invalidParameter); 1819 } 1820 1821 /** Generates a Hash-Code for {@code 'this'} instance */ 1822 public int hashCode() 1823 { 1824 return 1825 Objects.hashCode(this.violationType) 1826 + this.request.hashCode() 1827 + Objects.hashCode(this.violatingNodeId) 1828 + Objects.hashCode(this.invalidParameter); 1829 } 1830 } 1831 1832 /** 1833 * Details for issues about documents in Quirks Mode 1834 * or Limited Quirks Mode that affects page layouting. 1835 */ 1836 public static class QuirksModeIssueDetails 1837 extends BaseType 1838 implements java.io.Serializable 1839 { 1840 /** For Object Serialization. java.io.Serializable */ 1841 protected static final long serialVersionUID = 1; 1842 1843 public boolean[] optionals() 1844 { return new boolean[] { false, false, false, false, false, }; } 1845 1846 /** 1847 * If false, it means the document's mode is "quirks" 1848 * instead of "limited-quirks". 1849 */ 1850 public final boolean isLimitedQuirksMode; 1851 1852 /** <CODE>[No Description Provided by Google]</CODE> */ 1853 public final int documentNodeId; 1854 1855 /** <CODE>[No Description Provided by Google]</CODE> */ 1856 public final String url; 1857 1858 /** <CODE>[No Description Provided by Google]</CODE> */ 1859 public final String frameId; 1860 1861 /** <CODE>[No Description Provided by Google]</CODE> */ 1862 public final String loaderId; 1863 1864 /** 1865 * Constructor 1866 * 1867 * @param isLimitedQuirksMode 1868 * If false, it means the document's mode is "quirks" 1869 * instead of "limited-quirks". 1870 * 1871 * @param documentNodeId - 1872 * 1873 * @param url - 1874 * 1875 * @param frameId - 1876 * 1877 * @param loaderId - 1878 */ 1879 public QuirksModeIssueDetails( 1880 boolean isLimitedQuirksMode, int documentNodeId, String url, String frameId, 1881 String loaderId 1882 ) 1883 { 1884 // Exception-Check(s) to ensure that if any parameters which are not declared as 1885 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1886 1887 if (url == null) THROWS.throwNPE("url"); 1888 if (frameId == null) THROWS.throwNPE("frameId"); 1889 if (loaderId == null) THROWS.throwNPE("loaderId"); 1890 1891 this.isLimitedQuirksMode = isLimitedQuirksMode; 1892 this.documentNodeId = documentNodeId; 1893 this.url = url; 1894 this.frameId = frameId; 1895 this.loaderId = loaderId; 1896 } 1897 1898 /** 1899 * JSON Object Constructor 1900 * @param jo A Json-Object having data about an instance of {@code 'QuirksModeIssueDetails'}. 1901 */ 1902 public QuirksModeIssueDetails (JsonObject jo) 1903 { 1904 this.isLimitedQuirksMode = ReadPrimJSON.getBoolean(jo, "isLimitedQuirksMode"); 1905 this.documentNodeId = ReadPrimJSON.getInt(jo, "documentNodeId"); 1906 this.url = ReadJSON.getString(jo, "url", false, true); 1907 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 1908 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 1909 } 1910 1911 1912 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1913 public boolean equals(Object other) 1914 { 1915 if (this == other) return true; 1916 if (other == null) return false; 1917 if (other.getClass() != this.getClass()) return false; 1918 1919 QuirksModeIssueDetails o = (QuirksModeIssueDetails) other; 1920 1921 return 1922 (this.isLimitedQuirksMode == o.isLimitedQuirksMode) 1923 && Objects.equals(this.documentNodeId, o.documentNodeId) 1924 && Objects.equals(this.url, o.url) 1925 && Objects.equals(this.frameId, o.frameId) 1926 && Objects.equals(this.loaderId, o.loaderId); 1927 } 1928 1929 /** Generates a Hash-Code for {@code 'this'} instance */ 1930 public int hashCode() 1931 { 1932 return 1933 (this.isLimitedQuirksMode ? 1 : 0) 1934 + this.documentNodeId 1935 + Objects.hashCode(this.url) 1936 + Objects.hashCode(this.frameId) 1937 + Objects.hashCode(this.loaderId); 1938 } 1939 } 1940 1941 /** 1942 * <CODE>[No Description Provided by Google]</CODE> 1943 * <BR /><B CLASS=Dep>DEPRECATED</B> 1944 */ 1945 public static class NavigatorUserAgentIssueDetails 1946 extends BaseType 1947 implements java.io.Serializable 1948 { 1949 /** For Object Serialization. java.io.Serializable */ 1950 protected static final long serialVersionUID = 1; 1951 1952 public boolean[] optionals() 1953 { return new boolean[] { false, true, }; } 1954 1955 /** <CODE>[No Description Provided by Google]</CODE> */ 1956 public final String url; 1957 1958 /** 1959 * <CODE>[No Description Provided by Google]</CODE> 1960 * <BR /><B CLASS=Opt>OPTIONAL</B> 1961 */ 1962 public final Audits.SourceCodeLocation location; 1963 1964 /** 1965 * Constructor 1966 * 1967 * @param url - 1968 * 1969 * @param location - 1970 * <BR /><B CLASS=Opt>OPTIONAL</B> 1971 */ 1972 public NavigatorUserAgentIssueDetails(String url, Audits.SourceCodeLocation location) 1973 { 1974 // Exception-Check(s) to ensure that if any parameters which are not declared as 1975 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1976 1977 if (url == null) THROWS.throwNPE("url"); 1978 1979 this.url = url; 1980 this.location = location; 1981 } 1982 1983 /** 1984 * JSON Object Constructor 1985 * @param jo A Json-Object having data about an instance of {@code 'NavigatorUserAgentIssueDetails'}. 1986 */ 1987 public NavigatorUserAgentIssueDetails (JsonObject jo) 1988 { 1989 this.url = ReadJSON.getString(jo, "url", false, true); 1990 this.location = ReadJSON.getObject(jo, "location", Audits.SourceCodeLocation.class, true, false); 1991 } 1992 1993 1994 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1995 public boolean equals(Object other) 1996 { 1997 if (this == other) return true; 1998 if (other == null) return false; 1999 if (other.getClass() != this.getClass()) return false; 2000 2001 NavigatorUserAgentIssueDetails o = (NavigatorUserAgentIssueDetails) other; 2002 2003 return 2004 Objects.equals(this.url, o.url) 2005 && Objects.equals(this.location, o.location); 2006 } 2007 2008 /** Generates a Hash-Code for {@code 'this'} instance */ 2009 public int hashCode() 2010 { 2011 return 2012 Objects.hashCode(this.url) 2013 + this.location.hashCode(); 2014 } 2015 } 2016 2017 /** <CODE>[No Description Provided by Google]</CODE> */ 2018 public static class SharedDictionaryIssueDetails 2019 extends BaseType 2020 implements java.io.Serializable 2021 { 2022 /** For Object Serialization. java.io.Serializable */ 2023 protected static final long serialVersionUID = 1; 2024 2025 public boolean[] optionals() 2026 { return new boolean[] { false, false, }; } 2027 2028 /** <CODE>[No Description Provided by Google]</CODE> */ 2029 public final String sharedDictionaryError; 2030 2031 /** <CODE>[No Description Provided by Google]</CODE> */ 2032 public final Audits.AffectedRequest request; 2033 2034 /** 2035 * Constructor 2036 * 2037 * @param sharedDictionaryError - 2038 * 2039 * @param request - 2040 */ 2041 public SharedDictionaryIssueDetails 2042 (String sharedDictionaryError, Audits.AffectedRequest request) 2043 { 2044 // Exception-Check(s) to ensure that if any parameters which are not declared as 2045 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2046 2047 if (sharedDictionaryError == null) THROWS.throwNPE("sharedDictionaryError"); 2048 if (request == null) THROWS.throwNPE("request"); 2049 2050 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2051 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2052 2053 THROWS.checkIAE("sharedDictionaryError", sharedDictionaryError, "Audits.SharedDictionaryError", Audits.SharedDictionaryError); 2054 2055 this.sharedDictionaryError = sharedDictionaryError; 2056 this.request = request; 2057 } 2058 2059 /** 2060 * JSON Object Constructor 2061 * @param jo A Json-Object having data about an instance of {@code 'SharedDictionaryIssueDetails'}. 2062 */ 2063 public SharedDictionaryIssueDetails (JsonObject jo) 2064 { 2065 this.sharedDictionaryError = ReadJSON.getString(jo, "sharedDictionaryError", false, true); 2066 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, false, true); 2067 } 2068 2069 2070 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2071 public boolean equals(Object other) 2072 { 2073 if (this == other) return true; 2074 if (other == null) return false; 2075 if (other.getClass() != this.getClass()) return false; 2076 2077 SharedDictionaryIssueDetails o = (SharedDictionaryIssueDetails) other; 2078 2079 return 2080 Objects.equals(this.sharedDictionaryError, o.sharedDictionaryError) 2081 && Objects.equals(this.request, o.request); 2082 } 2083 2084 /** Generates a Hash-Code for {@code 'this'} instance */ 2085 public int hashCode() 2086 { 2087 return 2088 Objects.hashCode(this.sharedDictionaryError) 2089 + this.request.hashCode(); 2090 } 2091 } 2092 2093 /** <CODE>[No Description Provided by Google]</CODE> */ 2094 public static class SRIMessageSignatureIssueDetails 2095 extends BaseType 2096 implements java.io.Serializable 2097 { 2098 /** For Object Serialization. java.io.Serializable */ 2099 protected static final long serialVersionUID = 1; 2100 2101 public boolean[] optionals() 2102 { return new boolean[] { false, false, false, false, }; } 2103 2104 /** <CODE>[No Description Provided by Google]</CODE> */ 2105 public final String error; 2106 2107 /** <CODE>[No Description Provided by Google]</CODE> */ 2108 public final String signatureBase; 2109 2110 /** <CODE>[No Description Provided by Google]</CODE> */ 2111 public final String[] integrityAssertions; 2112 2113 /** <CODE>[No Description Provided by Google]</CODE> */ 2114 public final Audits.AffectedRequest request; 2115 2116 /** 2117 * Constructor 2118 * 2119 * @param error - 2120 * 2121 * @param signatureBase - 2122 * 2123 * @param integrityAssertions - 2124 * 2125 * @param request - 2126 */ 2127 public SRIMessageSignatureIssueDetails( 2128 String error, String signatureBase, String[] integrityAssertions, 2129 Audits.AffectedRequest request 2130 ) 2131 { 2132 // Exception-Check(s) to ensure that if any parameters which are not declared as 2133 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2134 2135 if (error == null) THROWS.throwNPE("error"); 2136 if (signatureBase == null) THROWS.throwNPE("signatureBase"); 2137 if (integrityAssertions == null) THROWS.throwNPE("integrityAssertions"); 2138 if (request == null) THROWS.throwNPE("request"); 2139 2140 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2141 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2142 2143 THROWS.checkIAE("error", error, "Audits.SRIMessageSignatureError", Audits.SRIMessageSignatureError); 2144 2145 this.error = error; 2146 this.signatureBase = signatureBase; 2147 this.integrityAssertions = integrityAssertions; 2148 this.request = request; 2149 } 2150 2151 /** 2152 * JSON Object Constructor 2153 * @param jo A Json-Object having data about an instance of {@code 'SRIMessageSignatureIssueDetails'}. 2154 */ 2155 public SRIMessageSignatureIssueDetails (JsonObject jo) 2156 { 2157 this.error = ReadJSON.getString(jo, "error", false, true); 2158 this.signatureBase = ReadJSON.getString(jo, "signatureBase", false, true); 2159 this.integrityAssertions = (jo.getJsonArray("integrityAssertions") == null) 2160 ? null 2161 : RJArrIntoStream.strArr(jo.getJsonArray("integrityAssertions"), null, 0).toArray(String[]::new); 2162 2163 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, false, true); 2164 } 2165 2166 2167 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2168 public boolean equals(Object other) 2169 { 2170 if (this == other) return true; 2171 if (other == null) return false; 2172 if (other.getClass() != this.getClass()) return false; 2173 2174 SRIMessageSignatureIssueDetails o = (SRIMessageSignatureIssueDetails) other; 2175 2176 return 2177 Objects.equals(this.error, o.error) 2178 && Objects.equals(this.signatureBase, o.signatureBase) 2179 && Arrays.deepEquals(this.integrityAssertions, o.integrityAssertions) 2180 && Objects.equals(this.request, o.request); 2181 } 2182 2183 /** Generates a Hash-Code for {@code 'this'} instance */ 2184 public int hashCode() 2185 { 2186 return 2187 Objects.hashCode(this.error) 2188 + Objects.hashCode(this.signatureBase) 2189 + Arrays.deepHashCode(this.integrityAssertions) 2190 + this.request.hashCode(); 2191 } 2192 } 2193 2194 /** <CODE>[No Description Provided by Google]</CODE> */ 2195 public static class UnencodedDigestIssueDetails 2196 extends BaseType 2197 implements java.io.Serializable 2198 { 2199 /** For Object Serialization. java.io.Serializable */ 2200 protected static final long serialVersionUID = 1; 2201 2202 public boolean[] optionals() 2203 { return new boolean[] { false, false, }; } 2204 2205 /** <CODE>[No Description Provided by Google]</CODE> */ 2206 public final String error; 2207 2208 /** <CODE>[No Description Provided by Google]</CODE> */ 2209 public final Audits.AffectedRequest request; 2210 2211 /** 2212 * Constructor 2213 * 2214 * @param error - 2215 * 2216 * @param request - 2217 */ 2218 public UnencodedDigestIssueDetails(String error, Audits.AffectedRequest request) 2219 { 2220 // Exception-Check(s) to ensure that if any parameters which are not declared as 2221 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2222 2223 if (error == null) THROWS.throwNPE("error"); 2224 if (request == null) THROWS.throwNPE("request"); 2225 2226 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2227 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2228 2229 THROWS.checkIAE("error", error, "Audits.UnencodedDigestError", Audits.UnencodedDigestError); 2230 2231 this.error = error; 2232 this.request = request; 2233 } 2234 2235 /** 2236 * JSON Object Constructor 2237 * @param jo A Json-Object having data about an instance of {@code 'UnencodedDigestIssueDetails'}. 2238 */ 2239 public UnencodedDigestIssueDetails (JsonObject jo) 2240 { 2241 this.error = ReadJSON.getString(jo, "error", false, true); 2242 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, false, true); 2243 } 2244 2245 2246 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2247 public boolean equals(Object other) 2248 { 2249 if (this == other) return true; 2250 if (other == null) return false; 2251 if (other.getClass() != this.getClass()) return false; 2252 2253 UnencodedDigestIssueDetails o = (UnencodedDigestIssueDetails) other; 2254 2255 return 2256 Objects.equals(this.error, o.error) 2257 && Objects.equals(this.request, o.request); 2258 } 2259 2260 /** Generates a Hash-Code for {@code 'this'} instance */ 2261 public int hashCode() 2262 { 2263 return 2264 Objects.hashCode(this.error) 2265 + this.request.hashCode(); 2266 } 2267 } 2268 2269 /** Depending on the concrete errorType, different properties are set. */ 2270 public static class GenericIssueDetails 2271 extends BaseType 2272 implements java.io.Serializable 2273 { 2274 /** For Object Serialization. java.io.Serializable */ 2275 protected static final long serialVersionUID = 1; 2276 2277 public boolean[] optionals() 2278 { return new boolean[] { false, true, true, true, true, }; } 2279 2280 /** Issues with the same errorType are aggregated in the frontend. */ 2281 public final String errorType; 2282 2283 /** 2284 * <CODE>[No Description Provided by Google]</CODE> 2285 * <BR /><B CLASS=Opt>OPTIONAL</B> 2286 */ 2287 public final String frameId; 2288 2289 /** 2290 * <CODE>[No Description Provided by Google]</CODE> 2291 * <BR /><B CLASS=Opt>OPTIONAL</B> 2292 */ 2293 public final Integer violatingNodeId; 2294 2295 /** 2296 * <CODE>[No Description Provided by Google]</CODE> 2297 * <BR /><B CLASS=Opt>OPTIONAL</B> 2298 */ 2299 public final String violatingNodeAttribute; 2300 2301 /** 2302 * <CODE>[No Description Provided by Google]</CODE> 2303 * <BR /><B CLASS=Opt>OPTIONAL</B> 2304 */ 2305 public final Audits.AffectedRequest request; 2306 2307 /** 2308 * Constructor 2309 * 2310 * @param errorType Issues with the same errorType are aggregated in the frontend. 2311 * 2312 * @param frameId - 2313 * <BR /><B CLASS=Opt>OPTIONAL</B> 2314 * 2315 * @param violatingNodeId - 2316 * <BR /><B CLASS=Opt>OPTIONAL</B> 2317 * 2318 * @param violatingNodeAttribute - 2319 * <BR /><B CLASS=Opt>OPTIONAL</B> 2320 * 2321 * @param request - 2322 * <BR /><B CLASS=Opt>OPTIONAL</B> 2323 */ 2324 public GenericIssueDetails( 2325 String errorType, String frameId, Integer violatingNodeId, 2326 String violatingNodeAttribute, Audits.AffectedRequest request 2327 ) 2328 { 2329 // Exception-Check(s) to ensure that if any parameters which are not declared as 2330 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2331 2332 if (errorType == null) THROWS.throwNPE("errorType"); 2333 2334 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2335 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2336 2337 THROWS.checkIAE("errorType", errorType, "Audits.GenericIssueErrorType", Audits.GenericIssueErrorType); 2338 2339 this.errorType = errorType; 2340 this.frameId = frameId; 2341 this.violatingNodeId = violatingNodeId; 2342 this.violatingNodeAttribute = violatingNodeAttribute; 2343 this.request = request; 2344 } 2345 2346 /** 2347 * JSON Object Constructor 2348 * @param jo A Json-Object having data about an instance of {@code 'GenericIssueDetails'}. 2349 */ 2350 public GenericIssueDetails (JsonObject jo) 2351 { 2352 this.errorType = ReadJSON.getString(jo, "errorType", false, true); 2353 this.frameId = ReadJSON.getString(jo, "frameId", true, false); 2354 this.violatingNodeId = ReadBoxedJSON.getInteger(jo, "violatingNodeId", true); 2355 this.violatingNodeAttribute = ReadJSON.getString(jo, "violatingNodeAttribute", true, false); 2356 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, true, false); 2357 } 2358 2359 2360 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2361 public boolean equals(Object other) 2362 { 2363 if (this == other) return true; 2364 if (other == null) return false; 2365 if (other.getClass() != this.getClass()) return false; 2366 2367 GenericIssueDetails o = (GenericIssueDetails) other; 2368 2369 return 2370 Objects.equals(this.errorType, o.errorType) 2371 && Objects.equals(this.frameId, o.frameId) 2372 && Objects.equals(this.violatingNodeId, o.violatingNodeId) 2373 && Objects.equals(this.violatingNodeAttribute, o.violatingNodeAttribute) 2374 && Objects.equals(this.request, o.request); 2375 } 2376 2377 /** Generates a Hash-Code for {@code 'this'} instance */ 2378 public int hashCode() 2379 { 2380 return 2381 Objects.hashCode(this.errorType) 2382 + Objects.hashCode(this.frameId) 2383 + Objects.hashCode(this.violatingNodeId) 2384 + Objects.hashCode(this.violatingNodeAttribute) 2385 + this.request.hashCode(); 2386 } 2387 } 2388 2389 /** 2390 * This issue tracks information needed to print a deprecation message. 2391 * https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md 2392 */ 2393 public static class DeprecationIssueDetails 2394 extends BaseType 2395 implements java.io.Serializable 2396 { 2397 /** For Object Serialization. java.io.Serializable */ 2398 protected static final long serialVersionUID = 1; 2399 2400 public boolean[] optionals() 2401 { return new boolean[] { true, false, false, }; } 2402 2403 /** 2404 * <CODE>[No Description Provided by Google]</CODE> 2405 * <BR /><B CLASS=Opt>OPTIONAL</B> 2406 */ 2407 public final Audits.AffectedFrame affectedFrame; 2408 2409 /** <CODE>[No Description Provided by Google]</CODE> */ 2410 public final Audits.SourceCodeLocation sourceCodeLocation; 2411 2412 /** One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5 */ 2413 public final String type; 2414 2415 /** 2416 * Constructor 2417 * 2418 * @param affectedFrame - 2419 * <BR /><B CLASS=Opt>OPTIONAL</B> 2420 * 2421 * @param sourceCodeLocation - 2422 * 2423 * @param type One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5 2424 */ 2425 public DeprecationIssueDetails( 2426 Audits.AffectedFrame affectedFrame, Audits.SourceCodeLocation sourceCodeLocation, 2427 String type 2428 ) 2429 { 2430 // Exception-Check(s) to ensure that if any parameters which are not declared as 2431 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2432 2433 if (sourceCodeLocation == null) THROWS.throwNPE("sourceCodeLocation"); 2434 if (type == null) THROWS.throwNPE("type"); 2435 2436 this.affectedFrame = affectedFrame; 2437 this.sourceCodeLocation = sourceCodeLocation; 2438 this.type = type; 2439 } 2440 2441 /** 2442 * JSON Object Constructor 2443 * @param jo A Json-Object having data about an instance of {@code 'DeprecationIssueDetails'}. 2444 */ 2445 public DeprecationIssueDetails (JsonObject jo) 2446 { 2447 this.affectedFrame = ReadJSON.getObject(jo, "affectedFrame", Audits.AffectedFrame.class, true, false); 2448 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, false, true); 2449 this.type = ReadJSON.getString(jo, "type", false, true); 2450 } 2451 2452 2453 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2454 public boolean equals(Object other) 2455 { 2456 if (this == other) return true; 2457 if (other == null) return false; 2458 if (other.getClass() != this.getClass()) return false; 2459 2460 DeprecationIssueDetails o = (DeprecationIssueDetails) other; 2461 2462 return 2463 Objects.equals(this.affectedFrame, o.affectedFrame) 2464 && Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 2465 && Objects.equals(this.type, o.type); 2466 } 2467 2468 /** Generates a Hash-Code for {@code 'this'} instance */ 2469 public int hashCode() 2470 { 2471 return 2472 this.affectedFrame.hashCode() 2473 + this.sourceCodeLocation.hashCode() 2474 + Objects.hashCode(this.type); 2475 } 2476 } 2477 2478 /** 2479 * This issue warns about sites in the redirect chain of a finished navigation 2480 * that may be flagged as trackers and have their state cleared if they don't 2481 * receive a user interaction. Note that in this context 'site' means eTLD+1. 2482 * For example, if the URL {@code https://example.test:80/bounce} was in the 2483 * redirect chain, the site reported would be {@code example.test}. 2484 */ 2485 public static class BounceTrackingIssueDetails 2486 extends BaseType 2487 implements java.io.Serializable 2488 { 2489 /** For Object Serialization. java.io.Serializable */ 2490 protected static final long serialVersionUID = 1; 2491 2492 public boolean[] optionals() 2493 { return new boolean[] { false, }; } 2494 2495 /** <CODE>[No Description Provided by Google]</CODE> */ 2496 public final String[] trackingSites; 2497 2498 /** 2499 * Constructor 2500 * 2501 * @param trackingSites - 2502 */ 2503 public BounceTrackingIssueDetails(String[] trackingSites) 2504 { 2505 // Exception-Check(s) to ensure that if any parameters which are not declared as 2506 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2507 2508 if (trackingSites == null) THROWS.throwNPE("trackingSites"); 2509 2510 this.trackingSites = trackingSites; 2511 } 2512 2513 /** 2514 * JSON Object Constructor 2515 * @param jo A Json-Object having data about an instance of {@code 'BounceTrackingIssueDetails'}. 2516 */ 2517 public BounceTrackingIssueDetails (JsonObject jo) 2518 { 2519 this.trackingSites = (jo.getJsonArray("trackingSites") == null) 2520 ? null 2521 : RJArrIntoStream.strArr(jo.getJsonArray("trackingSites"), null, 0).toArray(String[]::new); 2522 2523 } 2524 2525 2526 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2527 public boolean equals(Object other) 2528 { 2529 if (this == other) return true; 2530 if (other == null) return false; 2531 if (other.getClass() != this.getClass()) return false; 2532 2533 BounceTrackingIssueDetails o = (BounceTrackingIssueDetails) other; 2534 2535 return 2536 Arrays.deepEquals(this.trackingSites, o.trackingSites); 2537 } 2538 2539 /** Generates a Hash-Code for {@code 'this'} instance */ 2540 public int hashCode() 2541 { 2542 return 2543 Arrays.deepHashCode(this.trackingSites); 2544 } 2545 } 2546 2547 /** 2548 * This issue warns about third-party sites that are accessing cookies on the 2549 * current page, and have been permitted due to having a global metadata grant. 2550 * Note that in this context 'site' means eTLD+1. For example, if the URL 2551 * {@code https://example.test:80/web_page} was accessing cookies, the site reported 2552 * would be {@code example.test}. 2553 */ 2554 public static class CookieDeprecationMetadataIssueDetails 2555 extends BaseType 2556 implements java.io.Serializable 2557 { 2558 /** For Object Serialization. java.io.Serializable */ 2559 protected static final long serialVersionUID = 1; 2560 2561 public boolean[] optionals() 2562 { return new boolean[] { false, false, false, false, }; } 2563 2564 /** <CODE>[No Description Provided by Google]</CODE> */ 2565 public final String[] allowedSites; 2566 2567 /** <CODE>[No Description Provided by Google]</CODE> */ 2568 public final Number optOutPercentage; 2569 2570 /** <CODE>[No Description Provided by Google]</CODE> */ 2571 public final boolean isOptOutTopLevel; 2572 2573 /** <CODE>[No Description Provided by Google]</CODE> */ 2574 public final String operation; 2575 2576 /** 2577 * Constructor 2578 * 2579 * @param allowedSites - 2580 * 2581 * @param optOutPercentage - 2582 * 2583 * @param isOptOutTopLevel - 2584 * 2585 * @param operation - 2586 */ 2587 public CookieDeprecationMetadataIssueDetails( 2588 String[] allowedSites, Number optOutPercentage, boolean isOptOutTopLevel, 2589 String operation 2590 ) 2591 { 2592 // Exception-Check(s) to ensure that if any parameters which are not declared as 2593 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2594 2595 if (allowedSites == null) THROWS.throwNPE("allowedSites"); 2596 if (optOutPercentage == null) THROWS.throwNPE("optOutPercentage"); 2597 if (operation == null) THROWS.throwNPE("operation"); 2598 2599 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2600 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2601 2602 THROWS.checkIAE("operation", operation, "Audits.CookieOperation", Audits.CookieOperation); 2603 2604 this.allowedSites = allowedSites; 2605 this.optOutPercentage = optOutPercentage; 2606 this.isOptOutTopLevel = isOptOutTopLevel; 2607 this.operation = operation; 2608 } 2609 2610 /** 2611 * JSON Object Constructor 2612 * @param jo A Json-Object having data about an instance of {@code 'CookieDeprecationMetadataIssueDetails'}. 2613 */ 2614 public CookieDeprecationMetadataIssueDetails (JsonObject jo) 2615 { 2616 this.allowedSites = (jo.getJsonArray("allowedSites") == null) 2617 ? null 2618 : RJArrIntoStream.strArr(jo.getJsonArray("allowedSites"), null, 0).toArray(String[]::new); 2619 2620 this.optOutPercentage = ReadNumberJSON.get(jo, "optOutPercentage", false, true); 2621 this.isOptOutTopLevel = ReadPrimJSON.getBoolean(jo, "isOptOutTopLevel"); 2622 this.operation = ReadJSON.getString(jo, "operation", false, true); 2623 } 2624 2625 2626 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2627 public boolean equals(Object other) 2628 { 2629 if (this == other) return true; 2630 if (other == null) return false; 2631 if (other.getClass() != this.getClass()) return false; 2632 2633 CookieDeprecationMetadataIssueDetails o = (CookieDeprecationMetadataIssueDetails) other; 2634 2635 return 2636 Arrays.deepEquals(this.allowedSites, o.allowedSites) 2637 && Objects.equals(this.optOutPercentage, o.optOutPercentage) 2638 && (this.isOptOutTopLevel == o.isOptOutTopLevel) 2639 && Objects.equals(this.operation, o.operation); 2640 } 2641 2642 /** Generates a Hash-Code for {@code 'this'} instance */ 2643 public int hashCode() 2644 { 2645 return 2646 Arrays.deepHashCode(this.allowedSites) 2647 + Objects.hashCode(this.optOutPercentage) 2648 + (this.isOptOutTopLevel ? 1 : 0) 2649 + Objects.hashCode(this.operation); 2650 } 2651 } 2652 2653 /** <CODE>[No Description Provided by Google]</CODE> */ 2654 public static class FederatedAuthRequestIssueDetails 2655 extends BaseType 2656 implements java.io.Serializable 2657 { 2658 /** For Object Serialization. java.io.Serializable */ 2659 protected static final long serialVersionUID = 1; 2660 2661 public boolean[] optionals() 2662 { return new boolean[] { false, }; } 2663 2664 /** <CODE>[No Description Provided by Google]</CODE> */ 2665 public final String federatedAuthRequestIssueReason; 2666 2667 /** 2668 * Constructor 2669 * 2670 * @param federatedAuthRequestIssueReason - 2671 */ 2672 public FederatedAuthRequestIssueDetails(String federatedAuthRequestIssueReason) 2673 { 2674 // Exception-Check(s) to ensure that if any parameters which are not declared as 2675 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2676 2677 if (federatedAuthRequestIssueReason == null) THROWS.throwNPE("federatedAuthRequestIssueReason"); 2678 2679 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2680 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2681 2682 THROWS.checkIAE("federatedAuthRequestIssueReason", federatedAuthRequestIssueReason, "Audits.FederatedAuthRequestIssueReason", Audits.FederatedAuthRequestIssueReason); 2683 2684 this.federatedAuthRequestIssueReason = federatedAuthRequestIssueReason; 2685 } 2686 2687 /** 2688 * JSON Object Constructor 2689 * @param jo A Json-Object having data about an instance of {@code 'FederatedAuthRequestIssueDetails'}. 2690 */ 2691 public FederatedAuthRequestIssueDetails (JsonObject jo) 2692 { 2693 this.federatedAuthRequestIssueReason = ReadJSON.getString(jo, "federatedAuthRequestIssueReason", false, true); 2694 } 2695 2696 2697 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2698 public boolean equals(Object other) 2699 { 2700 if (this == other) return true; 2701 if (other == null) return false; 2702 if (other.getClass() != this.getClass()) return false; 2703 2704 FederatedAuthRequestIssueDetails o = (FederatedAuthRequestIssueDetails) other; 2705 2706 return 2707 Objects.equals(this.federatedAuthRequestIssueReason, o.federatedAuthRequestIssueReason); 2708 } 2709 2710 /** Generates a Hash-Code for {@code 'this'} instance */ 2711 public int hashCode() 2712 { 2713 return 2714 Objects.hashCode(this.federatedAuthRequestIssueReason); 2715 } 2716 } 2717 2718 /** <CODE>[No Description Provided by Google]</CODE> */ 2719 public static class FederatedAuthUserInfoRequestIssueDetails 2720 extends BaseType 2721 implements java.io.Serializable 2722 { 2723 /** For Object Serialization. java.io.Serializable */ 2724 protected static final long serialVersionUID = 1; 2725 2726 public boolean[] optionals() 2727 { return new boolean[] { false, }; } 2728 2729 /** <CODE>[No Description Provided by Google]</CODE> */ 2730 public final String federatedAuthUserInfoRequestIssueReason; 2731 2732 /** 2733 * Constructor 2734 * 2735 * @param federatedAuthUserInfoRequestIssueReason - 2736 */ 2737 public FederatedAuthUserInfoRequestIssueDetails 2738 (String federatedAuthUserInfoRequestIssueReason) 2739 { 2740 // Exception-Check(s) to ensure that if any parameters which are not declared as 2741 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2742 2743 if (federatedAuthUserInfoRequestIssueReason == null) THROWS.throwNPE("federatedAuthUserInfoRequestIssueReason"); 2744 2745 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2746 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2747 2748 THROWS.checkIAE("federatedAuthUserInfoRequestIssueReason", federatedAuthUserInfoRequestIssueReason, "Audits.FederatedAuthUserInfoRequestIssueReason", Audits.FederatedAuthUserInfoRequestIssueReason); 2749 2750 this.federatedAuthUserInfoRequestIssueReason = federatedAuthUserInfoRequestIssueReason; 2751 } 2752 2753 /** 2754 * JSON Object Constructor 2755 * @param jo A Json-Object having data about an instance of {@code 'FederatedAuthUserInfoRequestIssueDetails'}. 2756 */ 2757 public FederatedAuthUserInfoRequestIssueDetails (JsonObject jo) 2758 { 2759 this.federatedAuthUserInfoRequestIssueReason = ReadJSON.getString(jo, "federatedAuthUserInfoRequestIssueReason", false, true); 2760 } 2761 2762 2763 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2764 public boolean equals(Object other) 2765 { 2766 if (this == other) return true; 2767 if (other == null) return false; 2768 if (other.getClass() != this.getClass()) return false; 2769 2770 FederatedAuthUserInfoRequestIssueDetails o = (FederatedAuthUserInfoRequestIssueDetails) other; 2771 2772 return 2773 Objects.equals(this.federatedAuthUserInfoRequestIssueReason, o.federatedAuthUserInfoRequestIssueReason); 2774 } 2775 2776 /** Generates a Hash-Code for {@code 'this'} instance */ 2777 public int hashCode() 2778 { 2779 return 2780 Objects.hashCode(this.federatedAuthUserInfoRequestIssueReason); 2781 } 2782 } 2783 2784 /** 2785 * This issue tracks client hints related issues. It's used to deprecate old 2786 * features, encourage the use of new ones, and provide general guidance. 2787 */ 2788 public static class ClientHintIssueDetails 2789 extends BaseType 2790 implements java.io.Serializable 2791 { 2792 /** For Object Serialization. java.io.Serializable */ 2793 protected static final long serialVersionUID = 1; 2794 2795 public boolean[] optionals() 2796 { return new boolean[] { false, false, }; } 2797 2798 /** <CODE>[No Description Provided by Google]</CODE> */ 2799 public final Audits.SourceCodeLocation sourceCodeLocation; 2800 2801 /** <CODE>[No Description Provided by Google]</CODE> */ 2802 public final String clientHintIssueReason; 2803 2804 /** 2805 * Constructor 2806 * 2807 * @param sourceCodeLocation - 2808 * 2809 * @param clientHintIssueReason - 2810 */ 2811 public ClientHintIssueDetails 2812 (Audits.SourceCodeLocation sourceCodeLocation, String clientHintIssueReason) 2813 { 2814 // Exception-Check(s) to ensure that if any parameters which are not declared as 2815 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2816 2817 if (sourceCodeLocation == null) THROWS.throwNPE("sourceCodeLocation"); 2818 if (clientHintIssueReason == null) THROWS.throwNPE("clientHintIssueReason"); 2819 2820 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2821 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2822 2823 THROWS.checkIAE("clientHintIssueReason", clientHintIssueReason, "Audits.ClientHintIssueReason", Audits.ClientHintIssueReason); 2824 2825 this.sourceCodeLocation = sourceCodeLocation; 2826 this.clientHintIssueReason = clientHintIssueReason; 2827 } 2828 2829 /** 2830 * JSON Object Constructor 2831 * @param jo A Json-Object having data about an instance of {@code 'ClientHintIssueDetails'}. 2832 */ 2833 public ClientHintIssueDetails (JsonObject jo) 2834 { 2835 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, false, true); 2836 this.clientHintIssueReason = ReadJSON.getString(jo, "clientHintIssueReason", false, true); 2837 } 2838 2839 2840 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2841 public boolean equals(Object other) 2842 { 2843 if (this == other) return true; 2844 if (other == null) return false; 2845 if (other.getClass() != this.getClass()) return false; 2846 2847 ClientHintIssueDetails o = (ClientHintIssueDetails) other; 2848 2849 return 2850 Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 2851 && Objects.equals(this.clientHintIssueReason, o.clientHintIssueReason); 2852 } 2853 2854 /** Generates a Hash-Code for {@code 'this'} instance */ 2855 public int hashCode() 2856 { 2857 return 2858 this.sourceCodeLocation.hashCode() 2859 + Objects.hashCode(this.clientHintIssueReason); 2860 } 2861 } 2862 2863 /** <CODE>[No Description Provided by Google]</CODE> */ 2864 public static class FailedRequestInfo 2865 extends BaseType 2866 implements java.io.Serializable 2867 { 2868 /** For Object Serialization. java.io.Serializable */ 2869 protected static final long serialVersionUID = 1; 2870 2871 public boolean[] optionals() 2872 { return new boolean[] { false, false, true, }; } 2873 2874 /** The URL that failed to load. */ 2875 public final String url; 2876 2877 /** The failure message for the failed request. */ 2878 public final String failureMessage; 2879 2880 /** 2881 * <CODE>[No Description Provided by Google]</CODE> 2882 * <BR /><B CLASS=Opt>OPTIONAL</B> 2883 */ 2884 public final String requestId; 2885 2886 /** 2887 * Constructor 2888 * 2889 * @param url The URL that failed to load. 2890 * 2891 * @param failureMessage The failure message for the failed request. 2892 * 2893 * @param requestId - 2894 * <BR /><B CLASS=Opt>OPTIONAL</B> 2895 */ 2896 public FailedRequestInfo(String url, String failureMessage, String requestId) 2897 { 2898 // Exception-Check(s) to ensure that if any parameters which are not declared as 2899 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2900 2901 if (url == null) THROWS.throwNPE("url"); 2902 if (failureMessage == null) THROWS.throwNPE("failureMessage"); 2903 2904 this.url = url; 2905 this.failureMessage = failureMessage; 2906 this.requestId = requestId; 2907 } 2908 2909 /** 2910 * JSON Object Constructor 2911 * @param jo A Json-Object having data about an instance of {@code 'FailedRequestInfo'}. 2912 */ 2913 public FailedRequestInfo (JsonObject jo) 2914 { 2915 this.url = ReadJSON.getString(jo, "url", false, true); 2916 this.failureMessage = ReadJSON.getString(jo, "failureMessage", false, true); 2917 this.requestId = ReadJSON.getString(jo, "requestId", true, false); 2918 } 2919 2920 2921 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2922 public boolean equals(Object other) 2923 { 2924 if (this == other) return true; 2925 if (other == null) return false; 2926 if (other.getClass() != this.getClass()) return false; 2927 2928 FailedRequestInfo o = (FailedRequestInfo) other; 2929 2930 return 2931 Objects.equals(this.url, o.url) 2932 && Objects.equals(this.failureMessage, o.failureMessage) 2933 && Objects.equals(this.requestId, o.requestId); 2934 } 2935 2936 /** Generates a Hash-Code for {@code 'this'} instance */ 2937 public int hashCode() 2938 { 2939 return 2940 Objects.hashCode(this.url) 2941 + Objects.hashCode(this.failureMessage) 2942 + Objects.hashCode(this.requestId); 2943 } 2944 } 2945 2946 /** <CODE>[No Description Provided by Google]</CODE> */ 2947 public static class PartitioningBlobURLIssueDetails 2948 extends BaseType 2949 implements java.io.Serializable 2950 { 2951 /** For Object Serialization. java.io.Serializable */ 2952 protected static final long serialVersionUID = 1; 2953 2954 public boolean[] optionals() 2955 { return new boolean[] { false, false, }; } 2956 2957 /** The BlobURL that failed to load. */ 2958 public final String url; 2959 2960 /** Additional information about the Partitioning Blob URL issue. */ 2961 public final String partitioningBlobURLInfo; 2962 2963 /** 2964 * Constructor 2965 * 2966 * @param url The BlobURL that failed to load. 2967 * 2968 * @param partitioningBlobURLInfo Additional information about the Partitioning Blob URL issue. 2969 */ 2970 public PartitioningBlobURLIssueDetails(String url, String partitioningBlobURLInfo) 2971 { 2972 // Exception-Check(s) to ensure that if any parameters which are not declared as 2973 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2974 2975 if (url == null) THROWS.throwNPE("url"); 2976 if (partitioningBlobURLInfo == null) THROWS.throwNPE("partitioningBlobURLInfo"); 2977 2978 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2979 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2980 2981 THROWS.checkIAE("partitioningBlobURLInfo", partitioningBlobURLInfo, "Audits.PartitioningBlobURLInfo", Audits.PartitioningBlobURLInfo); 2982 2983 this.url = url; 2984 this.partitioningBlobURLInfo = partitioningBlobURLInfo; 2985 } 2986 2987 /** 2988 * JSON Object Constructor 2989 * @param jo A Json-Object having data about an instance of {@code 'PartitioningBlobURLIssueDetails'}. 2990 */ 2991 public PartitioningBlobURLIssueDetails (JsonObject jo) 2992 { 2993 this.url = ReadJSON.getString(jo, "url", false, true); 2994 this.partitioningBlobURLInfo = ReadJSON.getString(jo, "partitioningBlobURLInfo", false, true); 2995 } 2996 2997 2998 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2999 public boolean equals(Object other) 3000 { 3001 if (this == other) return true; 3002 if (other == null) return false; 3003 if (other.getClass() != this.getClass()) return false; 3004 3005 PartitioningBlobURLIssueDetails o = (PartitioningBlobURLIssueDetails) other; 3006 3007 return 3008 Objects.equals(this.url, o.url) 3009 && Objects.equals(this.partitioningBlobURLInfo, o.partitioningBlobURLInfo); 3010 } 3011 3012 /** Generates a Hash-Code for {@code 'this'} instance */ 3013 public int hashCode() 3014 { 3015 return 3016 Objects.hashCode(this.url) 3017 + Objects.hashCode(this.partitioningBlobURLInfo); 3018 } 3019 } 3020 3021 /** This issue warns about errors in the select or summary element content model. */ 3022 public static class ElementAccessibilityIssueDetails 3023 extends BaseType 3024 implements java.io.Serializable 3025 { 3026 /** For Object Serialization. java.io.Serializable */ 3027 protected static final long serialVersionUID = 1; 3028 3029 public boolean[] optionals() 3030 { return new boolean[] { false, false, false, }; } 3031 3032 /** <CODE>[No Description Provided by Google]</CODE> */ 3033 public final int nodeId; 3034 3035 /** <CODE>[No Description Provided by Google]</CODE> */ 3036 public final String elementAccessibilityIssueReason; 3037 3038 /** <CODE>[No Description Provided by Google]</CODE> */ 3039 public final boolean hasDisallowedAttributes; 3040 3041 /** 3042 * Constructor 3043 * 3044 * @param nodeId - 3045 * 3046 * @param elementAccessibilityIssueReason - 3047 * 3048 * @param hasDisallowedAttributes - 3049 */ 3050 public ElementAccessibilityIssueDetails 3051 (int nodeId, String elementAccessibilityIssueReason, boolean hasDisallowedAttributes) 3052 { 3053 // Exception-Check(s) to ensure that if any parameters which are not declared as 3054 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3055 3056 if (elementAccessibilityIssueReason == null) THROWS.throwNPE("elementAccessibilityIssueReason"); 3057 3058 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3059 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3060 3061 THROWS.checkIAE("elementAccessibilityIssueReason", elementAccessibilityIssueReason, "Audits.ElementAccessibilityIssueReason", Audits.ElementAccessibilityIssueReason); 3062 3063 this.nodeId = nodeId; 3064 this.elementAccessibilityIssueReason = elementAccessibilityIssueReason; 3065 this.hasDisallowedAttributes = hasDisallowedAttributes; 3066 } 3067 3068 /** 3069 * JSON Object Constructor 3070 * @param jo A Json-Object having data about an instance of {@code 'ElementAccessibilityIssueDetails'}. 3071 */ 3072 public ElementAccessibilityIssueDetails (JsonObject jo) 3073 { 3074 this.nodeId = ReadPrimJSON.getInt(jo, "nodeId"); 3075 this.elementAccessibilityIssueReason = ReadJSON.getString(jo, "elementAccessibilityIssueReason", false, true); 3076 this.hasDisallowedAttributes = ReadPrimJSON.getBoolean(jo, "hasDisallowedAttributes"); 3077 } 3078 3079 3080 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3081 public boolean equals(Object other) 3082 { 3083 if (this == other) return true; 3084 if (other == null) return false; 3085 if (other.getClass() != this.getClass()) return false; 3086 3087 ElementAccessibilityIssueDetails o = (ElementAccessibilityIssueDetails) other; 3088 3089 return 3090 Objects.equals(this.nodeId, o.nodeId) 3091 && Objects.equals(this.elementAccessibilityIssueReason, o.elementAccessibilityIssueReason) 3092 && (this.hasDisallowedAttributes == o.hasDisallowedAttributes); 3093 } 3094 3095 /** Generates a Hash-Code for {@code 'this'} instance */ 3096 public int hashCode() 3097 { 3098 return 3099 this.nodeId 3100 + Objects.hashCode(this.elementAccessibilityIssueReason) 3101 + (this.hasDisallowedAttributes ? 1 : 0); 3102 } 3103 } 3104 3105 /** This issue warns when a referenced stylesheet couldn't be loaded. */ 3106 public static class StylesheetLoadingIssueDetails 3107 extends BaseType 3108 implements java.io.Serializable 3109 { 3110 /** For Object Serialization. java.io.Serializable */ 3111 protected static final long serialVersionUID = 1; 3112 3113 public boolean[] optionals() 3114 { return new boolean[] { false, false, true, }; } 3115 3116 /** Source code position that referenced the failing stylesheet. */ 3117 public final Audits.SourceCodeLocation sourceCodeLocation; 3118 3119 /** Reason why the stylesheet couldn't be loaded. */ 3120 public final String styleSheetLoadingIssueReason; 3121 3122 /** 3123 * Contains additional info when the failure was due to a request. 3124 * <BR /><B CLASS=Opt>OPTIONAL</B> 3125 */ 3126 public final Audits.FailedRequestInfo failedRequestInfo; 3127 3128 /** 3129 * Constructor 3130 * 3131 * @param sourceCodeLocation Source code position that referenced the failing stylesheet. 3132 * 3133 * @param styleSheetLoadingIssueReason Reason why the stylesheet couldn't be loaded. 3134 * 3135 * @param failedRequestInfo Contains additional info when the failure was due to a request. 3136 * <BR /><B CLASS=Opt>OPTIONAL</B> 3137 */ 3138 public StylesheetLoadingIssueDetails( 3139 Audits.SourceCodeLocation sourceCodeLocation, String styleSheetLoadingIssueReason, 3140 Audits.FailedRequestInfo failedRequestInfo 3141 ) 3142 { 3143 // Exception-Check(s) to ensure that if any parameters which are not declared as 3144 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3145 3146 if (sourceCodeLocation == null) THROWS.throwNPE("sourceCodeLocation"); 3147 if (styleSheetLoadingIssueReason == null) THROWS.throwNPE("styleSheetLoadingIssueReason"); 3148 3149 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3150 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3151 3152 THROWS.checkIAE("styleSheetLoadingIssueReason", styleSheetLoadingIssueReason, "Audits.StyleSheetLoadingIssueReason", Audits.StyleSheetLoadingIssueReason); 3153 3154 this.sourceCodeLocation = sourceCodeLocation; 3155 this.styleSheetLoadingIssueReason = styleSheetLoadingIssueReason; 3156 this.failedRequestInfo = failedRequestInfo; 3157 } 3158 3159 /** 3160 * JSON Object Constructor 3161 * @param jo A Json-Object having data about an instance of {@code 'StylesheetLoadingIssueDetails'}. 3162 */ 3163 public StylesheetLoadingIssueDetails (JsonObject jo) 3164 { 3165 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, false, true); 3166 this.styleSheetLoadingIssueReason = ReadJSON.getString(jo, "styleSheetLoadingIssueReason", false, true); 3167 this.failedRequestInfo = ReadJSON.getObject(jo, "failedRequestInfo", Audits.FailedRequestInfo.class, true, false); 3168 } 3169 3170 3171 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3172 public boolean equals(Object other) 3173 { 3174 if (this == other) return true; 3175 if (other == null) return false; 3176 if (other.getClass() != this.getClass()) return false; 3177 3178 StylesheetLoadingIssueDetails o = (StylesheetLoadingIssueDetails) other; 3179 3180 return 3181 Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 3182 && Objects.equals(this.styleSheetLoadingIssueReason, o.styleSheetLoadingIssueReason) 3183 && Objects.equals(this.failedRequestInfo, o.failedRequestInfo); 3184 } 3185 3186 /** Generates a Hash-Code for {@code 'this'} instance */ 3187 public int hashCode() 3188 { 3189 return 3190 this.sourceCodeLocation.hashCode() 3191 + Objects.hashCode(this.styleSheetLoadingIssueReason) 3192 + this.failedRequestInfo.hashCode(); 3193 } 3194 } 3195 3196 /** 3197 * This issue warns about errors in property rules that lead to property 3198 * registrations being ignored. 3199 */ 3200 public static class PropertyRuleIssueDetails 3201 extends BaseType 3202 implements java.io.Serializable 3203 { 3204 /** For Object Serialization. java.io.Serializable */ 3205 protected static final long serialVersionUID = 1; 3206 3207 public boolean[] optionals() 3208 { return new boolean[] { false, false, true, }; } 3209 3210 /** Source code position of the property rule. */ 3211 public final Audits.SourceCodeLocation sourceCodeLocation; 3212 3213 /** Reason why the property rule was discarded. */ 3214 public final String propertyRuleIssueReason; 3215 3216 /** 3217 * The value of the property rule property that failed to parse 3218 * <BR /><B CLASS=Opt>OPTIONAL</B> 3219 */ 3220 public final String propertyValue; 3221 3222 /** 3223 * Constructor 3224 * 3225 * @param sourceCodeLocation Source code position of the property rule. 3226 * 3227 * @param propertyRuleIssueReason Reason why the property rule was discarded. 3228 * 3229 * @param propertyValue The value of the property rule property that failed to parse 3230 * <BR /><B CLASS=Opt>OPTIONAL</B> 3231 */ 3232 public PropertyRuleIssueDetails( 3233 Audits.SourceCodeLocation sourceCodeLocation, String propertyRuleIssueReason, 3234 String propertyValue 3235 ) 3236 { 3237 // Exception-Check(s) to ensure that if any parameters which are not declared as 3238 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3239 3240 if (sourceCodeLocation == null) THROWS.throwNPE("sourceCodeLocation"); 3241 if (propertyRuleIssueReason == null) THROWS.throwNPE("propertyRuleIssueReason"); 3242 3243 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3244 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3245 3246 THROWS.checkIAE("propertyRuleIssueReason", propertyRuleIssueReason, "Audits.PropertyRuleIssueReason", Audits.PropertyRuleIssueReason); 3247 3248 this.sourceCodeLocation = sourceCodeLocation; 3249 this.propertyRuleIssueReason = propertyRuleIssueReason; 3250 this.propertyValue = propertyValue; 3251 } 3252 3253 /** 3254 * JSON Object Constructor 3255 * @param jo A Json-Object having data about an instance of {@code 'PropertyRuleIssueDetails'}. 3256 */ 3257 public PropertyRuleIssueDetails (JsonObject jo) 3258 { 3259 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, false, true); 3260 this.propertyRuleIssueReason = ReadJSON.getString(jo, "propertyRuleIssueReason", false, true); 3261 this.propertyValue = ReadJSON.getString(jo, "propertyValue", true, false); 3262 } 3263 3264 3265 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3266 public boolean equals(Object other) 3267 { 3268 if (this == other) return true; 3269 if (other == null) return false; 3270 if (other.getClass() != this.getClass()) return false; 3271 3272 PropertyRuleIssueDetails o = (PropertyRuleIssueDetails) other; 3273 3274 return 3275 Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation) 3276 && Objects.equals(this.propertyRuleIssueReason, o.propertyRuleIssueReason) 3277 && Objects.equals(this.propertyValue, o.propertyValue); 3278 } 3279 3280 /** Generates a Hash-Code for {@code 'this'} instance */ 3281 public int hashCode() 3282 { 3283 return 3284 this.sourceCodeLocation.hashCode() 3285 + Objects.hashCode(this.propertyRuleIssueReason) 3286 + Objects.hashCode(this.propertyValue); 3287 } 3288 } 3289 3290 /** 3291 * This issue warns about uses of APIs that may be considered misuse to 3292 * re-identify users. 3293 */ 3294 public static class UserReidentificationIssueDetails 3295 extends BaseType 3296 implements java.io.Serializable 3297 { 3298 /** For Object Serialization. java.io.Serializable */ 3299 protected static final long serialVersionUID = 1; 3300 3301 public boolean[] optionals() 3302 { return new boolean[] { false, true, true, }; } 3303 3304 /** <CODE>[No Description Provided by Google]</CODE> */ 3305 public final String type; 3306 3307 /** 3308 * Applies to BlockedFrameNavigation and BlockedSubresource issue types. 3309 * <BR /><B CLASS=Opt>OPTIONAL</B> 3310 */ 3311 public final Audits.AffectedRequest request; 3312 3313 /** 3314 * Applies to NoisedCanvasReadback issue type. 3315 * <BR /><B CLASS=Opt>OPTIONAL</B> 3316 */ 3317 public final Audits.SourceCodeLocation sourceCodeLocation; 3318 3319 /** 3320 * Constructor 3321 * 3322 * @param type - 3323 * 3324 * @param request Applies to BlockedFrameNavigation and BlockedSubresource issue types. 3325 * <BR /><B CLASS=Opt>OPTIONAL</B> 3326 * 3327 * @param sourceCodeLocation Applies to NoisedCanvasReadback issue type. 3328 * <BR /><B CLASS=Opt>OPTIONAL</B> 3329 */ 3330 public UserReidentificationIssueDetails( 3331 String type, Audits.AffectedRequest request, 3332 Audits.SourceCodeLocation sourceCodeLocation 3333 ) 3334 { 3335 // Exception-Check(s) to ensure that if any parameters which are not declared as 3336 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3337 3338 if (type == null) THROWS.throwNPE("type"); 3339 3340 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3341 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3342 3343 THROWS.checkIAE("type", type, "Audits.UserReidentificationIssueType", Audits.UserReidentificationIssueType); 3344 3345 this.type = type; 3346 this.request = request; 3347 this.sourceCodeLocation = sourceCodeLocation; 3348 } 3349 3350 /** 3351 * JSON Object Constructor 3352 * @param jo A Json-Object having data about an instance of {@code 'UserReidentificationIssueDetails'}. 3353 */ 3354 public UserReidentificationIssueDetails (JsonObject jo) 3355 { 3356 this.type = ReadJSON.getString(jo, "type", false, true); 3357 this.request = ReadJSON.getObject(jo, "request", Audits.AffectedRequest.class, true, false); 3358 this.sourceCodeLocation = ReadJSON.getObject(jo, "sourceCodeLocation", Audits.SourceCodeLocation.class, true, false); 3359 } 3360 3361 3362 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3363 public boolean equals(Object other) 3364 { 3365 if (this == other) return true; 3366 if (other == null) return false; 3367 if (other.getClass() != this.getClass()) return false; 3368 3369 UserReidentificationIssueDetails o = (UserReidentificationIssueDetails) other; 3370 3371 return 3372 Objects.equals(this.type, o.type) 3373 && Objects.equals(this.request, o.request) 3374 && Objects.equals(this.sourceCodeLocation, o.sourceCodeLocation); 3375 } 3376 3377 /** Generates a Hash-Code for {@code 'this'} instance */ 3378 public int hashCode() 3379 { 3380 return 3381 Objects.hashCode(this.type) 3382 + this.request.hashCode() 3383 + this.sourceCodeLocation.hashCode(); 3384 } 3385 } 3386 3387 /** 3388 * This struct holds a list of optional fields with additional information 3389 * specific to the kind of issue. When adding a new issue code, please also 3390 * add a new optional field to this type. 3391 */ 3392 public static class InspectorIssueDetails 3393 extends BaseType 3394 implements java.io.Serializable 3395 { 3396 /** For Object Serialization. java.io.Serializable */ 3397 protected static final long serialVersionUID = 1; 3398 3399 public boolean[] optionals() 3400 { return new boolean[] { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, }; } 3401 3402 /** 3403 * <CODE>[No Description Provided by Google]</CODE> 3404 * <BR /><B CLASS=Opt>OPTIONAL</B> 3405 */ 3406 public final Audits.CookieIssueDetails cookieIssueDetails; 3407 3408 /** 3409 * <CODE>[No Description Provided by Google]</CODE> 3410 * <BR /><B CLASS=Opt>OPTIONAL</B> 3411 */ 3412 public final Audits.MixedContentIssueDetails mixedContentIssueDetails; 3413 3414 /** 3415 * <CODE>[No Description Provided by Google]</CODE> 3416 * <BR /><B CLASS=Opt>OPTIONAL</B> 3417 */ 3418 public final Audits.BlockedByResponseIssueDetails blockedByResponseIssueDetails; 3419 3420 /** 3421 * <CODE>[No Description Provided by Google]</CODE> 3422 * <BR /><B CLASS=Opt>OPTIONAL</B> 3423 */ 3424 public final Audits.HeavyAdIssueDetails heavyAdIssueDetails; 3425 3426 /** 3427 * <CODE>[No Description Provided by Google]</CODE> 3428 * <BR /><B CLASS=Opt>OPTIONAL</B> 3429 */ 3430 public final Audits.ContentSecurityPolicyIssueDetails contentSecurityPolicyIssueDetails; 3431 3432 /** 3433 * <CODE>[No Description Provided by Google]</CODE> 3434 * <BR /><B CLASS=Opt>OPTIONAL</B> 3435 */ 3436 public final Audits.SharedArrayBufferIssueDetails sharedArrayBufferIssueDetails; 3437 3438 /** 3439 * <CODE>[No Description Provided by Google]</CODE> 3440 * <BR /><B CLASS=Opt>OPTIONAL</B> 3441 */ 3442 public final Audits.LowTextContrastIssueDetails lowTextContrastIssueDetails; 3443 3444 /** 3445 * <CODE>[No Description Provided by Google]</CODE> 3446 * <BR /><B CLASS=Opt>OPTIONAL</B> 3447 */ 3448 public final Audits.CorsIssueDetails corsIssueDetails; 3449 3450 /** 3451 * <CODE>[No Description Provided by Google]</CODE> 3452 * <BR /><B CLASS=Opt>OPTIONAL</B> 3453 */ 3454 public final Audits.AttributionReportingIssueDetails attributionReportingIssueDetails; 3455 3456 /** 3457 * <CODE>[No Description Provided by Google]</CODE> 3458 * <BR /><B CLASS=Opt>OPTIONAL</B> 3459 */ 3460 public final Audits.QuirksModeIssueDetails quirksModeIssueDetails; 3461 3462 /** 3463 * <CODE>[No Description Provided by Google]</CODE> 3464 * <BR /><B CLASS=Opt>OPTIONAL</B> 3465 */ 3466 public final Audits.PartitioningBlobURLIssueDetails partitioningBlobURLIssueDetails; 3467 3468 /** 3469 * <CODE>[No Description Provided by Google]</CODE> 3470 * <BR /><B CLASS=Opt>OPTIONAL</B> 3471 <B CLASS=Dep>DEPRECATED</B> 3472 */ 3473 public final Audits.NavigatorUserAgentIssueDetails navigatorUserAgentIssueDetails; 3474 3475 /** 3476 * <CODE>[No Description Provided by Google]</CODE> 3477 * <BR /><B CLASS=Opt>OPTIONAL</B> 3478 */ 3479 public final Audits.GenericIssueDetails genericIssueDetails; 3480 3481 /** 3482 * <CODE>[No Description Provided by Google]</CODE> 3483 * <BR /><B CLASS=Opt>OPTIONAL</B> 3484 */ 3485 public final Audits.DeprecationIssueDetails deprecationIssueDetails; 3486 3487 /** 3488 * <CODE>[No Description Provided by Google]</CODE> 3489 * <BR /><B CLASS=Opt>OPTIONAL</B> 3490 */ 3491 public final Audits.ClientHintIssueDetails clientHintIssueDetails; 3492 3493 /** 3494 * <CODE>[No Description Provided by Google]</CODE> 3495 * <BR /><B CLASS=Opt>OPTIONAL</B> 3496 */ 3497 public final Audits.FederatedAuthRequestIssueDetails federatedAuthRequestIssueDetails; 3498 3499 /** 3500 * <CODE>[No Description Provided by Google]</CODE> 3501 * <BR /><B CLASS=Opt>OPTIONAL</B> 3502 */ 3503 public final Audits.BounceTrackingIssueDetails bounceTrackingIssueDetails; 3504 3505 /** 3506 * <CODE>[No Description Provided by Google]</CODE> 3507 * <BR /><B CLASS=Opt>OPTIONAL</B> 3508 */ 3509 public final Audits.CookieDeprecationMetadataIssueDetails cookieDeprecationMetadataIssueDetails; 3510 3511 /** 3512 * <CODE>[No Description Provided by Google]</CODE> 3513 * <BR /><B CLASS=Opt>OPTIONAL</B> 3514 */ 3515 public final Audits.StylesheetLoadingIssueDetails stylesheetLoadingIssueDetails; 3516 3517 /** 3518 * <CODE>[No Description Provided by Google]</CODE> 3519 * <BR /><B CLASS=Opt>OPTIONAL</B> 3520 */ 3521 public final Audits.PropertyRuleIssueDetails propertyRuleIssueDetails; 3522 3523 /** 3524 * <CODE>[No Description Provided by Google]</CODE> 3525 * <BR /><B CLASS=Opt>OPTIONAL</B> 3526 */ 3527 public final Audits.FederatedAuthUserInfoRequestIssueDetails federatedAuthUserInfoRequestIssueDetails; 3528 3529 /** 3530 * <CODE>[No Description Provided by Google]</CODE> 3531 * <BR /><B CLASS=Opt>OPTIONAL</B> 3532 */ 3533 public final Audits.SharedDictionaryIssueDetails sharedDictionaryIssueDetails; 3534 3535 /** 3536 * <CODE>[No Description Provided by Google]</CODE> 3537 * <BR /><B CLASS=Opt>OPTIONAL</B> 3538 */ 3539 public final Audits.ElementAccessibilityIssueDetails elementAccessibilityIssueDetails; 3540 3541 /** 3542 * <CODE>[No Description Provided by Google]</CODE> 3543 * <BR /><B CLASS=Opt>OPTIONAL</B> 3544 */ 3545 public final Audits.SRIMessageSignatureIssueDetails sriMessageSignatureIssueDetails; 3546 3547 /** 3548 * <CODE>[No Description Provided by Google]</CODE> 3549 * <BR /><B CLASS=Opt>OPTIONAL</B> 3550 */ 3551 public final Audits.UnencodedDigestIssueDetails unencodedDigestIssueDetails; 3552 3553 /** 3554 * <CODE>[No Description Provided by Google]</CODE> 3555 * <BR /><B CLASS=Opt>OPTIONAL</B> 3556 */ 3557 public final Audits.UserReidentificationIssueDetails userReidentificationIssueDetails; 3558 3559 /** 3560 * Constructor 3561 * 3562 * @param cookieIssueDetails - 3563 * <BR /><B CLASS=Opt>OPTIONAL</B> 3564 * 3565 * @param mixedContentIssueDetails - 3566 * <BR /><B CLASS=Opt>OPTIONAL</B> 3567 * 3568 * @param blockedByResponseIssueDetails - 3569 * <BR /><B CLASS=Opt>OPTIONAL</B> 3570 * 3571 * @param heavyAdIssueDetails - 3572 * <BR /><B CLASS=Opt>OPTIONAL</B> 3573 * 3574 * @param contentSecurityPolicyIssueDetails - 3575 * <BR /><B CLASS=Opt>OPTIONAL</B> 3576 * 3577 * @param sharedArrayBufferIssueDetails - 3578 * <BR /><B CLASS=Opt>OPTIONAL</B> 3579 * 3580 * @param lowTextContrastIssueDetails - 3581 * <BR /><B CLASS=Opt>OPTIONAL</B> 3582 * 3583 * @param corsIssueDetails - 3584 * <BR /><B CLASS=Opt>OPTIONAL</B> 3585 * 3586 * @param attributionReportingIssueDetails - 3587 * <BR /><B CLASS=Opt>OPTIONAL</B> 3588 * 3589 * @param quirksModeIssueDetails - 3590 * <BR /><B CLASS=Opt>OPTIONAL</B> 3591 * 3592 * @param partitioningBlobURLIssueDetails - 3593 * <BR /><B CLASS=Opt>OPTIONAL</B> 3594 * 3595 * @param navigatorUserAgentIssueDetails - 3596 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Dep>DEPRECATED</B> 3597 * 3598 * @param genericIssueDetails - 3599 * <BR /><B CLASS=Opt>OPTIONAL</B> 3600 * 3601 * @param deprecationIssueDetails - 3602 * <BR /><B CLASS=Opt>OPTIONAL</B> 3603 * 3604 * @param clientHintIssueDetails - 3605 * <BR /><B CLASS=Opt>OPTIONAL</B> 3606 * 3607 * @param federatedAuthRequestIssueDetails - 3608 * <BR /><B CLASS=Opt>OPTIONAL</B> 3609 * 3610 * @param bounceTrackingIssueDetails - 3611 * <BR /><B CLASS=Opt>OPTIONAL</B> 3612 * 3613 * @param cookieDeprecationMetadataIssueDetails - 3614 * <BR /><B CLASS=Opt>OPTIONAL</B> 3615 * 3616 * @param stylesheetLoadingIssueDetails - 3617 * <BR /><B CLASS=Opt>OPTIONAL</B> 3618 * 3619 * @param propertyRuleIssueDetails - 3620 * <BR /><B CLASS=Opt>OPTIONAL</B> 3621 * 3622 * @param federatedAuthUserInfoRequestIssueDetails - 3623 * <BR /><B CLASS=Opt>OPTIONAL</B> 3624 * 3625 * @param sharedDictionaryIssueDetails - 3626 * <BR /><B CLASS=Opt>OPTIONAL</B> 3627 * 3628 * @param elementAccessibilityIssueDetails - 3629 * <BR /><B CLASS=Opt>OPTIONAL</B> 3630 * 3631 * @param sriMessageSignatureIssueDetails - 3632 * <BR /><B CLASS=Opt>OPTIONAL</B> 3633 * 3634 * @param unencodedDigestIssueDetails - 3635 * <BR /><B CLASS=Opt>OPTIONAL</B> 3636 * 3637 * @param userReidentificationIssueDetails - 3638 * <BR /><B CLASS=Opt>OPTIONAL</B> 3639 */ 3640 public InspectorIssueDetails( 3641 Audits.CookieIssueDetails cookieIssueDetails, 3642 Audits.MixedContentIssueDetails mixedContentIssueDetails, 3643 Audits.BlockedByResponseIssueDetails blockedByResponseIssueDetails, 3644 Audits.HeavyAdIssueDetails heavyAdIssueDetails, 3645 Audits.ContentSecurityPolicyIssueDetails contentSecurityPolicyIssueDetails, 3646 Audits.SharedArrayBufferIssueDetails sharedArrayBufferIssueDetails, 3647 Audits.LowTextContrastIssueDetails lowTextContrastIssueDetails, 3648 Audits.CorsIssueDetails corsIssueDetails, 3649 Audits.AttributionReportingIssueDetails attributionReportingIssueDetails, 3650 Audits.QuirksModeIssueDetails quirksModeIssueDetails, 3651 Audits.PartitioningBlobURLIssueDetails partitioningBlobURLIssueDetails, 3652 Audits.NavigatorUserAgentIssueDetails navigatorUserAgentIssueDetails, 3653 Audits.GenericIssueDetails genericIssueDetails, 3654 Audits.DeprecationIssueDetails deprecationIssueDetails, 3655 Audits.ClientHintIssueDetails clientHintIssueDetails, 3656 Audits.FederatedAuthRequestIssueDetails federatedAuthRequestIssueDetails, 3657 Audits.BounceTrackingIssueDetails bounceTrackingIssueDetails, 3658 Audits.CookieDeprecationMetadataIssueDetails cookieDeprecationMetadataIssueDetails, 3659 Audits.StylesheetLoadingIssueDetails stylesheetLoadingIssueDetails, 3660 Audits.PropertyRuleIssueDetails propertyRuleIssueDetails, 3661 Audits.FederatedAuthUserInfoRequestIssueDetails federatedAuthUserInfoRequestIssueDetails, 3662 Audits.SharedDictionaryIssueDetails sharedDictionaryIssueDetails, 3663 Audits.ElementAccessibilityIssueDetails elementAccessibilityIssueDetails, 3664 Audits.SRIMessageSignatureIssueDetails sriMessageSignatureIssueDetails, 3665 Audits.UnencodedDigestIssueDetails unencodedDigestIssueDetails, 3666 Audits.UserReidentificationIssueDetails userReidentificationIssueDetails 3667 ) 3668 { 3669 this.cookieIssueDetails = cookieIssueDetails; 3670 this.mixedContentIssueDetails = mixedContentIssueDetails; 3671 this.blockedByResponseIssueDetails = blockedByResponseIssueDetails; 3672 this.heavyAdIssueDetails = heavyAdIssueDetails; 3673 this.contentSecurityPolicyIssueDetails = contentSecurityPolicyIssueDetails; 3674 this.sharedArrayBufferIssueDetails = sharedArrayBufferIssueDetails; 3675 this.lowTextContrastIssueDetails = lowTextContrastIssueDetails; 3676 this.corsIssueDetails = corsIssueDetails; 3677 this.attributionReportingIssueDetails = attributionReportingIssueDetails; 3678 this.quirksModeIssueDetails = quirksModeIssueDetails; 3679 this.partitioningBlobURLIssueDetails = partitioningBlobURLIssueDetails; 3680 this.navigatorUserAgentIssueDetails = navigatorUserAgentIssueDetails; 3681 this.genericIssueDetails = genericIssueDetails; 3682 this.deprecationIssueDetails = deprecationIssueDetails; 3683 this.clientHintIssueDetails = clientHintIssueDetails; 3684 this.federatedAuthRequestIssueDetails = federatedAuthRequestIssueDetails; 3685 this.bounceTrackingIssueDetails = bounceTrackingIssueDetails; 3686 this.cookieDeprecationMetadataIssueDetails = cookieDeprecationMetadataIssueDetails; 3687 this.stylesheetLoadingIssueDetails = stylesheetLoadingIssueDetails; 3688 this.propertyRuleIssueDetails = propertyRuleIssueDetails; 3689 this.federatedAuthUserInfoRequestIssueDetails = federatedAuthUserInfoRequestIssueDetails; 3690 this.sharedDictionaryIssueDetails = sharedDictionaryIssueDetails; 3691 this.elementAccessibilityIssueDetails = elementAccessibilityIssueDetails; 3692 this.sriMessageSignatureIssueDetails = sriMessageSignatureIssueDetails; 3693 this.unencodedDigestIssueDetails = unencodedDigestIssueDetails; 3694 this.userReidentificationIssueDetails = userReidentificationIssueDetails; 3695 } 3696 3697 /** 3698 * JSON Object Constructor 3699 * @param jo A Json-Object having data about an instance of {@code 'InspectorIssueDetails'}. 3700 */ 3701 public InspectorIssueDetails (JsonObject jo) 3702 { 3703 this.cookieIssueDetails = ReadJSON.getObject(jo, "cookieIssueDetails", Audits.CookieIssueDetails.class, true, false); 3704 this.mixedContentIssueDetails = ReadJSON.getObject(jo, "mixedContentIssueDetails", Audits.MixedContentIssueDetails.class, true, false); 3705 this.blockedByResponseIssueDetails = ReadJSON.getObject(jo, "blockedByResponseIssueDetails", Audits.BlockedByResponseIssueDetails.class, true, false); 3706 this.heavyAdIssueDetails = ReadJSON.getObject(jo, "heavyAdIssueDetails", Audits.HeavyAdIssueDetails.class, true, false); 3707 this.contentSecurityPolicyIssueDetails = ReadJSON.getObject(jo, "contentSecurityPolicyIssueDetails", Audits.ContentSecurityPolicyIssueDetails.class, true, false); 3708 this.sharedArrayBufferIssueDetails = ReadJSON.getObject(jo, "sharedArrayBufferIssueDetails", Audits.SharedArrayBufferIssueDetails.class, true, false); 3709 this.lowTextContrastIssueDetails = ReadJSON.getObject(jo, "lowTextContrastIssueDetails", Audits.LowTextContrastIssueDetails.class, true, false); 3710 this.corsIssueDetails = ReadJSON.getObject(jo, "corsIssueDetails", Audits.CorsIssueDetails.class, true, false); 3711 this.attributionReportingIssueDetails = ReadJSON.getObject(jo, "attributionReportingIssueDetails", Audits.AttributionReportingIssueDetails.class, true, false); 3712 this.quirksModeIssueDetails = ReadJSON.getObject(jo, "quirksModeIssueDetails", Audits.QuirksModeIssueDetails.class, true, false); 3713 this.partitioningBlobURLIssueDetails = ReadJSON.getObject(jo, "partitioningBlobURLIssueDetails", Audits.PartitioningBlobURLIssueDetails.class, true, false); 3714 this.navigatorUserAgentIssueDetails = ReadJSON.getObject(jo, "navigatorUserAgentIssueDetails", Audits.NavigatorUserAgentIssueDetails.class, true, false); 3715 this.genericIssueDetails = ReadJSON.getObject(jo, "genericIssueDetails", Audits.GenericIssueDetails.class, true, false); 3716 this.deprecationIssueDetails = ReadJSON.getObject(jo, "deprecationIssueDetails", Audits.DeprecationIssueDetails.class, true, false); 3717 this.clientHintIssueDetails = ReadJSON.getObject(jo, "clientHintIssueDetails", Audits.ClientHintIssueDetails.class, true, false); 3718 this.federatedAuthRequestIssueDetails = ReadJSON.getObject(jo, "federatedAuthRequestIssueDetails", Audits.FederatedAuthRequestIssueDetails.class, true, false); 3719 this.bounceTrackingIssueDetails = ReadJSON.getObject(jo, "bounceTrackingIssueDetails", Audits.BounceTrackingIssueDetails.class, true, false); 3720 this.cookieDeprecationMetadataIssueDetails = ReadJSON.getObject(jo, "cookieDeprecationMetadataIssueDetails", Audits.CookieDeprecationMetadataIssueDetails.class, true, false); 3721 this.stylesheetLoadingIssueDetails = ReadJSON.getObject(jo, "stylesheetLoadingIssueDetails", Audits.StylesheetLoadingIssueDetails.class, true, false); 3722 this.propertyRuleIssueDetails = ReadJSON.getObject(jo, "propertyRuleIssueDetails", Audits.PropertyRuleIssueDetails.class, true, false); 3723 this.federatedAuthUserInfoRequestIssueDetails = ReadJSON.getObject(jo, "federatedAuthUserInfoRequestIssueDetails", Audits.FederatedAuthUserInfoRequestIssueDetails.class, true, false); 3724 this.sharedDictionaryIssueDetails = ReadJSON.getObject(jo, "sharedDictionaryIssueDetails", Audits.SharedDictionaryIssueDetails.class, true, false); 3725 this.elementAccessibilityIssueDetails = ReadJSON.getObject(jo, "elementAccessibilityIssueDetails", Audits.ElementAccessibilityIssueDetails.class, true, false); 3726 this.sriMessageSignatureIssueDetails = ReadJSON.getObject(jo, "sriMessageSignatureIssueDetails", Audits.SRIMessageSignatureIssueDetails.class, true, false); 3727 this.unencodedDigestIssueDetails = ReadJSON.getObject(jo, "unencodedDigestIssueDetails", Audits.UnencodedDigestIssueDetails.class, true, false); 3728 this.userReidentificationIssueDetails = ReadJSON.getObject(jo, "userReidentificationIssueDetails", Audits.UserReidentificationIssueDetails.class, true, false); 3729 } 3730 3731 3732 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3733 public boolean equals(Object other) 3734 { 3735 if (this == other) return true; 3736 if (other == null) return false; 3737 if (other.getClass() != this.getClass()) return false; 3738 3739 InspectorIssueDetails o = (InspectorIssueDetails) other; 3740 3741 return 3742 Objects.equals(this.cookieIssueDetails, o.cookieIssueDetails) 3743 && Objects.equals(this.mixedContentIssueDetails, o.mixedContentIssueDetails) 3744 && Objects.equals(this.blockedByResponseIssueDetails, o.blockedByResponseIssueDetails) 3745 && Objects.equals(this.heavyAdIssueDetails, o.heavyAdIssueDetails) 3746 && Objects.equals(this.contentSecurityPolicyIssueDetails, o.contentSecurityPolicyIssueDetails) 3747 && Objects.equals(this.sharedArrayBufferIssueDetails, o.sharedArrayBufferIssueDetails) 3748 && Objects.equals(this.lowTextContrastIssueDetails, o.lowTextContrastIssueDetails) 3749 && Objects.equals(this.corsIssueDetails, o.corsIssueDetails) 3750 && Objects.equals(this.attributionReportingIssueDetails, o.attributionReportingIssueDetails) 3751 && Objects.equals(this.quirksModeIssueDetails, o.quirksModeIssueDetails) 3752 && Objects.equals(this.partitioningBlobURLIssueDetails, o.partitioningBlobURLIssueDetails) 3753 && Objects.equals(this.navigatorUserAgentIssueDetails, o.navigatorUserAgentIssueDetails) 3754 && Objects.equals(this.genericIssueDetails, o.genericIssueDetails) 3755 && Objects.equals(this.deprecationIssueDetails, o.deprecationIssueDetails) 3756 && Objects.equals(this.clientHintIssueDetails, o.clientHintIssueDetails) 3757 && Objects.equals(this.federatedAuthRequestIssueDetails, o.federatedAuthRequestIssueDetails) 3758 && Objects.equals(this.bounceTrackingIssueDetails, o.bounceTrackingIssueDetails) 3759 && Objects.equals(this.cookieDeprecationMetadataIssueDetails, o.cookieDeprecationMetadataIssueDetails) 3760 && Objects.equals(this.stylesheetLoadingIssueDetails, o.stylesheetLoadingIssueDetails) 3761 && Objects.equals(this.propertyRuleIssueDetails, o.propertyRuleIssueDetails) 3762 && Objects.equals(this.federatedAuthUserInfoRequestIssueDetails, o.federatedAuthUserInfoRequestIssueDetails) 3763 && Objects.equals(this.sharedDictionaryIssueDetails, o.sharedDictionaryIssueDetails) 3764 && Objects.equals(this.elementAccessibilityIssueDetails, o.elementAccessibilityIssueDetails) 3765 && Objects.equals(this.sriMessageSignatureIssueDetails, o.sriMessageSignatureIssueDetails) 3766 && Objects.equals(this.unencodedDigestIssueDetails, o.unencodedDigestIssueDetails) 3767 && Objects.equals(this.userReidentificationIssueDetails, o.userReidentificationIssueDetails); 3768 } 3769 3770 /** Generates a Hash-Code for {@code 'this'} instance */ 3771 public int hashCode() 3772 { 3773 return 3774 this.cookieIssueDetails.hashCode() 3775 + this.mixedContentIssueDetails.hashCode() 3776 + this.blockedByResponseIssueDetails.hashCode() 3777 + this.heavyAdIssueDetails.hashCode() 3778 + this.contentSecurityPolicyIssueDetails.hashCode() 3779 + this.sharedArrayBufferIssueDetails.hashCode() 3780 + this.lowTextContrastIssueDetails.hashCode() 3781 + this.corsIssueDetails.hashCode() 3782 + this.attributionReportingIssueDetails.hashCode() 3783 + this.quirksModeIssueDetails.hashCode() 3784 + this.partitioningBlobURLIssueDetails.hashCode() 3785 + this.navigatorUserAgentIssueDetails.hashCode() 3786 + this.genericIssueDetails.hashCode() 3787 + this.deprecationIssueDetails.hashCode() 3788 + this.clientHintIssueDetails.hashCode() 3789 + this.federatedAuthRequestIssueDetails.hashCode() 3790 + this.bounceTrackingIssueDetails.hashCode() 3791 + this.cookieDeprecationMetadataIssueDetails.hashCode() 3792 + this.stylesheetLoadingIssueDetails.hashCode() 3793 + this.propertyRuleIssueDetails.hashCode() 3794 + this.federatedAuthUserInfoRequestIssueDetails.hashCode() 3795 + this.sharedDictionaryIssueDetails.hashCode() 3796 + this.elementAccessibilityIssueDetails.hashCode() 3797 + this.sriMessageSignatureIssueDetails.hashCode() 3798 + this.unencodedDigestIssueDetails.hashCode() 3799 + this.userReidentificationIssueDetails.hashCode(); 3800 } 3801 } 3802 3803 /** An inspector issue reported from the back-end. */ 3804 public static class InspectorIssue 3805 extends BaseType 3806 implements java.io.Serializable 3807 { 3808 /** For Object Serialization. java.io.Serializable */ 3809 protected static final long serialVersionUID = 1; 3810 3811 public boolean[] optionals() 3812 { return new boolean[] { false, false, true, }; } 3813 3814 /** <CODE>[No Description Provided by Google]</CODE> */ 3815 public final String code; 3816 3817 /** <CODE>[No Description Provided by Google]</CODE> */ 3818 public final Audits.InspectorIssueDetails details; 3819 3820 /** 3821 * A unique id for this issue. May be omitted if no other entity (e.g. 3822 * exception, CDP message, etc.) is referencing this issue. 3823 * <BR /><B CLASS=Opt>OPTIONAL</B> 3824 */ 3825 public final String issueId; 3826 3827 /** 3828 * Constructor 3829 * 3830 * @param code - 3831 * 3832 * @param details - 3833 * 3834 * @param issueId 3835 * A unique id for this issue. May be omitted if no other entity (e.g. 3836 * exception, CDP message, etc.) is referencing this issue. 3837 * <BR /><B CLASS=Opt>OPTIONAL</B> 3838 */ 3839 public InspectorIssue(String code, Audits.InspectorIssueDetails details, String issueId) 3840 { 3841 // Exception-Check(s) to ensure that if any parameters which are not declared as 3842 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3843 3844 if (code == null) THROWS.throwNPE("code"); 3845 if (details == null) THROWS.throwNPE("details"); 3846 3847 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3848 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3849 3850 THROWS.checkIAE("code", code, "Audits.InspectorIssueCode", Audits.InspectorIssueCode); 3851 3852 this.code = code; 3853 this.details = details; 3854 this.issueId = issueId; 3855 } 3856 3857 /** 3858 * JSON Object Constructor 3859 * @param jo A Json-Object having data about an instance of {@code 'InspectorIssue'}. 3860 */ 3861 public InspectorIssue (JsonObject jo) 3862 { 3863 this.code = ReadJSON.getString(jo, "code", false, true); 3864 this.details = ReadJSON.getObject(jo, "details", Audits.InspectorIssueDetails.class, false, true); 3865 this.issueId = ReadJSON.getString(jo, "issueId", true, false); 3866 } 3867 3868 3869 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3870 public boolean equals(Object other) 3871 { 3872 if (this == other) return true; 3873 if (other == null) return false; 3874 if (other.getClass() != this.getClass()) return false; 3875 3876 InspectorIssue o = (InspectorIssue) other; 3877 3878 return 3879 Objects.equals(this.code, o.code) 3880 && Objects.equals(this.details, o.details) 3881 && Objects.equals(this.issueId, o.issueId); 3882 } 3883 3884 /** Generates a Hash-Code for {@code 'this'} instance */ 3885 public int hashCode() 3886 { 3887 return 3888 Objects.hashCode(this.code) 3889 + this.details.hashCode() 3890 + Objects.hashCode(this.issueId); 3891 } 3892 } 3893 3894 /** <CODE>[No Description Provided by Google]</CODE> */ 3895 public static class issueAdded 3896 extends BrowserEvent 3897 implements java.io.Serializable 3898 { 3899 /** For Object Serialization. java.io.Serializable */ 3900 protected static final long serialVersionUID = 1; 3901 3902 public boolean[] optionals() 3903 { return new boolean[] { false, }; } 3904 3905 /** <CODE>[No Description Provided by Google]</CODE> */ 3906 public final Audits.InspectorIssue issue; 3907 3908 /** 3909 * Constructor 3910 * 3911 * @param issue - 3912 */ 3913 public issueAdded(Audits.InspectorIssue issue) 3914 { 3915 super("Audits", "issueAdded", 1); 3916 3917 // Exception-Check(s) to ensure that if any parameters which are not declared as 3918 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3919 3920 if (issue == null) THROWS.throwNPE("issue"); 3921 3922 this.issue = issue; 3923 } 3924 3925 /** 3926 * JSON Object Constructor 3927 * @param jo A Json-Object having data about an instance of {@code 'issueAdded'}. 3928 */ 3929 public issueAdded (JsonObject jo) 3930 { 3931 super("Audits", "issueAdded", 1); 3932 3933 this.issue = ReadJSON.getObject(jo, "issue", Audits.InspectorIssue.class, false, true); 3934 } 3935 3936 3937 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3938 public boolean equals(Object other) 3939 { 3940 if (this == other) return true; 3941 if (other == null) return false; 3942 if (other.getClass() != this.getClass()) return false; 3943 3944 issueAdded o = (issueAdded) other; 3945 3946 return 3947 Objects.equals(this.issue, o.issue); 3948 } 3949 3950 /** Generates a Hash-Code for {@code 'this'} instance */ 3951 public int hashCode() 3952 { 3953 return 3954 this.issue.hashCode(); 3955 } 3956 } 3957 3958 3959 // Counter for keeping the WebSocket Request ID's distinct. 3960 private static int counter = 1; 3961 3962 /** 3963 * Returns the response body and size if it were re-encoded with the specified settings. Only 3964 * applies to images. 3965 * 3966 * @param requestId Identifier of the network request to get content for. 3967 * 3968 * @param encoding The encoding to use. 3969 * <BR />Acceptable Values: ["webp", "jpeg", "png"] 3970 * 3971 * @param quality The quality of the encoding (0-1). (defaults to 1) 3972 * <BR /><B CLASS=Opt>OPTIONAL</B> 3973 * 3974 * @param sizeOnly Whether to only return the size information (defaults to false). 3975 * <BR /><B CLASS=Opt>OPTIONAL</B> 3976 * 3977 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 3978 * {@link Ret3}></CODE> 3979 * 3980 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 3981 * {@link Script#exec()}), and a {@link Promise} returned. 3982 * 3983 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 3984 * (using {@link Promise#await()}), the {@code Ret3} will subsequently 3985 * be returned from that call. 3986 * 3987 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 3988 * in an instance of <B>{@link Ret3}</B> 3989 * 3990 * <BR /><BR /><UL CLASS=JDUL> 3991 * <LI><CODE><B>Ret3.a:</B> String (<B>body</B>)</CODE> 3992 * <BR />The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON) 3993 * <BR /><BR /></LI> 3994 * <LI><CODE><B>Ret3.b:</B> Integer (<B>originalSize</B>)</CODE> 3995 * <BR />Size before re-encoding. 3996 * <BR /><BR /></LI> 3997 * <LI><CODE><B>Ret3.c:</B> Integer (<B>encodedSize</B>)</CODE> 3998 * <BR />Size after re-encoding. 3999 * </LI> 4000 * </UL> 4001 */ 4002 public static Script<String, JsonObject, Ret3<String, Integer, Integer>> getEncodedResponse 4003 (String requestId, String encoding, Number quality, Boolean sizeOnly) 4004 { 4005 // Exception-Check(s) to ensure that if any parameters which are not declared as 4006 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4007 4008 if (requestId == null) THROWS.throwNPE("requestId"); 4009 if (encoding == null) THROWS.throwNPE("encoding"); 4010 4011 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4012 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4013 4014 THROWS.checkIAE( 4015 "encoding", encoding, 4016 "webp", "jpeg", "png" 4017 ); 4018 4019 final int webSocketID = 9000000 + counter++; 4020 final boolean[] optionals = { false, false, true, true, }; 4021 4022 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 4023 String requestJSON = WriteJSON.get( 4024 parameterTypes.get("getEncodedResponse"), 4025 parameterNames.get("getEncodedResponse"), 4026 optionals, webSocketID, 4027 "Audits.getEncodedResponse", 4028 requestId, encoding, quality, sizeOnly 4029 ); 4030 4031 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret3' 4032 Function<JsonObject, Ret3<String, Integer, Integer>> 4033 responseProcessor = (JsonObject jo) -> new Ret3<>( 4034 ReadJSON.getString(jo, "body", true, false), 4035 ReadBoxedJSON.getInteger(jo, "originalSize", true), 4036 ReadBoxedJSON.getInteger(jo, "encodedSize", true) 4037 ); 4038 4039 return new Script<>(webSocketID, requestJSON, responseProcessor); 4040 } 4041 4042 /** 4043 * Disables issues domain, prevents further issues from being reported to the client. 4044 * 4045 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 4046 * {@link Ret0}></CODE> 4047 * 4048 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 4049 * browser receives the invocation-request. 4050 * 4051 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 4052 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 4053 * {@code >} to ensure the Browser Function has run to completion. 4054 */ 4055 public static Script<String, JsonObject, Ret0> disable() 4056 { 4057 final int webSocketID = 9001000 + counter++; 4058 final boolean[] optionals = new boolean[0]; 4059 4060 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 4061 String requestJSON = WriteJSON.get( 4062 parameterTypes.get("disable"), 4063 parameterNames.get("disable"), 4064 optionals, webSocketID, 4065 "Audits.disable" 4066 ); 4067 4068 // This Remote Command does not have a Return-Value. 4069 return new Script<> 4070 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 4071 } 4072 4073 /** 4074 * Enables issues domain, sends the issues collected so far to the client by means of the 4075 * {@code issueAdded} event. 4076 * 4077 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 4078 * {@link Ret0}></CODE> 4079 * 4080 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 4081 * browser receives the invocation-request. 4082 * 4083 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 4084 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 4085 * {@code >} to ensure the Browser Function has run to completion. 4086 */ 4087 public static Script<String, JsonObject, Ret0> enable() 4088 { 4089 final int webSocketID = 9002000 + counter++; 4090 final boolean[] optionals = new boolean[0]; 4091 4092 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 4093 String requestJSON = WriteJSON.get( 4094 parameterTypes.get("enable"), 4095 parameterNames.get("enable"), 4096 optionals, webSocketID, 4097 "Audits.enable" 4098 ); 4099 4100 // This Remote Command does not have a Return-Value. 4101 return new Script<> 4102 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 4103 } 4104 4105 /** 4106 * Runs the contrast check for the target page. Found issues are reported 4107 * using Audits.issueAdded event. 4108 * 4109 * @param reportAAA Whether to report WCAG AAA level issues. Default is false. 4110 * <BR /><B CLASS=Opt>OPTIONAL</B> 4111 * 4112 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 4113 * {@link Ret0}></CODE> 4114 * 4115 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 4116 * browser receives the invocation-request. 4117 * 4118 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 4119 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 4120 * {@code >} to ensure the Browser Function has run to completion. 4121 */ 4122 public static Script<String, JsonObject, Ret0> checkContrast(Boolean reportAAA) 4123 { 4124 final int webSocketID = 9003000 + counter++; 4125 final boolean[] optionals = { true, }; 4126 4127 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 4128 String requestJSON = WriteJSON.get( 4129 parameterTypes.get("checkContrast"), 4130 parameterNames.get("checkContrast"), 4131 optionals, webSocketID, 4132 "Audits.checkContrast", 4133 reportAAA 4134 ); 4135 4136 // This Remote Command does not have a Return-Value. 4137 return new Script<> 4138 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 4139 } 4140 4141 /** 4142 * Runs the form issues check for the target page. Found issues are reported 4143 * using Audits.issueAdded event. 4144 * 4145 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 4146 * {@link Audits.GenericIssueDetails}[]></CODE> 4147 * 4148 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 4149 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 4150 * {@link Audits.GenericIssueDetails}[]></CODE> will be returned. 4151 * 4152 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 4153 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 4154 * may be retrieved.</I> 4155 * 4156 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 4157 * <BR /><BR /><UL CLASS=JDUL> 4158 * <LI><CODE>{@link Audits.GenericIssueDetails}[] (<B>formIssues</B></CODE>) 4159 * <BR />- 4160 * </LI> 4161 * </UL> */ 4162 public static Script<String, JsonObject, Audits.GenericIssueDetails[]> checkFormsIssues() 4163 { 4164 final int webSocketID = 9004000 + counter++; 4165 final boolean[] optionals = new boolean[0]; 4166 4167 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 4168 String requestJSON = WriteJSON.get( 4169 parameterTypes.get("checkFormsIssues"), 4170 parameterNames.get("checkFormsIssues"), 4171 optionals, webSocketID, 4172 "Audits.checkFormsIssues" 4173 ); 4174 4175 // 'JSON Binding' ... Converts Browser Response-JSON to 'Audits.GenericIssueDetails[]' 4176 Function<JsonObject, Audits.GenericIssueDetails[]> responseProcessor = (JsonObject jo) -> 4177 (jo.getJsonArray("formIssues") == null) 4178 ? null 4179 : RJArrIntoStream.objArr(jo.getJsonArray("formIssues"), null, 0, Audits.GenericIssueDetails.class).toArray(Audits.GenericIssueDetails[]::new); 4180 4181 return new Script<>(webSocketID, requestJSON, responseProcessor); 4182 } 4183 4184}