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>Network domain allows tracking network activities of the page. It exposes information about http, 028 * file, data and other requests and responses, their headers, bodies, timing, etc.</B></SPAN> 029 * 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CODE_GEN_NOTE> 031 */ 032@StaticFunctional(Excused={"counter"}, Excuses={Excuse.CONFIGURATION}) 033@JDHeaderBackgroundImg(EmbedTagFileID="WOOD_PLANK_NOTE") 034public class Network 035{ 036 // ******************************************************************************************** 037 // ******************************************************************************************** 038 // Class Header Stuff 039 // ******************************************************************************************** 040 // ******************************************************************************************** 041 042 043 // No Pubic Constructors 044 private Network () { } 045 046 // These two Vector's are used by all the "Methods" exported by this class. java.lang.reflect 047 // is used to generate the JSON String's. It saves thousands of lines of Auto-Generated Code. 048 private static final Map<String, Vector<String>> parameterNames = new HashMap<>(); 049 private static final Map<String, Vector<Class<?>>> parameterTypes = new HashMap<>(); 050 051 // Some Methods do not take any parameters - for instance all the "enable()" and "disable()" 052 // I simply could not get ride of RAW-TYPES and UNCHECKED warnings... so there are now, 053 // offically, two empty-vectors. One for String's, and the other for Classes. 054 055 private static final Vector<String> EMPTY_VEC_STR = new Vector<>(); 056 private static final Vector<Class<?>> EMPTY_VEC_CLASS = new Vector<>(); 057 058 static 059 { 060 for (Method m : Network.class.getMethods()) 061 { 062 // This doesn't work! The parameter names are all "arg0" ... "argN" 063 // It works for java.lang.reflect.Field, BUT NOT java.lang.reflect.Parameter! 064 // 065 // Vector<String> parameterNamesList = new Vector<>(); -- NOPE! 066 067 Vector<Class<?>> parameterTypesList = new Vector<>(); 068 069 for (Parameter p : m.getParameters()) parameterTypesList.add(p.getType()); 070 071 parameterTypes.put( 072 m.getName(), 073 (parameterTypesList.size() > 0) ? parameterTypesList : EMPTY_VEC_CLASS 074 ); 075 } 076 } 077 078 static 079 { 080 Vector<String> v = null; 081 082 v = new Vector<String>(1); 083 parameterNames.put("setAcceptedEncodings", v); 084 Collections.addAll(v, new String[] 085 { "encodings", }); 086 087 parameterNames.put("clearAcceptedEncodingsOverride", EMPTY_VEC_STR); 088 089 parameterNames.put("canClearBrowserCache", EMPTY_VEC_STR); 090 091 parameterNames.put("canClearBrowserCookies", EMPTY_VEC_STR); 092 093 parameterNames.put("canEmulateNetworkConditions", EMPTY_VEC_STR); 094 095 parameterNames.put("clearBrowserCache", EMPTY_VEC_STR); 096 097 parameterNames.put("clearBrowserCookies", EMPTY_VEC_STR); 098 099 v = new Vector<String>(8); 100 parameterNames.put("continueInterceptedRequest", v); 101 Collections.addAll(v, new String[] 102 { "interceptionId", "errorReason", "rawResponse", "url", "method", "postData", "headers", "authChallengeResponse", }); 103 104 v = new Vector<String>(5); 105 parameterNames.put("deleteCookies", v); 106 Collections.addAll(v, new String[] 107 { "name", "url", "domain", "path", "partitionKey", }); 108 109 parameterNames.put("disable", EMPTY_VEC_STR); 110 111 v = new Vector<String>(8); 112 parameterNames.put("emulateNetworkConditions", v); 113 Collections.addAll(v, new String[] 114 { "offline", "latency", "downloadThroughput", "uploadThroughput", "connectionType", "packetLoss", "packetQueueLength", "packetReordering", }); 115 116 v = new Vector<String>(4); 117 parameterNames.put("enable", v); 118 Collections.addAll(v, new String[] 119 { "maxTotalBufferSize", "maxResourceBufferSize", "maxPostDataSize", "reportDirectSocketTraffic", }); 120 121 parameterNames.put("getAllCookies", EMPTY_VEC_STR); 122 123 v = new Vector<String>(1); 124 parameterNames.put("getCertificate", v); 125 Collections.addAll(v, new String[] 126 { "origin", }); 127 128 v = new Vector<String>(1); 129 parameterNames.put("getCookies", v); 130 Collections.addAll(v, new String[] 131 { "urls", }); 132 133 v = new Vector<String>(1); 134 parameterNames.put("getResponseBody", v); 135 Collections.addAll(v, new String[] 136 { "requestId", }); 137 138 v = new Vector<String>(1); 139 parameterNames.put("getRequestPostData", v); 140 Collections.addAll(v, new String[] 141 { "requestId", }); 142 143 v = new Vector<String>(1); 144 parameterNames.put("getResponseBodyForInterception", v); 145 Collections.addAll(v, new String[] 146 { "interceptionId", }); 147 148 v = new Vector<String>(1); 149 parameterNames.put("takeResponseBodyForInterceptionAsStream", v); 150 Collections.addAll(v, new String[] 151 { "interceptionId", }); 152 153 v = new Vector<String>(1); 154 parameterNames.put("replayXHR", v); 155 Collections.addAll(v, new String[] 156 { "requestId", }); 157 158 v = new Vector<String>(4); 159 parameterNames.put("searchInResponseBody", v); 160 Collections.addAll(v, new String[] 161 { "requestId", "query", "caseSensitive", "isRegex", }); 162 163 v = new Vector<String>(1); 164 parameterNames.put("setBlockedURLs", v); 165 Collections.addAll(v, new String[] 166 { "urls", }); 167 168 v = new Vector<String>(1); 169 parameterNames.put("setBypassServiceWorker", v); 170 Collections.addAll(v, new String[] 171 { "bypass", }); 172 173 v = new Vector<String>(1); 174 parameterNames.put("setCacheDisabled", v); 175 Collections.addAll(v, new String[] 176 { "cacheDisabled", }); 177 178 v = new Vector<String>(14); 179 parameterNames.put("setCookie", v); 180 Collections.addAll(v, new String[] 181 { "name", "value", "url", "domain", "path", "secure", "httpOnly", "sameSite", "expires", "priority", "sameParty", "sourceScheme", "sourcePort", "partitionKey", }); 182 183 v = new Vector<String>(1); 184 parameterNames.put("setCookies", v); 185 Collections.addAll(v, new String[] 186 { "cookies", }); 187 188 v = new Vector<String>(1); 189 parameterNames.put("setExtraHTTPHeaders", v); 190 Collections.addAll(v, new String[] 191 { "headers", }); 192 193 v = new Vector<String>(1); 194 parameterNames.put("setAttachDebugStack", v); 195 Collections.addAll(v, new String[] 196 { "enabled", }); 197 198 v = new Vector<String>(1); 199 parameterNames.put("setRequestInterception", v); 200 Collections.addAll(v, new String[] 201 { "patterns", }); 202 203 v = new Vector<String>(4); 204 parameterNames.put("setUserAgentOverride", v); 205 Collections.addAll(v, new String[] 206 { "userAgent", "acceptLanguage", "platform", "userAgentMetadata", }); 207 208 v = new Vector<String>(1); 209 parameterNames.put("streamResourceContent", v); 210 Collections.addAll(v, new String[] 211 { "requestId", }); 212 213 v = new Vector<String>(1); 214 parameterNames.put("getSecurityIsolationStatus", v); 215 Collections.addAll(v, new String[] 216 { "frameId", }); 217 218 v = new Vector<String>(1); 219 parameterNames.put("enableReportingApi", v); 220 Collections.addAll(v, new String[] 221 { "enable", }); 222 223 v = new Vector<String>(3); 224 parameterNames.put("loadNetworkResource", v); 225 Collections.addAll(v, new String[] 226 { "frameId", "url", "options", }); 227 228 v = new Vector<String>(3); 229 parameterNames.put("setCookieControls", v); 230 Collections.addAll(v, new String[] 231 { "enableThirdPartyCookieRestriction", "disableThirdPartyCookieMetadata", "disableThirdPartyCookieHeuristics", }); 232 } 233 234 235 // ******************************************************************************************** 236 // ******************************************************************************************** 237 // Types - Static Inner Classes 238 // ******************************************************************************************** 239 // ******************************************************************************************** 240 241 // public static class LoaderId => String 242 243 // public static class RequestId => String 244 245 // public static class InterceptionId => String 246 247 // public static class TimeSinceEpoch => Number 248 249 // public static class MonotonicTime => Number 250 251 // public static class Headers => JsonObject 252 253 // public static class ReportId => String 254 255 /** Resource type as it was perceived by the rendering engine. */ 256 public static final String[] ResourceType = 257 { 258 "Document", "Stylesheet", "Image", "Media", "Font", "Script", "TextTrack", "XHR", "Fetch", 259 "Prefetch", "EventSource", "WebSocket", "Manifest", "SignedExchange", "Ping", 260 "CSPViolationReport", "Preflight", "FedCM", "Other", 261 }; 262 263 /** Network level fetch failure reason. */ 264 public static final String[] ErrorReason = 265 { 266 "Failed", "Aborted", "TimedOut", "AccessDenied", "ConnectionClosed", "ConnectionReset", 267 "ConnectionRefused", "ConnectionAborted", "ConnectionFailed", "NameNotResolved", 268 "InternetDisconnected", "AddressUnreachable", "BlockedByClient", "BlockedByResponse", 269 }; 270 271 /** The underlying connection technology that the browser is supposedly using. */ 272 public static final String[] ConnectionType = 273 { 274 "none", "cellular2g", "cellular3g", "cellular4g", "bluetooth", "ethernet", "wifi", "wimax", 275 "other", 276 }; 277 278 /** 279 * Represents the cookie's 'SameSite' status: 280 * https://tools.ietf.org/html/draft-west-first-party-cookies 281 */ 282 public static final String[] CookieSameSite = 283 { "Strict", "Lax", "None", }; 284 285 /** 286 * Represents the cookie's 'Priority' status: 287 * https://tools.ietf.org/html/draft-west-cookie-priority-00 288 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 289 */ 290 public static final String[] CookiePriority = 291 { "Low", "Medium", "High", }; 292 293 /** 294 * Represents the source scheme of the origin that originally set the cookie. 295 * A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme. 296 * This is a temporary ability and it will be removed in the future. 297 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 298 */ 299 public static final String[] CookieSourceScheme = 300 { "Unset", "NonSecure", "Secure", }; 301 302 /** Loading priority of a resource request. */ 303 public static final String[] ResourcePriority = 304 { "VeryLow", "Low", "Medium", "High", "VeryHigh", }; 305 306 /** Whether the request complied with Certificate Transparency policy. */ 307 public static final String[] CertificateTransparencyCompliance = 308 { "unknown", "not-compliant", "compliant", }; 309 310 /** The reason why request was blocked. */ 311 public static final String[] BlockedReason = 312 { 313 "other", "csp", "mixed-content", "origin", "inspector", "integrity", "subresource-filter", 314 "content-type", "coep-frame-resource-needs-coep-header", 315 "coop-sandboxed-iframe-cannot-navigate-to-coop-page", "corp-not-same-origin", 316 "corp-not-same-origin-after-defaulted-to-same-origin-by-coep", 317 "corp-not-same-origin-after-defaulted-to-same-origin-by-dip", 318 "corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip", 319 "corp-not-same-site", "sri-message-signature-mismatch", 320 }; 321 322 /** The reason why request was blocked. */ 323 public static final String[] CorsError = 324 { 325 "DisallowedByMode", "InvalidResponse", "WildcardOriginNotAllowed", 326 "MissingAllowOriginHeader", "MultipleAllowOriginValues", "InvalidAllowOriginValue", 327 "AllowOriginMismatch", "InvalidAllowCredentials", "CorsDisabledScheme", 328 "PreflightInvalidStatus", "PreflightDisallowedRedirect", 329 "PreflightWildcardOriginNotAllowed", "PreflightMissingAllowOriginHeader", 330 "PreflightMultipleAllowOriginValues", "PreflightInvalidAllowOriginValue", 331 "PreflightAllowOriginMismatch", "PreflightInvalidAllowCredentials", 332 "PreflightMissingAllowExternal", "PreflightInvalidAllowExternal", 333 "PreflightMissingAllowPrivateNetwork", "PreflightInvalidAllowPrivateNetwork", 334 "InvalidAllowMethodsPreflightResponse", "InvalidAllowHeadersPreflightResponse", 335 "MethodDisallowedByPreflightResponse", "HeaderDisallowedByPreflightResponse", 336 "RedirectContainsCredentials", "InsecurePrivateNetwork", "InvalidPrivateNetworkAccess", 337 "UnexpectedPrivateNetworkAccess", "NoCorsRedirectModeNotFollow", 338 "PreflightMissingPrivateNetworkAccessId", "PreflightMissingPrivateNetworkAccessName", 339 "PrivateNetworkAccessPermissionUnavailable", "PrivateNetworkAccessPermissionDenied", 340 "LocalNetworkAccessPermissionDenied", 341 }; 342 343 /** Source of serviceworker response. */ 344 public static final String[] ServiceWorkerResponseSource = 345 { "cache-storage", "http-cache", "fallback-code", "network", }; 346 347 /** 348 * <CODE>[No Description Provided by Google]</CODE> 349 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 350 */ 351 public static final String[] TrustTokenOperationType = 352 { "Issuance", "Redemption", "Signing", }; 353 354 /** 355 * The reason why Chrome uses a specific transport protocol for HTTP semantics. 356 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 357 */ 358 public static final String[] AlternateProtocolUsage = 359 { 360 "alternativeJobWonWithoutRace", "alternativeJobWonRace", "mainJobWonRace", 361 "mappingMissing", "broken", "dnsAlpnH3JobWonWithoutRace", "dnsAlpnH3JobWonRace", 362 "unspecifiedReason", 363 }; 364 365 /** Source of service worker router. */ 366 public static final String[] ServiceWorkerRouterSource = 367 { 368 "network", "cache", "fetch-event", "race-network-and-fetch-handler", 369 "race-network-and-cache", 370 }; 371 372 /** 373 * Types of reasons why a cookie may not be stored from a response. 374 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 375 */ 376 public static final String[] SetCookieBlockedReason = 377 { 378 "SecureOnly", "SameSiteStrict", "SameSiteLax", "SameSiteUnspecifiedTreatedAsLax", 379 "SameSiteNoneInsecure", "UserPreferences", "ThirdPartyPhaseout", 380 "ThirdPartyBlockedInFirstPartySet", "SyntaxError", "SchemeNotSupported", "OverwriteSecure", 381 "InvalidDomain", "InvalidPrefix", "UnknownError", "SchemefulSameSiteStrict", 382 "SchemefulSameSiteLax", "SchemefulSameSiteUnspecifiedTreatedAsLax", 383 "SamePartyFromCrossPartyContext", "SamePartyConflictsWithOtherAttributes", 384 "NameValuePairExceedsMaxSize", "DisallowedCharacter", "NoCookieContent", 385 }; 386 387 /** 388 * Types of reasons why a cookie may not be sent with a request. 389 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 390 */ 391 public static final String[] CookieBlockedReason = 392 { 393 "SecureOnly", "NotOnPath", "DomainMismatch", "SameSiteStrict", "SameSiteLax", 394 "SameSiteUnspecifiedTreatedAsLax", "SameSiteNoneInsecure", "UserPreferences", 395 "ThirdPartyPhaseout", "ThirdPartyBlockedInFirstPartySet", "UnknownError", 396 "SchemefulSameSiteStrict", "SchemefulSameSiteLax", 397 "SchemefulSameSiteUnspecifiedTreatedAsLax", "SamePartyFromCrossPartyContext", 398 "NameValuePairExceedsMaxSize", "PortMismatch", "SchemeMismatch", "AnonymousContext", 399 }; 400 401 /** 402 * Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request. 403 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 404 */ 405 public static final String[] CookieExemptionReason = 406 { 407 "None", "UserSetting", "TPCDMetadata", "TPCDDeprecationTrial", 408 "TopLevelTPCDDeprecationTrial", "TPCDHeuristics", "EnterprisePolicy", "StorageAccess", 409 "TopLevelStorageAccess", "Scheme", "SameSiteNoneCookiesInSandbox", 410 }; 411 412 /** 413 * Stages of the interception to begin intercepting. Request will intercept before the request is 414 * sent. Response will intercept after the response is received. 415 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 416 */ 417 public static final String[] InterceptionStage = 418 { "Request", "HeadersReceived", }; 419 420 /** 421 * Field type for a signed exchange related error. 422 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 423 */ 424 public static final String[] SignedExchangeErrorField = 425 { 426 "signatureSig", "signatureIntegrity", "signatureCertUrl", "signatureCertSha256", 427 "signatureValidityUrl", "signatureTimestamps", 428 }; 429 430 /** 431 * List of content encodings supported by the backend. 432 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 433 */ 434 public static final String[] ContentEncoding = 435 { "deflate", "gzip", "br", "zstd", }; 436 437 /** 438 * <CODE>[No Description Provided by Google]</CODE> 439 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 440 */ 441 public static final String[] DirectSocketDnsQueryType = 442 { "ipv4", "ipv6", }; 443 444 /** 445 * <CODE>[No Description Provided by Google]</CODE> 446 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 447 */ 448 public static final String[] PrivateNetworkRequestPolicy = 449 { 450 "Allow", "BlockFromInsecureToMorePrivate", "WarnFromInsecureToMorePrivate", 451 "PreflightBlock", "PreflightWarn", "PermissionBlock", "PermissionWarn", 452 }; 453 454 /** 455 * <CODE>[No Description Provided by Google]</CODE> 456 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 457 */ 458 public static final String[] IPAddressSpace = 459 { "Loopback", "Local", "Public", "Unknown", }; 460 461 /** 462 * <CODE>[No Description Provided by Google]</CODE> 463 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 464 */ 465 public static final String[] CrossOriginOpenerPolicyValue = 466 { 467 "SameOrigin", "SameOriginAllowPopups", "RestrictProperties", "UnsafeNone", 468 "SameOriginPlusCoep", "RestrictPropertiesPlusCoep", "NoopenerAllowPopups", 469 }; 470 471 /** 472 * <CODE>[No Description Provided by Google]</CODE> 473 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 474 */ 475 public static final String[] CrossOriginEmbedderPolicyValue = 476 { "None", "Credentialless", "RequireCorp", }; 477 478 /** 479 * <CODE>[No Description Provided by Google]</CODE> 480 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 481 */ 482 public static final String[] ContentSecurityPolicySource = 483 { "HTTP", "Meta", }; 484 485 /** 486 * The status of a Reporting API report. 487 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 488 */ 489 public static final String[] ReportStatus = 490 { "Queued", "Pending", "MarkedForRemoval", "Success", }; 491 492 /** Timing information for the request. */ 493 public static class ResourceTiming 494 extends BaseType 495 implements java.io.Serializable 496 { 497 /** For Object Serialization. java.io.Serializable */ 498 protected static final long serialVersionUID = 1; 499 500 public boolean[] optionals() 501 { return new boolean[] { false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false, }; } 502 503 /** 504 * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in 505 * milliseconds relatively to this requestTime. 506 */ 507 public final Number requestTime; 508 509 /** Started resolving proxy. */ 510 public final Number proxyStart; 511 512 /** Finished resolving proxy. */ 513 public final Number proxyEnd; 514 515 /** Started DNS address resolve. */ 516 public final Number dnsStart; 517 518 /** Finished DNS address resolve. */ 519 public final Number dnsEnd; 520 521 /** Started connecting to the remote host. */ 522 public final Number connectStart; 523 524 /** Connected to the remote host. */ 525 public final Number connectEnd; 526 527 /** Started SSL handshake. */ 528 public final Number sslStart; 529 530 /** Finished SSL handshake. */ 531 public final Number sslEnd; 532 533 /** 534 * Started running ServiceWorker. 535 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 536 */ 537 public final Number workerStart; 538 539 /** 540 * Finished Starting ServiceWorker. 541 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 542 */ 543 public final Number workerReady; 544 545 /** 546 * Started fetch event. 547 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 548 */ 549 public final Number workerFetchStart; 550 551 /** 552 * Settled fetch event respondWith promise. 553 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 554 */ 555 public final Number workerRespondWithSettled; 556 557 /** 558 * Started ServiceWorker static routing source evaluation. 559 * <BR /><B CLASS=Opt>OPTIONAL</B> 560 <B CLASS=Exp>EXPERIMENTAL</B> 561 */ 562 public final Number workerRouterEvaluationStart; 563 564 /** 565 * Started cache lookup when the source was evaluated to {@code cache}. 566 * <BR /><B CLASS=Opt>OPTIONAL</B> 567 <B CLASS=Exp>EXPERIMENTAL</B> 568 */ 569 public final Number workerCacheLookupStart; 570 571 /** Started sending request. */ 572 public final Number sendStart; 573 574 /** Finished sending request. */ 575 public final Number sendEnd; 576 577 /** 578 * Time the server started pushing request. 579 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 580 */ 581 public final Number pushStart; 582 583 /** 584 * Time the server finished pushing request. 585 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 586 */ 587 public final Number pushEnd; 588 589 /** 590 * Started receiving response headers. 591 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 592 */ 593 public final Number receiveHeadersStart; 594 595 /** Finished receiving response headers. */ 596 public final Number receiveHeadersEnd; 597 598 /** 599 * Constructor 600 * 601 * @param requestTime 602 * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in 603 * milliseconds relatively to this requestTime. 604 * 605 * @param proxyStart Started resolving proxy. 606 * 607 * @param proxyEnd Finished resolving proxy. 608 * 609 * @param dnsStart Started DNS address resolve. 610 * 611 * @param dnsEnd Finished DNS address resolve. 612 * 613 * @param connectStart Started connecting to the remote host. 614 * 615 * @param connectEnd Connected to the remote host. 616 * 617 * @param sslStart Started SSL handshake. 618 * 619 * @param sslEnd Finished SSL handshake. 620 * 621 * @param workerStart Started running ServiceWorker. 622 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 623 * 624 * @param workerReady Finished Starting ServiceWorker. 625 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 626 * 627 * @param workerFetchStart Started fetch event. 628 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 629 * 630 * @param workerRespondWithSettled Settled fetch event respondWith promise. 631 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 632 * 633 * @param workerRouterEvaluationStart Started ServiceWorker static routing source evaluation. 634 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 635 * 636 * @param workerCacheLookupStart Started cache lookup when the source was evaluated to {@code cache}. 637 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 638 * 639 * @param sendStart Started sending request. 640 * 641 * @param sendEnd Finished sending request. 642 * 643 * @param pushStart Time the server started pushing request. 644 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 645 * 646 * @param pushEnd Time the server finished pushing request. 647 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 648 * 649 * @param receiveHeadersStart Started receiving response headers. 650 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 651 * 652 * @param receiveHeadersEnd Finished receiving response headers. 653 */ 654 public ResourceTiming( 655 Number requestTime, Number proxyStart, Number proxyEnd, Number dnsStart, 656 Number dnsEnd, Number connectStart, Number connectEnd, Number sslStart, 657 Number sslEnd, Number workerStart, Number workerReady, Number workerFetchStart, 658 Number workerRespondWithSettled, Number workerRouterEvaluationStart, 659 Number workerCacheLookupStart, Number sendStart, Number sendEnd, Number pushStart, 660 Number pushEnd, Number receiveHeadersStart, Number receiveHeadersEnd 661 ) 662 { 663 // Exception-Check(s) to ensure that if any parameters which are not declared as 664 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 665 666 if (requestTime == null) THROWS.throwNPE("requestTime"); 667 if (proxyStart == null) THROWS.throwNPE("proxyStart"); 668 if (proxyEnd == null) THROWS.throwNPE("proxyEnd"); 669 if (dnsStart == null) THROWS.throwNPE("dnsStart"); 670 if (dnsEnd == null) THROWS.throwNPE("dnsEnd"); 671 if (connectStart == null) THROWS.throwNPE("connectStart"); 672 if (connectEnd == null) THROWS.throwNPE("connectEnd"); 673 if (sslStart == null) THROWS.throwNPE("sslStart"); 674 if (sslEnd == null) THROWS.throwNPE("sslEnd"); 675 if (workerStart == null) THROWS.throwNPE("workerStart"); 676 if (workerReady == null) THROWS.throwNPE("workerReady"); 677 if (workerFetchStart == null) THROWS.throwNPE("workerFetchStart"); 678 if (workerRespondWithSettled == null) THROWS.throwNPE("workerRespondWithSettled"); 679 if (sendStart == null) THROWS.throwNPE("sendStart"); 680 if (sendEnd == null) THROWS.throwNPE("sendEnd"); 681 if (pushStart == null) THROWS.throwNPE("pushStart"); 682 if (pushEnd == null) THROWS.throwNPE("pushEnd"); 683 if (receiveHeadersStart == null) THROWS.throwNPE("receiveHeadersStart"); 684 if (receiveHeadersEnd == null) THROWS.throwNPE("receiveHeadersEnd"); 685 686 this.requestTime = requestTime; 687 this.proxyStart = proxyStart; 688 this.proxyEnd = proxyEnd; 689 this.dnsStart = dnsStart; 690 this.dnsEnd = dnsEnd; 691 this.connectStart = connectStart; 692 this.connectEnd = connectEnd; 693 this.sslStart = sslStart; 694 this.sslEnd = sslEnd; 695 this.workerStart = workerStart; 696 this.workerReady = workerReady; 697 this.workerFetchStart = workerFetchStart; 698 this.workerRespondWithSettled = workerRespondWithSettled; 699 this.workerRouterEvaluationStart = workerRouterEvaluationStart; 700 this.workerCacheLookupStart = workerCacheLookupStart; 701 this.sendStart = sendStart; 702 this.sendEnd = sendEnd; 703 this.pushStart = pushStart; 704 this.pushEnd = pushEnd; 705 this.receiveHeadersStart = receiveHeadersStart; 706 this.receiveHeadersEnd = receiveHeadersEnd; 707 } 708 709 /** 710 * JSON Object Constructor 711 * @param jo A Json-Object having data about an instance of {@code 'ResourceTiming'}. 712 */ 713 public ResourceTiming (JsonObject jo) 714 { 715 this.requestTime = ReadNumberJSON.get(jo, "requestTime", false, true); 716 this.proxyStart = ReadNumberJSON.get(jo, "proxyStart", false, true); 717 this.proxyEnd = ReadNumberJSON.get(jo, "proxyEnd", false, true); 718 this.dnsStart = ReadNumberJSON.get(jo, "dnsStart", false, true); 719 this.dnsEnd = ReadNumberJSON.get(jo, "dnsEnd", false, true); 720 this.connectStart = ReadNumberJSON.get(jo, "connectStart", false, true); 721 this.connectEnd = ReadNumberJSON.get(jo, "connectEnd", false, true); 722 this.sslStart = ReadNumberJSON.get(jo, "sslStart", false, true); 723 this.sslEnd = ReadNumberJSON.get(jo, "sslEnd", false, true); 724 this.workerStart = ReadNumberJSON.get(jo, "workerStart", false, true); 725 this.workerReady = ReadNumberJSON.get(jo, "workerReady", false, true); 726 this.workerFetchStart = ReadNumberJSON.get(jo, "workerFetchStart", false, true); 727 this.workerRespondWithSettled = ReadNumberJSON.get(jo, "workerRespondWithSettled", false, true); 728 this.workerRouterEvaluationStart = ReadNumberJSON.get(jo, "workerRouterEvaluationStart", true, false); 729 this.workerCacheLookupStart = ReadNumberJSON.get(jo, "workerCacheLookupStart", true, false); 730 this.sendStart = ReadNumberJSON.get(jo, "sendStart", false, true); 731 this.sendEnd = ReadNumberJSON.get(jo, "sendEnd", false, true); 732 this.pushStart = ReadNumberJSON.get(jo, "pushStart", false, true); 733 this.pushEnd = ReadNumberJSON.get(jo, "pushEnd", false, true); 734 this.receiveHeadersStart = ReadNumberJSON.get(jo, "receiveHeadersStart", false, true); 735 this.receiveHeadersEnd = ReadNumberJSON.get(jo, "receiveHeadersEnd", false, true); 736 } 737 738 739 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 740 public boolean equals(Object other) 741 { 742 if (this == other) return true; 743 if (other == null) return false; 744 if (other.getClass() != this.getClass()) return false; 745 746 ResourceTiming o = (ResourceTiming) other; 747 748 return 749 Objects.equals(this.requestTime, o.requestTime) 750 && Objects.equals(this.proxyStart, o.proxyStart) 751 && Objects.equals(this.proxyEnd, o.proxyEnd) 752 && Objects.equals(this.dnsStart, o.dnsStart) 753 && Objects.equals(this.dnsEnd, o.dnsEnd) 754 && Objects.equals(this.connectStart, o.connectStart) 755 && Objects.equals(this.connectEnd, o.connectEnd) 756 && Objects.equals(this.sslStart, o.sslStart) 757 && Objects.equals(this.sslEnd, o.sslEnd) 758 && Objects.equals(this.workerStart, o.workerStart) 759 && Objects.equals(this.workerReady, o.workerReady) 760 && Objects.equals(this.workerFetchStart, o.workerFetchStart) 761 && Objects.equals(this.workerRespondWithSettled, o.workerRespondWithSettled) 762 && Objects.equals(this.workerRouterEvaluationStart, o.workerRouterEvaluationStart) 763 && Objects.equals(this.workerCacheLookupStart, o.workerCacheLookupStart) 764 && Objects.equals(this.sendStart, o.sendStart) 765 && Objects.equals(this.sendEnd, o.sendEnd) 766 && Objects.equals(this.pushStart, o.pushStart) 767 && Objects.equals(this.pushEnd, o.pushEnd) 768 && Objects.equals(this.receiveHeadersStart, o.receiveHeadersStart) 769 && Objects.equals(this.receiveHeadersEnd, o.receiveHeadersEnd); 770 } 771 772 /** Generates a Hash-Code for {@code 'this'} instance */ 773 public int hashCode() 774 { 775 return 776 Objects.hashCode(this.requestTime) 777 + Objects.hashCode(this.proxyStart) 778 + Objects.hashCode(this.proxyEnd) 779 + Objects.hashCode(this.dnsStart) 780 + Objects.hashCode(this.dnsEnd) 781 + Objects.hashCode(this.connectStart) 782 + Objects.hashCode(this.connectEnd) 783 + Objects.hashCode(this.sslStart) 784 + Objects.hashCode(this.sslEnd) 785 + Objects.hashCode(this.workerStart) 786 + Objects.hashCode(this.workerReady) 787 + Objects.hashCode(this.workerFetchStart) 788 + Objects.hashCode(this.workerRespondWithSettled) 789 + Objects.hashCode(this.workerRouterEvaluationStart) 790 + Objects.hashCode(this.workerCacheLookupStart) 791 + Objects.hashCode(this.sendStart) 792 + Objects.hashCode(this.sendEnd) 793 + Objects.hashCode(this.pushStart) 794 + Objects.hashCode(this.pushEnd) 795 + Objects.hashCode(this.receiveHeadersStart) 796 + Objects.hashCode(this.receiveHeadersEnd); 797 } 798 } 799 800 /** Post data entry for HTTP request */ 801 public static class PostDataEntry 802 extends BaseType 803 implements java.io.Serializable 804 { 805 /** For Object Serialization. java.io.Serializable */ 806 protected static final long serialVersionUID = 1; 807 808 public boolean[] optionals() 809 { return new boolean[] { true, }; } 810 811 /** 812 * <CODE>[No Description Provided by Google]</CODE> 813 * <BR /><B CLASS=Opt>OPTIONAL</B> 814 */ 815 public final String bytes; 816 817 /** 818 * Constructor 819 * 820 * @param bytes - 821 * <BR /><B CLASS=Opt>OPTIONAL</B> 822 */ 823 public PostDataEntry(String bytes) 824 { 825 this.bytes = bytes; 826 } 827 828 /** 829 * JSON Object Constructor 830 * @param jo A Json-Object having data about an instance of {@code 'PostDataEntry'}. 831 */ 832 public PostDataEntry (JsonObject jo) 833 { 834 this.bytes = ReadJSON.getString(jo, "bytes", true, false); 835 } 836 837 838 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 839 public boolean equals(Object other) 840 { 841 if (this == other) return true; 842 if (other == null) return false; 843 if (other.getClass() != this.getClass()) return false; 844 845 PostDataEntry o = (PostDataEntry) other; 846 847 return 848 Objects.equals(this.bytes, o.bytes); 849 } 850 851 /** Generates a Hash-Code for {@code 'this'} instance */ 852 public int hashCode() 853 { 854 return 855 Objects.hashCode(this.bytes); 856 } 857 } 858 859 /** HTTP request data. */ 860 public static class Request 861 extends BaseType 862 implements java.io.Serializable 863 { 864 /** For Object Serialization. java.io.Serializable */ 865 protected static final long serialVersionUID = 1; 866 867 public boolean[] optionals() 868 { return new boolean[] { false, true, false, false, true, true, true, true, false, false, true, true, true, }; } 869 870 /** Request URL (without fragment). */ 871 public final String url; 872 873 /** 874 * Fragment of the requested URL starting with hash, if present. 875 * <BR /><B CLASS=Opt>OPTIONAL</B> 876 */ 877 public final String urlFragment; 878 879 /** HTTP request method. */ 880 public final String method; 881 882 /** HTTP request headers. */ 883 public final JsonObject headers; 884 885 /** 886 * HTTP POST request data. 887 * Use postDataEntries instead. 888 * <BR /><B CLASS=Opt>OPTIONAL</B> 889 <B CLASS=Dep>DEPRECATED</B> 890 */ 891 public final String postData; 892 893 /** 894 * True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long. 895 * <BR /><B CLASS=Opt>OPTIONAL</B> 896 */ 897 public final Boolean hasPostData; 898 899 /** 900 * Request body elements (post data broken into individual entries). 901 * <BR /><B CLASS=Opt>OPTIONAL</B> 902 <B CLASS=Exp>EXPERIMENTAL</B> 903 */ 904 public final Network.PostDataEntry[] postDataEntries; 905 906 /** 907 * The mixed content type of the request. 908 * <BR /><B CLASS=Opt>OPTIONAL</B> 909 */ 910 public final String mixedContentType; 911 912 /** Priority of the resource request at the time request is sent. */ 913 public final String initialPriority; 914 915 /** The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ */ 916 public final String referrerPolicy; 917 918 /** 919 * Whether is loaded via link preload. 920 * <BR /><B CLASS=Opt>OPTIONAL</B> 921 */ 922 public final Boolean isLinkPreload; 923 924 /** 925 * Set for requests when the TrustToken API is used. Contains the parameters 926 * passed by the developer (e.g. via "fetch") as understood by the backend. 927 * <BR /><B CLASS=Opt>OPTIONAL</B> 928 <B CLASS=Exp>EXPERIMENTAL</B> 929 */ 930 public final Network.TrustTokenParams trustTokenParams; 931 932 /** 933 * True if this resource request is considered to be the 'same site' as the 934 * request corresponding to the main frame. 935 * <BR /><B CLASS=Opt>OPTIONAL</B> 936 <B CLASS=Exp>EXPERIMENTAL</B> 937 */ 938 public final Boolean isSameSite; 939 940 /** 941 * Constructor 942 * 943 * @param url Request URL (without fragment). 944 * 945 * @param urlFragment Fragment of the requested URL starting with hash, if present. 946 * <BR /><B CLASS=Opt>OPTIONAL</B> 947 * 948 * @param method HTTP request method. 949 * 950 * @param headers HTTP request headers. 951 * 952 * @param postData 953 * HTTP POST request data. 954 * Use postDataEntries instead. 955 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Dep>DEPRECATED</B> 956 * 957 * @param hasPostData True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long. 958 * <BR /><B CLASS=Opt>OPTIONAL</B> 959 * 960 * @param postDataEntries Request body elements (post data broken into individual entries). 961 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 962 * 963 * @param mixedContentType The mixed content type of the request. 964 * <BR /><B CLASS=Opt>OPTIONAL</B> 965 * 966 * @param initialPriority Priority of the resource request at the time request is sent. 967 * 968 * @param referrerPolicy The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/ 969 * <BR />Acceptable Values: ["unsafe-url", "no-referrer-when-downgrade", "no-referrer", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin"] 970 * 971 * @param isLinkPreload Whether is loaded via link preload. 972 * <BR /><B CLASS=Opt>OPTIONAL</B> 973 * 974 * @param trustTokenParams 975 * Set for requests when the TrustToken API is used. Contains the parameters 976 * passed by the developer (e.g. via "fetch") as understood by the backend. 977 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 978 * 979 * @param isSameSite 980 * True if this resource request is considered to be the 'same site' as the 981 * request corresponding to the main frame. 982 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 983 */ 984 public Request( 985 String url, String urlFragment, String method, JsonObject headers, String postData, 986 Boolean hasPostData, Network.PostDataEntry[] postDataEntries, 987 String mixedContentType, String initialPriority, String referrerPolicy, 988 Boolean isLinkPreload, Network.TrustTokenParams trustTokenParams, Boolean isSameSite 989 ) 990 { 991 // Exception-Check(s) to ensure that if any parameters which are not declared as 992 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 993 994 if (url == null) THROWS.throwNPE("url"); 995 if (method == null) THROWS.throwNPE("method"); 996 if (headers == null) THROWS.throwNPE("headers"); 997 if (initialPriority == null) THROWS.throwNPE("initialPriority"); 998 if (referrerPolicy == null) THROWS.throwNPE("referrerPolicy"); 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("mixedContentType", mixedContentType, "Security.MixedContentType", Security.MixedContentType); 1004 THROWS.checkIAE("initialPriority", initialPriority, "Network.ResourcePriority", Network.ResourcePriority); 1005 THROWS.checkIAE( 1006 "referrerPolicy", referrerPolicy, 1007 "unsafe-url", "no-referrer-when-downgrade", "no-referrer", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin" 1008 ); 1009 1010 this.url = url; 1011 this.urlFragment = urlFragment; 1012 this.method = method; 1013 this.headers = headers; 1014 this.postData = postData; 1015 this.hasPostData = hasPostData; 1016 this.postDataEntries = postDataEntries; 1017 this.mixedContentType = mixedContentType; 1018 this.initialPriority = initialPriority; 1019 this.referrerPolicy = referrerPolicy; 1020 this.isLinkPreload = isLinkPreload; 1021 this.trustTokenParams = trustTokenParams; 1022 this.isSameSite = isSameSite; 1023 } 1024 1025 /** 1026 * JSON Object Constructor 1027 * @param jo A Json-Object having data about an instance of {@code 'Request'}. 1028 */ 1029 public Request (JsonObject jo) 1030 { 1031 this.url = ReadJSON.getString(jo, "url", false, true); 1032 this.urlFragment = ReadJSON.getString(jo, "urlFragment", true, false); 1033 this.method = ReadJSON.getString(jo, "method", false, true); 1034 this.headers = jo.getJsonObject("headers"); 1035 this.postData = ReadJSON.getString(jo, "postData", true, false); 1036 this.hasPostData = ReadBoxedJSON.getBoolean(jo, "hasPostData", true); 1037 this.postDataEntries = (jo.getJsonArray("postDataEntries") == null) 1038 ? null 1039 : RJArrIntoStream.objArr(jo.getJsonArray("postDataEntries"), null, 0, Network.PostDataEntry.class).toArray(Network.PostDataEntry[]::new); 1040 1041 this.mixedContentType = ReadJSON.getString(jo, "mixedContentType", true, false); 1042 this.initialPriority = ReadJSON.getString(jo, "initialPriority", false, true); 1043 this.referrerPolicy = ReadJSON.getString(jo, "referrerPolicy", false, true); 1044 this.isLinkPreload = ReadBoxedJSON.getBoolean(jo, "isLinkPreload", true); 1045 this.trustTokenParams = ReadJSON.getObject(jo, "trustTokenParams", Network.TrustTokenParams.class, true, false); 1046 this.isSameSite = ReadBoxedJSON.getBoolean(jo, "isSameSite", true); 1047 } 1048 1049 1050 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1051 public boolean equals(Object other) 1052 { 1053 if (this == other) return true; 1054 if (other == null) return false; 1055 if (other.getClass() != this.getClass()) return false; 1056 1057 Request o = (Request) other; 1058 1059 return 1060 Objects.equals(this.url, o.url) 1061 && Objects.equals(this.urlFragment, o.urlFragment) 1062 && Objects.equals(this.method, o.method) 1063 && Objects.equals(this.headers, o.headers) 1064 && Objects.equals(this.postData, o.postData) 1065 && Objects.equals(this.hasPostData, o.hasPostData) 1066 && Arrays.deepEquals(this.postDataEntries, o.postDataEntries) 1067 && Objects.equals(this.mixedContentType, o.mixedContentType) 1068 && Objects.equals(this.initialPriority, o.initialPriority) 1069 && Objects.equals(this.referrerPolicy, o.referrerPolicy) 1070 && Objects.equals(this.isLinkPreload, o.isLinkPreload) 1071 && Objects.equals(this.trustTokenParams, o.trustTokenParams) 1072 && Objects.equals(this.isSameSite, o.isSameSite); 1073 } 1074 1075 /** Generates a Hash-Code for {@code 'this'} instance */ 1076 public int hashCode() 1077 { 1078 return 1079 Objects.hashCode(this.url) 1080 + Objects.hashCode(this.urlFragment) 1081 + Objects.hashCode(this.method) 1082 + this.headers.hashCode() 1083 + Objects.hashCode(this.postData) 1084 + Objects.hashCode(this.hasPostData) 1085 + Arrays.deepHashCode(this.postDataEntries) 1086 + Objects.hashCode(this.mixedContentType) 1087 + Objects.hashCode(this.initialPriority) 1088 + Objects.hashCode(this.referrerPolicy) 1089 + Objects.hashCode(this.isLinkPreload) 1090 + this.trustTokenParams.hashCode() 1091 + Objects.hashCode(this.isSameSite); 1092 } 1093 } 1094 1095 /** Details of a signed certificate timestamp (SCT). */ 1096 public static class SignedCertificateTimestamp 1097 extends BaseType 1098 implements java.io.Serializable 1099 { 1100 /** For Object Serialization. java.io.Serializable */ 1101 protected static final long serialVersionUID = 1; 1102 1103 public boolean[] optionals() 1104 { return new boolean[] { false, false, false, false, false, false, false, false, }; } 1105 1106 /** Validation status. */ 1107 public final String status; 1108 1109 /** Origin. */ 1110 public final String origin; 1111 1112 /** Log name / description. */ 1113 public final String logDescription; 1114 1115 /** Log ID. */ 1116 public final String logId; 1117 1118 /** 1119 * Issuance date. Unlike TimeSinceEpoch, this contains the number of 1120 * milliseconds since January 1, 1970, UTC, not the number of seconds. 1121 */ 1122 public final Number timestamp; 1123 1124 /** Hash algorithm. */ 1125 public final String hashAlgorithm; 1126 1127 /** Signature algorithm. */ 1128 public final String signatureAlgorithm; 1129 1130 /** Signature data. */ 1131 public final String signatureData; 1132 1133 /** 1134 * Constructor 1135 * 1136 * @param status Validation status. 1137 * 1138 * @param origin Origin. 1139 * 1140 * @param logDescription Log name / description. 1141 * 1142 * @param logId Log ID. 1143 * 1144 * @param timestamp 1145 * Issuance date. Unlike TimeSinceEpoch, this contains the number of 1146 * milliseconds since January 1, 1970, UTC, not the number of seconds. 1147 * 1148 * @param hashAlgorithm Hash algorithm. 1149 * 1150 * @param signatureAlgorithm Signature algorithm. 1151 * 1152 * @param signatureData Signature data. 1153 */ 1154 public SignedCertificateTimestamp( 1155 String status, String origin, String logDescription, String logId, Number timestamp, 1156 String hashAlgorithm, String signatureAlgorithm, String signatureData 1157 ) 1158 { 1159 // Exception-Check(s) to ensure that if any parameters which are not declared as 1160 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1161 1162 if (status == null) THROWS.throwNPE("status"); 1163 if (origin == null) THROWS.throwNPE("origin"); 1164 if (logDescription == null) THROWS.throwNPE("logDescription"); 1165 if (logId == null) THROWS.throwNPE("logId"); 1166 if (timestamp == null) THROWS.throwNPE("timestamp"); 1167 if (hashAlgorithm == null) THROWS.throwNPE("hashAlgorithm"); 1168 if (signatureAlgorithm == null) THROWS.throwNPE("signatureAlgorithm"); 1169 if (signatureData == null) THROWS.throwNPE("signatureData"); 1170 1171 this.status = status; 1172 this.origin = origin; 1173 this.logDescription = logDescription; 1174 this.logId = logId; 1175 this.timestamp = timestamp; 1176 this.hashAlgorithm = hashAlgorithm; 1177 this.signatureAlgorithm = signatureAlgorithm; 1178 this.signatureData = signatureData; 1179 } 1180 1181 /** 1182 * JSON Object Constructor 1183 * @param jo A Json-Object having data about an instance of {@code 'SignedCertificateTimestamp'}. 1184 */ 1185 public SignedCertificateTimestamp (JsonObject jo) 1186 { 1187 this.status = ReadJSON.getString(jo, "status", false, true); 1188 this.origin = ReadJSON.getString(jo, "origin", false, true); 1189 this.logDescription = ReadJSON.getString(jo, "logDescription", false, true); 1190 this.logId = ReadJSON.getString(jo, "logId", false, true); 1191 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 1192 this.hashAlgorithm = ReadJSON.getString(jo, "hashAlgorithm", false, true); 1193 this.signatureAlgorithm = ReadJSON.getString(jo, "signatureAlgorithm", false, true); 1194 this.signatureData = ReadJSON.getString(jo, "signatureData", false, true); 1195 } 1196 1197 1198 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1199 public boolean equals(Object other) 1200 { 1201 if (this == other) return true; 1202 if (other == null) return false; 1203 if (other.getClass() != this.getClass()) return false; 1204 1205 SignedCertificateTimestamp o = (SignedCertificateTimestamp) other; 1206 1207 return 1208 Objects.equals(this.status, o.status) 1209 && Objects.equals(this.origin, o.origin) 1210 && Objects.equals(this.logDescription, o.logDescription) 1211 && Objects.equals(this.logId, o.logId) 1212 && Objects.equals(this.timestamp, o.timestamp) 1213 && Objects.equals(this.hashAlgorithm, o.hashAlgorithm) 1214 && Objects.equals(this.signatureAlgorithm, o.signatureAlgorithm) 1215 && Objects.equals(this.signatureData, o.signatureData); 1216 } 1217 1218 /** Generates a Hash-Code for {@code 'this'} instance */ 1219 public int hashCode() 1220 { 1221 return 1222 Objects.hashCode(this.status) 1223 + Objects.hashCode(this.origin) 1224 + Objects.hashCode(this.logDescription) 1225 + Objects.hashCode(this.logId) 1226 + Objects.hashCode(this.timestamp) 1227 + Objects.hashCode(this.hashAlgorithm) 1228 + Objects.hashCode(this.signatureAlgorithm) 1229 + Objects.hashCode(this.signatureData); 1230 } 1231 } 1232 1233 /** Security details about a request. */ 1234 public static class SecurityDetails 1235 extends BaseType 1236 implements java.io.Serializable 1237 { 1238 /** For Object Serialization. java.io.Serializable */ 1239 protected static final long serialVersionUID = 1; 1240 1241 public boolean[] optionals() 1242 { return new boolean[] { false, false, true, false, true, false, false, false, false, false, false, false, false, true, false, }; } 1243 1244 /** Protocol name (e.g. "TLS 1.2" or "QUIC"). */ 1245 public final String protocol; 1246 1247 /** Key Exchange used by the connection, or the empty string if not applicable. */ 1248 public final String keyExchange; 1249 1250 /** 1251 * (EC)DH group used by the connection, if applicable. 1252 * <BR /><B CLASS=Opt>OPTIONAL</B> 1253 */ 1254 public final String keyExchangeGroup; 1255 1256 /** Cipher name. */ 1257 public final String cipher; 1258 1259 /** 1260 * TLS MAC. Note that AEAD ciphers do not have separate MACs. 1261 * <BR /><B CLASS=Opt>OPTIONAL</B> 1262 */ 1263 public final String mac; 1264 1265 /** Certificate ID value. */ 1266 public final int certificateId; 1267 1268 /** Certificate subject name. */ 1269 public final String subjectName; 1270 1271 /** Subject Alternative Name (SAN) DNS names and IP addresses. */ 1272 public final String[] sanList; 1273 1274 /** Name of the issuing CA. */ 1275 public final String issuer; 1276 1277 /** Certificate valid from date. */ 1278 public final Number validFrom; 1279 1280 /** Certificate valid to (expiration) date */ 1281 public final Number validTo; 1282 1283 /** List of signed certificate timestamps (SCTs). */ 1284 public final Network.SignedCertificateTimestamp[] signedCertificateTimestampList; 1285 1286 /** Whether the request complied with Certificate Transparency policy */ 1287 public final String certificateTransparencyCompliance; 1288 1289 /** 1290 * The signature algorithm used by the server in the TLS server signature, 1291 * represented as a TLS SignatureScheme code point. Omitted if not 1292 * applicable or not known. 1293 * <BR /><B CLASS=Opt>OPTIONAL</B> 1294 */ 1295 public final Integer serverSignatureAlgorithm; 1296 1297 /** Whether the connection used Encrypted ClientHello */ 1298 public final boolean encryptedClientHello; 1299 1300 /** 1301 * Constructor 1302 * 1303 * @param protocol Protocol name (e.g. "TLS 1.2" or "QUIC"). 1304 * 1305 * @param keyExchange Key Exchange used by the connection, or the empty string if not applicable. 1306 * 1307 * @param keyExchangeGroup (EC)DH group used by the connection, if applicable. 1308 * <BR /><B CLASS=Opt>OPTIONAL</B> 1309 * 1310 * @param cipher Cipher name. 1311 * 1312 * @param mac TLS MAC. Note that AEAD ciphers do not have separate MACs. 1313 * <BR /><B CLASS=Opt>OPTIONAL</B> 1314 * 1315 * @param certificateId Certificate ID value. 1316 * 1317 * @param subjectName Certificate subject name. 1318 * 1319 * @param sanList Subject Alternative Name (SAN) DNS names and IP addresses. 1320 * 1321 * @param issuer Name of the issuing CA. 1322 * 1323 * @param validFrom Certificate valid from date. 1324 * 1325 * @param validTo Certificate valid to (expiration) date 1326 * 1327 * @param signedCertificateTimestampList List of signed certificate timestamps (SCTs). 1328 * 1329 * @param certificateTransparencyCompliance Whether the request complied with Certificate Transparency policy 1330 * 1331 * @param serverSignatureAlgorithm 1332 * The signature algorithm used by the server in the TLS server signature, 1333 * represented as a TLS SignatureScheme code point. Omitted if not 1334 * applicable or not known. 1335 * <BR /><B CLASS=Opt>OPTIONAL</B> 1336 * 1337 * @param encryptedClientHello Whether the connection used Encrypted ClientHello 1338 */ 1339 public SecurityDetails( 1340 String protocol, String keyExchange, String keyExchangeGroup, String cipher, 1341 String mac, int certificateId, String subjectName, String[] sanList, String issuer, 1342 Number validFrom, Number validTo, 1343 Network.SignedCertificateTimestamp[] signedCertificateTimestampList, 1344 String certificateTransparencyCompliance, Integer serverSignatureAlgorithm, 1345 boolean encryptedClientHello 1346 ) 1347 { 1348 // Exception-Check(s) to ensure that if any parameters which are not declared as 1349 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1350 1351 if (protocol == null) THROWS.throwNPE("protocol"); 1352 if (keyExchange == null) THROWS.throwNPE("keyExchange"); 1353 if (cipher == null) THROWS.throwNPE("cipher"); 1354 if (subjectName == null) THROWS.throwNPE("subjectName"); 1355 if (sanList == null) THROWS.throwNPE("sanList"); 1356 if (issuer == null) THROWS.throwNPE("issuer"); 1357 if (validFrom == null) THROWS.throwNPE("validFrom"); 1358 if (validTo == null) THROWS.throwNPE("validTo"); 1359 if (signedCertificateTimestampList == null) THROWS.throwNPE("signedCertificateTimestampList"); 1360 if (certificateTransparencyCompliance == null) THROWS.throwNPE("certificateTransparencyCompliance"); 1361 1362 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1363 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1364 1365 THROWS.checkIAE("certificateTransparencyCompliance", certificateTransparencyCompliance, "Network.CertificateTransparencyCompliance", Network.CertificateTransparencyCompliance); 1366 1367 this.protocol = protocol; 1368 this.keyExchange = keyExchange; 1369 this.keyExchangeGroup = keyExchangeGroup; 1370 this.cipher = cipher; 1371 this.mac = mac; 1372 this.certificateId = certificateId; 1373 this.subjectName = subjectName; 1374 this.sanList = sanList; 1375 this.issuer = issuer; 1376 this.validFrom = validFrom; 1377 this.validTo = validTo; 1378 this.signedCertificateTimestampList = signedCertificateTimestampList; 1379 this.certificateTransparencyCompliance = certificateTransparencyCompliance; 1380 this.serverSignatureAlgorithm = serverSignatureAlgorithm; 1381 this.encryptedClientHello = encryptedClientHello; 1382 } 1383 1384 /** 1385 * JSON Object Constructor 1386 * @param jo A Json-Object having data about an instance of {@code 'SecurityDetails'}. 1387 */ 1388 public SecurityDetails (JsonObject jo) 1389 { 1390 this.protocol = ReadJSON.getString(jo, "protocol", false, true); 1391 this.keyExchange = ReadJSON.getString(jo, "keyExchange", false, true); 1392 this.keyExchangeGroup = ReadJSON.getString(jo, "keyExchangeGroup", true, false); 1393 this.cipher = ReadJSON.getString(jo, "cipher", false, true); 1394 this.mac = ReadJSON.getString(jo, "mac", true, false); 1395 this.certificateId = ReadPrimJSON.getInt(jo, "certificateId"); 1396 this.subjectName = ReadJSON.getString(jo, "subjectName", false, true); 1397 this.sanList = (jo.getJsonArray("sanList") == null) 1398 ? null 1399 : RJArrIntoStream.strArr(jo.getJsonArray("sanList"), null, 0).toArray(String[]::new); 1400 1401 this.issuer = ReadJSON.getString(jo, "issuer", false, true); 1402 this.validFrom = ReadNumberJSON.get(jo, "validFrom", false, true); 1403 this.validTo = ReadNumberJSON.get(jo, "validTo", false, true); 1404 this.signedCertificateTimestampList = (jo.getJsonArray("signedCertificateTimestampList") == null) 1405 ? null 1406 : RJArrIntoStream.objArr(jo.getJsonArray("signedCertificateTimestampList"), null, 0, Network.SignedCertificateTimestamp.class).toArray(Network.SignedCertificateTimestamp[]::new); 1407 1408 this.certificateTransparencyCompliance = ReadJSON.getString(jo, "certificateTransparencyCompliance", false, true); 1409 this.serverSignatureAlgorithm = ReadBoxedJSON.getInteger(jo, "serverSignatureAlgorithm", true); 1410 this.encryptedClientHello = ReadPrimJSON.getBoolean(jo, "encryptedClientHello"); 1411 } 1412 1413 1414 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1415 public boolean equals(Object other) 1416 { 1417 if (this == other) return true; 1418 if (other == null) return false; 1419 if (other.getClass() != this.getClass()) return false; 1420 1421 SecurityDetails o = (SecurityDetails) other; 1422 1423 return 1424 Objects.equals(this.protocol, o.protocol) 1425 && Objects.equals(this.keyExchange, o.keyExchange) 1426 && Objects.equals(this.keyExchangeGroup, o.keyExchangeGroup) 1427 && Objects.equals(this.cipher, o.cipher) 1428 && Objects.equals(this.mac, o.mac) 1429 && Objects.equals(this.certificateId, o.certificateId) 1430 && Objects.equals(this.subjectName, o.subjectName) 1431 && Arrays.deepEquals(this.sanList, o.sanList) 1432 && Objects.equals(this.issuer, o.issuer) 1433 && Objects.equals(this.validFrom, o.validFrom) 1434 && Objects.equals(this.validTo, o.validTo) 1435 && Arrays.deepEquals(this.signedCertificateTimestampList, o.signedCertificateTimestampList) 1436 && Objects.equals(this.certificateTransparencyCompliance, o.certificateTransparencyCompliance) 1437 && Objects.equals(this.serverSignatureAlgorithm, o.serverSignatureAlgorithm) 1438 && (this.encryptedClientHello == o.encryptedClientHello); 1439 } 1440 1441 /** Generates a Hash-Code for {@code 'this'} instance */ 1442 public int hashCode() 1443 { 1444 return 1445 Objects.hashCode(this.protocol) 1446 + Objects.hashCode(this.keyExchange) 1447 + Objects.hashCode(this.keyExchangeGroup) 1448 + Objects.hashCode(this.cipher) 1449 + Objects.hashCode(this.mac) 1450 + this.certificateId 1451 + Objects.hashCode(this.subjectName) 1452 + Arrays.deepHashCode(this.sanList) 1453 + Objects.hashCode(this.issuer) 1454 + Objects.hashCode(this.validFrom) 1455 + Objects.hashCode(this.validTo) 1456 + Arrays.deepHashCode(this.signedCertificateTimestampList) 1457 + Objects.hashCode(this.certificateTransparencyCompliance) 1458 + Objects.hashCode(this.serverSignatureAlgorithm) 1459 + (this.encryptedClientHello ? 1 : 0); 1460 } 1461 } 1462 1463 /** <CODE>[No Description Provided by Google]</CODE> */ 1464 public static class CorsErrorStatus 1465 extends BaseType 1466 implements java.io.Serializable 1467 { 1468 /** For Object Serialization. java.io.Serializable */ 1469 protected static final long serialVersionUID = 1; 1470 1471 public boolean[] optionals() 1472 { return new boolean[] { false, false, }; } 1473 1474 /** <CODE>[No Description Provided by Google]</CODE> */ 1475 public final String corsError; 1476 1477 /** <CODE>[No Description Provided by Google]</CODE> */ 1478 public final String failedParameter; 1479 1480 /** 1481 * Constructor 1482 * 1483 * @param corsError - 1484 * 1485 * @param failedParameter - 1486 */ 1487 public CorsErrorStatus(String corsError, String failedParameter) 1488 { 1489 // Exception-Check(s) to ensure that if any parameters which are not declared as 1490 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1491 1492 if (corsError == null) THROWS.throwNPE("corsError"); 1493 if (failedParameter == null) THROWS.throwNPE("failedParameter"); 1494 1495 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1496 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1497 1498 THROWS.checkIAE("corsError", corsError, "Network.CorsError", Network.CorsError); 1499 1500 this.corsError = corsError; 1501 this.failedParameter = failedParameter; 1502 } 1503 1504 /** 1505 * JSON Object Constructor 1506 * @param jo A Json-Object having data about an instance of {@code 'CorsErrorStatus'}. 1507 */ 1508 public CorsErrorStatus (JsonObject jo) 1509 { 1510 this.corsError = ReadJSON.getString(jo, "corsError", false, true); 1511 this.failedParameter = ReadJSON.getString(jo, "failedParameter", false, true); 1512 } 1513 1514 1515 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1516 public boolean equals(Object other) 1517 { 1518 if (this == other) return true; 1519 if (other == null) return false; 1520 if (other.getClass() != this.getClass()) return false; 1521 1522 CorsErrorStatus o = (CorsErrorStatus) other; 1523 1524 return 1525 Objects.equals(this.corsError, o.corsError) 1526 && Objects.equals(this.failedParameter, o.failedParameter); 1527 } 1528 1529 /** Generates a Hash-Code for {@code 'this'} instance */ 1530 public int hashCode() 1531 { 1532 return 1533 Objects.hashCode(this.corsError) 1534 + Objects.hashCode(this.failedParameter); 1535 } 1536 } 1537 1538 /** 1539 * Determines what type of Trust Token operation is executed and 1540 * depending on the type, some additional parameters. The values 1541 * are specified in third_party/blink/renderer/core/fetch/trust_token.idl. 1542 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1543 */ 1544 public static class TrustTokenParams 1545 extends BaseType 1546 implements java.io.Serializable 1547 { 1548 /** For Object Serialization. java.io.Serializable */ 1549 protected static final long serialVersionUID = 1; 1550 1551 public boolean[] optionals() 1552 { return new boolean[] { false, false, true, }; } 1553 1554 /** <CODE>[No Description Provided by Google]</CODE> */ 1555 public final String operation; 1556 1557 /** 1558 * Only set for "token-redemption" operation and determine whether 1559 * to request a fresh SRR or use a still valid cached SRR. 1560 */ 1561 public final String refreshPolicy; 1562 1563 /** 1564 * Origins of issuers from whom to request tokens or redemption 1565 * records. 1566 * <BR /><B CLASS=Opt>OPTIONAL</B> 1567 */ 1568 public final String[] issuers; 1569 1570 /** 1571 * Constructor 1572 * 1573 * @param operation - 1574 * 1575 * @param refreshPolicy 1576 * Only set for "token-redemption" operation and determine whether 1577 * to request a fresh SRR or use a still valid cached SRR. 1578 * <BR />Acceptable Values: ["UseCached", "Refresh"] 1579 * 1580 * @param issuers 1581 * Origins of issuers from whom to request tokens or redemption 1582 * records. 1583 * <BR /><B CLASS=Opt>OPTIONAL</B> 1584 */ 1585 public TrustTokenParams(String operation, String refreshPolicy, String[] issuers) 1586 { 1587 // Exception-Check(s) to ensure that if any parameters which are not declared as 1588 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 1589 1590 if (operation == null) THROWS.throwNPE("operation"); 1591 if (refreshPolicy == null) THROWS.throwNPE("refreshPolicy"); 1592 1593 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1594 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1595 1596 THROWS.checkIAE("operation", operation, "Network.TrustTokenOperationType", Network.TrustTokenOperationType); 1597 THROWS.checkIAE( 1598 "refreshPolicy", refreshPolicy, 1599 "UseCached", "Refresh" 1600 ); 1601 1602 this.operation = operation; 1603 this.refreshPolicy = refreshPolicy; 1604 this.issuers = issuers; 1605 } 1606 1607 /** 1608 * JSON Object Constructor 1609 * @param jo A Json-Object having data about an instance of {@code 'TrustTokenParams'}. 1610 */ 1611 public TrustTokenParams (JsonObject jo) 1612 { 1613 this.operation = ReadJSON.getString(jo, "operation", false, true); 1614 this.refreshPolicy = ReadJSON.getString(jo, "refreshPolicy", false, true); 1615 this.issuers = (jo.getJsonArray("issuers") == null) 1616 ? null 1617 : RJArrIntoStream.strArr(jo.getJsonArray("issuers"), null, 0).toArray(String[]::new); 1618 1619 } 1620 1621 1622 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1623 public boolean equals(Object other) 1624 { 1625 if (this == other) return true; 1626 if (other == null) return false; 1627 if (other.getClass() != this.getClass()) return false; 1628 1629 TrustTokenParams o = (TrustTokenParams) other; 1630 1631 return 1632 Objects.equals(this.operation, o.operation) 1633 && Objects.equals(this.refreshPolicy, o.refreshPolicy) 1634 && Arrays.deepEquals(this.issuers, o.issuers); 1635 } 1636 1637 /** Generates a Hash-Code for {@code 'this'} instance */ 1638 public int hashCode() 1639 { 1640 return 1641 Objects.hashCode(this.operation) 1642 + Objects.hashCode(this.refreshPolicy) 1643 + Arrays.deepHashCode(this.issuers); 1644 } 1645 } 1646 1647 /** 1648 * <CODE>[No Description Provided by Google]</CODE> 1649 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 1650 */ 1651 public static class ServiceWorkerRouterInfo 1652 extends BaseType 1653 implements java.io.Serializable 1654 { 1655 /** For Object Serialization. java.io.Serializable */ 1656 protected static final long serialVersionUID = 1; 1657 1658 public boolean[] optionals() 1659 { return new boolean[] { true, true, true, }; } 1660 1661 /** 1662 * ID of the rule matched. If there is a matched rule, this field will 1663 * be set, otherwiser no value will be set. 1664 * <BR /><B CLASS=Opt>OPTIONAL</B> 1665 */ 1666 public final Integer ruleIdMatched; 1667 1668 /** 1669 * The router source of the matched rule. If there is a matched rule, this 1670 * field will be set, otherwise no value will be set. 1671 * <BR /><B CLASS=Opt>OPTIONAL</B> 1672 */ 1673 public final String matchedSourceType; 1674 1675 /** 1676 * The actual router source used. 1677 * <BR /><B CLASS=Opt>OPTIONAL</B> 1678 */ 1679 public final String actualSourceType; 1680 1681 /** 1682 * Constructor 1683 * 1684 * @param ruleIdMatched 1685 * ID of the rule matched. If there is a matched rule, this field will 1686 * be set, otherwiser no value will be set. 1687 * <BR /><B CLASS=Opt>OPTIONAL</B> 1688 * 1689 * @param matchedSourceType 1690 * The router source of the matched rule. If there is a matched rule, this 1691 * field will be set, otherwise no value will be set. 1692 * <BR /><B CLASS=Opt>OPTIONAL</B> 1693 * 1694 * @param actualSourceType The actual router source used. 1695 * <BR /><B CLASS=Opt>OPTIONAL</B> 1696 */ 1697 public ServiceWorkerRouterInfo 1698 (Integer ruleIdMatched, String matchedSourceType, String actualSourceType) 1699 { 1700 // Exception-Check(s) to ensure that if any parameters which must adhere to a 1701 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 1702 1703 THROWS.checkIAE("matchedSourceType", matchedSourceType, "Network.ServiceWorkerRouterSource", Network.ServiceWorkerRouterSource); 1704 THROWS.checkIAE("actualSourceType", actualSourceType, "Network.ServiceWorkerRouterSource", Network.ServiceWorkerRouterSource); 1705 1706 this.ruleIdMatched = ruleIdMatched; 1707 this.matchedSourceType = matchedSourceType; 1708 this.actualSourceType = actualSourceType; 1709 } 1710 1711 /** 1712 * JSON Object Constructor 1713 * @param jo A Json-Object having data about an instance of {@code 'ServiceWorkerRouterInfo'}. 1714 */ 1715 public ServiceWorkerRouterInfo (JsonObject jo) 1716 { 1717 this.ruleIdMatched = ReadBoxedJSON.getInteger(jo, "ruleIdMatched", true); 1718 this.matchedSourceType = ReadJSON.getString(jo, "matchedSourceType", true, false); 1719 this.actualSourceType = ReadJSON.getString(jo, "actualSourceType", true, false); 1720 } 1721 1722 1723 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 1724 public boolean equals(Object other) 1725 { 1726 if (this == other) return true; 1727 if (other == null) return false; 1728 if (other.getClass() != this.getClass()) return false; 1729 1730 ServiceWorkerRouterInfo o = (ServiceWorkerRouterInfo) other; 1731 1732 return 1733 Objects.equals(this.ruleIdMatched, o.ruleIdMatched) 1734 && Objects.equals(this.matchedSourceType, o.matchedSourceType) 1735 && Objects.equals(this.actualSourceType, o.actualSourceType); 1736 } 1737 1738 /** Generates a Hash-Code for {@code 'this'} instance */ 1739 public int hashCode() 1740 { 1741 return 1742 Objects.hashCode(this.ruleIdMatched) 1743 + Objects.hashCode(this.matchedSourceType) 1744 + Objects.hashCode(this.actualSourceType); 1745 } 1746 } 1747 1748 /** HTTP response data. */ 1749 public static class Response 1750 extends BaseType 1751 implements java.io.Serializable 1752 { 1753 /** For Object Serialization. java.io.Serializable */ 1754 protected static final long serialVersionUID = 1; 1755 1756 public boolean[] optionals() 1757 { return new boolean[] { false, false, false, false, true, false, false, true, true, false, false, true, true, true, true, true, true, true, false, true, true, true, true, true, true, false, true, true, }; } 1758 1759 /** Response URL. This URL can be different from CachedResource.url in case of redirect. */ 1760 public final String url; 1761 1762 /** HTTP response status code. */ 1763 public final int status; 1764 1765 /** HTTP response status text. */ 1766 public final String statusText; 1767 1768 /** HTTP response headers. */ 1769 public final JsonObject headers; 1770 1771 /** 1772 * HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo. 1773 * <BR /><B CLASS=Opt>OPTIONAL</B> 1774 <B CLASS=Dep>DEPRECATED</B> 1775 */ 1776 public final String headersText; 1777 1778 /** Resource mimeType as determined by the browser. */ 1779 public final String mimeType; 1780 1781 /** Resource charset as determined by the browser (if applicable). */ 1782 public final String charset; 1783 1784 /** 1785 * Refined HTTP request headers that were actually transmitted over the network. 1786 * <BR /><B CLASS=Opt>OPTIONAL</B> 1787 */ 1788 public final JsonObject requestHeaders; 1789 1790 /** 1791 * HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo. 1792 * <BR /><B CLASS=Opt>OPTIONAL</B> 1793 <B CLASS=Dep>DEPRECATED</B> 1794 */ 1795 public final String requestHeadersText; 1796 1797 /** Specifies whether physical connection was actually reused for this request. */ 1798 public final boolean connectionReused; 1799 1800 /** Physical connection id that was actually used for this request. */ 1801 public final Number connectionId; 1802 1803 /** 1804 * Remote IP address. 1805 * <BR /><B CLASS=Opt>OPTIONAL</B> 1806 */ 1807 public final String remoteIPAddress; 1808 1809 /** 1810 * Remote port. 1811 * <BR /><B CLASS=Opt>OPTIONAL</B> 1812 */ 1813 public final Integer remotePort; 1814 1815 /** 1816 * Specifies that the request was served from the disk cache. 1817 * <BR /><B CLASS=Opt>OPTIONAL</B> 1818 */ 1819 public final Boolean fromDiskCache; 1820 1821 /** 1822 * Specifies that the request was served from the ServiceWorker. 1823 * <BR /><B CLASS=Opt>OPTIONAL</B> 1824 */ 1825 public final Boolean fromServiceWorker; 1826 1827 /** 1828 * Specifies that the request was served from the prefetch cache. 1829 * <BR /><B CLASS=Opt>OPTIONAL</B> 1830 */ 1831 public final Boolean fromPrefetchCache; 1832 1833 /** 1834 * Specifies that the request was served from the prefetch cache. 1835 * <BR /><B CLASS=Opt>OPTIONAL</B> 1836 */ 1837 public final Boolean fromEarlyHints; 1838 1839 /** 1840 * Information about how ServiceWorker Static Router API was used. If this 1841 * field is set with {@code matchedSourceType} field, a matching rule is found. 1842 * If this field is set without {@code matchedSource}, no matching rule is found. 1843 * Otherwise, the API is not used. 1844 * <BR /><B CLASS=Opt>OPTIONAL</B> 1845 <B CLASS=Exp>EXPERIMENTAL</B> 1846 */ 1847 public final Network.ServiceWorkerRouterInfo serviceWorkerRouterInfo; 1848 1849 /** Total number of bytes received for this request so far. */ 1850 public final Number encodedDataLength; 1851 1852 /** 1853 * Timing information for the given request. 1854 * <BR /><B CLASS=Opt>OPTIONAL</B> 1855 */ 1856 public final Network.ResourceTiming timing; 1857 1858 /** 1859 * Response source of response from ServiceWorker. 1860 * <BR /><B CLASS=Opt>OPTIONAL</B> 1861 */ 1862 public final String serviceWorkerResponseSource; 1863 1864 /** 1865 * The time at which the returned response was generated. 1866 * <BR /><B CLASS=Opt>OPTIONAL</B> 1867 */ 1868 public final Number responseTime; 1869 1870 /** 1871 * Cache Storage Cache Name. 1872 * <BR /><B CLASS=Opt>OPTIONAL</B> 1873 */ 1874 public final String cacheStorageCacheName; 1875 1876 /** 1877 * Protocol used to fetch this request. 1878 * <BR /><B CLASS=Opt>OPTIONAL</B> 1879 */ 1880 public final String protocol; 1881 1882 /** 1883 * The reason why Chrome uses a specific transport protocol for HTTP semantics. 1884 * <BR /><B CLASS=Opt>OPTIONAL</B> 1885 <B CLASS=Exp>EXPERIMENTAL</B> 1886 */ 1887 public final String alternateProtocolUsage; 1888 1889 /** Security state of the request resource. */ 1890 public final String securityState; 1891 1892 /** 1893 * Security details for the request. 1894 * <BR /><B CLASS=Opt>OPTIONAL</B> 1895 */ 1896 public final Network.SecurityDetails securityDetails; 1897 1898 /** 1899 * Indicates whether the request was sent through IP Protection proxies. If 1900 * set to true, the request used the IP Protection privacy feature. 1901 * <BR /><B CLASS=Opt>OPTIONAL</B> 1902 <B CLASS=Exp>EXPERIMENTAL</B> 1903 */ 1904 public final Boolean isIpProtectionUsed; 1905 1906 /** 1907 * Constructor 1908 * 1909 * @param url Response URL. This URL can be different from CachedResource.url in case of redirect. 1910 * 1911 * @param status HTTP response status code. 1912 * 1913 * @param statusText HTTP response status text. 1914 * 1915 * @param headers HTTP response headers. 1916 * 1917 * @param headersText HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo. 1918 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Dep>DEPRECATED</B> 1919 * 1920 * @param mimeType Resource mimeType as determined by the browser. 1921 * 1922 * @param charset Resource charset as determined by the browser (if applicable). 1923 * 1924 * @param requestHeaders Refined HTTP request headers that were actually transmitted over the network. 1925 * <BR /><B CLASS=Opt>OPTIONAL</B> 1926 * 1927 * @param requestHeadersText HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo. 1928 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Dep>DEPRECATED</B> 1929 * 1930 * @param connectionReused Specifies whether physical connection was actually reused for this request. 1931 * 1932 * @param connectionId Physical connection id that was actually used for this request. 1933 * 1934 * @param remoteIPAddress Remote IP address. 1935 * <BR /><B CLASS=Opt>OPTIONAL</B> 1936 * 1937 * @param remotePort Remote port. 1938 * <BR /><B CLASS=Opt>OPTIONAL</B> 1939 * 1940 * @param fromDiskCache Specifies that the request was served from the disk cache. 1941 * <BR /><B CLASS=Opt>OPTIONAL</B> 1942 * 1943 * @param fromServiceWorker Specifies that the request was served from the ServiceWorker. 1944 * <BR /><B CLASS=Opt>OPTIONAL</B> 1945 * 1946 * @param fromPrefetchCache Specifies that the request was served from the prefetch cache. 1947 * <BR /><B CLASS=Opt>OPTIONAL</B> 1948 * 1949 * @param fromEarlyHints Specifies that the request was served from the prefetch cache. 1950 * <BR /><B CLASS=Opt>OPTIONAL</B> 1951 * 1952 * @param serviceWorkerRouterInfo 1953 * Information about how ServiceWorker Static Router API was used. If this 1954 * field is set with {@code matchedSourceType} field, a matching rule is found. 1955 * If this field is set without {@code matchedSource}, no matching rule is found. 1956 * Otherwise, the API is not used. 1957 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1958 * 1959 * @param encodedDataLength Total number of bytes received for this request so far. 1960 * 1961 * @param timing Timing information for the given request. 1962 * <BR /><B CLASS=Opt>OPTIONAL</B> 1963 * 1964 * @param serviceWorkerResponseSource Response source of response from ServiceWorker. 1965 * <BR /><B CLASS=Opt>OPTIONAL</B> 1966 * 1967 * @param responseTime The time at which the returned response was generated. 1968 * <BR /><B CLASS=Opt>OPTIONAL</B> 1969 * 1970 * @param cacheStorageCacheName Cache Storage Cache Name. 1971 * <BR /><B CLASS=Opt>OPTIONAL</B> 1972 * 1973 * @param protocol Protocol used to fetch this request. 1974 * <BR /><B CLASS=Opt>OPTIONAL</B> 1975 * 1976 * @param alternateProtocolUsage The reason why Chrome uses a specific transport protocol for HTTP semantics. 1977 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1978 * 1979 * @param securityState Security state of the request resource. 1980 * 1981 * @param securityDetails Security details for the request. 1982 * <BR /><B CLASS=Opt>OPTIONAL</B> 1983 * 1984 * @param isIpProtectionUsed 1985 * Indicates whether the request was sent through IP Protection proxies. If 1986 * set to true, the request used the IP Protection privacy feature. 1987 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 1988 */ 1989 public Response( 1990 String url, int status, String statusText, JsonObject headers, String headersText, 1991 String mimeType, String charset, JsonObject requestHeaders, 1992 String requestHeadersText, boolean connectionReused, Number connectionId, 1993 String remoteIPAddress, Integer remotePort, Boolean fromDiskCache, 1994 Boolean fromServiceWorker, Boolean fromPrefetchCache, Boolean fromEarlyHints, 1995 Network.ServiceWorkerRouterInfo serviceWorkerRouterInfo, Number encodedDataLength, 1996 Network.ResourceTiming timing, String serviceWorkerResponseSource, 1997 Number responseTime, String cacheStorageCacheName, String protocol, 1998 String alternateProtocolUsage, String securityState, 1999 Network.SecurityDetails securityDetails, Boolean isIpProtectionUsed 2000 ) 2001 { 2002 // Exception-Check(s) to ensure that if any parameters which are not declared as 2003 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2004 2005 if (url == null) THROWS.throwNPE("url"); 2006 if (statusText == null) THROWS.throwNPE("statusText"); 2007 if (headers == null) THROWS.throwNPE("headers"); 2008 if (mimeType == null) THROWS.throwNPE("mimeType"); 2009 if (charset == null) THROWS.throwNPE("charset"); 2010 if (connectionId == null) THROWS.throwNPE("connectionId"); 2011 if (encodedDataLength == null) THROWS.throwNPE("encodedDataLength"); 2012 if (securityState == null) THROWS.throwNPE("securityState"); 2013 2014 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2015 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2016 2017 THROWS.checkIAE("serviceWorkerResponseSource", serviceWorkerResponseSource, "Network.ServiceWorkerResponseSource", Network.ServiceWorkerResponseSource); 2018 THROWS.checkIAE("alternateProtocolUsage", alternateProtocolUsage, "Network.AlternateProtocolUsage", Network.AlternateProtocolUsage); 2019 THROWS.checkIAE("securityState", securityState, "Security.SecurityState", Security.SecurityState); 2020 2021 this.url = url; 2022 this.status = status; 2023 this.statusText = statusText; 2024 this.headers = headers; 2025 this.headersText = headersText; 2026 this.mimeType = mimeType; 2027 this.charset = charset; 2028 this.requestHeaders = requestHeaders; 2029 this.requestHeadersText = requestHeadersText; 2030 this.connectionReused = connectionReused; 2031 this.connectionId = connectionId; 2032 this.remoteIPAddress = remoteIPAddress; 2033 this.remotePort = remotePort; 2034 this.fromDiskCache = fromDiskCache; 2035 this.fromServiceWorker = fromServiceWorker; 2036 this.fromPrefetchCache = fromPrefetchCache; 2037 this.fromEarlyHints = fromEarlyHints; 2038 this.serviceWorkerRouterInfo = serviceWorkerRouterInfo; 2039 this.encodedDataLength = encodedDataLength; 2040 this.timing = timing; 2041 this.serviceWorkerResponseSource = serviceWorkerResponseSource; 2042 this.responseTime = responseTime; 2043 this.cacheStorageCacheName = cacheStorageCacheName; 2044 this.protocol = protocol; 2045 this.alternateProtocolUsage = alternateProtocolUsage; 2046 this.securityState = securityState; 2047 this.securityDetails = securityDetails; 2048 this.isIpProtectionUsed = isIpProtectionUsed; 2049 } 2050 2051 /** 2052 * JSON Object Constructor 2053 * @param jo A Json-Object having data about an instance of {@code 'Response'}. 2054 */ 2055 public Response (JsonObject jo) 2056 { 2057 this.url = ReadJSON.getString(jo, "url", false, true); 2058 this.status = ReadPrimJSON.getInt(jo, "status"); 2059 this.statusText = ReadJSON.getString(jo, "statusText", false, true); 2060 this.headers = jo.getJsonObject("headers"); 2061 this.headersText = ReadJSON.getString(jo, "headersText", true, false); 2062 this.mimeType = ReadJSON.getString(jo, "mimeType", false, true); 2063 this.charset = ReadJSON.getString(jo, "charset", false, true); 2064 this.requestHeaders = jo.getJsonObject("requestHeaders"); 2065 this.requestHeadersText = ReadJSON.getString(jo, "requestHeadersText", true, false); 2066 this.connectionReused = ReadPrimJSON.getBoolean(jo, "connectionReused"); 2067 this.connectionId = ReadNumberJSON.get(jo, "connectionId", false, true); 2068 this.remoteIPAddress = ReadJSON.getString(jo, "remoteIPAddress", true, false); 2069 this.remotePort = ReadBoxedJSON.getInteger(jo, "remotePort", true); 2070 this.fromDiskCache = ReadBoxedJSON.getBoolean(jo, "fromDiskCache", true); 2071 this.fromServiceWorker = ReadBoxedJSON.getBoolean(jo, "fromServiceWorker", true); 2072 this.fromPrefetchCache = ReadBoxedJSON.getBoolean(jo, "fromPrefetchCache", true); 2073 this.fromEarlyHints = ReadBoxedJSON.getBoolean(jo, "fromEarlyHints", true); 2074 this.serviceWorkerRouterInfo = ReadJSON.getObject(jo, "serviceWorkerRouterInfo", Network.ServiceWorkerRouterInfo.class, true, false); 2075 this.encodedDataLength = ReadNumberJSON.get(jo, "encodedDataLength", false, true); 2076 this.timing = ReadJSON.getObject(jo, "timing", Network.ResourceTiming.class, true, false); 2077 this.serviceWorkerResponseSource = ReadJSON.getString(jo, "serviceWorkerResponseSource", true, false); 2078 this.responseTime = ReadNumberJSON.get(jo, "responseTime", true, false); 2079 this.cacheStorageCacheName = ReadJSON.getString(jo, "cacheStorageCacheName", true, false); 2080 this.protocol = ReadJSON.getString(jo, "protocol", true, false); 2081 this.alternateProtocolUsage = ReadJSON.getString(jo, "alternateProtocolUsage", true, false); 2082 this.securityState = ReadJSON.getString(jo, "securityState", false, true); 2083 this.securityDetails = ReadJSON.getObject(jo, "securityDetails", Network.SecurityDetails.class, true, false); 2084 this.isIpProtectionUsed = ReadBoxedJSON.getBoolean(jo, "isIpProtectionUsed", true); 2085 } 2086 2087 2088 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2089 public boolean equals(Object other) 2090 { 2091 if (this == other) return true; 2092 if (other == null) return false; 2093 if (other.getClass() != this.getClass()) return false; 2094 2095 Response o = (Response) other; 2096 2097 return 2098 Objects.equals(this.url, o.url) 2099 && (this.status == o.status) 2100 && Objects.equals(this.statusText, o.statusText) 2101 && Objects.equals(this.headers, o.headers) 2102 && Objects.equals(this.headersText, o.headersText) 2103 && Objects.equals(this.mimeType, o.mimeType) 2104 && Objects.equals(this.charset, o.charset) 2105 && Objects.equals(this.requestHeaders, o.requestHeaders) 2106 && Objects.equals(this.requestHeadersText, o.requestHeadersText) 2107 && (this.connectionReused == o.connectionReused) 2108 && Objects.equals(this.connectionId, o.connectionId) 2109 && Objects.equals(this.remoteIPAddress, o.remoteIPAddress) 2110 && Objects.equals(this.remotePort, o.remotePort) 2111 && Objects.equals(this.fromDiskCache, o.fromDiskCache) 2112 && Objects.equals(this.fromServiceWorker, o.fromServiceWorker) 2113 && Objects.equals(this.fromPrefetchCache, o.fromPrefetchCache) 2114 && Objects.equals(this.fromEarlyHints, o.fromEarlyHints) 2115 && Objects.equals(this.serviceWorkerRouterInfo, o.serviceWorkerRouterInfo) 2116 && Objects.equals(this.encodedDataLength, o.encodedDataLength) 2117 && Objects.equals(this.timing, o.timing) 2118 && Objects.equals(this.serviceWorkerResponseSource, o.serviceWorkerResponseSource) 2119 && Objects.equals(this.responseTime, o.responseTime) 2120 && Objects.equals(this.cacheStorageCacheName, o.cacheStorageCacheName) 2121 && Objects.equals(this.protocol, o.protocol) 2122 && Objects.equals(this.alternateProtocolUsage, o.alternateProtocolUsage) 2123 && Objects.equals(this.securityState, o.securityState) 2124 && Objects.equals(this.securityDetails, o.securityDetails) 2125 && Objects.equals(this.isIpProtectionUsed, o.isIpProtectionUsed); 2126 } 2127 2128 /** Generates a Hash-Code for {@code 'this'} instance */ 2129 public int hashCode() 2130 { 2131 return 2132 Objects.hashCode(this.url) 2133 + this.status 2134 + Objects.hashCode(this.statusText) 2135 + this.headers.hashCode() 2136 + Objects.hashCode(this.headersText) 2137 + Objects.hashCode(this.mimeType) 2138 + Objects.hashCode(this.charset) 2139 + this.requestHeaders.hashCode() 2140 + Objects.hashCode(this.requestHeadersText) 2141 + (this.connectionReused ? 1 : 0) 2142 + Objects.hashCode(this.connectionId) 2143 + Objects.hashCode(this.remoteIPAddress) 2144 + Objects.hashCode(this.remotePort) 2145 + Objects.hashCode(this.fromDiskCache) 2146 + Objects.hashCode(this.fromServiceWorker) 2147 + Objects.hashCode(this.fromPrefetchCache) 2148 + Objects.hashCode(this.fromEarlyHints) 2149 + this.serviceWorkerRouterInfo.hashCode() 2150 + Objects.hashCode(this.encodedDataLength) 2151 + this.timing.hashCode() 2152 + Objects.hashCode(this.serviceWorkerResponseSource) 2153 + Objects.hashCode(this.responseTime) 2154 + Objects.hashCode(this.cacheStorageCacheName) 2155 + Objects.hashCode(this.protocol) 2156 + Objects.hashCode(this.alternateProtocolUsage) 2157 + Objects.hashCode(this.securityState) 2158 + this.securityDetails.hashCode() 2159 + Objects.hashCode(this.isIpProtectionUsed); 2160 } 2161 } 2162 2163 /** WebSocket request data. */ 2164 public static class WebSocketRequest 2165 extends BaseType 2166 implements java.io.Serializable 2167 { 2168 /** For Object Serialization. java.io.Serializable */ 2169 protected static final long serialVersionUID = 1; 2170 2171 public boolean[] optionals() 2172 { return new boolean[] { false, }; } 2173 2174 /** HTTP request headers. */ 2175 public final JsonObject headers; 2176 2177 /** 2178 * Constructor 2179 * 2180 * @param headers HTTP request headers. 2181 */ 2182 public WebSocketRequest(JsonObject headers) 2183 { 2184 // Exception-Check(s) to ensure that if any parameters which are not declared as 2185 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2186 2187 if (headers == null) THROWS.throwNPE("headers"); 2188 2189 this.headers = headers; 2190 } 2191 2192 2193 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2194 public boolean equals(Object other) 2195 { 2196 if (this == other) return true; 2197 if (other == null) return false; 2198 if (other.getClass() != this.getClass()) return false; 2199 2200 WebSocketRequest o = (WebSocketRequest) other; 2201 2202 return 2203 Objects.equals(this.headers, o.headers); 2204 } 2205 2206 /** Generates a Hash-Code for {@code 'this'} instance */ 2207 public int hashCode() 2208 { 2209 return 2210 this.headers.hashCode(); 2211 } 2212 } 2213 2214 /** WebSocket response data. */ 2215 public static class WebSocketResponse 2216 extends BaseType 2217 implements java.io.Serializable 2218 { 2219 /** For Object Serialization. java.io.Serializable */ 2220 protected static final long serialVersionUID = 1; 2221 2222 public boolean[] optionals() 2223 { return new boolean[] { false, false, false, true, true, true, }; } 2224 2225 /** HTTP response status code. */ 2226 public final int status; 2227 2228 /** HTTP response status text. */ 2229 public final String statusText; 2230 2231 /** HTTP response headers. */ 2232 public final JsonObject headers; 2233 2234 /** 2235 * HTTP response headers text. 2236 * <BR /><B CLASS=Opt>OPTIONAL</B> 2237 */ 2238 public final String headersText; 2239 2240 /** 2241 * HTTP request headers. 2242 * <BR /><B CLASS=Opt>OPTIONAL</B> 2243 */ 2244 public final JsonObject requestHeaders; 2245 2246 /** 2247 * HTTP request headers text. 2248 * <BR /><B CLASS=Opt>OPTIONAL</B> 2249 */ 2250 public final String requestHeadersText; 2251 2252 /** 2253 * Constructor 2254 * 2255 * @param status HTTP response status code. 2256 * 2257 * @param statusText HTTP response status text. 2258 * 2259 * @param headers HTTP response headers. 2260 * 2261 * @param headersText HTTP response headers text. 2262 * <BR /><B CLASS=Opt>OPTIONAL</B> 2263 * 2264 * @param requestHeaders HTTP request headers. 2265 * <BR /><B CLASS=Opt>OPTIONAL</B> 2266 * 2267 * @param requestHeadersText HTTP request headers text. 2268 * <BR /><B CLASS=Opt>OPTIONAL</B> 2269 */ 2270 public WebSocketResponse( 2271 int status, String statusText, JsonObject headers, String headersText, 2272 JsonObject requestHeaders, String requestHeadersText 2273 ) 2274 { 2275 // Exception-Check(s) to ensure that if any parameters which are not declared as 2276 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2277 2278 if (statusText == null) THROWS.throwNPE("statusText"); 2279 if (headers == null) THROWS.throwNPE("headers"); 2280 2281 this.status = status; 2282 this.statusText = statusText; 2283 this.headers = headers; 2284 this.headersText = headersText; 2285 this.requestHeaders = requestHeaders; 2286 this.requestHeadersText = requestHeadersText; 2287 } 2288 2289 /** 2290 * JSON Object Constructor 2291 * @param jo A Json-Object having data about an instance of {@code 'WebSocketResponse'}. 2292 */ 2293 public WebSocketResponse (JsonObject jo) 2294 { 2295 this.status = ReadPrimJSON.getInt(jo, "status"); 2296 this.statusText = ReadJSON.getString(jo, "statusText", false, true); 2297 this.headers = jo.getJsonObject("headers"); 2298 this.headersText = ReadJSON.getString(jo, "headersText", true, false); 2299 this.requestHeaders = jo.getJsonObject("requestHeaders"); 2300 this.requestHeadersText = ReadJSON.getString(jo, "requestHeadersText", true, false); 2301 } 2302 2303 2304 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2305 public boolean equals(Object other) 2306 { 2307 if (this == other) return true; 2308 if (other == null) return false; 2309 if (other.getClass() != this.getClass()) return false; 2310 2311 WebSocketResponse o = (WebSocketResponse) other; 2312 2313 return 2314 (this.status == o.status) 2315 && Objects.equals(this.statusText, o.statusText) 2316 && Objects.equals(this.headers, o.headers) 2317 && Objects.equals(this.headersText, o.headersText) 2318 && Objects.equals(this.requestHeaders, o.requestHeaders) 2319 && Objects.equals(this.requestHeadersText, o.requestHeadersText); 2320 } 2321 2322 /** Generates a Hash-Code for {@code 'this'} instance */ 2323 public int hashCode() 2324 { 2325 return 2326 this.status 2327 + Objects.hashCode(this.statusText) 2328 + this.headers.hashCode() 2329 + Objects.hashCode(this.headersText) 2330 + this.requestHeaders.hashCode() 2331 + Objects.hashCode(this.requestHeadersText); 2332 } 2333 } 2334 2335 /** WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests. */ 2336 public static class WebSocketFrame 2337 extends BaseType 2338 implements java.io.Serializable 2339 { 2340 /** For Object Serialization. java.io.Serializable */ 2341 protected static final long serialVersionUID = 1; 2342 2343 public boolean[] optionals() 2344 { return new boolean[] { false, false, false, }; } 2345 2346 /** WebSocket message opcode. */ 2347 public final Number opcode; 2348 2349 /** WebSocket message mask. */ 2350 public final boolean mask; 2351 2352 /** 2353 * WebSocket message payload data. 2354 * If the opcode is 1, this is a text message and payloadData is a UTF-8 string. 2355 * If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data. 2356 */ 2357 public final String payloadData; 2358 2359 /** 2360 * Constructor 2361 * 2362 * @param opcode WebSocket message opcode. 2363 * 2364 * @param mask WebSocket message mask. 2365 * 2366 * @param payloadData 2367 * WebSocket message payload data. 2368 * If the opcode is 1, this is a text message and payloadData is a UTF-8 string. 2369 * If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data. 2370 */ 2371 public WebSocketFrame(Number opcode, boolean mask, String payloadData) 2372 { 2373 // Exception-Check(s) to ensure that if any parameters which are not declared as 2374 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2375 2376 if (opcode == null) THROWS.throwNPE("opcode"); 2377 if (payloadData == null) THROWS.throwNPE("payloadData"); 2378 2379 this.opcode = opcode; 2380 this.mask = mask; 2381 this.payloadData = payloadData; 2382 } 2383 2384 /** 2385 * JSON Object Constructor 2386 * @param jo A Json-Object having data about an instance of {@code 'WebSocketFrame'}. 2387 */ 2388 public WebSocketFrame (JsonObject jo) 2389 { 2390 this.opcode = ReadNumberJSON.get(jo, "opcode", false, true); 2391 this.mask = ReadPrimJSON.getBoolean(jo, "mask"); 2392 this.payloadData = ReadJSON.getString(jo, "payloadData", false, true); 2393 } 2394 2395 2396 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2397 public boolean equals(Object other) 2398 { 2399 if (this == other) return true; 2400 if (other == null) return false; 2401 if (other.getClass() != this.getClass()) return false; 2402 2403 WebSocketFrame o = (WebSocketFrame) other; 2404 2405 return 2406 Objects.equals(this.opcode, o.opcode) 2407 && (this.mask == o.mask) 2408 && Objects.equals(this.payloadData, o.payloadData); 2409 } 2410 2411 /** Generates a Hash-Code for {@code 'this'} instance */ 2412 public int hashCode() 2413 { 2414 return 2415 Objects.hashCode(this.opcode) 2416 + (this.mask ? 1 : 0) 2417 + Objects.hashCode(this.payloadData); 2418 } 2419 } 2420 2421 /** Information about the cached resource. */ 2422 public static class CachedResource 2423 extends BaseType 2424 implements java.io.Serializable 2425 { 2426 /** For Object Serialization. java.io.Serializable */ 2427 protected static final long serialVersionUID = 1; 2428 2429 public boolean[] optionals() 2430 { return new boolean[] { false, false, true, false, }; } 2431 2432 /** Resource URL. This is the url of the original network request. */ 2433 public final String url; 2434 2435 /** Type of this resource. */ 2436 public final String type; 2437 2438 /** 2439 * Cached response data. 2440 * <BR /><B CLASS=Opt>OPTIONAL</B> 2441 */ 2442 public final Network.Response response; 2443 2444 /** Cached response body size. */ 2445 public final Number bodySize; 2446 2447 /** 2448 * Constructor 2449 * 2450 * @param url Resource URL. This is the url of the original network request. 2451 * 2452 * @param type Type of this resource. 2453 * 2454 * @param response Cached response data. 2455 * <BR /><B CLASS=Opt>OPTIONAL</B> 2456 * 2457 * @param bodySize Cached response body size. 2458 */ 2459 public CachedResource 2460 (String url, String type, Network.Response response, Number bodySize) 2461 { 2462 // Exception-Check(s) to ensure that if any parameters which are not declared as 2463 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2464 2465 if (url == null) THROWS.throwNPE("url"); 2466 if (type == null) THROWS.throwNPE("type"); 2467 if (bodySize == null) THROWS.throwNPE("bodySize"); 2468 2469 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2470 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2471 2472 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 2473 2474 this.url = url; 2475 this.type = type; 2476 this.response = response; 2477 this.bodySize = bodySize; 2478 } 2479 2480 /** 2481 * JSON Object Constructor 2482 * @param jo A Json-Object having data about an instance of {@code 'CachedResource'}. 2483 */ 2484 public CachedResource (JsonObject jo) 2485 { 2486 this.url = ReadJSON.getString(jo, "url", false, true); 2487 this.type = ReadJSON.getString(jo, "type", false, true); 2488 this.response = ReadJSON.getObject(jo, "response", Network.Response.class, true, false); 2489 this.bodySize = ReadNumberJSON.get(jo, "bodySize", false, true); 2490 } 2491 2492 2493 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2494 public boolean equals(Object other) 2495 { 2496 if (this == other) return true; 2497 if (other == null) return false; 2498 if (other.getClass() != this.getClass()) return false; 2499 2500 CachedResource o = (CachedResource) other; 2501 2502 return 2503 Objects.equals(this.url, o.url) 2504 && Objects.equals(this.type, o.type) 2505 && Objects.equals(this.response, o.response) 2506 && Objects.equals(this.bodySize, o.bodySize); 2507 } 2508 2509 /** Generates a Hash-Code for {@code 'this'} instance */ 2510 public int hashCode() 2511 { 2512 return 2513 Objects.hashCode(this.url) 2514 + Objects.hashCode(this.type) 2515 + this.response.hashCode() 2516 + Objects.hashCode(this.bodySize); 2517 } 2518 } 2519 2520 /** Information about the request initiator. */ 2521 public static class Initiator 2522 extends BaseType 2523 implements java.io.Serializable 2524 { 2525 /** For Object Serialization. java.io.Serializable */ 2526 protected static final long serialVersionUID = 1; 2527 2528 public boolean[] optionals() 2529 { return new boolean[] { false, true, true, true, true, true, }; } 2530 2531 /** Type of this initiator. */ 2532 public final String type; 2533 2534 /** 2535 * Initiator JavaScript stack trace, set for Script only. 2536 * Requires the Debugger domain to be enabled. 2537 * <BR /><B CLASS=Opt>OPTIONAL</B> 2538 */ 2539 public final RunTime.StackTrace stack; 2540 2541 /** 2542 * Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type. 2543 * <BR /><B CLASS=Opt>OPTIONAL</B> 2544 */ 2545 public final String url; 2546 2547 /** 2548 * Initiator line number, set for Parser type or for Script type (when script is importing 2549 * module) (0-based). 2550 * <BR /><B CLASS=Opt>OPTIONAL</B> 2551 */ 2552 public final Number lineNumber; 2553 2554 /** 2555 * Initiator column number, set for Parser type or for Script type (when script is importing 2556 * module) (0-based). 2557 * <BR /><B CLASS=Opt>OPTIONAL</B> 2558 */ 2559 public final Number columnNumber; 2560 2561 /** 2562 * Set if another request triggered this request (e.g. preflight). 2563 * <BR /><B CLASS=Opt>OPTIONAL</B> 2564 */ 2565 public final String requestId; 2566 2567 /** 2568 * Constructor 2569 * 2570 * @param type Type of this initiator. 2571 * <BR />Acceptable Values: ["parser", "script", "preload", "SignedExchange", "preflight", "other"] 2572 * 2573 * @param stack 2574 * Initiator JavaScript stack trace, set for Script only. 2575 * Requires the Debugger domain to be enabled. 2576 * <BR /><B CLASS=Opt>OPTIONAL</B> 2577 * 2578 * @param url Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type. 2579 * <BR /><B CLASS=Opt>OPTIONAL</B> 2580 * 2581 * @param lineNumber 2582 * Initiator line number, set for Parser type or for Script type (when script is importing 2583 * module) (0-based). 2584 * <BR /><B CLASS=Opt>OPTIONAL</B> 2585 * 2586 * @param columnNumber 2587 * Initiator column number, set for Parser type or for Script type (when script is importing 2588 * module) (0-based). 2589 * <BR /><B CLASS=Opt>OPTIONAL</B> 2590 * 2591 * @param requestId Set if another request triggered this request (e.g. preflight). 2592 * <BR /><B CLASS=Opt>OPTIONAL</B> 2593 */ 2594 public Initiator( 2595 String type, RunTime.StackTrace stack, String url, Number lineNumber, 2596 Number columnNumber, String requestId 2597 ) 2598 { 2599 // Exception-Check(s) to ensure that if any parameters which are not declared as 2600 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2601 2602 if (type == null) THROWS.throwNPE("type"); 2603 2604 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2605 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2606 2607 THROWS.checkIAE( 2608 "type", type, 2609 "parser", "script", "preload", "SignedExchange", "preflight", "other" 2610 ); 2611 2612 this.type = type; 2613 this.stack = stack; 2614 this.url = url; 2615 this.lineNumber = lineNumber; 2616 this.columnNumber = columnNumber; 2617 this.requestId = requestId; 2618 } 2619 2620 /** 2621 * JSON Object Constructor 2622 * @param jo A Json-Object having data about an instance of {@code 'Initiator'}. 2623 */ 2624 public Initiator (JsonObject jo) 2625 { 2626 this.type = ReadJSON.getString(jo, "type", false, true); 2627 this.stack = ReadJSON.getObject(jo, "stack", RunTime.StackTrace.class, true, false); 2628 this.url = ReadJSON.getString(jo, "url", true, false); 2629 this.lineNumber = ReadNumberJSON.get(jo, "lineNumber", true, false); 2630 this.columnNumber = ReadNumberJSON.get(jo, "columnNumber", true, false); 2631 this.requestId = ReadJSON.getString(jo, "requestId", true, false); 2632 } 2633 2634 2635 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2636 public boolean equals(Object other) 2637 { 2638 if (this == other) return true; 2639 if (other == null) return false; 2640 if (other.getClass() != this.getClass()) return false; 2641 2642 Initiator o = (Initiator) other; 2643 2644 return 2645 Objects.equals(this.type, o.type) 2646 && Objects.equals(this.stack, o.stack) 2647 && Objects.equals(this.url, o.url) 2648 && Objects.equals(this.lineNumber, o.lineNumber) 2649 && Objects.equals(this.columnNumber, o.columnNumber) 2650 && Objects.equals(this.requestId, o.requestId); 2651 } 2652 2653 /** Generates a Hash-Code for {@code 'this'} instance */ 2654 public int hashCode() 2655 { 2656 return 2657 Objects.hashCode(this.type) 2658 + this.stack.hashCode() 2659 + Objects.hashCode(this.url) 2660 + Objects.hashCode(this.lineNumber) 2661 + Objects.hashCode(this.columnNumber) 2662 + Objects.hashCode(this.requestId); 2663 } 2664 } 2665 2666 /** 2667 * cookiePartitionKey object 2668 * The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h. 2669 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2670 */ 2671 public static class CookiePartitionKey 2672 extends BaseType 2673 implements java.io.Serializable 2674 { 2675 /** For Object Serialization. java.io.Serializable */ 2676 protected static final long serialVersionUID = 1; 2677 2678 public boolean[] optionals() 2679 { return new boolean[] { false, false, }; } 2680 2681 /** 2682 * The site of the top-level URL the browser was visiting at the start 2683 * of the request to the endpoint that set the cookie. 2684 */ 2685 public final String topLevelSite; 2686 2687 /** Indicates if the cookie has any ancestors that are cross-site to the topLevelSite. */ 2688 public final boolean hasCrossSiteAncestor; 2689 2690 /** 2691 * Constructor 2692 * 2693 * @param topLevelSite 2694 * The site of the top-level URL the browser was visiting at the start 2695 * of the request to the endpoint that set the cookie. 2696 * 2697 * @param hasCrossSiteAncestor Indicates if the cookie has any ancestors that are cross-site to the topLevelSite. 2698 */ 2699 public CookiePartitionKey(String topLevelSite, boolean hasCrossSiteAncestor) 2700 { 2701 // Exception-Check(s) to ensure that if any parameters which are not declared as 2702 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2703 2704 if (topLevelSite == null) THROWS.throwNPE("topLevelSite"); 2705 2706 this.topLevelSite = topLevelSite; 2707 this.hasCrossSiteAncestor = hasCrossSiteAncestor; 2708 } 2709 2710 /** 2711 * JSON Object Constructor 2712 * @param jo A Json-Object having data about an instance of {@code 'CookiePartitionKey'}. 2713 */ 2714 public CookiePartitionKey (JsonObject jo) 2715 { 2716 this.topLevelSite = ReadJSON.getString(jo, "topLevelSite", false, true); 2717 this.hasCrossSiteAncestor = ReadPrimJSON.getBoolean(jo, "hasCrossSiteAncestor"); 2718 } 2719 2720 2721 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2722 public boolean equals(Object other) 2723 { 2724 if (this == other) return true; 2725 if (other == null) return false; 2726 if (other.getClass() != this.getClass()) return false; 2727 2728 CookiePartitionKey o = (CookiePartitionKey) other; 2729 2730 return 2731 Objects.equals(this.topLevelSite, o.topLevelSite) 2732 && (this.hasCrossSiteAncestor == o.hasCrossSiteAncestor); 2733 } 2734 2735 /** Generates a Hash-Code for {@code 'this'} instance */ 2736 public int hashCode() 2737 { 2738 return 2739 Objects.hashCode(this.topLevelSite) 2740 + (this.hasCrossSiteAncestor ? 1 : 0); 2741 } 2742 } 2743 2744 /** Cookie object */ 2745 public static class Cookie 2746 extends BaseType 2747 implements java.io.Serializable 2748 { 2749 /** For Object Serialization. java.io.Serializable */ 2750 protected static final long serialVersionUID = 1; 2751 2752 public boolean[] optionals() 2753 { return new boolean[] { false, false, false, false, false, false, false, false, false, true, false, false, false, false, true, true, }; } 2754 2755 /** Cookie name. */ 2756 public final String name; 2757 2758 /** Cookie value. */ 2759 public final String value; 2760 2761 /** Cookie domain. */ 2762 public final String domain; 2763 2764 /** Cookie path. */ 2765 public final String path; 2766 2767 /** Cookie expiration date as the number of seconds since the UNIX epoch. */ 2768 public final Number expires; 2769 2770 /** Cookie size. */ 2771 public final int size; 2772 2773 /** True if cookie is http-only. */ 2774 public final boolean httpOnly; 2775 2776 /** True if cookie is secure. */ 2777 public final boolean secure; 2778 2779 /** True in case of session cookie. */ 2780 public final boolean session; 2781 2782 /** 2783 * Cookie SameSite type. 2784 * <BR /><B CLASS=Opt>OPTIONAL</B> 2785 */ 2786 public final String sameSite; 2787 2788 /** 2789 * Cookie Priority 2790 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2791 */ 2792 public final String priority; 2793 2794 /** 2795 * True if cookie is SameParty. 2796 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2797 <B CLASS=Dep>DEPRECATED</B> 2798 */ 2799 public final boolean sameParty; 2800 2801 /** 2802 * Cookie source scheme type. 2803 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2804 */ 2805 public final String sourceScheme; 2806 2807 /** 2808 * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. 2809 * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. 2810 * This is a temporary ability and it will be removed in the future. 2811 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2812 */ 2813 public final int sourcePort; 2814 2815 /** 2816 * Cookie partition key. 2817 * <BR /><B CLASS=Opt>OPTIONAL</B> 2818 <B CLASS=Exp>EXPERIMENTAL</B> 2819 */ 2820 public final Network.CookiePartitionKey partitionKey; 2821 2822 /** 2823 * True if cookie partition key is opaque. 2824 * <BR /><B CLASS=Opt>OPTIONAL</B> 2825 <B CLASS=Exp>EXPERIMENTAL</B> 2826 */ 2827 public final Boolean partitionKeyOpaque; 2828 2829 /** 2830 * Constructor 2831 * 2832 * @param name Cookie name. 2833 * 2834 * @param value Cookie value. 2835 * 2836 * @param domain Cookie domain. 2837 * 2838 * @param path Cookie path. 2839 * 2840 * @param expires Cookie expiration date as the number of seconds since the UNIX epoch. 2841 * 2842 * @param size Cookie size. 2843 * 2844 * @param httpOnly True if cookie is http-only. 2845 * 2846 * @param secure True if cookie is secure. 2847 * 2848 * @param session True in case of session cookie. 2849 * 2850 * @param sameSite Cookie SameSite type. 2851 * <BR /><B CLASS=Opt>OPTIONAL</B> 2852 * 2853 * @param priority Cookie Priority 2854 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2855 * 2856 * @param sameParty True if cookie is SameParty. 2857 * <BR /><B CLASS=Exp>EXPERIMENTAL</B><B CLASS=Dep>DEPRECATED</B> 2858 * 2859 * @param sourceScheme Cookie source scheme type. 2860 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2861 * 2862 * @param sourcePort 2863 * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. 2864 * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. 2865 * This is a temporary ability and it will be removed in the future. 2866 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2867 * 2868 * @param partitionKey Cookie partition key. 2869 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 2870 * 2871 * @param partitionKeyOpaque True if cookie partition key is opaque. 2872 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 2873 */ 2874 public Cookie( 2875 String name, String value, String domain, String path, Number expires, int size, 2876 boolean httpOnly, boolean secure, boolean session, String sameSite, String priority, 2877 boolean sameParty, String sourceScheme, int sourcePort, 2878 Network.CookiePartitionKey partitionKey, Boolean partitionKeyOpaque 2879 ) 2880 { 2881 // Exception-Check(s) to ensure that if any parameters which are not declared as 2882 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 2883 2884 if (name == null) THROWS.throwNPE("name"); 2885 if (value == null) THROWS.throwNPE("value"); 2886 if (domain == null) THROWS.throwNPE("domain"); 2887 if (path == null) THROWS.throwNPE("path"); 2888 if (expires == null) THROWS.throwNPE("expires"); 2889 if (priority == null) THROWS.throwNPE("priority"); 2890 if (sourceScheme == null) THROWS.throwNPE("sourceScheme"); 2891 2892 // Exception-Check(s) to ensure that if any parameters which must adhere to a 2893 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 2894 2895 THROWS.checkIAE("sameSite", sameSite, "Network.CookieSameSite", Network.CookieSameSite); 2896 THROWS.checkIAE("priority", priority, "Network.CookiePriority", Network.CookiePriority); 2897 THROWS.checkIAE("sourceScheme", sourceScheme, "Network.CookieSourceScheme", Network.CookieSourceScheme); 2898 2899 this.name = name; 2900 this.value = value; 2901 this.domain = domain; 2902 this.path = path; 2903 this.expires = expires; 2904 this.size = size; 2905 this.httpOnly = httpOnly; 2906 this.secure = secure; 2907 this.session = session; 2908 this.sameSite = sameSite; 2909 this.priority = priority; 2910 this.sameParty = sameParty; 2911 this.sourceScheme = sourceScheme; 2912 this.sourcePort = sourcePort; 2913 this.partitionKey = partitionKey; 2914 this.partitionKeyOpaque = partitionKeyOpaque; 2915 } 2916 2917 /** 2918 * JSON Object Constructor 2919 * @param jo A Json-Object having data about an instance of {@code 'Cookie'}. 2920 */ 2921 public Cookie (JsonObject jo) 2922 { 2923 this.name = ReadJSON.getString(jo, "name", false, true); 2924 this.value = ReadJSON.getString(jo, "value", false, true); 2925 this.domain = ReadJSON.getString(jo, "domain", false, true); 2926 this.path = ReadJSON.getString(jo, "path", false, true); 2927 this.expires = ReadNumberJSON.get(jo, "expires", false, true); 2928 this.size = ReadPrimJSON.getInt(jo, "size"); 2929 this.httpOnly = ReadPrimJSON.getBoolean(jo, "httpOnly"); 2930 this.secure = ReadPrimJSON.getBoolean(jo, "secure"); 2931 this.session = ReadPrimJSON.getBoolean(jo, "session"); 2932 this.sameSite = ReadJSON.getString(jo, "sameSite", true, false); 2933 this.priority = ReadJSON.getString(jo, "priority", false, true); 2934 this.sameParty = ReadPrimJSON.getBoolean(jo, "sameParty"); 2935 this.sourceScheme = ReadJSON.getString(jo, "sourceScheme", false, true); 2936 this.sourcePort = ReadPrimJSON.getInt(jo, "sourcePort"); 2937 this.partitionKey = ReadJSON.getObject(jo, "partitionKey", Network.CookiePartitionKey.class, true, false); 2938 this.partitionKeyOpaque = ReadBoxedJSON.getBoolean(jo, "partitionKeyOpaque", true); 2939 } 2940 2941 2942 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 2943 public boolean equals(Object other) 2944 { 2945 if (this == other) return true; 2946 if (other == null) return false; 2947 if (other.getClass() != this.getClass()) return false; 2948 2949 Cookie o = (Cookie) other; 2950 2951 return 2952 Objects.equals(this.name, o.name) 2953 && Objects.equals(this.value, o.value) 2954 && Objects.equals(this.domain, o.domain) 2955 && Objects.equals(this.path, o.path) 2956 && Objects.equals(this.expires, o.expires) 2957 && (this.size == o.size) 2958 && (this.httpOnly == o.httpOnly) 2959 && (this.secure == o.secure) 2960 && (this.session == o.session) 2961 && Objects.equals(this.sameSite, o.sameSite) 2962 && Objects.equals(this.priority, o.priority) 2963 && (this.sameParty == o.sameParty) 2964 && Objects.equals(this.sourceScheme, o.sourceScheme) 2965 && (this.sourcePort == o.sourcePort) 2966 && Objects.equals(this.partitionKey, o.partitionKey) 2967 && Objects.equals(this.partitionKeyOpaque, o.partitionKeyOpaque); 2968 } 2969 2970 /** Generates a Hash-Code for {@code 'this'} instance */ 2971 public int hashCode() 2972 { 2973 return 2974 Objects.hashCode(this.name) 2975 + Objects.hashCode(this.value) 2976 + Objects.hashCode(this.domain) 2977 + Objects.hashCode(this.path) 2978 + Objects.hashCode(this.expires) 2979 + this.size 2980 + (this.httpOnly ? 1 : 0) 2981 + (this.secure ? 1 : 0) 2982 + (this.session ? 1 : 0) 2983 + Objects.hashCode(this.sameSite) 2984 + Objects.hashCode(this.priority) 2985 + (this.sameParty ? 1 : 0) 2986 + Objects.hashCode(this.sourceScheme) 2987 + this.sourcePort 2988 + this.partitionKey.hashCode() 2989 + Objects.hashCode(this.partitionKeyOpaque); 2990 } 2991 } 2992 2993 /** 2994 * A cookie which was not stored from a response with the corresponding reason. 2995 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 2996 */ 2997 public static class BlockedSetCookieWithReason 2998 extends BaseType 2999 implements java.io.Serializable 3000 { 3001 /** For Object Serialization. java.io.Serializable */ 3002 protected static final long serialVersionUID = 1; 3003 3004 public boolean[] optionals() 3005 { return new boolean[] { false, false, true, }; } 3006 3007 /** The reason(s) this cookie was blocked. */ 3008 public final String[] blockedReasons; 3009 3010 /** 3011 * The string representing this individual cookie as it would appear in the header. 3012 * This is not the entire "cookie" or "set-cookie" header which could have multiple cookies. 3013 */ 3014 public final String cookieLine; 3015 3016 /** 3017 * The cookie object which represents the cookie which was not stored. It is optional because 3018 * sometimes complete cookie information is not available, such as in the case of parsing 3019 * errors. 3020 * <BR /><B CLASS=Opt>OPTIONAL</B> 3021 */ 3022 public final Network.Cookie cookie; 3023 3024 /** 3025 * Constructor 3026 * 3027 * @param blockedReasons The reason(s) this cookie was blocked. 3028 * 3029 * @param cookieLine 3030 * The string representing this individual cookie as it would appear in the header. 3031 * This is not the entire "cookie" or "set-cookie" header which could have multiple cookies. 3032 * 3033 * @param cookie 3034 * The cookie object which represents the cookie which was not stored. It is optional because 3035 * sometimes complete cookie information is not available, such as in the case of parsing 3036 * errors. 3037 * <BR /><B CLASS=Opt>OPTIONAL</B> 3038 */ 3039 public BlockedSetCookieWithReason 3040 (String[] blockedReasons, String cookieLine, Network.Cookie cookie) 3041 { 3042 // Exception-Check(s) to ensure that if any parameters which are not declared as 3043 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3044 3045 if (blockedReasons == null) THROWS.throwNPE("blockedReasons"); 3046 if (cookieLine == null) THROWS.throwNPE("cookieLine"); 3047 3048 this.blockedReasons = blockedReasons; 3049 this.cookieLine = cookieLine; 3050 this.cookie = cookie; 3051 } 3052 3053 /** 3054 * JSON Object Constructor 3055 * @param jo A Json-Object having data about an instance of {@code 'BlockedSetCookieWithReason'}. 3056 */ 3057 public BlockedSetCookieWithReason (JsonObject jo) 3058 { 3059 this.blockedReasons = (jo.getJsonArray("blockedReasons") == null) 3060 ? null 3061 : RJArrIntoStream.strArr(jo.getJsonArray("blockedReasons"), null, 0).toArray(String[]::new); 3062 3063 this.cookieLine = ReadJSON.getString(jo, "cookieLine", false, true); 3064 this.cookie = ReadJSON.getObject(jo, "cookie", Network.Cookie.class, true, false); 3065 } 3066 3067 3068 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3069 public boolean equals(Object other) 3070 { 3071 if (this == other) return true; 3072 if (other == null) return false; 3073 if (other.getClass() != this.getClass()) return false; 3074 3075 BlockedSetCookieWithReason o = (BlockedSetCookieWithReason) other; 3076 3077 return 3078 Arrays.deepEquals(this.blockedReasons, o.blockedReasons) 3079 && Objects.equals(this.cookieLine, o.cookieLine) 3080 && Objects.equals(this.cookie, o.cookie); 3081 } 3082 3083 /** Generates a Hash-Code for {@code 'this'} instance */ 3084 public int hashCode() 3085 { 3086 return 3087 Arrays.deepHashCode(this.blockedReasons) 3088 + Objects.hashCode(this.cookieLine) 3089 + this.cookie.hashCode(); 3090 } 3091 } 3092 3093 /** 3094 * A cookie should have been blocked by 3PCD but is exempted and stored from a response with the 3095 * corresponding reason. A cookie could only have at most one exemption reason. 3096 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3097 */ 3098 public static class ExemptedSetCookieWithReason 3099 extends BaseType 3100 implements java.io.Serializable 3101 { 3102 /** For Object Serialization. java.io.Serializable */ 3103 protected static final long serialVersionUID = 1; 3104 3105 public boolean[] optionals() 3106 { return new boolean[] { false, false, false, }; } 3107 3108 /** The reason the cookie was exempted. */ 3109 public final String exemptionReason; 3110 3111 /** The string representing this individual cookie as it would appear in the header. */ 3112 public final String cookieLine; 3113 3114 /** The cookie object representing the cookie. */ 3115 public final Network.Cookie cookie; 3116 3117 /** 3118 * Constructor 3119 * 3120 * @param exemptionReason The reason the cookie was exempted. 3121 * 3122 * @param cookieLine The string representing this individual cookie as it would appear in the header. 3123 * 3124 * @param cookie The cookie object representing the cookie. 3125 */ 3126 public ExemptedSetCookieWithReason 3127 (String exemptionReason, String cookieLine, Network.Cookie cookie) 3128 { 3129 // Exception-Check(s) to ensure that if any parameters which are not declared as 3130 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3131 3132 if (exemptionReason == null) THROWS.throwNPE("exemptionReason"); 3133 if (cookieLine == null) THROWS.throwNPE("cookieLine"); 3134 if (cookie == null) THROWS.throwNPE("cookie"); 3135 3136 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3137 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3138 3139 THROWS.checkIAE("exemptionReason", exemptionReason, "Network.CookieExemptionReason", Network.CookieExemptionReason); 3140 3141 this.exemptionReason = exemptionReason; 3142 this.cookieLine = cookieLine; 3143 this.cookie = cookie; 3144 } 3145 3146 /** 3147 * JSON Object Constructor 3148 * @param jo A Json-Object having data about an instance of {@code 'ExemptedSetCookieWithReason'}. 3149 */ 3150 public ExemptedSetCookieWithReason (JsonObject jo) 3151 { 3152 this.exemptionReason = ReadJSON.getString(jo, "exemptionReason", false, true); 3153 this.cookieLine = ReadJSON.getString(jo, "cookieLine", false, true); 3154 this.cookie = ReadJSON.getObject(jo, "cookie", Network.Cookie.class, false, true); 3155 } 3156 3157 3158 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3159 public boolean equals(Object other) 3160 { 3161 if (this == other) return true; 3162 if (other == null) return false; 3163 if (other.getClass() != this.getClass()) return false; 3164 3165 ExemptedSetCookieWithReason o = (ExemptedSetCookieWithReason) other; 3166 3167 return 3168 Objects.equals(this.exemptionReason, o.exemptionReason) 3169 && Objects.equals(this.cookieLine, o.cookieLine) 3170 && Objects.equals(this.cookie, o.cookie); 3171 } 3172 3173 /** Generates a Hash-Code for {@code 'this'} instance */ 3174 public int hashCode() 3175 { 3176 return 3177 Objects.hashCode(this.exemptionReason) 3178 + Objects.hashCode(this.cookieLine) 3179 + this.cookie.hashCode(); 3180 } 3181 } 3182 3183 /** 3184 * A cookie associated with the request which may or may not be sent with it. 3185 * Includes the cookies itself and reasons for blocking or exemption. 3186 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3187 */ 3188 public static class AssociatedCookie 3189 extends BaseType 3190 implements java.io.Serializable 3191 { 3192 /** For Object Serialization. java.io.Serializable */ 3193 protected static final long serialVersionUID = 1; 3194 3195 public boolean[] optionals() 3196 { return new boolean[] { false, false, true, }; } 3197 3198 /** The cookie object representing the cookie which was not sent. */ 3199 public final Network.Cookie cookie; 3200 3201 /** The reason(s) the cookie was blocked. If empty means the cookie is included. */ 3202 public final String[] blockedReasons; 3203 3204 /** 3205 * The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could 3206 * only have at most one exemption reason. 3207 * <BR /><B CLASS=Opt>OPTIONAL</B> 3208 */ 3209 public final String exemptionReason; 3210 3211 /** 3212 * Constructor 3213 * 3214 * @param cookie The cookie object representing the cookie which was not sent. 3215 * 3216 * @param blockedReasons The reason(s) the cookie was blocked. If empty means the cookie is included. 3217 * 3218 * @param exemptionReason 3219 * The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could 3220 * only have at most one exemption reason. 3221 * <BR /><B CLASS=Opt>OPTIONAL</B> 3222 */ 3223 public AssociatedCookie 3224 (Network.Cookie cookie, String[] blockedReasons, String exemptionReason) 3225 { 3226 // Exception-Check(s) to ensure that if any parameters which are not declared as 3227 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3228 3229 if (cookie == null) THROWS.throwNPE("cookie"); 3230 if (blockedReasons == null) THROWS.throwNPE("blockedReasons"); 3231 3232 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3233 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3234 3235 THROWS.checkIAE("exemptionReason", exemptionReason, "Network.CookieExemptionReason", Network.CookieExemptionReason); 3236 3237 this.cookie = cookie; 3238 this.blockedReasons = blockedReasons; 3239 this.exemptionReason = exemptionReason; 3240 } 3241 3242 /** 3243 * JSON Object Constructor 3244 * @param jo A Json-Object having data about an instance of {@code 'AssociatedCookie'}. 3245 */ 3246 public AssociatedCookie (JsonObject jo) 3247 { 3248 this.cookie = ReadJSON.getObject(jo, "cookie", Network.Cookie.class, false, true); 3249 this.blockedReasons = (jo.getJsonArray("blockedReasons") == null) 3250 ? null 3251 : RJArrIntoStream.strArr(jo.getJsonArray("blockedReasons"), null, 0).toArray(String[]::new); 3252 3253 this.exemptionReason = ReadJSON.getString(jo, "exemptionReason", true, false); 3254 } 3255 3256 3257 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3258 public boolean equals(Object other) 3259 { 3260 if (this == other) return true; 3261 if (other == null) return false; 3262 if (other.getClass() != this.getClass()) return false; 3263 3264 AssociatedCookie o = (AssociatedCookie) other; 3265 3266 return 3267 Objects.equals(this.cookie, o.cookie) 3268 && Arrays.deepEquals(this.blockedReasons, o.blockedReasons) 3269 && Objects.equals(this.exemptionReason, o.exemptionReason); 3270 } 3271 3272 /** Generates a Hash-Code for {@code 'this'} instance */ 3273 public int hashCode() 3274 { 3275 return 3276 this.cookie.hashCode() 3277 + Arrays.deepHashCode(this.blockedReasons) 3278 + Objects.hashCode(this.exemptionReason); 3279 } 3280 } 3281 3282 /** Cookie parameter object */ 3283 public static class CookieParam 3284 extends BaseType 3285 implements java.io.Serializable 3286 { 3287 /** For Object Serialization. java.io.Serializable */ 3288 protected static final long serialVersionUID = 1; 3289 3290 public boolean[] optionals() 3291 { return new boolean[] { false, false, true, true, true, true, true, true, true, true, true, true, true, true, }; } 3292 3293 /** Cookie name. */ 3294 public final String name; 3295 3296 /** Cookie value. */ 3297 public final String value; 3298 3299 /** 3300 * The request-URI to associate with the setting of the cookie. This value can affect the 3301 * default domain, path, source port, and source scheme values of the created cookie. 3302 * <BR /><B CLASS=Opt>OPTIONAL</B> 3303 */ 3304 public final String url; 3305 3306 /** 3307 * Cookie domain. 3308 * <BR /><B CLASS=Opt>OPTIONAL</B> 3309 */ 3310 public final String domain; 3311 3312 /** 3313 * Cookie path. 3314 * <BR /><B CLASS=Opt>OPTIONAL</B> 3315 */ 3316 public final String path; 3317 3318 /** 3319 * True if cookie is secure. 3320 * <BR /><B CLASS=Opt>OPTIONAL</B> 3321 */ 3322 public final Boolean secure; 3323 3324 /** 3325 * True if cookie is http-only. 3326 * <BR /><B CLASS=Opt>OPTIONAL</B> 3327 */ 3328 public final Boolean httpOnly; 3329 3330 /** 3331 * Cookie SameSite type. 3332 * <BR /><B CLASS=Opt>OPTIONAL</B> 3333 */ 3334 public final String sameSite; 3335 3336 /** 3337 * Cookie expiration date, session cookie if not set 3338 * <BR /><B CLASS=Opt>OPTIONAL</B> 3339 */ 3340 public final Number expires; 3341 3342 /** 3343 * Cookie Priority. 3344 * <BR /><B CLASS=Opt>OPTIONAL</B> 3345 <B CLASS=Exp>EXPERIMENTAL</B> 3346 */ 3347 public final String priority; 3348 3349 /** 3350 * True if cookie is SameParty. 3351 * <BR /><B CLASS=Opt>OPTIONAL</B> 3352 <B CLASS=Exp>EXPERIMENTAL</B> 3353 */ 3354 public final Boolean sameParty; 3355 3356 /** 3357 * Cookie source scheme type. 3358 * <BR /><B CLASS=Opt>OPTIONAL</B> 3359 <B CLASS=Exp>EXPERIMENTAL</B> 3360 */ 3361 public final String sourceScheme; 3362 3363 /** 3364 * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. 3365 * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. 3366 * This is a temporary ability and it will be removed in the future. 3367 * <BR /><B CLASS=Opt>OPTIONAL</B> 3368 <B CLASS=Exp>EXPERIMENTAL</B> 3369 */ 3370 public final Integer sourcePort; 3371 3372 /** 3373 * Cookie partition key. If not set, the cookie will be set as not partitioned. 3374 * <BR /><B CLASS=Opt>OPTIONAL</B> 3375 <B CLASS=Exp>EXPERIMENTAL</B> 3376 */ 3377 public final Network.CookiePartitionKey partitionKey; 3378 3379 /** 3380 * Constructor 3381 * 3382 * @param name Cookie name. 3383 * 3384 * @param value Cookie value. 3385 * 3386 * @param url 3387 * The request-URI to associate with the setting of the cookie. This value can affect the 3388 * default domain, path, source port, and source scheme values of the created cookie. 3389 * <BR /><B CLASS=Opt>OPTIONAL</B> 3390 * 3391 * @param domain Cookie domain. 3392 * <BR /><B CLASS=Opt>OPTIONAL</B> 3393 * 3394 * @param path Cookie path. 3395 * <BR /><B CLASS=Opt>OPTIONAL</B> 3396 * 3397 * @param secure True if cookie is secure. 3398 * <BR /><B CLASS=Opt>OPTIONAL</B> 3399 * 3400 * @param httpOnly True if cookie is http-only. 3401 * <BR /><B CLASS=Opt>OPTIONAL</B> 3402 * 3403 * @param sameSite Cookie SameSite type. 3404 * <BR /><B CLASS=Opt>OPTIONAL</B> 3405 * 3406 * @param expires Cookie expiration date, session cookie if not set 3407 * <BR /><B CLASS=Opt>OPTIONAL</B> 3408 * 3409 * @param priority Cookie Priority. 3410 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 3411 * 3412 * @param sameParty True if cookie is SameParty. 3413 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 3414 * 3415 * @param sourceScheme Cookie source scheme type. 3416 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 3417 * 3418 * @param sourcePort 3419 * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. 3420 * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. 3421 * This is a temporary ability and it will be removed in the future. 3422 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 3423 * 3424 * @param partitionKey Cookie partition key. If not set, the cookie will be set as not partitioned. 3425 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 3426 */ 3427 public CookieParam( 3428 String name, String value, String url, String domain, String path, Boolean secure, 3429 Boolean httpOnly, String sameSite, Number expires, String priority, 3430 Boolean sameParty, String sourceScheme, Integer sourcePort, 3431 Network.CookiePartitionKey partitionKey 3432 ) 3433 { 3434 // Exception-Check(s) to ensure that if any parameters which are not declared as 3435 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3436 3437 if (name == null) THROWS.throwNPE("name"); 3438 if (value == null) THROWS.throwNPE("value"); 3439 3440 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3441 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3442 3443 THROWS.checkIAE("sameSite", sameSite, "Network.CookieSameSite", Network.CookieSameSite); 3444 THROWS.checkIAE("priority", priority, "Network.CookiePriority", Network.CookiePriority); 3445 THROWS.checkIAE("sourceScheme", sourceScheme, "Network.CookieSourceScheme", Network.CookieSourceScheme); 3446 3447 this.name = name; 3448 this.value = value; 3449 this.url = url; 3450 this.domain = domain; 3451 this.path = path; 3452 this.secure = secure; 3453 this.httpOnly = httpOnly; 3454 this.sameSite = sameSite; 3455 this.expires = expires; 3456 this.priority = priority; 3457 this.sameParty = sameParty; 3458 this.sourceScheme = sourceScheme; 3459 this.sourcePort = sourcePort; 3460 this.partitionKey = partitionKey; 3461 } 3462 3463 /** 3464 * JSON Object Constructor 3465 * @param jo A Json-Object having data about an instance of {@code 'CookieParam'}. 3466 */ 3467 public CookieParam (JsonObject jo) 3468 { 3469 this.name = ReadJSON.getString(jo, "name", false, true); 3470 this.value = ReadJSON.getString(jo, "value", false, true); 3471 this.url = ReadJSON.getString(jo, "url", true, false); 3472 this.domain = ReadJSON.getString(jo, "domain", true, false); 3473 this.path = ReadJSON.getString(jo, "path", true, false); 3474 this.secure = ReadBoxedJSON.getBoolean(jo, "secure", true); 3475 this.httpOnly = ReadBoxedJSON.getBoolean(jo, "httpOnly", true); 3476 this.sameSite = ReadJSON.getString(jo, "sameSite", true, false); 3477 this.expires = ReadNumberJSON.get(jo, "expires", true, false); 3478 this.priority = ReadJSON.getString(jo, "priority", true, false); 3479 this.sameParty = ReadBoxedJSON.getBoolean(jo, "sameParty", true); 3480 this.sourceScheme = ReadJSON.getString(jo, "sourceScheme", true, false); 3481 this.sourcePort = ReadBoxedJSON.getInteger(jo, "sourcePort", true); 3482 this.partitionKey = ReadJSON.getObject(jo, "partitionKey", Network.CookiePartitionKey.class, true, false); 3483 } 3484 3485 3486 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3487 public boolean equals(Object other) 3488 { 3489 if (this == other) return true; 3490 if (other == null) return false; 3491 if (other.getClass() != this.getClass()) return false; 3492 3493 CookieParam o = (CookieParam) other; 3494 3495 return 3496 Objects.equals(this.name, o.name) 3497 && Objects.equals(this.value, o.value) 3498 && Objects.equals(this.url, o.url) 3499 && Objects.equals(this.domain, o.domain) 3500 && Objects.equals(this.path, o.path) 3501 && Objects.equals(this.secure, o.secure) 3502 && Objects.equals(this.httpOnly, o.httpOnly) 3503 && Objects.equals(this.sameSite, o.sameSite) 3504 && Objects.equals(this.expires, o.expires) 3505 && Objects.equals(this.priority, o.priority) 3506 && Objects.equals(this.sameParty, o.sameParty) 3507 && Objects.equals(this.sourceScheme, o.sourceScheme) 3508 && Objects.equals(this.sourcePort, o.sourcePort) 3509 && Objects.equals(this.partitionKey, o.partitionKey); 3510 } 3511 3512 /** Generates a Hash-Code for {@code 'this'} instance */ 3513 public int hashCode() 3514 { 3515 return 3516 Objects.hashCode(this.name) 3517 + Objects.hashCode(this.value) 3518 + Objects.hashCode(this.url) 3519 + Objects.hashCode(this.domain) 3520 + Objects.hashCode(this.path) 3521 + Objects.hashCode(this.secure) 3522 + Objects.hashCode(this.httpOnly) 3523 + Objects.hashCode(this.sameSite) 3524 + Objects.hashCode(this.expires) 3525 + Objects.hashCode(this.priority) 3526 + Objects.hashCode(this.sameParty) 3527 + Objects.hashCode(this.sourceScheme) 3528 + Objects.hashCode(this.sourcePort) 3529 + this.partitionKey.hashCode(); 3530 } 3531 } 3532 3533 /** 3534 * Authorization challenge for HTTP status code 401 or 407. 3535 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3536 */ 3537 public static class AuthChallenge 3538 extends BaseType 3539 implements java.io.Serializable 3540 { 3541 /** For Object Serialization. java.io.Serializable */ 3542 protected static final long serialVersionUID = 1; 3543 3544 public boolean[] optionals() 3545 { return new boolean[] { true, false, false, false, }; } 3546 3547 /** 3548 * Source of the authentication challenge. 3549 * <BR /><B CLASS=Opt>OPTIONAL</B> 3550 */ 3551 public final String source; 3552 3553 /** Origin of the challenger. */ 3554 public final String origin; 3555 3556 /** The authentication scheme used, such as basic or digest */ 3557 public final String scheme; 3558 3559 /** The realm of the challenge. May be empty. */ 3560 public final String realm; 3561 3562 /** 3563 * Constructor 3564 * 3565 * @param source Source of the authentication challenge. 3566 * <BR />Acceptable Values: ["Server", "Proxy"] 3567 * <BR /><B CLASS=Opt>OPTIONAL</B> 3568 * 3569 * @param origin Origin of the challenger. 3570 * 3571 * @param scheme The authentication scheme used, such as basic or digest 3572 * 3573 * @param realm The realm of the challenge. May be empty. 3574 */ 3575 public AuthChallenge(String source, String origin, String scheme, String realm) 3576 { 3577 // Exception-Check(s) to ensure that if any parameters which are not declared as 3578 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3579 3580 if (origin == null) THROWS.throwNPE("origin"); 3581 if (scheme == null) THROWS.throwNPE("scheme"); 3582 if (realm == null) THROWS.throwNPE("realm"); 3583 3584 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3585 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3586 3587 THROWS.checkIAE( 3588 "source", source, 3589 "Server", "Proxy" 3590 ); 3591 3592 this.source = source; 3593 this.origin = origin; 3594 this.scheme = scheme; 3595 this.realm = realm; 3596 } 3597 3598 /** 3599 * JSON Object Constructor 3600 * @param jo A Json-Object having data about an instance of {@code 'AuthChallenge'}. 3601 */ 3602 public AuthChallenge (JsonObject jo) 3603 { 3604 this.source = ReadJSON.getString(jo, "source", true, false); 3605 this.origin = ReadJSON.getString(jo, "origin", false, true); 3606 this.scheme = ReadJSON.getString(jo, "scheme", false, true); 3607 this.realm = ReadJSON.getString(jo, "realm", false, true); 3608 } 3609 3610 3611 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3612 public boolean equals(Object other) 3613 { 3614 if (this == other) return true; 3615 if (other == null) return false; 3616 if (other.getClass() != this.getClass()) return false; 3617 3618 AuthChallenge o = (AuthChallenge) other; 3619 3620 return 3621 Objects.equals(this.source, o.source) 3622 && Objects.equals(this.origin, o.origin) 3623 && Objects.equals(this.scheme, o.scheme) 3624 && Objects.equals(this.realm, o.realm); 3625 } 3626 3627 /** Generates a Hash-Code for {@code 'this'} instance */ 3628 public int hashCode() 3629 { 3630 return 3631 Objects.hashCode(this.source) 3632 + Objects.hashCode(this.origin) 3633 + Objects.hashCode(this.scheme) 3634 + Objects.hashCode(this.realm); 3635 } 3636 } 3637 3638 /** 3639 * Response to an AuthChallenge. 3640 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3641 */ 3642 public static class AuthChallengeResponse 3643 extends BaseType 3644 implements java.io.Serializable 3645 { 3646 /** For Object Serialization. java.io.Serializable */ 3647 protected static final long serialVersionUID = 1; 3648 3649 public boolean[] optionals() 3650 { return new boolean[] { false, true, true, }; } 3651 3652 /** 3653 * The decision on what to do in response to the authorization challenge. Default means 3654 * deferring to the default behavior of the net stack, which will likely either the Cancel 3655 * authentication or display a popup dialog box. 3656 */ 3657 public final String response; 3658 3659 /** 3660 * The username to provide, possibly empty. Should only be set if response is 3661 * ProvideCredentials. 3662 * <BR /><B CLASS=Opt>OPTIONAL</B> 3663 */ 3664 public final String username; 3665 3666 /** 3667 * The password to provide, possibly empty. Should only be set if response is 3668 * ProvideCredentials. 3669 * <BR /><B CLASS=Opt>OPTIONAL</B> 3670 */ 3671 public final String password; 3672 3673 /** 3674 * Constructor 3675 * 3676 * @param response 3677 * The decision on what to do in response to the authorization challenge. Default means 3678 * deferring to the default behavior of the net stack, which will likely either the Cancel 3679 * authentication or display a popup dialog box. 3680 * <BR />Acceptable Values: ["Default", "CancelAuth", "ProvideCredentials"] 3681 * 3682 * @param username 3683 * The username to provide, possibly empty. Should only be set if response is 3684 * ProvideCredentials. 3685 * <BR /><B CLASS=Opt>OPTIONAL</B> 3686 * 3687 * @param password 3688 * The password to provide, possibly empty. Should only be set if response is 3689 * ProvideCredentials. 3690 * <BR /><B CLASS=Opt>OPTIONAL</B> 3691 */ 3692 public AuthChallengeResponse(String response, String username, String password) 3693 { 3694 // Exception-Check(s) to ensure that if any parameters which are not declared as 3695 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3696 3697 if (response == null) THROWS.throwNPE("response"); 3698 3699 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3700 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3701 3702 THROWS.checkIAE( 3703 "response", response, 3704 "Default", "CancelAuth", "ProvideCredentials" 3705 ); 3706 3707 this.response = response; 3708 this.username = username; 3709 this.password = password; 3710 } 3711 3712 /** 3713 * JSON Object Constructor 3714 * @param jo A Json-Object having data about an instance of {@code 'AuthChallengeResponse'}. 3715 */ 3716 public AuthChallengeResponse (JsonObject jo) 3717 { 3718 this.response = ReadJSON.getString(jo, "response", false, true); 3719 this.username = ReadJSON.getString(jo, "username", true, false); 3720 this.password = ReadJSON.getString(jo, "password", true, false); 3721 } 3722 3723 3724 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3725 public boolean equals(Object other) 3726 { 3727 if (this == other) return true; 3728 if (other == null) return false; 3729 if (other.getClass() != this.getClass()) return false; 3730 3731 AuthChallengeResponse o = (AuthChallengeResponse) other; 3732 3733 return 3734 Objects.equals(this.response, o.response) 3735 && Objects.equals(this.username, o.username) 3736 && Objects.equals(this.password, o.password); 3737 } 3738 3739 /** Generates a Hash-Code for {@code 'this'} instance */ 3740 public int hashCode() 3741 { 3742 return 3743 Objects.hashCode(this.response) 3744 + Objects.hashCode(this.username) 3745 + Objects.hashCode(this.password); 3746 } 3747 } 3748 3749 /** 3750 * Request pattern for interception. 3751 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3752 */ 3753 public static class RequestPattern 3754 extends BaseType 3755 implements java.io.Serializable 3756 { 3757 /** For Object Serialization. java.io.Serializable */ 3758 protected static final long serialVersionUID = 1; 3759 3760 public boolean[] optionals() 3761 { return new boolean[] { true, true, true, }; } 3762 3763 /** 3764 * Wildcards ({@code '*'} -> zero or more, {@code '?'} -> exactly one) are allowed. Escape character is 3765 * backslash. Omitting is equivalent to {@code "*"}. 3766 * <BR /><B CLASS=Opt>OPTIONAL</B> 3767 */ 3768 public final String urlPattern; 3769 3770 /** 3771 * If set, only requests for matching resource types will be intercepted. 3772 * <BR /><B CLASS=Opt>OPTIONAL</B> 3773 */ 3774 public final String resourceType; 3775 3776 /** 3777 * Stage at which to begin intercepting requests. Default is Request. 3778 * <BR /><B CLASS=Opt>OPTIONAL</B> 3779 */ 3780 public final String interceptionStage; 3781 3782 /** 3783 * Constructor 3784 * 3785 * @param urlPattern 3786 * Wildcards ({@code '*'} -> zero or more, {@code '?'} -> exactly one) are allowed. Escape character is 3787 * backslash. Omitting is equivalent to {@code "*"}. 3788 * <BR /><B CLASS=Opt>OPTIONAL</B> 3789 * 3790 * @param resourceType If set, only requests for matching resource types will be intercepted. 3791 * <BR /><B CLASS=Opt>OPTIONAL</B> 3792 * 3793 * @param interceptionStage Stage at which to begin intercepting requests. Default is Request. 3794 * <BR /><B CLASS=Opt>OPTIONAL</B> 3795 */ 3796 public RequestPattern(String urlPattern, String resourceType, String interceptionStage) 3797 { 3798 // Exception-Check(s) to ensure that if any parameters which must adhere to a 3799 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 3800 3801 THROWS.checkIAE("resourceType", resourceType, "Network.ResourceType", Network.ResourceType); 3802 THROWS.checkIAE("interceptionStage", interceptionStage, "Network.InterceptionStage", Network.InterceptionStage); 3803 3804 this.urlPattern = urlPattern; 3805 this.resourceType = resourceType; 3806 this.interceptionStage = interceptionStage; 3807 } 3808 3809 /** 3810 * JSON Object Constructor 3811 * @param jo A Json-Object having data about an instance of {@code 'RequestPattern'}. 3812 */ 3813 public RequestPattern (JsonObject jo) 3814 { 3815 this.urlPattern = ReadJSON.getString(jo, "urlPattern", true, false); 3816 this.resourceType = ReadJSON.getString(jo, "resourceType", true, false); 3817 this.interceptionStage = ReadJSON.getString(jo, "interceptionStage", true, false); 3818 } 3819 3820 3821 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3822 public boolean equals(Object other) 3823 { 3824 if (this == other) return true; 3825 if (other == null) return false; 3826 if (other.getClass() != this.getClass()) return false; 3827 3828 RequestPattern o = (RequestPattern) other; 3829 3830 return 3831 Objects.equals(this.urlPattern, o.urlPattern) 3832 && Objects.equals(this.resourceType, o.resourceType) 3833 && Objects.equals(this.interceptionStage, o.interceptionStage); 3834 } 3835 3836 /** Generates a Hash-Code for {@code 'this'} instance */ 3837 public int hashCode() 3838 { 3839 return 3840 Objects.hashCode(this.urlPattern) 3841 + Objects.hashCode(this.resourceType) 3842 + Objects.hashCode(this.interceptionStage); 3843 } 3844 } 3845 3846 /** 3847 * Information about a signed exchange signature. 3848 * https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1 3849 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 3850 */ 3851 public static class SignedExchangeSignature 3852 extends BaseType 3853 implements java.io.Serializable 3854 { 3855 /** For Object Serialization. java.io.Serializable */ 3856 protected static final long serialVersionUID = 1; 3857 3858 public boolean[] optionals() 3859 { return new boolean[] { false, false, false, true, true, false, false, false, true, }; } 3860 3861 /** Signed exchange signature label. */ 3862 public final String label; 3863 3864 /** The hex string of signed exchange signature. */ 3865 public final String signature; 3866 3867 /** Signed exchange signature integrity. */ 3868 public final String integrity; 3869 3870 /** 3871 * Signed exchange signature cert Url. 3872 * <BR /><B CLASS=Opt>OPTIONAL</B> 3873 */ 3874 public final String certUrl; 3875 3876 /** 3877 * The hex string of signed exchange signature cert sha256. 3878 * <BR /><B CLASS=Opt>OPTIONAL</B> 3879 */ 3880 public final String certSha256; 3881 3882 /** Signed exchange signature validity Url. */ 3883 public final String validityUrl; 3884 3885 /** Signed exchange signature date. */ 3886 public final int date; 3887 3888 /** Signed exchange signature expires. */ 3889 public final int expires; 3890 3891 /** 3892 * The encoded certificates. 3893 * <BR /><B CLASS=Opt>OPTIONAL</B> 3894 */ 3895 public final String[] certificates; 3896 3897 /** 3898 * Constructor 3899 * 3900 * @param label Signed exchange signature label. 3901 * 3902 * @param signature The hex string of signed exchange signature. 3903 * 3904 * @param integrity Signed exchange signature integrity. 3905 * 3906 * @param certUrl Signed exchange signature cert Url. 3907 * <BR /><B CLASS=Opt>OPTIONAL</B> 3908 * 3909 * @param certSha256 The hex string of signed exchange signature cert sha256. 3910 * <BR /><B CLASS=Opt>OPTIONAL</B> 3911 * 3912 * @param validityUrl Signed exchange signature validity Url. 3913 * 3914 * @param date Signed exchange signature date. 3915 * 3916 * @param expires Signed exchange signature expires. 3917 * 3918 * @param certificates The encoded certificates. 3919 * <BR /><B CLASS=Opt>OPTIONAL</B> 3920 */ 3921 public SignedExchangeSignature( 3922 String label, String signature, String integrity, String certUrl, String certSha256, 3923 String validityUrl, int date, int expires, String[] certificates 3924 ) 3925 { 3926 // Exception-Check(s) to ensure that if any parameters which are not declared as 3927 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 3928 3929 if (label == null) THROWS.throwNPE("label"); 3930 if (signature == null) THROWS.throwNPE("signature"); 3931 if (integrity == null) THROWS.throwNPE("integrity"); 3932 if (validityUrl == null) THROWS.throwNPE("validityUrl"); 3933 3934 this.label = label; 3935 this.signature = signature; 3936 this.integrity = integrity; 3937 this.certUrl = certUrl; 3938 this.certSha256 = certSha256; 3939 this.validityUrl = validityUrl; 3940 this.date = date; 3941 this.expires = expires; 3942 this.certificates = certificates; 3943 } 3944 3945 /** 3946 * JSON Object Constructor 3947 * @param jo A Json-Object having data about an instance of {@code 'SignedExchangeSignature'}. 3948 */ 3949 public SignedExchangeSignature (JsonObject jo) 3950 { 3951 this.label = ReadJSON.getString(jo, "label", false, true); 3952 this.signature = ReadJSON.getString(jo, "signature", false, true); 3953 this.integrity = ReadJSON.getString(jo, "integrity", false, true); 3954 this.certUrl = ReadJSON.getString(jo, "certUrl", true, false); 3955 this.certSha256 = ReadJSON.getString(jo, "certSha256", true, false); 3956 this.validityUrl = ReadJSON.getString(jo, "validityUrl", false, true); 3957 this.date = ReadPrimJSON.getInt(jo, "date"); 3958 this.expires = ReadPrimJSON.getInt(jo, "expires"); 3959 this.certificates = (jo.getJsonArray("certificates") == null) 3960 ? null 3961 : RJArrIntoStream.strArr(jo.getJsonArray("certificates"), null, 0).toArray(String[]::new); 3962 3963 } 3964 3965 3966 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 3967 public boolean equals(Object other) 3968 { 3969 if (this == other) return true; 3970 if (other == null) return false; 3971 if (other.getClass() != this.getClass()) return false; 3972 3973 SignedExchangeSignature o = (SignedExchangeSignature) other; 3974 3975 return 3976 Objects.equals(this.label, o.label) 3977 && Objects.equals(this.signature, o.signature) 3978 && Objects.equals(this.integrity, o.integrity) 3979 && Objects.equals(this.certUrl, o.certUrl) 3980 && Objects.equals(this.certSha256, o.certSha256) 3981 && Objects.equals(this.validityUrl, o.validityUrl) 3982 && (this.date == o.date) 3983 && (this.expires == o.expires) 3984 && Arrays.deepEquals(this.certificates, o.certificates); 3985 } 3986 3987 /** Generates a Hash-Code for {@code 'this'} instance */ 3988 public int hashCode() 3989 { 3990 return 3991 Objects.hashCode(this.label) 3992 + Objects.hashCode(this.signature) 3993 + Objects.hashCode(this.integrity) 3994 + Objects.hashCode(this.certUrl) 3995 + Objects.hashCode(this.certSha256) 3996 + Objects.hashCode(this.validityUrl) 3997 + this.date 3998 + this.expires 3999 + Arrays.deepHashCode(this.certificates); 4000 } 4001 } 4002 4003 /** 4004 * Information about a signed exchange header. 4005 * https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation 4006 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4007 */ 4008 public static class SignedExchangeHeader 4009 extends BaseType 4010 implements java.io.Serializable 4011 { 4012 /** For Object Serialization. java.io.Serializable */ 4013 protected static final long serialVersionUID = 1; 4014 4015 public boolean[] optionals() 4016 { return new boolean[] { false, false, false, false, false, }; } 4017 4018 /** Signed exchange request URL. */ 4019 public final String requestUrl; 4020 4021 /** Signed exchange response code. */ 4022 public final int responseCode; 4023 4024 /** Signed exchange response headers. */ 4025 public final JsonObject responseHeaders; 4026 4027 /** Signed exchange response signature. */ 4028 public final Network.SignedExchangeSignature[] signatures; 4029 4030 /** Signed exchange header integrity hash in the form of {@code sha256-<base64-hash-value>}. */ 4031 public final String headerIntegrity; 4032 4033 /** 4034 * Constructor 4035 * 4036 * @param requestUrl Signed exchange request URL. 4037 * 4038 * @param responseCode Signed exchange response code. 4039 * 4040 * @param responseHeaders Signed exchange response headers. 4041 * 4042 * @param signatures Signed exchange response signature. 4043 * 4044 * @param headerIntegrity Signed exchange header integrity hash in the form of {@code sha256-<base64-hash-value>}. 4045 */ 4046 public SignedExchangeHeader( 4047 String requestUrl, int responseCode, JsonObject responseHeaders, 4048 Network.SignedExchangeSignature[] signatures, String headerIntegrity 4049 ) 4050 { 4051 // Exception-Check(s) to ensure that if any parameters which are not declared as 4052 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4053 4054 if (requestUrl == null) THROWS.throwNPE("requestUrl"); 4055 if (responseHeaders == null) THROWS.throwNPE("responseHeaders"); 4056 if (signatures == null) THROWS.throwNPE("signatures"); 4057 if (headerIntegrity == null) THROWS.throwNPE("headerIntegrity"); 4058 4059 this.requestUrl = requestUrl; 4060 this.responseCode = responseCode; 4061 this.responseHeaders = responseHeaders; 4062 this.signatures = signatures; 4063 this.headerIntegrity = headerIntegrity; 4064 } 4065 4066 /** 4067 * JSON Object Constructor 4068 * @param jo A Json-Object having data about an instance of {@code 'SignedExchangeHeader'}. 4069 */ 4070 public SignedExchangeHeader (JsonObject jo) 4071 { 4072 this.requestUrl = ReadJSON.getString(jo, "requestUrl", false, true); 4073 this.responseCode = ReadPrimJSON.getInt(jo, "responseCode"); 4074 this.responseHeaders = jo.getJsonObject("responseHeaders"); 4075 this.signatures = (jo.getJsonArray("signatures") == null) 4076 ? null 4077 : RJArrIntoStream.objArr(jo.getJsonArray("signatures"), null, 0, Network.SignedExchangeSignature.class).toArray(Network.SignedExchangeSignature[]::new); 4078 4079 this.headerIntegrity = ReadJSON.getString(jo, "headerIntegrity", false, true); 4080 } 4081 4082 4083 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4084 public boolean equals(Object other) 4085 { 4086 if (this == other) return true; 4087 if (other == null) return false; 4088 if (other.getClass() != this.getClass()) return false; 4089 4090 SignedExchangeHeader o = (SignedExchangeHeader) other; 4091 4092 return 4093 Objects.equals(this.requestUrl, o.requestUrl) 4094 && (this.responseCode == o.responseCode) 4095 && Objects.equals(this.responseHeaders, o.responseHeaders) 4096 && Arrays.deepEquals(this.signatures, o.signatures) 4097 && Objects.equals(this.headerIntegrity, o.headerIntegrity); 4098 } 4099 4100 /** Generates a Hash-Code for {@code 'this'} instance */ 4101 public int hashCode() 4102 { 4103 return 4104 Objects.hashCode(this.requestUrl) 4105 + this.responseCode 4106 + this.responseHeaders.hashCode() 4107 + Arrays.deepHashCode(this.signatures) 4108 + Objects.hashCode(this.headerIntegrity); 4109 } 4110 } 4111 4112 /** 4113 * Information about a signed exchange response. 4114 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4115 */ 4116 public static class SignedExchangeError 4117 extends BaseType 4118 implements java.io.Serializable 4119 { 4120 /** For Object Serialization. java.io.Serializable */ 4121 protected static final long serialVersionUID = 1; 4122 4123 public boolean[] optionals() 4124 { return new boolean[] { false, true, true, }; } 4125 4126 /** Error message. */ 4127 public final String message; 4128 4129 /** 4130 * The index of the signature which caused the error. 4131 * <BR /><B CLASS=Opt>OPTIONAL</B> 4132 */ 4133 public final Integer signatureIndex; 4134 4135 /** 4136 * The field which caused the error. 4137 * <BR /><B CLASS=Opt>OPTIONAL</B> 4138 */ 4139 public final String errorField; 4140 4141 /** 4142 * Constructor 4143 * 4144 * @param message Error message. 4145 * 4146 * @param signatureIndex The index of the signature which caused the error. 4147 * <BR /><B CLASS=Opt>OPTIONAL</B> 4148 * 4149 * @param errorField The field which caused the error. 4150 * <BR /><B CLASS=Opt>OPTIONAL</B> 4151 */ 4152 public SignedExchangeError(String message, Integer signatureIndex, String errorField) 4153 { 4154 // Exception-Check(s) to ensure that if any parameters which are not declared as 4155 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4156 4157 if (message == null) THROWS.throwNPE("message"); 4158 4159 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4160 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4161 4162 THROWS.checkIAE("errorField", errorField, "Network.SignedExchangeErrorField", Network.SignedExchangeErrorField); 4163 4164 this.message = message; 4165 this.signatureIndex = signatureIndex; 4166 this.errorField = errorField; 4167 } 4168 4169 /** 4170 * JSON Object Constructor 4171 * @param jo A Json-Object having data about an instance of {@code 'SignedExchangeError'}. 4172 */ 4173 public SignedExchangeError (JsonObject jo) 4174 { 4175 this.message = ReadJSON.getString(jo, "message", false, true); 4176 this.signatureIndex = ReadBoxedJSON.getInteger(jo, "signatureIndex", true); 4177 this.errorField = ReadJSON.getString(jo, "errorField", true, false); 4178 } 4179 4180 4181 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4182 public boolean equals(Object other) 4183 { 4184 if (this == other) return true; 4185 if (other == null) return false; 4186 if (other.getClass() != this.getClass()) return false; 4187 4188 SignedExchangeError o = (SignedExchangeError) other; 4189 4190 return 4191 Objects.equals(this.message, o.message) 4192 && Objects.equals(this.signatureIndex, o.signatureIndex) 4193 && Objects.equals(this.errorField, o.errorField); 4194 } 4195 4196 /** Generates a Hash-Code for {@code 'this'} instance */ 4197 public int hashCode() 4198 { 4199 return 4200 Objects.hashCode(this.message) 4201 + Objects.hashCode(this.signatureIndex) 4202 + Objects.hashCode(this.errorField); 4203 } 4204 } 4205 4206 /** 4207 * Information about a signed exchange response. 4208 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4209 */ 4210 public static class SignedExchangeInfo 4211 extends BaseType 4212 implements java.io.Serializable 4213 { 4214 /** For Object Serialization. java.io.Serializable */ 4215 protected static final long serialVersionUID = 1; 4216 4217 public boolean[] optionals() 4218 { return new boolean[] { false, false, true, true, true, }; } 4219 4220 /** The outer response of signed HTTP exchange which was received from network. */ 4221 public final Network.Response outerResponse; 4222 4223 /** 4224 * Whether network response for the signed exchange was accompanied by 4225 * extra headers. 4226 */ 4227 public final boolean hasExtraInfo; 4228 4229 /** 4230 * Information about the signed exchange header. 4231 * <BR /><B CLASS=Opt>OPTIONAL</B> 4232 */ 4233 public final Network.SignedExchangeHeader header; 4234 4235 /** 4236 * Security details for the signed exchange header. 4237 * <BR /><B CLASS=Opt>OPTIONAL</B> 4238 */ 4239 public final Network.SecurityDetails securityDetails; 4240 4241 /** 4242 * Errors occurred while handling the signed exchange. 4243 * <BR /><B CLASS=Opt>OPTIONAL</B> 4244 */ 4245 public final Network.SignedExchangeError[] errors; 4246 4247 /** 4248 * Constructor 4249 * 4250 * @param outerResponse The outer response of signed HTTP exchange which was received from network. 4251 * 4252 * @param hasExtraInfo 4253 * Whether network response for the signed exchange was accompanied by 4254 * extra headers. 4255 * 4256 * @param header Information about the signed exchange header. 4257 * <BR /><B CLASS=Opt>OPTIONAL</B> 4258 * 4259 * @param securityDetails Security details for the signed exchange header. 4260 * <BR /><B CLASS=Opt>OPTIONAL</B> 4261 * 4262 * @param errors Errors occurred while handling the signed exchange. 4263 * <BR /><B CLASS=Opt>OPTIONAL</B> 4264 */ 4265 public SignedExchangeInfo( 4266 Network.Response outerResponse, boolean hasExtraInfo, 4267 Network.SignedExchangeHeader header, Network.SecurityDetails securityDetails, 4268 Network.SignedExchangeError[] errors 4269 ) 4270 { 4271 // Exception-Check(s) to ensure that if any parameters which are not declared as 4272 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4273 4274 if (outerResponse == null) THROWS.throwNPE("outerResponse"); 4275 4276 this.outerResponse = outerResponse; 4277 this.hasExtraInfo = hasExtraInfo; 4278 this.header = header; 4279 this.securityDetails = securityDetails; 4280 this.errors = errors; 4281 } 4282 4283 /** 4284 * JSON Object Constructor 4285 * @param jo A Json-Object having data about an instance of {@code 'SignedExchangeInfo'}. 4286 */ 4287 public SignedExchangeInfo (JsonObject jo) 4288 { 4289 this.outerResponse = ReadJSON.getObject(jo, "outerResponse", Network.Response.class, false, true); 4290 this.hasExtraInfo = ReadPrimJSON.getBoolean(jo, "hasExtraInfo"); 4291 this.header = ReadJSON.getObject(jo, "header", Network.SignedExchangeHeader.class, true, false); 4292 this.securityDetails = ReadJSON.getObject(jo, "securityDetails", Network.SecurityDetails.class, true, false); 4293 this.errors = (jo.getJsonArray("errors") == null) 4294 ? null 4295 : RJArrIntoStream.objArr(jo.getJsonArray("errors"), null, 0, Network.SignedExchangeError.class).toArray(Network.SignedExchangeError[]::new); 4296 4297 } 4298 4299 4300 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4301 public boolean equals(Object other) 4302 { 4303 if (this == other) return true; 4304 if (other == null) return false; 4305 if (other.getClass() != this.getClass()) return false; 4306 4307 SignedExchangeInfo o = (SignedExchangeInfo) other; 4308 4309 return 4310 Objects.equals(this.outerResponse, o.outerResponse) 4311 && (this.hasExtraInfo == o.hasExtraInfo) 4312 && Objects.equals(this.header, o.header) 4313 && Objects.equals(this.securityDetails, o.securityDetails) 4314 && Arrays.deepEquals(this.errors, o.errors); 4315 } 4316 4317 /** Generates a Hash-Code for {@code 'this'} instance */ 4318 public int hashCode() 4319 { 4320 return 4321 this.outerResponse.hashCode() 4322 + (this.hasExtraInfo ? 1 : 0) 4323 + this.header.hashCode() 4324 + this.securityDetails.hashCode() 4325 + Arrays.deepHashCode(this.errors); 4326 } 4327 } 4328 4329 /** 4330 * <CODE>[No Description Provided by Google]</CODE> 4331 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4332 */ 4333 public static class DirectTCPSocketOptions 4334 extends BaseType 4335 implements java.io.Serializable 4336 { 4337 /** For Object Serialization. java.io.Serializable */ 4338 protected static final long serialVersionUID = 1; 4339 4340 public boolean[] optionals() 4341 { return new boolean[] { false, true, true, true, true, }; } 4342 4343 /** TCP_NODELAY option */ 4344 public final boolean noDelay; 4345 4346 /** 4347 * Expected to be unsigned integer. 4348 * <BR /><B CLASS=Opt>OPTIONAL</B> 4349 */ 4350 public final Number keepAliveDelay; 4351 4352 /** 4353 * Expected to be unsigned integer. 4354 * <BR /><B CLASS=Opt>OPTIONAL</B> 4355 */ 4356 public final Number sendBufferSize; 4357 4358 /** 4359 * Expected to be unsigned integer. 4360 * <BR /><B CLASS=Opt>OPTIONAL</B> 4361 */ 4362 public final Number receiveBufferSize; 4363 4364 /** 4365 * <CODE>[No Description Provided by Google]</CODE> 4366 * <BR /><B CLASS=Opt>OPTIONAL</B> 4367 */ 4368 public final String dnsQueryType; 4369 4370 /** 4371 * Constructor 4372 * 4373 * @param noDelay TCP_NODELAY option 4374 * 4375 * @param keepAliveDelay Expected to be unsigned integer. 4376 * <BR /><B CLASS=Opt>OPTIONAL</B> 4377 * 4378 * @param sendBufferSize Expected to be unsigned integer. 4379 * <BR /><B CLASS=Opt>OPTIONAL</B> 4380 * 4381 * @param receiveBufferSize Expected to be unsigned integer. 4382 * <BR /><B CLASS=Opt>OPTIONAL</B> 4383 * 4384 * @param dnsQueryType - 4385 * <BR /><B CLASS=Opt>OPTIONAL</B> 4386 */ 4387 public DirectTCPSocketOptions( 4388 boolean noDelay, Number keepAliveDelay, Number sendBufferSize, 4389 Number receiveBufferSize, String dnsQueryType 4390 ) 4391 { 4392 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4393 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4394 4395 THROWS.checkIAE("dnsQueryType", dnsQueryType, "Network.DirectSocketDnsQueryType", Network.DirectSocketDnsQueryType); 4396 4397 this.noDelay = noDelay; 4398 this.keepAliveDelay = keepAliveDelay; 4399 this.sendBufferSize = sendBufferSize; 4400 this.receiveBufferSize = receiveBufferSize; 4401 this.dnsQueryType = dnsQueryType; 4402 } 4403 4404 /** 4405 * JSON Object Constructor 4406 * @param jo A Json-Object having data about an instance of {@code 'DirectTCPSocketOptions'}. 4407 */ 4408 public DirectTCPSocketOptions (JsonObject jo) 4409 { 4410 this.noDelay = ReadPrimJSON.getBoolean(jo, "noDelay"); 4411 this.keepAliveDelay = ReadNumberJSON.get(jo, "keepAliveDelay", true, false); 4412 this.sendBufferSize = ReadNumberJSON.get(jo, "sendBufferSize", true, false); 4413 this.receiveBufferSize = ReadNumberJSON.get(jo, "receiveBufferSize", true, false); 4414 this.dnsQueryType = ReadJSON.getString(jo, "dnsQueryType", true, false); 4415 } 4416 4417 4418 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4419 public boolean equals(Object other) 4420 { 4421 if (this == other) return true; 4422 if (other == null) return false; 4423 if (other.getClass() != this.getClass()) return false; 4424 4425 DirectTCPSocketOptions o = (DirectTCPSocketOptions) other; 4426 4427 return 4428 (this.noDelay == o.noDelay) 4429 && Objects.equals(this.keepAliveDelay, o.keepAliveDelay) 4430 && Objects.equals(this.sendBufferSize, o.sendBufferSize) 4431 && Objects.equals(this.receiveBufferSize, o.receiveBufferSize) 4432 && Objects.equals(this.dnsQueryType, o.dnsQueryType); 4433 } 4434 4435 /** Generates a Hash-Code for {@code 'this'} instance */ 4436 public int hashCode() 4437 { 4438 return 4439 (this.noDelay ? 1 : 0) 4440 + Objects.hashCode(this.keepAliveDelay) 4441 + Objects.hashCode(this.sendBufferSize) 4442 + Objects.hashCode(this.receiveBufferSize) 4443 + Objects.hashCode(this.dnsQueryType); 4444 } 4445 } 4446 4447 /** 4448 * <CODE>[No Description Provided by Google]</CODE> 4449 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4450 */ 4451 public static class DirectUDPSocketOptions 4452 extends BaseType 4453 implements java.io.Serializable 4454 { 4455 /** For Object Serialization. java.io.Serializable */ 4456 protected static final long serialVersionUID = 1; 4457 4458 public boolean[] optionals() 4459 { return new boolean[] { true, true, true, true, true, true, true, }; } 4460 4461 /** 4462 * <CODE>[No Description Provided by Google]</CODE> 4463 * <BR /><B CLASS=Opt>OPTIONAL</B> 4464 */ 4465 public final String remoteAddr; 4466 4467 /** 4468 * Unsigned int 16. 4469 * <BR /><B CLASS=Opt>OPTIONAL</B> 4470 */ 4471 public final Integer remotePort; 4472 4473 /** 4474 * <CODE>[No Description Provided by Google]</CODE> 4475 * <BR /><B CLASS=Opt>OPTIONAL</B> 4476 */ 4477 public final String localAddr; 4478 4479 /** 4480 * Unsigned int 16. 4481 * <BR /><B CLASS=Opt>OPTIONAL</B> 4482 */ 4483 public final Integer localPort; 4484 4485 /** 4486 * <CODE>[No Description Provided by Google]</CODE> 4487 * <BR /><B CLASS=Opt>OPTIONAL</B> 4488 */ 4489 public final String dnsQueryType; 4490 4491 /** 4492 * Expected to be unsigned integer. 4493 * <BR /><B CLASS=Opt>OPTIONAL</B> 4494 */ 4495 public final Number sendBufferSize; 4496 4497 /** 4498 * Expected to be unsigned integer. 4499 * <BR /><B CLASS=Opt>OPTIONAL</B> 4500 */ 4501 public final Number receiveBufferSize; 4502 4503 /** 4504 * Constructor 4505 * 4506 * @param remoteAddr - 4507 * <BR /><B CLASS=Opt>OPTIONAL</B> 4508 * 4509 * @param remotePort Unsigned int 16. 4510 * <BR /><B CLASS=Opt>OPTIONAL</B> 4511 * 4512 * @param localAddr - 4513 * <BR /><B CLASS=Opt>OPTIONAL</B> 4514 * 4515 * @param localPort Unsigned int 16. 4516 * <BR /><B CLASS=Opt>OPTIONAL</B> 4517 * 4518 * @param dnsQueryType - 4519 * <BR /><B CLASS=Opt>OPTIONAL</B> 4520 * 4521 * @param sendBufferSize Expected to be unsigned integer. 4522 * <BR /><B CLASS=Opt>OPTIONAL</B> 4523 * 4524 * @param receiveBufferSize Expected to be unsigned integer. 4525 * <BR /><B CLASS=Opt>OPTIONAL</B> 4526 */ 4527 public DirectUDPSocketOptions( 4528 String remoteAddr, Integer remotePort, String localAddr, Integer localPort, 4529 String dnsQueryType, Number sendBufferSize, Number receiveBufferSize 4530 ) 4531 { 4532 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4533 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4534 4535 THROWS.checkIAE("dnsQueryType", dnsQueryType, "Network.DirectSocketDnsQueryType", Network.DirectSocketDnsQueryType); 4536 4537 this.remoteAddr = remoteAddr; 4538 this.remotePort = remotePort; 4539 this.localAddr = localAddr; 4540 this.localPort = localPort; 4541 this.dnsQueryType = dnsQueryType; 4542 this.sendBufferSize = sendBufferSize; 4543 this.receiveBufferSize = receiveBufferSize; 4544 } 4545 4546 /** 4547 * JSON Object Constructor 4548 * @param jo A Json-Object having data about an instance of {@code 'DirectUDPSocketOptions'}. 4549 */ 4550 public DirectUDPSocketOptions (JsonObject jo) 4551 { 4552 this.remoteAddr = ReadJSON.getString(jo, "remoteAddr", true, false); 4553 this.remotePort = ReadBoxedJSON.getInteger(jo, "remotePort", true); 4554 this.localAddr = ReadJSON.getString(jo, "localAddr", true, false); 4555 this.localPort = ReadBoxedJSON.getInteger(jo, "localPort", true); 4556 this.dnsQueryType = ReadJSON.getString(jo, "dnsQueryType", true, false); 4557 this.sendBufferSize = ReadNumberJSON.get(jo, "sendBufferSize", true, false); 4558 this.receiveBufferSize = ReadNumberJSON.get(jo, "receiveBufferSize", true, false); 4559 } 4560 4561 4562 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4563 public boolean equals(Object other) 4564 { 4565 if (this == other) return true; 4566 if (other == null) return false; 4567 if (other.getClass() != this.getClass()) return false; 4568 4569 DirectUDPSocketOptions o = (DirectUDPSocketOptions) other; 4570 4571 return 4572 Objects.equals(this.remoteAddr, o.remoteAddr) 4573 && Objects.equals(this.remotePort, o.remotePort) 4574 && Objects.equals(this.localAddr, o.localAddr) 4575 && Objects.equals(this.localPort, o.localPort) 4576 && Objects.equals(this.dnsQueryType, o.dnsQueryType) 4577 && Objects.equals(this.sendBufferSize, o.sendBufferSize) 4578 && Objects.equals(this.receiveBufferSize, o.receiveBufferSize); 4579 } 4580 4581 /** Generates a Hash-Code for {@code 'this'} instance */ 4582 public int hashCode() 4583 { 4584 return 4585 Objects.hashCode(this.remoteAddr) 4586 + Objects.hashCode(this.remotePort) 4587 + Objects.hashCode(this.localAddr) 4588 + Objects.hashCode(this.localPort) 4589 + Objects.hashCode(this.dnsQueryType) 4590 + Objects.hashCode(this.sendBufferSize) 4591 + Objects.hashCode(this.receiveBufferSize); 4592 } 4593 } 4594 4595 /** 4596 * <CODE>[No Description Provided by Google]</CODE> 4597 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4598 */ 4599 public static class DirectUDPMessage 4600 extends BaseType 4601 implements java.io.Serializable 4602 { 4603 /** For Object Serialization. java.io.Serializable */ 4604 protected static final long serialVersionUID = 1; 4605 4606 public boolean[] optionals() 4607 { return new boolean[] { false, true, true, }; } 4608 4609 /** <CODE>[No Description Provided by Google]</CODE> */ 4610 public final String data; 4611 4612 /** 4613 * Null for connected mode. 4614 * <BR /><B CLASS=Opt>OPTIONAL</B> 4615 */ 4616 public final String remoteAddr; 4617 4618 /** 4619 * Null for connected mode. 4620 * Expected to be unsigned integer. 4621 * <BR /><B CLASS=Opt>OPTIONAL</B> 4622 */ 4623 public final Integer remotePort; 4624 4625 /** 4626 * Constructor 4627 * 4628 * @param data - 4629 * 4630 * @param remoteAddr Null for connected mode. 4631 * <BR /><B CLASS=Opt>OPTIONAL</B> 4632 * 4633 * @param remotePort 4634 * Null for connected mode. 4635 * Expected to be unsigned integer. 4636 * <BR /><B CLASS=Opt>OPTIONAL</B> 4637 */ 4638 public DirectUDPMessage(String data, String remoteAddr, Integer remotePort) 4639 { 4640 // Exception-Check(s) to ensure that if any parameters which are not declared as 4641 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4642 4643 if (data == null) THROWS.throwNPE("data"); 4644 4645 this.data = data; 4646 this.remoteAddr = remoteAddr; 4647 this.remotePort = remotePort; 4648 } 4649 4650 /** 4651 * JSON Object Constructor 4652 * @param jo A Json-Object having data about an instance of {@code 'DirectUDPMessage'}. 4653 */ 4654 public DirectUDPMessage (JsonObject jo) 4655 { 4656 this.data = ReadJSON.getString(jo, "data", false, true); 4657 this.remoteAddr = ReadJSON.getString(jo, "remoteAddr", true, false); 4658 this.remotePort = ReadBoxedJSON.getInteger(jo, "remotePort", true); 4659 } 4660 4661 4662 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4663 public boolean equals(Object other) 4664 { 4665 if (this == other) return true; 4666 if (other == null) return false; 4667 if (other.getClass() != this.getClass()) return false; 4668 4669 DirectUDPMessage o = (DirectUDPMessage) other; 4670 4671 return 4672 Objects.equals(this.data, o.data) 4673 && Objects.equals(this.remoteAddr, o.remoteAddr) 4674 && Objects.equals(this.remotePort, o.remotePort); 4675 } 4676 4677 /** Generates a Hash-Code for {@code 'this'} instance */ 4678 public int hashCode() 4679 { 4680 return 4681 Objects.hashCode(this.data) 4682 + Objects.hashCode(this.remoteAddr) 4683 + Objects.hashCode(this.remotePort); 4684 } 4685 } 4686 4687 /** 4688 * <CODE>[No Description Provided by Google]</CODE> 4689 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4690 */ 4691 public static class ConnectTiming 4692 extends BaseType 4693 implements java.io.Serializable 4694 { 4695 /** For Object Serialization. java.io.Serializable */ 4696 protected static final long serialVersionUID = 1; 4697 4698 public boolean[] optionals() 4699 { return new boolean[] { false, }; } 4700 4701 /** 4702 * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in 4703 * milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for 4704 * the same request (but not for redirected requests). 4705 */ 4706 public final Number requestTime; 4707 4708 /** 4709 * Constructor 4710 * 4711 * @param requestTime 4712 * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in 4713 * milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for 4714 * the same request (but not for redirected requests). 4715 */ 4716 public ConnectTiming(Number requestTime) 4717 { 4718 // Exception-Check(s) to ensure that if any parameters which are not declared as 4719 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4720 4721 if (requestTime == null) THROWS.throwNPE("requestTime"); 4722 4723 this.requestTime = requestTime; 4724 } 4725 4726 /** 4727 * JSON Object Constructor 4728 * @param jo A Json-Object having data about an instance of {@code 'ConnectTiming'}. 4729 */ 4730 public ConnectTiming (JsonObject jo) 4731 { 4732 this.requestTime = ReadNumberJSON.get(jo, "requestTime", false, true); 4733 } 4734 4735 4736 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4737 public boolean equals(Object other) 4738 { 4739 if (this == other) return true; 4740 if (other == null) return false; 4741 if (other.getClass() != this.getClass()) return false; 4742 4743 ConnectTiming o = (ConnectTiming) other; 4744 4745 return 4746 Objects.equals(this.requestTime, o.requestTime); 4747 } 4748 4749 /** Generates a Hash-Code for {@code 'this'} instance */ 4750 public int hashCode() 4751 { 4752 return 4753 Objects.hashCode(this.requestTime); 4754 } 4755 } 4756 4757 /** 4758 * <CODE>[No Description Provided by Google]</CODE> 4759 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4760 */ 4761 public static class ClientSecurityState 4762 extends BaseType 4763 implements java.io.Serializable 4764 { 4765 /** For Object Serialization. java.io.Serializable */ 4766 protected static final long serialVersionUID = 1; 4767 4768 public boolean[] optionals() 4769 { return new boolean[] { false, false, false, }; } 4770 4771 /** <CODE>[No Description Provided by Google]</CODE> */ 4772 public final boolean initiatorIsSecureContext; 4773 4774 /** <CODE>[No Description Provided by Google]</CODE> */ 4775 public final String initiatorIPAddressSpace; 4776 4777 /** <CODE>[No Description Provided by Google]</CODE> */ 4778 public final String privateNetworkRequestPolicy; 4779 4780 /** 4781 * Constructor 4782 * 4783 * @param initiatorIsSecureContext - 4784 * 4785 * @param initiatorIPAddressSpace - 4786 * 4787 * @param privateNetworkRequestPolicy - 4788 */ 4789 public ClientSecurityState( 4790 boolean initiatorIsSecureContext, String initiatorIPAddressSpace, 4791 String privateNetworkRequestPolicy 4792 ) 4793 { 4794 // Exception-Check(s) to ensure that if any parameters which are not declared as 4795 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4796 4797 if (initiatorIPAddressSpace == null) THROWS.throwNPE("initiatorIPAddressSpace"); 4798 if (privateNetworkRequestPolicy == null) THROWS.throwNPE("privateNetworkRequestPolicy"); 4799 4800 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4801 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4802 4803 THROWS.checkIAE("initiatorIPAddressSpace", initiatorIPAddressSpace, "Network.IPAddressSpace", Network.IPAddressSpace); 4804 THROWS.checkIAE("privateNetworkRequestPolicy", privateNetworkRequestPolicy, "Network.PrivateNetworkRequestPolicy", Network.PrivateNetworkRequestPolicy); 4805 4806 this.initiatorIsSecureContext = initiatorIsSecureContext; 4807 this.initiatorIPAddressSpace = initiatorIPAddressSpace; 4808 this.privateNetworkRequestPolicy = privateNetworkRequestPolicy; 4809 } 4810 4811 /** 4812 * JSON Object Constructor 4813 * @param jo A Json-Object having data about an instance of {@code 'ClientSecurityState'}. 4814 */ 4815 public ClientSecurityState (JsonObject jo) 4816 { 4817 this.initiatorIsSecureContext = ReadPrimJSON.getBoolean(jo, "initiatorIsSecureContext"); 4818 this.initiatorIPAddressSpace = ReadJSON.getString(jo, "initiatorIPAddressSpace", false, true); 4819 this.privateNetworkRequestPolicy = ReadJSON.getString(jo, "privateNetworkRequestPolicy", false, true); 4820 } 4821 4822 4823 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4824 public boolean equals(Object other) 4825 { 4826 if (this == other) return true; 4827 if (other == null) return false; 4828 if (other.getClass() != this.getClass()) return false; 4829 4830 ClientSecurityState o = (ClientSecurityState) other; 4831 4832 return 4833 (this.initiatorIsSecureContext == o.initiatorIsSecureContext) 4834 && Objects.equals(this.initiatorIPAddressSpace, o.initiatorIPAddressSpace) 4835 && Objects.equals(this.privateNetworkRequestPolicy, o.privateNetworkRequestPolicy); 4836 } 4837 4838 /** Generates a Hash-Code for {@code 'this'} instance */ 4839 public int hashCode() 4840 { 4841 return 4842 (this.initiatorIsSecureContext ? 1 : 0) 4843 + Objects.hashCode(this.initiatorIPAddressSpace) 4844 + Objects.hashCode(this.privateNetworkRequestPolicy); 4845 } 4846 } 4847 4848 /** 4849 * <CODE>[No Description Provided by Google]</CODE> 4850 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4851 */ 4852 public static class CrossOriginOpenerPolicyStatus 4853 extends BaseType 4854 implements java.io.Serializable 4855 { 4856 /** For Object Serialization. java.io.Serializable */ 4857 protected static final long serialVersionUID = 1; 4858 4859 public boolean[] optionals() 4860 { return new boolean[] { false, false, true, true, }; } 4861 4862 /** <CODE>[No Description Provided by Google]</CODE> */ 4863 public final String value; 4864 4865 /** <CODE>[No Description Provided by Google]</CODE> */ 4866 public final String reportOnlyValue; 4867 4868 /** 4869 * <CODE>[No Description Provided by Google]</CODE> 4870 * <BR /><B CLASS=Opt>OPTIONAL</B> 4871 */ 4872 public final String reportingEndpoint; 4873 4874 /** 4875 * <CODE>[No Description Provided by Google]</CODE> 4876 * <BR /><B CLASS=Opt>OPTIONAL</B> 4877 */ 4878 public final String reportOnlyReportingEndpoint; 4879 4880 /** 4881 * Constructor 4882 * 4883 * @param value - 4884 * 4885 * @param reportOnlyValue - 4886 * 4887 * @param reportingEndpoint - 4888 * <BR /><B CLASS=Opt>OPTIONAL</B> 4889 * 4890 * @param reportOnlyReportingEndpoint - 4891 * <BR /><B CLASS=Opt>OPTIONAL</B> 4892 */ 4893 public CrossOriginOpenerPolicyStatus( 4894 String value, String reportOnlyValue, String reportingEndpoint, 4895 String reportOnlyReportingEndpoint 4896 ) 4897 { 4898 // Exception-Check(s) to ensure that if any parameters which are not declared as 4899 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 4900 4901 if (value == null) THROWS.throwNPE("value"); 4902 if (reportOnlyValue == null) THROWS.throwNPE("reportOnlyValue"); 4903 4904 // Exception-Check(s) to ensure that if any parameters which must adhere to a 4905 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 4906 4907 THROWS.checkIAE("value", value, "Network.CrossOriginOpenerPolicyValue", Network.CrossOriginOpenerPolicyValue); 4908 THROWS.checkIAE("reportOnlyValue", reportOnlyValue, "Network.CrossOriginOpenerPolicyValue", Network.CrossOriginOpenerPolicyValue); 4909 4910 this.value = value; 4911 this.reportOnlyValue = reportOnlyValue; 4912 this.reportingEndpoint = reportingEndpoint; 4913 this.reportOnlyReportingEndpoint = reportOnlyReportingEndpoint; 4914 } 4915 4916 /** 4917 * JSON Object Constructor 4918 * @param jo A Json-Object having data about an instance of {@code 'CrossOriginOpenerPolicyStatus'}. 4919 */ 4920 public CrossOriginOpenerPolicyStatus (JsonObject jo) 4921 { 4922 this.value = ReadJSON.getString(jo, "value", false, true); 4923 this.reportOnlyValue = ReadJSON.getString(jo, "reportOnlyValue", false, true); 4924 this.reportingEndpoint = ReadJSON.getString(jo, "reportingEndpoint", true, false); 4925 this.reportOnlyReportingEndpoint = ReadJSON.getString(jo, "reportOnlyReportingEndpoint", true, false); 4926 } 4927 4928 4929 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 4930 public boolean equals(Object other) 4931 { 4932 if (this == other) return true; 4933 if (other == null) return false; 4934 if (other.getClass() != this.getClass()) return false; 4935 4936 CrossOriginOpenerPolicyStatus o = (CrossOriginOpenerPolicyStatus) other; 4937 4938 return 4939 Objects.equals(this.value, o.value) 4940 && Objects.equals(this.reportOnlyValue, o.reportOnlyValue) 4941 && Objects.equals(this.reportingEndpoint, o.reportingEndpoint) 4942 && Objects.equals(this.reportOnlyReportingEndpoint, o.reportOnlyReportingEndpoint); 4943 } 4944 4945 /** Generates a Hash-Code for {@code 'this'} instance */ 4946 public int hashCode() 4947 { 4948 return 4949 Objects.hashCode(this.value) 4950 + Objects.hashCode(this.reportOnlyValue) 4951 + Objects.hashCode(this.reportingEndpoint) 4952 + Objects.hashCode(this.reportOnlyReportingEndpoint); 4953 } 4954 } 4955 4956 /** 4957 * <CODE>[No Description Provided by Google]</CODE> 4958 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 4959 */ 4960 public static class CrossOriginEmbedderPolicyStatus 4961 extends BaseType 4962 implements java.io.Serializable 4963 { 4964 /** For Object Serialization. java.io.Serializable */ 4965 protected static final long serialVersionUID = 1; 4966 4967 public boolean[] optionals() 4968 { return new boolean[] { false, false, true, true, }; } 4969 4970 /** <CODE>[No Description Provided by Google]</CODE> */ 4971 public final String value; 4972 4973 /** <CODE>[No Description Provided by Google]</CODE> */ 4974 public final String reportOnlyValue; 4975 4976 /** 4977 * <CODE>[No Description Provided by Google]</CODE> 4978 * <BR /><B CLASS=Opt>OPTIONAL</B> 4979 */ 4980 public final String reportingEndpoint; 4981 4982 /** 4983 * <CODE>[No Description Provided by Google]</CODE> 4984 * <BR /><B CLASS=Opt>OPTIONAL</B> 4985 */ 4986 public final String reportOnlyReportingEndpoint; 4987 4988 /** 4989 * Constructor 4990 * 4991 * @param value - 4992 * 4993 * @param reportOnlyValue - 4994 * 4995 * @param reportingEndpoint - 4996 * <BR /><B CLASS=Opt>OPTIONAL</B> 4997 * 4998 * @param reportOnlyReportingEndpoint - 4999 * <BR /><B CLASS=Opt>OPTIONAL</B> 5000 */ 5001 public CrossOriginEmbedderPolicyStatus( 5002 String value, String reportOnlyValue, String reportingEndpoint, 5003 String reportOnlyReportingEndpoint 5004 ) 5005 { 5006 // Exception-Check(s) to ensure that if any parameters which are not declared as 5007 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5008 5009 if (value == null) THROWS.throwNPE("value"); 5010 if (reportOnlyValue == null) THROWS.throwNPE("reportOnlyValue"); 5011 5012 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5013 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5014 5015 THROWS.checkIAE("value", value, "Network.CrossOriginEmbedderPolicyValue", Network.CrossOriginEmbedderPolicyValue); 5016 THROWS.checkIAE("reportOnlyValue", reportOnlyValue, "Network.CrossOriginEmbedderPolicyValue", Network.CrossOriginEmbedderPolicyValue); 5017 5018 this.value = value; 5019 this.reportOnlyValue = reportOnlyValue; 5020 this.reportingEndpoint = reportingEndpoint; 5021 this.reportOnlyReportingEndpoint = reportOnlyReportingEndpoint; 5022 } 5023 5024 /** 5025 * JSON Object Constructor 5026 * @param jo A Json-Object having data about an instance of {@code 'CrossOriginEmbedderPolicyStatus'}. 5027 */ 5028 public CrossOriginEmbedderPolicyStatus (JsonObject jo) 5029 { 5030 this.value = ReadJSON.getString(jo, "value", false, true); 5031 this.reportOnlyValue = ReadJSON.getString(jo, "reportOnlyValue", false, true); 5032 this.reportingEndpoint = ReadJSON.getString(jo, "reportingEndpoint", true, false); 5033 this.reportOnlyReportingEndpoint = ReadJSON.getString(jo, "reportOnlyReportingEndpoint", true, false); 5034 } 5035 5036 5037 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5038 public boolean equals(Object other) 5039 { 5040 if (this == other) return true; 5041 if (other == null) return false; 5042 if (other.getClass() != this.getClass()) return false; 5043 5044 CrossOriginEmbedderPolicyStatus o = (CrossOriginEmbedderPolicyStatus) other; 5045 5046 return 5047 Objects.equals(this.value, o.value) 5048 && Objects.equals(this.reportOnlyValue, o.reportOnlyValue) 5049 && Objects.equals(this.reportingEndpoint, o.reportingEndpoint) 5050 && Objects.equals(this.reportOnlyReportingEndpoint, o.reportOnlyReportingEndpoint); 5051 } 5052 5053 /** Generates a Hash-Code for {@code 'this'} instance */ 5054 public int hashCode() 5055 { 5056 return 5057 Objects.hashCode(this.value) 5058 + Objects.hashCode(this.reportOnlyValue) 5059 + Objects.hashCode(this.reportingEndpoint) 5060 + Objects.hashCode(this.reportOnlyReportingEndpoint); 5061 } 5062 } 5063 5064 /** 5065 * <CODE>[No Description Provided by Google]</CODE> 5066 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5067 */ 5068 public static class ContentSecurityPolicyStatus 5069 extends BaseType 5070 implements java.io.Serializable 5071 { 5072 /** For Object Serialization. java.io.Serializable */ 5073 protected static final long serialVersionUID = 1; 5074 5075 public boolean[] optionals() 5076 { return new boolean[] { false, false, false, }; } 5077 5078 /** <CODE>[No Description Provided by Google]</CODE> */ 5079 public final String effectiveDirectives; 5080 5081 /** <CODE>[No Description Provided by Google]</CODE> */ 5082 public final boolean isEnforced; 5083 5084 /** <CODE>[No Description Provided by Google]</CODE> */ 5085 public final String source; 5086 5087 /** 5088 * Constructor 5089 * 5090 * @param effectiveDirectives - 5091 * 5092 * @param isEnforced - 5093 * 5094 * @param source - 5095 */ 5096 public ContentSecurityPolicyStatus 5097 (String effectiveDirectives, boolean isEnforced, String source) 5098 { 5099 // Exception-Check(s) to ensure that if any parameters which are not declared as 5100 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5101 5102 if (effectiveDirectives == null) THROWS.throwNPE("effectiveDirectives"); 5103 if (source == null) THROWS.throwNPE("source"); 5104 5105 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5106 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5107 5108 THROWS.checkIAE("source", source, "Network.ContentSecurityPolicySource", Network.ContentSecurityPolicySource); 5109 5110 this.effectiveDirectives = effectiveDirectives; 5111 this.isEnforced = isEnforced; 5112 this.source = source; 5113 } 5114 5115 /** 5116 * JSON Object Constructor 5117 * @param jo A Json-Object having data about an instance of {@code 'ContentSecurityPolicyStatus'}. 5118 */ 5119 public ContentSecurityPolicyStatus (JsonObject jo) 5120 { 5121 this.effectiveDirectives = ReadJSON.getString(jo, "effectiveDirectives", false, true); 5122 this.isEnforced = ReadPrimJSON.getBoolean(jo, "isEnforced"); 5123 this.source = ReadJSON.getString(jo, "source", false, true); 5124 } 5125 5126 5127 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5128 public boolean equals(Object other) 5129 { 5130 if (this == other) return true; 5131 if (other == null) return false; 5132 if (other.getClass() != this.getClass()) return false; 5133 5134 ContentSecurityPolicyStatus o = (ContentSecurityPolicyStatus) other; 5135 5136 return 5137 Objects.equals(this.effectiveDirectives, o.effectiveDirectives) 5138 && (this.isEnforced == o.isEnforced) 5139 && Objects.equals(this.source, o.source); 5140 } 5141 5142 /** Generates a Hash-Code for {@code 'this'} instance */ 5143 public int hashCode() 5144 { 5145 return 5146 Objects.hashCode(this.effectiveDirectives) 5147 + (this.isEnforced ? 1 : 0) 5148 + Objects.hashCode(this.source); 5149 } 5150 } 5151 5152 /** 5153 * <CODE>[No Description Provided by Google]</CODE> 5154 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5155 */ 5156 public static class SecurityIsolationStatus 5157 extends BaseType 5158 implements java.io.Serializable 5159 { 5160 /** For Object Serialization. java.io.Serializable */ 5161 protected static final long serialVersionUID = 1; 5162 5163 public boolean[] optionals() 5164 { return new boolean[] { true, true, true, }; } 5165 5166 /** 5167 * <CODE>[No Description Provided by Google]</CODE> 5168 * <BR /><B CLASS=Opt>OPTIONAL</B> 5169 */ 5170 public final Network.CrossOriginOpenerPolicyStatus coop; 5171 5172 /** 5173 * <CODE>[No Description Provided by Google]</CODE> 5174 * <BR /><B CLASS=Opt>OPTIONAL</B> 5175 */ 5176 public final Network.CrossOriginEmbedderPolicyStatus coep; 5177 5178 /** 5179 * <CODE>[No Description Provided by Google]</CODE> 5180 * <BR /><B CLASS=Opt>OPTIONAL</B> 5181 */ 5182 public final Network.ContentSecurityPolicyStatus[] csp; 5183 5184 /** 5185 * Constructor 5186 * 5187 * @param coop - 5188 * <BR /><B CLASS=Opt>OPTIONAL</B> 5189 * 5190 * @param coep - 5191 * <BR /><B CLASS=Opt>OPTIONAL</B> 5192 * 5193 * @param csp - 5194 * <BR /><B CLASS=Opt>OPTIONAL</B> 5195 */ 5196 public SecurityIsolationStatus( 5197 Network.CrossOriginOpenerPolicyStatus coop, 5198 Network.CrossOriginEmbedderPolicyStatus coep, 5199 Network.ContentSecurityPolicyStatus[] csp 5200 ) 5201 { 5202 this.coop = coop; 5203 this.coep = coep; 5204 this.csp = csp; 5205 } 5206 5207 /** 5208 * JSON Object Constructor 5209 * @param jo A Json-Object having data about an instance of {@code 'SecurityIsolationStatus'}. 5210 */ 5211 public SecurityIsolationStatus (JsonObject jo) 5212 { 5213 this.coop = ReadJSON.getObject(jo, "coop", Network.CrossOriginOpenerPolicyStatus.class, true, false); 5214 this.coep = ReadJSON.getObject(jo, "coep", Network.CrossOriginEmbedderPolicyStatus.class, true, false); 5215 this.csp = (jo.getJsonArray("csp") == null) 5216 ? null 5217 : RJArrIntoStream.objArr(jo.getJsonArray("csp"), null, 0, Network.ContentSecurityPolicyStatus.class).toArray(Network.ContentSecurityPolicyStatus[]::new); 5218 5219 } 5220 5221 5222 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5223 public boolean equals(Object other) 5224 { 5225 if (this == other) return true; 5226 if (other == null) return false; 5227 if (other.getClass() != this.getClass()) return false; 5228 5229 SecurityIsolationStatus o = (SecurityIsolationStatus) other; 5230 5231 return 5232 Objects.equals(this.coop, o.coop) 5233 && Objects.equals(this.coep, o.coep) 5234 && Arrays.deepEquals(this.csp, o.csp); 5235 } 5236 5237 /** Generates a Hash-Code for {@code 'this'} instance */ 5238 public int hashCode() 5239 { 5240 return 5241 this.coop.hashCode() 5242 + this.coep.hashCode() 5243 + Arrays.deepHashCode(this.csp); 5244 } 5245 } 5246 5247 /** 5248 * An object representing a report generated by the Reporting API. 5249 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5250 */ 5251 public static class ReportingApiReport 5252 extends BaseType 5253 implements java.io.Serializable 5254 { 5255 /** For Object Serialization. java.io.Serializable */ 5256 protected static final long serialVersionUID = 1; 5257 5258 public boolean[] optionals() 5259 { return new boolean[] { false, false, false, false, false, false, false, false, false, }; } 5260 5261 /** <CODE>[No Description Provided by Google]</CODE> */ 5262 public final String id; 5263 5264 /** The URL of the document that triggered the report. */ 5265 public final String initiatorUrl; 5266 5267 /** The name of the endpoint group that should be used to deliver the report. */ 5268 public final String destination; 5269 5270 /** The type of the report (specifies the set of data that is contained in the report body). */ 5271 public final String type; 5272 5273 /** When the report was generated. */ 5274 public final Number timestamp; 5275 5276 /** How many uploads deep the related request was. */ 5277 public final int depth; 5278 5279 /** The number of delivery attempts made so far, not including an active attempt. */ 5280 public final int completedAttempts; 5281 5282 /** <CODE>[No Description Provided by Google]</CODE> */ 5283 public final JsonObject body; 5284 5285 /** <CODE>[No Description Provided by Google]</CODE> */ 5286 public final String status; 5287 5288 /** 5289 * Constructor 5290 * 5291 * @param id - 5292 * 5293 * @param initiatorUrl The URL of the document that triggered the report. 5294 * 5295 * @param destination The name of the endpoint group that should be used to deliver the report. 5296 * 5297 * @param type The type of the report (specifies the set of data that is contained in the report body). 5298 * 5299 * @param timestamp When the report was generated. 5300 * 5301 * @param depth How many uploads deep the related request was. 5302 * 5303 * @param completedAttempts The number of delivery attempts made so far, not including an active attempt. 5304 * 5305 * @param body - 5306 * 5307 * @param status - 5308 */ 5309 public ReportingApiReport( 5310 String id, String initiatorUrl, String destination, String type, Number timestamp, 5311 int depth, int completedAttempts, JsonObject body, String status 5312 ) 5313 { 5314 // Exception-Check(s) to ensure that if any parameters which are not declared as 5315 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5316 5317 if (id == null) THROWS.throwNPE("id"); 5318 if (initiatorUrl == null) THROWS.throwNPE("initiatorUrl"); 5319 if (destination == null) THROWS.throwNPE("destination"); 5320 if (type == null) THROWS.throwNPE("type"); 5321 if (timestamp == null) THROWS.throwNPE("timestamp"); 5322 if (body == null) THROWS.throwNPE("body"); 5323 if (status == null) THROWS.throwNPE("status"); 5324 5325 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5326 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5327 5328 THROWS.checkIAE("status", status, "Network.ReportStatus", Network.ReportStatus); 5329 5330 this.id = id; 5331 this.initiatorUrl = initiatorUrl; 5332 this.destination = destination; 5333 this.type = type; 5334 this.timestamp = timestamp; 5335 this.depth = depth; 5336 this.completedAttempts = completedAttempts; 5337 this.body = body; 5338 this.status = status; 5339 } 5340 5341 /** 5342 * JSON Object Constructor 5343 * @param jo A Json-Object having data about an instance of {@code 'ReportingApiReport'}. 5344 */ 5345 public ReportingApiReport (JsonObject jo) 5346 { 5347 this.id = ReadJSON.getString(jo, "id", false, true); 5348 this.initiatorUrl = ReadJSON.getString(jo, "initiatorUrl", false, true); 5349 this.destination = ReadJSON.getString(jo, "destination", false, true); 5350 this.type = ReadJSON.getString(jo, "type", false, true); 5351 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 5352 this.depth = ReadPrimJSON.getInt(jo, "depth"); 5353 this.completedAttempts = ReadPrimJSON.getInt(jo, "completedAttempts"); 5354 this.body = jo.getJsonObject("body"); 5355 this.status = ReadJSON.getString(jo, "status", false, true); 5356 } 5357 5358 5359 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5360 public boolean equals(Object other) 5361 { 5362 if (this == other) return true; 5363 if (other == null) return false; 5364 if (other.getClass() != this.getClass()) return false; 5365 5366 ReportingApiReport o = (ReportingApiReport) other; 5367 5368 return 5369 Objects.equals(this.id, o.id) 5370 && Objects.equals(this.initiatorUrl, o.initiatorUrl) 5371 && Objects.equals(this.destination, o.destination) 5372 && Objects.equals(this.type, o.type) 5373 && Objects.equals(this.timestamp, o.timestamp) 5374 && (this.depth == o.depth) 5375 && (this.completedAttempts == o.completedAttempts) 5376 && Objects.equals(this.body, o.body) 5377 && Objects.equals(this.status, o.status); 5378 } 5379 5380 /** Generates a Hash-Code for {@code 'this'} instance */ 5381 public int hashCode() 5382 { 5383 return 5384 Objects.hashCode(this.id) 5385 + Objects.hashCode(this.initiatorUrl) 5386 + Objects.hashCode(this.destination) 5387 + Objects.hashCode(this.type) 5388 + Objects.hashCode(this.timestamp) 5389 + this.depth 5390 + this.completedAttempts 5391 + Objects.hashCode(this.body) 5392 + Objects.hashCode(this.status); 5393 } 5394 } 5395 5396 /** 5397 * <CODE>[No Description Provided by Google]</CODE> 5398 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5399 */ 5400 public static class ReportingApiEndpoint 5401 extends BaseType 5402 implements java.io.Serializable 5403 { 5404 /** For Object Serialization. java.io.Serializable */ 5405 protected static final long serialVersionUID = 1; 5406 5407 public boolean[] optionals() 5408 { return new boolean[] { false, false, }; } 5409 5410 /** The URL of the endpoint to which reports may be delivered. */ 5411 public final String url; 5412 5413 /** Name of the endpoint group. */ 5414 public final String groupName; 5415 5416 /** 5417 * Constructor 5418 * 5419 * @param url The URL of the endpoint to which reports may be delivered. 5420 * 5421 * @param groupName Name of the endpoint group. 5422 */ 5423 public ReportingApiEndpoint(String url, String groupName) 5424 { 5425 // Exception-Check(s) to ensure that if any parameters which are not declared as 5426 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5427 5428 if (url == null) THROWS.throwNPE("url"); 5429 if (groupName == null) THROWS.throwNPE("groupName"); 5430 5431 this.url = url; 5432 this.groupName = groupName; 5433 } 5434 5435 /** 5436 * JSON Object Constructor 5437 * @param jo A Json-Object having data about an instance of {@code 'ReportingApiEndpoint'}. 5438 */ 5439 public ReportingApiEndpoint (JsonObject jo) 5440 { 5441 this.url = ReadJSON.getString(jo, "url", false, true); 5442 this.groupName = ReadJSON.getString(jo, "groupName", false, true); 5443 } 5444 5445 5446 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5447 public boolean equals(Object other) 5448 { 5449 if (this == other) return true; 5450 if (other == null) return false; 5451 if (other.getClass() != this.getClass()) return false; 5452 5453 ReportingApiEndpoint o = (ReportingApiEndpoint) other; 5454 5455 return 5456 Objects.equals(this.url, o.url) 5457 && Objects.equals(this.groupName, o.groupName); 5458 } 5459 5460 /** Generates a Hash-Code for {@code 'this'} instance */ 5461 public int hashCode() 5462 { 5463 return 5464 Objects.hashCode(this.url) 5465 + Objects.hashCode(this.groupName); 5466 } 5467 } 5468 5469 /** 5470 * An object providing the result of a network resource load. 5471 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5472 */ 5473 public static class LoadNetworkResourcePageResult 5474 extends BaseType 5475 implements java.io.Serializable 5476 { 5477 /** For Object Serialization. java.io.Serializable */ 5478 protected static final long serialVersionUID = 1; 5479 5480 public boolean[] optionals() 5481 { return new boolean[] { false, true, true, true, true, true, }; } 5482 5483 /** <CODE>[No Description Provided by Google]</CODE> */ 5484 public final boolean success; 5485 5486 /** 5487 * Optional values used for error reporting. 5488 * <BR /><B CLASS=Opt>OPTIONAL</B> 5489 */ 5490 public final Number netError; 5491 5492 /** 5493 * <CODE>[No Description Provided by Google]</CODE> 5494 * <BR /><B CLASS=Opt>OPTIONAL</B> 5495 */ 5496 public final String netErrorName; 5497 5498 /** 5499 * <CODE>[No Description Provided by Google]</CODE> 5500 * <BR /><B CLASS=Opt>OPTIONAL</B> 5501 */ 5502 public final Number httpStatusCode; 5503 5504 /** 5505 * If successful, one of the following two fields holds the result. 5506 * <BR /><B CLASS=Opt>OPTIONAL</B> 5507 */ 5508 public final String stream; 5509 5510 /** 5511 * Response headers. 5512 * <BR /><B CLASS=Opt>OPTIONAL</B> 5513 */ 5514 public final JsonObject headers; 5515 5516 /** 5517 * Constructor 5518 * 5519 * @param success - 5520 * 5521 * @param netError Optional values used for error reporting. 5522 * <BR /><B CLASS=Opt>OPTIONAL</B> 5523 * 5524 * @param netErrorName - 5525 * <BR /><B CLASS=Opt>OPTIONAL</B> 5526 * 5527 * @param httpStatusCode - 5528 * <BR /><B CLASS=Opt>OPTIONAL</B> 5529 * 5530 * @param stream If successful, one of the following two fields holds the result. 5531 * <BR /><B CLASS=Opt>OPTIONAL</B> 5532 * 5533 * @param headers Response headers. 5534 * <BR /><B CLASS=Opt>OPTIONAL</B> 5535 */ 5536 public LoadNetworkResourcePageResult( 5537 boolean success, Number netError, String netErrorName, Number httpStatusCode, 5538 String stream, JsonObject headers 5539 ) 5540 { 5541 this.success = success; 5542 this.netError = netError; 5543 this.netErrorName = netErrorName; 5544 this.httpStatusCode = httpStatusCode; 5545 this.stream = stream; 5546 this.headers = headers; 5547 } 5548 5549 /** 5550 * JSON Object Constructor 5551 * @param jo A Json-Object having data about an instance of {@code 'LoadNetworkResourcePageResult'}. 5552 */ 5553 public LoadNetworkResourcePageResult (JsonObject jo) 5554 { 5555 this.success = ReadPrimJSON.getBoolean(jo, "success"); 5556 this.netError = ReadNumberJSON.get(jo, "netError", true, false); 5557 this.netErrorName = ReadJSON.getString(jo, "netErrorName", true, false); 5558 this.httpStatusCode = ReadNumberJSON.get(jo, "httpStatusCode", true, false); 5559 this.stream = ReadJSON.getString(jo, "stream", true, false); 5560 this.headers = jo.getJsonObject("headers"); 5561 } 5562 5563 5564 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5565 public boolean equals(Object other) 5566 { 5567 if (this == other) return true; 5568 if (other == null) return false; 5569 if (other.getClass() != this.getClass()) return false; 5570 5571 LoadNetworkResourcePageResult o = (LoadNetworkResourcePageResult) other; 5572 5573 return 5574 (this.success == o.success) 5575 && Objects.equals(this.netError, o.netError) 5576 && Objects.equals(this.netErrorName, o.netErrorName) 5577 && Objects.equals(this.httpStatusCode, o.httpStatusCode) 5578 && Objects.equals(this.stream, o.stream) 5579 && Objects.equals(this.headers, o.headers); 5580 } 5581 5582 /** Generates a Hash-Code for {@code 'this'} instance */ 5583 public int hashCode() 5584 { 5585 return 5586 (this.success ? 1 : 0) 5587 + Objects.hashCode(this.netError) 5588 + Objects.hashCode(this.netErrorName) 5589 + Objects.hashCode(this.httpStatusCode) 5590 + Objects.hashCode(this.stream) 5591 + this.headers.hashCode(); 5592 } 5593 } 5594 5595 /** 5596 * An options object that may be extended later to better support CORS, 5597 * CORB and streaming. 5598 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 5599 */ 5600 public static class LoadNetworkResourceOptions 5601 extends BaseType 5602 implements java.io.Serializable 5603 { 5604 /** For Object Serialization. java.io.Serializable */ 5605 protected static final long serialVersionUID = 1; 5606 5607 public boolean[] optionals() 5608 { return new boolean[] { false, false, }; } 5609 5610 /** <CODE>[No Description Provided by Google]</CODE> */ 5611 public final boolean disableCache; 5612 5613 /** <CODE>[No Description Provided by Google]</CODE> */ 5614 public final boolean includeCredentials; 5615 5616 /** 5617 * Constructor 5618 * 5619 * @param disableCache - 5620 * 5621 * @param includeCredentials - 5622 */ 5623 public LoadNetworkResourceOptions(boolean disableCache, boolean includeCredentials) 5624 { 5625 this.disableCache = disableCache; 5626 this.includeCredentials = includeCredentials; 5627 } 5628 5629 /** 5630 * JSON Object Constructor 5631 * @param jo A Json-Object having data about an instance of {@code 'LoadNetworkResourceOptions'}. 5632 */ 5633 public LoadNetworkResourceOptions (JsonObject jo) 5634 { 5635 this.disableCache = ReadPrimJSON.getBoolean(jo, "disableCache"); 5636 this.includeCredentials = ReadPrimJSON.getBoolean(jo, "includeCredentials"); 5637 } 5638 5639 5640 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5641 public boolean equals(Object other) 5642 { 5643 if (this == other) return true; 5644 if (other == null) return false; 5645 if (other.getClass() != this.getClass()) return false; 5646 5647 LoadNetworkResourceOptions o = (LoadNetworkResourceOptions) other; 5648 5649 return 5650 (this.disableCache == o.disableCache) 5651 && (this.includeCredentials == o.includeCredentials); 5652 } 5653 5654 /** Generates a Hash-Code for {@code 'this'} instance */ 5655 public int hashCode() 5656 { 5657 return 5658 (this.disableCache ? 1 : 0) 5659 + (this.includeCredentials ? 1 : 0); 5660 } 5661 } 5662 5663 /** 5664 * Fired once security policy has been updated. 5665 * <BR /> 5666 * <BR /><B>EXPERIMENTAL</B> 5667 * 5668 * <BR /><BR />This is Marker-Event. Marker-Event's are Events that do not posses 5669 * any data, fields or state. When they are fired, only the event name is supplied. 5670 */ 5671 public static class policyUpdated 5672 extends BrowserEvent 5673 implements java.io.Serializable 5674 { 5675 /** For Object Serialization. java.io.Serializable */ 5676 protected static final long serialVersionUID = 1; 5677 5678 public boolean[] optionals() { return new boolean[0]; } 5679 5680 /** JSON Object Constructor */ 5681 public policyUpdated(JsonObject jo) 5682 { super("Network", "policyUpdated", 0); } 5683 5684 @Override 5685 public String toString() { return "Network.policyUpdated Marker Event\n"; } 5686 } 5687 5688 /** Fired when data chunk was received over the network. */ 5689 public static class dataReceived 5690 extends BrowserEvent 5691 implements java.io.Serializable 5692 { 5693 /** For Object Serialization. java.io.Serializable */ 5694 protected static final long serialVersionUID = 1; 5695 5696 public boolean[] optionals() 5697 { return new boolean[] { false, false, false, false, true, }; } 5698 5699 /** Request identifier. */ 5700 public final String requestId; 5701 5702 /** Timestamp. */ 5703 public final Number timestamp; 5704 5705 /** Data chunk length. */ 5706 public final int dataLength; 5707 5708 /** Actual bytes received (might be less than dataLength for compressed encodings). */ 5709 public final int encodedDataLength; 5710 5711 /** 5712 * Data that was received. (Encoded as a base64 string when passed over JSON) 5713 * <BR /><B CLASS=Opt>OPTIONAL</B> 5714 <B CLASS=Exp>EXPERIMENTAL</B> 5715 */ 5716 public final String data; 5717 5718 /** 5719 * Constructor 5720 * 5721 * @param requestId Request identifier. 5722 * 5723 * @param timestamp Timestamp. 5724 * 5725 * @param dataLength Data chunk length. 5726 * 5727 * @param encodedDataLength Actual bytes received (might be less than dataLength for compressed encodings). 5728 * 5729 * @param data Data that was received. (Encoded as a base64 string when passed over JSON) 5730 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 5731 */ 5732 public dataReceived 5733 (String requestId, Number timestamp, int dataLength, int encodedDataLength, String data) 5734 { 5735 super("Network", "dataReceived", 5); 5736 5737 // Exception-Check(s) to ensure that if any parameters which are not declared as 5738 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5739 5740 if (requestId == null) THROWS.throwNPE("requestId"); 5741 if (timestamp == null) THROWS.throwNPE("timestamp"); 5742 5743 this.requestId = requestId; 5744 this.timestamp = timestamp; 5745 this.dataLength = dataLength; 5746 this.encodedDataLength = encodedDataLength; 5747 this.data = data; 5748 } 5749 5750 /** 5751 * JSON Object Constructor 5752 * @param jo A Json-Object having data about an instance of {@code 'dataReceived'}. 5753 */ 5754 public dataReceived (JsonObject jo) 5755 { 5756 super("Network", "dataReceived", 5); 5757 5758 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 5759 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 5760 this.dataLength = ReadPrimJSON.getInt(jo, "dataLength"); 5761 this.encodedDataLength = ReadPrimJSON.getInt(jo, "encodedDataLength"); 5762 this.data = ReadJSON.getString(jo, "data", true, false); 5763 } 5764 5765 5766 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5767 public boolean equals(Object other) 5768 { 5769 if (this == other) return true; 5770 if (other == null) return false; 5771 if (other.getClass() != this.getClass()) return false; 5772 5773 dataReceived o = (dataReceived) other; 5774 5775 return 5776 Objects.equals(this.requestId, o.requestId) 5777 && Objects.equals(this.timestamp, o.timestamp) 5778 && (this.dataLength == o.dataLength) 5779 && (this.encodedDataLength == o.encodedDataLength) 5780 && Objects.equals(this.data, o.data); 5781 } 5782 5783 /** Generates a Hash-Code for {@code 'this'} instance */ 5784 public int hashCode() 5785 { 5786 return 5787 Objects.hashCode(this.requestId) 5788 + Objects.hashCode(this.timestamp) 5789 + this.dataLength 5790 + this.encodedDataLength 5791 + Objects.hashCode(this.data); 5792 } 5793 } 5794 5795 /** Fired when EventSource message is received. */ 5796 public static class eventSourceMessageReceived 5797 extends BrowserEvent 5798 implements java.io.Serializable 5799 { 5800 /** For Object Serialization. java.io.Serializable */ 5801 protected static final long serialVersionUID = 1; 5802 5803 public boolean[] optionals() 5804 { return new boolean[] { false, false, false, false, false, }; } 5805 5806 /** Request identifier. */ 5807 public final String requestId; 5808 5809 /** Timestamp. */ 5810 public final Number timestamp; 5811 5812 /** Message type. */ 5813 public final String eventName; 5814 5815 /** Message identifier. */ 5816 public final String eventId; 5817 5818 /** Message content. */ 5819 public final String data; 5820 5821 /** 5822 * Constructor 5823 * 5824 * @param requestId Request identifier. 5825 * 5826 * @param timestamp Timestamp. 5827 * 5828 * @param eventName Message type. 5829 * 5830 * @param eventId Message identifier. 5831 * 5832 * @param data Message content. 5833 */ 5834 public eventSourceMessageReceived 5835 (String requestId, Number timestamp, String eventName, String eventId, String data) 5836 { 5837 super("Network", "eventSourceMessageReceived", 5); 5838 5839 // Exception-Check(s) to ensure that if any parameters which are not declared as 5840 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5841 5842 if (requestId == null) THROWS.throwNPE("requestId"); 5843 if (timestamp == null) THROWS.throwNPE("timestamp"); 5844 if (eventName == null) THROWS.throwNPE("eventName"); 5845 if (eventId == null) THROWS.throwNPE("eventId"); 5846 if (data == null) THROWS.throwNPE("data"); 5847 5848 this.requestId = requestId; 5849 this.timestamp = timestamp; 5850 this.eventName = eventName; 5851 this.eventId = eventId; 5852 this.data = data; 5853 } 5854 5855 /** 5856 * JSON Object Constructor 5857 * @param jo A Json-Object having data about an instance of {@code 'eventSourceMessageReceived'}. 5858 */ 5859 public eventSourceMessageReceived (JsonObject jo) 5860 { 5861 super("Network", "eventSourceMessageReceived", 5); 5862 5863 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 5864 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 5865 this.eventName = ReadJSON.getString(jo, "eventName", false, true); 5866 this.eventId = ReadJSON.getString(jo, "eventId", false, true); 5867 this.data = ReadJSON.getString(jo, "data", false, true); 5868 } 5869 5870 5871 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 5872 public boolean equals(Object other) 5873 { 5874 if (this == other) return true; 5875 if (other == null) return false; 5876 if (other.getClass() != this.getClass()) return false; 5877 5878 eventSourceMessageReceived o = (eventSourceMessageReceived) other; 5879 5880 return 5881 Objects.equals(this.requestId, o.requestId) 5882 && Objects.equals(this.timestamp, o.timestamp) 5883 && Objects.equals(this.eventName, o.eventName) 5884 && Objects.equals(this.eventId, o.eventId) 5885 && Objects.equals(this.data, o.data); 5886 } 5887 5888 /** Generates a Hash-Code for {@code 'this'} instance */ 5889 public int hashCode() 5890 { 5891 return 5892 Objects.hashCode(this.requestId) 5893 + Objects.hashCode(this.timestamp) 5894 + Objects.hashCode(this.eventName) 5895 + Objects.hashCode(this.eventId) 5896 + Objects.hashCode(this.data); 5897 } 5898 } 5899 5900 /** Fired when HTTP request has failed to load. */ 5901 public static class loadingFailed 5902 extends BrowserEvent 5903 implements java.io.Serializable 5904 { 5905 /** For Object Serialization. java.io.Serializable */ 5906 protected static final long serialVersionUID = 1; 5907 5908 public boolean[] optionals() 5909 { return new boolean[] { false, false, false, false, true, true, true, }; } 5910 5911 /** Request identifier. */ 5912 public final String requestId; 5913 5914 /** Timestamp. */ 5915 public final Number timestamp; 5916 5917 /** Resource type. */ 5918 public final String type; 5919 5920 /** Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h */ 5921 public final String errorText; 5922 5923 /** 5924 * True if loading was canceled. 5925 * <BR /><B CLASS=Opt>OPTIONAL</B> 5926 */ 5927 public final Boolean canceled; 5928 5929 /** 5930 * The reason why loading was blocked, if any. 5931 * <BR /><B CLASS=Opt>OPTIONAL</B> 5932 */ 5933 public final String blockedReason; 5934 5935 /** 5936 * The reason why loading was blocked by CORS, if any. 5937 * <BR /><B CLASS=Opt>OPTIONAL</B> 5938 */ 5939 public final Network.CorsErrorStatus corsErrorStatus; 5940 5941 /** 5942 * Constructor 5943 * 5944 * @param requestId Request identifier. 5945 * 5946 * @param timestamp Timestamp. 5947 * 5948 * @param type Resource type. 5949 * 5950 * @param errorText Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h 5951 * 5952 * @param canceled True if loading was canceled. 5953 * <BR /><B CLASS=Opt>OPTIONAL</B> 5954 * 5955 * @param blockedReason The reason why loading was blocked, if any. 5956 * <BR /><B CLASS=Opt>OPTIONAL</B> 5957 * 5958 * @param corsErrorStatus The reason why loading was blocked by CORS, if any. 5959 * <BR /><B CLASS=Opt>OPTIONAL</B> 5960 */ 5961 public loadingFailed( 5962 String requestId, Number timestamp, String type, String errorText, Boolean canceled, 5963 String blockedReason, Network.CorsErrorStatus corsErrorStatus 5964 ) 5965 { 5966 super("Network", "loadingFailed", 7); 5967 5968 // Exception-Check(s) to ensure that if any parameters which are not declared as 5969 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 5970 5971 if (requestId == null) THROWS.throwNPE("requestId"); 5972 if (timestamp == null) THROWS.throwNPE("timestamp"); 5973 if (type == null) THROWS.throwNPE("type"); 5974 if (errorText == null) THROWS.throwNPE("errorText"); 5975 5976 // Exception-Check(s) to ensure that if any parameters which must adhere to a 5977 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 5978 5979 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 5980 THROWS.checkIAE("blockedReason", blockedReason, "Network.BlockedReason", Network.BlockedReason); 5981 5982 this.requestId = requestId; 5983 this.timestamp = timestamp; 5984 this.type = type; 5985 this.errorText = errorText; 5986 this.canceled = canceled; 5987 this.blockedReason = blockedReason; 5988 this.corsErrorStatus = corsErrorStatus; 5989 } 5990 5991 /** 5992 * JSON Object Constructor 5993 * @param jo A Json-Object having data about an instance of {@code 'loadingFailed'}. 5994 */ 5995 public loadingFailed (JsonObject jo) 5996 { 5997 super("Network", "loadingFailed", 7); 5998 5999 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6000 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6001 this.type = ReadJSON.getString(jo, "type", false, true); 6002 this.errorText = ReadJSON.getString(jo, "errorText", false, true); 6003 this.canceled = ReadBoxedJSON.getBoolean(jo, "canceled", true); 6004 this.blockedReason = ReadJSON.getString(jo, "blockedReason", true, false); 6005 this.corsErrorStatus = ReadJSON.getObject(jo, "corsErrorStatus", Network.CorsErrorStatus.class, true, false); 6006 } 6007 6008 6009 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6010 public boolean equals(Object other) 6011 { 6012 if (this == other) return true; 6013 if (other == null) return false; 6014 if (other.getClass() != this.getClass()) return false; 6015 6016 loadingFailed o = (loadingFailed) other; 6017 6018 return 6019 Objects.equals(this.requestId, o.requestId) 6020 && Objects.equals(this.timestamp, o.timestamp) 6021 && Objects.equals(this.type, o.type) 6022 && Objects.equals(this.errorText, o.errorText) 6023 && Objects.equals(this.canceled, o.canceled) 6024 && Objects.equals(this.blockedReason, o.blockedReason) 6025 && Objects.equals(this.corsErrorStatus, o.corsErrorStatus); 6026 } 6027 6028 /** Generates a Hash-Code for {@code 'this'} instance */ 6029 public int hashCode() 6030 { 6031 return 6032 Objects.hashCode(this.requestId) 6033 + Objects.hashCode(this.timestamp) 6034 + Objects.hashCode(this.type) 6035 + Objects.hashCode(this.errorText) 6036 + Objects.hashCode(this.canceled) 6037 + Objects.hashCode(this.blockedReason) 6038 + this.corsErrorStatus.hashCode(); 6039 } 6040 } 6041 6042 /** Fired when HTTP request has finished loading. */ 6043 public static class loadingFinished 6044 extends BrowserEvent 6045 implements java.io.Serializable 6046 { 6047 /** For Object Serialization. java.io.Serializable */ 6048 protected static final long serialVersionUID = 1; 6049 6050 public boolean[] optionals() 6051 { return new boolean[] { false, false, false, }; } 6052 6053 /** Request identifier. */ 6054 public final String requestId; 6055 6056 /** Timestamp. */ 6057 public final Number timestamp; 6058 6059 /** Total number of bytes received for this request. */ 6060 public final Number encodedDataLength; 6061 6062 /** 6063 * Constructor 6064 * 6065 * @param requestId Request identifier. 6066 * 6067 * @param timestamp Timestamp. 6068 * 6069 * @param encodedDataLength Total number of bytes received for this request. 6070 */ 6071 public loadingFinished(String requestId, Number timestamp, Number encodedDataLength) 6072 { 6073 super("Network", "loadingFinished", 3); 6074 6075 // Exception-Check(s) to ensure that if any parameters which are not declared as 6076 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6077 6078 if (requestId == null) THROWS.throwNPE("requestId"); 6079 if (timestamp == null) THROWS.throwNPE("timestamp"); 6080 if (encodedDataLength == null) THROWS.throwNPE("encodedDataLength"); 6081 6082 this.requestId = requestId; 6083 this.timestamp = timestamp; 6084 this.encodedDataLength = encodedDataLength; 6085 } 6086 6087 /** 6088 * JSON Object Constructor 6089 * @param jo A Json-Object having data about an instance of {@code 'loadingFinished'}. 6090 */ 6091 public loadingFinished (JsonObject jo) 6092 { 6093 super("Network", "loadingFinished", 3); 6094 6095 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6096 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6097 this.encodedDataLength = ReadNumberJSON.get(jo, "encodedDataLength", false, true); 6098 } 6099 6100 6101 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6102 public boolean equals(Object other) 6103 { 6104 if (this == other) return true; 6105 if (other == null) return false; 6106 if (other.getClass() != this.getClass()) return false; 6107 6108 loadingFinished o = (loadingFinished) other; 6109 6110 return 6111 Objects.equals(this.requestId, o.requestId) 6112 && Objects.equals(this.timestamp, o.timestamp) 6113 && Objects.equals(this.encodedDataLength, o.encodedDataLength); 6114 } 6115 6116 /** Generates a Hash-Code for {@code 'this'} instance */ 6117 public int hashCode() 6118 { 6119 return 6120 Objects.hashCode(this.requestId) 6121 + Objects.hashCode(this.timestamp) 6122 + Objects.hashCode(this.encodedDataLength); 6123 } 6124 } 6125 6126 /** 6127 * Details of an intercepted HTTP request, which must be either allowed, blocked, modified or 6128 * mocked. 6129 * Deprecated, use Fetch.requestPaused instead. 6130 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6131 <B CLASS=Dep>DEPRECATED</B> 6132 */ 6133 public static class requestIntercepted 6134 extends BrowserEvent 6135 implements java.io.Serializable 6136 { 6137 /** For Object Serialization. java.io.Serializable */ 6138 protected static final long serialVersionUID = 1; 6139 6140 public boolean[] optionals() 6141 { return new boolean[] { false, false, false, false, false, true, true, true, true, true, true, true, }; } 6142 6143 /** 6144 * Each request the page makes will have a unique id, however if any redirects are encountered 6145 * while processing that fetch, they will be reported with the same id as the original fetch. 6146 * Likewise if HTTP authentication is needed then the same fetch id will be used. 6147 */ 6148 public final String interceptionId; 6149 6150 /** <CODE>[No Description Provided by Google]</CODE> */ 6151 public final Network.Request request; 6152 6153 /** The id of the frame that initiated the request. */ 6154 public final String frameId; 6155 6156 /** How the requested resource will be used. */ 6157 public final String resourceType; 6158 6159 /** Whether this is a navigation request, which can abort the navigation completely. */ 6160 public final boolean isNavigationRequest; 6161 6162 /** 6163 * Set if the request is a navigation that will result in a download. 6164 * Only present after response is received from the server (i.e. HeadersReceived stage). 6165 * <BR /><B CLASS=Opt>OPTIONAL</B> 6166 */ 6167 public final Boolean isDownload; 6168 6169 /** 6170 * Redirect location, only sent if a redirect was intercepted. 6171 * <BR /><B CLASS=Opt>OPTIONAL</B> 6172 */ 6173 public final String redirectUrl; 6174 6175 /** 6176 * Details of the Authorization Challenge encountered. If this is set then 6177 * continueInterceptedRequest must contain an authChallengeResponse. 6178 * <BR /><B CLASS=Opt>OPTIONAL</B> 6179 */ 6180 public final Network.AuthChallenge authChallenge; 6181 6182 /** 6183 * Response error if intercepted at response stage or if redirect occurred while intercepting 6184 * request. 6185 * <BR /><B CLASS=Opt>OPTIONAL</B> 6186 */ 6187 public final String responseErrorReason; 6188 6189 /** 6190 * Response code if intercepted at response stage or if redirect occurred while intercepting 6191 * request or auth retry occurred. 6192 * <BR /><B CLASS=Opt>OPTIONAL</B> 6193 */ 6194 public final Integer responseStatusCode; 6195 6196 /** 6197 * Response headers if intercepted at the response stage or if redirect occurred while 6198 * intercepting request or auth retry occurred. 6199 * <BR /><B CLASS=Opt>OPTIONAL</B> 6200 */ 6201 public final JsonObject responseHeaders; 6202 6203 /** 6204 * If the intercepted request had a corresponding requestWillBeSent event fired for it, then 6205 * this requestId will be the same as the requestId present in the requestWillBeSent event. 6206 * <BR /><B CLASS=Opt>OPTIONAL</B> 6207 */ 6208 public final String requestId; 6209 6210 /** 6211 * Constructor 6212 * 6213 * @param interceptionId 6214 * Each request the page makes will have a unique id, however if any redirects are encountered 6215 * while processing that fetch, they will be reported with the same id as the original fetch. 6216 * Likewise if HTTP authentication is needed then the same fetch id will be used. 6217 * 6218 * @param request - 6219 * 6220 * @param frameId The id of the frame that initiated the request. 6221 * 6222 * @param resourceType How the requested resource will be used. 6223 * 6224 * @param isNavigationRequest Whether this is a navigation request, which can abort the navigation completely. 6225 * 6226 * @param isDownload 6227 * Set if the request is a navigation that will result in a download. 6228 * Only present after response is received from the server (i.e. HeadersReceived stage). 6229 * <BR /><B CLASS=Opt>OPTIONAL</B> 6230 * 6231 * @param redirectUrl Redirect location, only sent if a redirect was intercepted. 6232 * <BR /><B CLASS=Opt>OPTIONAL</B> 6233 * 6234 * @param authChallenge 6235 * Details of the Authorization Challenge encountered. If this is set then 6236 * continueInterceptedRequest must contain an authChallengeResponse. 6237 * <BR /><B CLASS=Opt>OPTIONAL</B> 6238 * 6239 * @param responseErrorReason 6240 * Response error if intercepted at response stage or if redirect occurred while intercepting 6241 * request. 6242 * <BR /><B CLASS=Opt>OPTIONAL</B> 6243 * 6244 * @param responseStatusCode 6245 * Response code if intercepted at response stage or if redirect occurred while intercepting 6246 * request or auth retry occurred. 6247 * <BR /><B CLASS=Opt>OPTIONAL</B> 6248 * 6249 * @param responseHeaders 6250 * Response headers if intercepted at the response stage or if redirect occurred while 6251 * intercepting request or auth retry occurred. 6252 * <BR /><B CLASS=Opt>OPTIONAL</B> 6253 * 6254 * @param requestId 6255 * If the intercepted request had a corresponding requestWillBeSent event fired for it, then 6256 * this requestId will be the same as the requestId present in the requestWillBeSent event. 6257 * <BR /><B CLASS=Opt>OPTIONAL</B> 6258 */ 6259 public requestIntercepted( 6260 String interceptionId, Network.Request request, String frameId, String resourceType, 6261 boolean isNavigationRequest, Boolean isDownload, String redirectUrl, 6262 Network.AuthChallenge authChallenge, String responseErrorReason, 6263 Integer responseStatusCode, JsonObject responseHeaders, String requestId 6264 ) 6265 { 6266 super("Network", "requestIntercepted", 12); 6267 6268 // Exception-Check(s) to ensure that if any parameters which are not declared as 6269 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6270 6271 if (interceptionId == null) THROWS.throwNPE("interceptionId"); 6272 if (request == null) THROWS.throwNPE("request"); 6273 if (frameId == null) THROWS.throwNPE("frameId"); 6274 if (resourceType == null) THROWS.throwNPE("resourceType"); 6275 6276 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6277 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6278 6279 THROWS.checkIAE("resourceType", resourceType, "Network.ResourceType", Network.ResourceType); 6280 THROWS.checkIAE("responseErrorReason", responseErrorReason, "Network.ErrorReason", Network.ErrorReason); 6281 6282 this.interceptionId = interceptionId; 6283 this.request = request; 6284 this.frameId = frameId; 6285 this.resourceType = resourceType; 6286 this.isNavigationRequest = isNavigationRequest; 6287 this.isDownload = isDownload; 6288 this.redirectUrl = redirectUrl; 6289 this.authChallenge = authChallenge; 6290 this.responseErrorReason = responseErrorReason; 6291 this.responseStatusCode = responseStatusCode; 6292 this.responseHeaders = responseHeaders; 6293 this.requestId = requestId; 6294 } 6295 6296 /** 6297 * JSON Object Constructor 6298 * @param jo A Json-Object having data about an instance of {@code 'requestIntercepted'}. 6299 */ 6300 public requestIntercepted (JsonObject jo) 6301 { 6302 super("Network", "requestIntercepted", 12); 6303 6304 this.interceptionId = ReadJSON.getString(jo, "interceptionId", false, true); 6305 this.request = ReadJSON.getObject(jo, "request", Network.Request.class, false, true); 6306 this.frameId = ReadJSON.getString(jo, "frameId", false, true); 6307 this.resourceType = ReadJSON.getString(jo, "resourceType", false, true); 6308 this.isNavigationRequest = ReadPrimJSON.getBoolean(jo, "isNavigationRequest"); 6309 this.isDownload = ReadBoxedJSON.getBoolean(jo, "isDownload", true); 6310 this.redirectUrl = ReadJSON.getString(jo, "redirectUrl", true, false); 6311 this.authChallenge = ReadJSON.getObject(jo, "authChallenge", Network.AuthChallenge.class, true, false); 6312 this.responseErrorReason = ReadJSON.getString(jo, "responseErrorReason", true, false); 6313 this.responseStatusCode = ReadBoxedJSON.getInteger(jo, "responseStatusCode", true); 6314 this.responseHeaders = jo.getJsonObject("responseHeaders"); 6315 this.requestId = ReadJSON.getString(jo, "requestId", true, false); 6316 } 6317 6318 6319 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6320 public boolean equals(Object other) 6321 { 6322 if (this == other) return true; 6323 if (other == null) return false; 6324 if (other.getClass() != this.getClass()) return false; 6325 6326 requestIntercepted o = (requestIntercepted) other; 6327 6328 return 6329 Objects.equals(this.interceptionId, o.interceptionId) 6330 && Objects.equals(this.request, o.request) 6331 && Objects.equals(this.frameId, o.frameId) 6332 && Objects.equals(this.resourceType, o.resourceType) 6333 && (this.isNavigationRequest == o.isNavigationRequest) 6334 && Objects.equals(this.isDownload, o.isDownload) 6335 && Objects.equals(this.redirectUrl, o.redirectUrl) 6336 && Objects.equals(this.authChallenge, o.authChallenge) 6337 && Objects.equals(this.responseErrorReason, o.responseErrorReason) 6338 && Objects.equals(this.responseStatusCode, o.responseStatusCode) 6339 && Objects.equals(this.responseHeaders, o.responseHeaders) 6340 && Objects.equals(this.requestId, o.requestId); 6341 } 6342 6343 /** Generates a Hash-Code for {@code 'this'} instance */ 6344 public int hashCode() 6345 { 6346 return 6347 Objects.hashCode(this.interceptionId) 6348 + this.request.hashCode() 6349 + Objects.hashCode(this.frameId) 6350 + Objects.hashCode(this.resourceType) 6351 + (this.isNavigationRequest ? 1 : 0) 6352 + Objects.hashCode(this.isDownload) 6353 + Objects.hashCode(this.redirectUrl) 6354 + this.authChallenge.hashCode() 6355 + Objects.hashCode(this.responseErrorReason) 6356 + Objects.hashCode(this.responseStatusCode) 6357 + this.responseHeaders.hashCode() 6358 + Objects.hashCode(this.requestId); 6359 } 6360 } 6361 6362 /** Fired if request ended up loading from cache. */ 6363 public static class requestServedFromCache 6364 extends BrowserEvent 6365 implements java.io.Serializable 6366 { 6367 /** For Object Serialization. java.io.Serializable */ 6368 protected static final long serialVersionUID = 1; 6369 6370 public boolean[] optionals() 6371 { return new boolean[] { false, }; } 6372 6373 /** Request identifier. */ 6374 public final String requestId; 6375 6376 /** 6377 * Constructor 6378 * 6379 * @param requestId Request identifier. 6380 */ 6381 public requestServedFromCache(String requestId) 6382 { 6383 super("Network", "requestServedFromCache", 1); 6384 6385 // Exception-Check(s) to ensure that if any parameters which are not declared as 6386 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6387 6388 if (requestId == null) THROWS.throwNPE("requestId"); 6389 6390 this.requestId = requestId; 6391 } 6392 6393 /** 6394 * JSON Object Constructor 6395 * @param jo A Json-Object having data about an instance of {@code 'requestServedFromCache'}. 6396 */ 6397 public requestServedFromCache (JsonObject jo) 6398 { 6399 super("Network", "requestServedFromCache", 1); 6400 6401 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6402 } 6403 6404 6405 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6406 public boolean equals(Object other) 6407 { 6408 if (this == other) return true; 6409 if (other == null) return false; 6410 if (other.getClass() != this.getClass()) return false; 6411 6412 requestServedFromCache o = (requestServedFromCache) other; 6413 6414 return 6415 Objects.equals(this.requestId, o.requestId); 6416 } 6417 6418 /** Generates a Hash-Code for {@code 'this'} instance */ 6419 public int hashCode() 6420 { 6421 return 6422 Objects.hashCode(this.requestId); 6423 } 6424 } 6425 6426 /** Fired when page is about to send HTTP request. */ 6427 public static class requestWillBeSent 6428 extends BrowserEvent 6429 implements java.io.Serializable 6430 { 6431 /** For Object Serialization. java.io.Serializable */ 6432 protected static final long serialVersionUID = 1; 6433 6434 public boolean[] optionals() 6435 { return new boolean[] { false, false, false, false, false, false, false, false, true, true, true, true, }; } 6436 6437 /** Request identifier. */ 6438 public final String requestId; 6439 6440 /** Loader identifier. Empty string if the request is fetched from worker. */ 6441 public final String loaderId; 6442 6443 /** URL of the document this request is loaded for. */ 6444 public final String documentURL; 6445 6446 /** Request data. */ 6447 public final Network.Request request; 6448 6449 /** Timestamp. */ 6450 public final Number timestamp; 6451 6452 /** Timestamp. */ 6453 public final Number wallTime; 6454 6455 /** Request initiator. */ 6456 public final Network.Initiator initiator; 6457 6458 /** 6459 * In the case that redirectResponse is populated, this flag indicates whether 6460 * requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted 6461 * for the request which was just redirected. 6462 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6463 */ 6464 public final boolean redirectHasExtraInfo; 6465 6466 /** 6467 * Redirect response data. 6468 * <BR /><B CLASS=Opt>OPTIONAL</B> 6469 */ 6470 public final Network.Response redirectResponse; 6471 6472 /** 6473 * Type of this resource. 6474 * <BR /><B CLASS=Opt>OPTIONAL</B> 6475 */ 6476 public final String type; 6477 6478 /** 6479 * Frame identifier. 6480 * <BR /><B CLASS=Opt>OPTIONAL</B> 6481 */ 6482 public final String frameId; 6483 6484 /** 6485 * Whether the request is initiated by a user gesture. Defaults to false. 6486 * <BR /><B CLASS=Opt>OPTIONAL</B> 6487 */ 6488 public final Boolean hasUserGesture; 6489 6490 /** 6491 * Constructor 6492 * 6493 * @param requestId Request identifier. 6494 * 6495 * @param loaderId Loader identifier. Empty string if the request is fetched from worker. 6496 * 6497 * @param documentURL URL of the document this request is loaded for. 6498 * 6499 * @param request Request data. 6500 * 6501 * @param timestamp Timestamp. 6502 * 6503 * @param wallTime Timestamp. 6504 * 6505 * @param initiator Request initiator. 6506 * 6507 * @param redirectHasExtraInfo 6508 * In the case that redirectResponse is populated, this flag indicates whether 6509 * requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted 6510 * for the request which was just redirected. 6511 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6512 * 6513 * @param redirectResponse Redirect response data. 6514 * <BR /><B CLASS=Opt>OPTIONAL</B> 6515 * 6516 * @param type Type of this resource. 6517 * <BR /><B CLASS=Opt>OPTIONAL</B> 6518 * 6519 * @param frameId Frame identifier. 6520 * <BR /><B CLASS=Opt>OPTIONAL</B> 6521 * 6522 * @param hasUserGesture Whether the request is initiated by a user gesture. Defaults to false. 6523 * <BR /><B CLASS=Opt>OPTIONAL</B> 6524 */ 6525 public requestWillBeSent( 6526 String requestId, String loaderId, String documentURL, Network.Request request, 6527 Number timestamp, Number wallTime, Network.Initiator initiator, 6528 boolean redirectHasExtraInfo, Network.Response redirectResponse, String type, 6529 String frameId, Boolean hasUserGesture 6530 ) 6531 { 6532 super("Network", "requestWillBeSent", 12); 6533 6534 // Exception-Check(s) to ensure that if any parameters which are not declared as 6535 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6536 6537 if (requestId == null) THROWS.throwNPE("requestId"); 6538 if (loaderId == null) THROWS.throwNPE("loaderId"); 6539 if (documentURL == null) THROWS.throwNPE("documentURL"); 6540 if (request == null) THROWS.throwNPE("request"); 6541 if (timestamp == null) THROWS.throwNPE("timestamp"); 6542 if (wallTime == null) THROWS.throwNPE("wallTime"); 6543 if (initiator == null) THROWS.throwNPE("initiator"); 6544 6545 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6546 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6547 6548 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 6549 6550 this.requestId = requestId; 6551 this.loaderId = loaderId; 6552 this.documentURL = documentURL; 6553 this.request = request; 6554 this.timestamp = timestamp; 6555 this.wallTime = wallTime; 6556 this.initiator = initiator; 6557 this.redirectHasExtraInfo = redirectHasExtraInfo; 6558 this.redirectResponse = redirectResponse; 6559 this.type = type; 6560 this.frameId = frameId; 6561 this.hasUserGesture = hasUserGesture; 6562 } 6563 6564 /** 6565 * JSON Object Constructor 6566 * @param jo A Json-Object having data about an instance of {@code 'requestWillBeSent'}. 6567 */ 6568 public requestWillBeSent (JsonObject jo) 6569 { 6570 super("Network", "requestWillBeSent", 12); 6571 6572 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6573 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 6574 this.documentURL = ReadJSON.getString(jo, "documentURL", false, true); 6575 this.request = ReadJSON.getObject(jo, "request", Network.Request.class, false, true); 6576 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6577 this.wallTime = ReadNumberJSON.get(jo, "wallTime", false, true); 6578 this.initiator = ReadJSON.getObject(jo, "initiator", Network.Initiator.class, false, true); 6579 this.redirectHasExtraInfo = ReadPrimJSON.getBoolean(jo, "redirectHasExtraInfo"); 6580 this.redirectResponse = ReadJSON.getObject(jo, "redirectResponse", Network.Response.class, true, false); 6581 this.type = ReadJSON.getString(jo, "type", true, false); 6582 this.frameId = ReadJSON.getString(jo, "frameId", true, false); 6583 this.hasUserGesture = ReadBoxedJSON.getBoolean(jo, "hasUserGesture", true); 6584 } 6585 6586 6587 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6588 public boolean equals(Object other) 6589 { 6590 if (this == other) return true; 6591 if (other == null) return false; 6592 if (other.getClass() != this.getClass()) return false; 6593 6594 requestWillBeSent o = (requestWillBeSent) other; 6595 6596 return 6597 Objects.equals(this.requestId, o.requestId) 6598 && Objects.equals(this.loaderId, o.loaderId) 6599 && Objects.equals(this.documentURL, o.documentURL) 6600 && Objects.equals(this.request, o.request) 6601 && Objects.equals(this.timestamp, o.timestamp) 6602 && Objects.equals(this.wallTime, o.wallTime) 6603 && Objects.equals(this.initiator, o.initiator) 6604 && (this.redirectHasExtraInfo == o.redirectHasExtraInfo) 6605 && Objects.equals(this.redirectResponse, o.redirectResponse) 6606 && Objects.equals(this.type, o.type) 6607 && Objects.equals(this.frameId, o.frameId) 6608 && Objects.equals(this.hasUserGesture, o.hasUserGesture); 6609 } 6610 6611 /** Generates a Hash-Code for {@code 'this'} instance */ 6612 public int hashCode() 6613 { 6614 return 6615 Objects.hashCode(this.requestId) 6616 + Objects.hashCode(this.loaderId) 6617 + Objects.hashCode(this.documentURL) 6618 + this.request.hashCode() 6619 + Objects.hashCode(this.timestamp) 6620 + Objects.hashCode(this.wallTime) 6621 + this.initiator.hashCode() 6622 + (this.redirectHasExtraInfo ? 1 : 0) 6623 + this.redirectResponse.hashCode() 6624 + Objects.hashCode(this.type) 6625 + Objects.hashCode(this.frameId) 6626 + Objects.hashCode(this.hasUserGesture); 6627 } 6628 } 6629 6630 /** 6631 * Fired when resource loading priority is changed 6632 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6633 */ 6634 public static class resourceChangedPriority 6635 extends BrowserEvent 6636 implements java.io.Serializable 6637 { 6638 /** For Object Serialization. java.io.Serializable */ 6639 protected static final long serialVersionUID = 1; 6640 6641 public boolean[] optionals() 6642 { return new boolean[] { false, false, false, }; } 6643 6644 /** Request identifier. */ 6645 public final String requestId; 6646 6647 /** New priority */ 6648 public final String newPriority; 6649 6650 /** Timestamp. */ 6651 public final Number timestamp; 6652 6653 /** 6654 * Constructor 6655 * 6656 * @param requestId Request identifier. 6657 * 6658 * @param newPriority New priority 6659 * 6660 * @param timestamp Timestamp. 6661 */ 6662 public resourceChangedPriority(String requestId, String newPriority, Number timestamp) 6663 { 6664 super("Network", "resourceChangedPriority", 3); 6665 6666 // Exception-Check(s) to ensure that if any parameters which are not declared as 6667 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6668 6669 if (requestId == null) THROWS.throwNPE("requestId"); 6670 if (newPriority == null) THROWS.throwNPE("newPriority"); 6671 if (timestamp == null) THROWS.throwNPE("timestamp"); 6672 6673 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6674 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6675 6676 THROWS.checkIAE("newPriority", newPriority, "Network.ResourcePriority", Network.ResourcePriority); 6677 6678 this.requestId = requestId; 6679 this.newPriority = newPriority; 6680 this.timestamp = timestamp; 6681 } 6682 6683 /** 6684 * JSON Object Constructor 6685 * @param jo A Json-Object having data about an instance of {@code 'resourceChangedPriority'}. 6686 */ 6687 public resourceChangedPriority (JsonObject jo) 6688 { 6689 super("Network", "resourceChangedPriority", 3); 6690 6691 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6692 this.newPriority = ReadJSON.getString(jo, "newPriority", false, true); 6693 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6694 } 6695 6696 6697 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6698 public boolean equals(Object other) 6699 { 6700 if (this == other) return true; 6701 if (other == null) return false; 6702 if (other.getClass() != this.getClass()) return false; 6703 6704 resourceChangedPriority o = (resourceChangedPriority) other; 6705 6706 return 6707 Objects.equals(this.requestId, o.requestId) 6708 && Objects.equals(this.newPriority, o.newPriority) 6709 && Objects.equals(this.timestamp, o.timestamp); 6710 } 6711 6712 /** Generates a Hash-Code for {@code 'this'} instance */ 6713 public int hashCode() 6714 { 6715 return 6716 Objects.hashCode(this.requestId) 6717 + Objects.hashCode(this.newPriority) 6718 + Objects.hashCode(this.timestamp); 6719 } 6720 } 6721 6722 /** 6723 * Fired when a signed exchange was received over the network 6724 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6725 */ 6726 public static class signedExchangeReceived 6727 extends BrowserEvent 6728 implements java.io.Serializable 6729 { 6730 /** For Object Serialization. java.io.Serializable */ 6731 protected static final long serialVersionUID = 1; 6732 6733 public boolean[] optionals() 6734 { return new boolean[] { false, false, }; } 6735 6736 /** Request identifier. */ 6737 public final String requestId; 6738 6739 /** Information about the signed exchange response. */ 6740 public final Network.SignedExchangeInfo info; 6741 6742 /** 6743 * Constructor 6744 * 6745 * @param requestId Request identifier. 6746 * 6747 * @param info Information about the signed exchange response. 6748 */ 6749 public signedExchangeReceived(String requestId, Network.SignedExchangeInfo info) 6750 { 6751 super("Network", "signedExchangeReceived", 2); 6752 6753 // Exception-Check(s) to ensure that if any parameters which are not declared as 6754 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6755 6756 if (requestId == null) THROWS.throwNPE("requestId"); 6757 if (info == null) THROWS.throwNPE("info"); 6758 6759 this.requestId = requestId; 6760 this.info = info; 6761 } 6762 6763 /** 6764 * JSON Object Constructor 6765 * @param jo A Json-Object having data about an instance of {@code 'signedExchangeReceived'}. 6766 */ 6767 public signedExchangeReceived (JsonObject jo) 6768 { 6769 super("Network", "signedExchangeReceived", 2); 6770 6771 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6772 this.info = ReadJSON.getObject(jo, "info", Network.SignedExchangeInfo.class, false, true); 6773 } 6774 6775 6776 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6777 public boolean equals(Object other) 6778 { 6779 if (this == other) return true; 6780 if (other == null) return false; 6781 if (other.getClass() != this.getClass()) return false; 6782 6783 signedExchangeReceived o = (signedExchangeReceived) other; 6784 6785 return 6786 Objects.equals(this.requestId, o.requestId) 6787 && Objects.equals(this.info, o.info); 6788 } 6789 6790 /** Generates a Hash-Code for {@code 'this'} instance */ 6791 public int hashCode() 6792 { 6793 return 6794 Objects.hashCode(this.requestId) 6795 + this.info.hashCode(); 6796 } 6797 } 6798 6799 /** Fired when HTTP response is available. */ 6800 public static class responseReceived 6801 extends BrowserEvent 6802 implements java.io.Serializable 6803 { 6804 /** For Object Serialization. java.io.Serializable */ 6805 protected static final long serialVersionUID = 1; 6806 6807 public boolean[] optionals() 6808 { return new boolean[] { false, false, false, false, false, false, true, }; } 6809 6810 /** Request identifier. */ 6811 public final String requestId; 6812 6813 /** Loader identifier. Empty string if the request is fetched from worker. */ 6814 public final String loaderId; 6815 6816 /** Timestamp. */ 6817 public final Number timestamp; 6818 6819 /** Resource type. */ 6820 public final String type; 6821 6822 /** Response data. */ 6823 public final Network.Response response; 6824 6825 /** 6826 * Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be 6827 * or were emitted for this request. 6828 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6829 */ 6830 public final boolean hasExtraInfo; 6831 6832 /** 6833 * Frame identifier. 6834 * <BR /><B CLASS=Opt>OPTIONAL</B> 6835 */ 6836 public final String frameId; 6837 6838 /** 6839 * Constructor 6840 * 6841 * @param requestId Request identifier. 6842 * 6843 * @param loaderId Loader identifier. Empty string if the request is fetched from worker. 6844 * 6845 * @param timestamp Timestamp. 6846 * 6847 * @param type Resource type. 6848 * 6849 * @param response Response data. 6850 * 6851 * @param hasExtraInfo 6852 * Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be 6853 * or were emitted for this request. 6854 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 6855 * 6856 * @param frameId Frame identifier. 6857 * <BR /><B CLASS=Opt>OPTIONAL</B> 6858 */ 6859 public responseReceived( 6860 String requestId, String loaderId, Number timestamp, String type, 6861 Network.Response response, boolean hasExtraInfo, String frameId 6862 ) 6863 { 6864 super("Network", "responseReceived", 7); 6865 6866 // Exception-Check(s) to ensure that if any parameters which are not declared as 6867 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6868 6869 if (requestId == null) THROWS.throwNPE("requestId"); 6870 if (loaderId == null) THROWS.throwNPE("loaderId"); 6871 if (timestamp == null) THROWS.throwNPE("timestamp"); 6872 if (type == null) THROWS.throwNPE("type"); 6873 if (response == null) THROWS.throwNPE("response"); 6874 6875 // Exception-Check(s) to ensure that if any parameters which must adhere to a 6876 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 6877 6878 THROWS.checkIAE("type", type, "Network.ResourceType", Network.ResourceType); 6879 6880 this.requestId = requestId; 6881 this.loaderId = loaderId; 6882 this.timestamp = timestamp; 6883 this.type = type; 6884 this.response = response; 6885 this.hasExtraInfo = hasExtraInfo; 6886 this.frameId = frameId; 6887 } 6888 6889 /** 6890 * JSON Object Constructor 6891 * @param jo A Json-Object having data about an instance of {@code 'responseReceived'}. 6892 */ 6893 public responseReceived (JsonObject jo) 6894 { 6895 super("Network", "responseReceived", 7); 6896 6897 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6898 this.loaderId = ReadJSON.getString(jo, "loaderId", false, true); 6899 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6900 this.type = ReadJSON.getString(jo, "type", false, true); 6901 this.response = ReadJSON.getObject(jo, "response", Network.Response.class, false, true); 6902 this.hasExtraInfo = ReadPrimJSON.getBoolean(jo, "hasExtraInfo"); 6903 this.frameId = ReadJSON.getString(jo, "frameId", true, false); 6904 } 6905 6906 6907 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6908 public boolean equals(Object other) 6909 { 6910 if (this == other) return true; 6911 if (other == null) return false; 6912 if (other.getClass() != this.getClass()) return false; 6913 6914 responseReceived o = (responseReceived) other; 6915 6916 return 6917 Objects.equals(this.requestId, o.requestId) 6918 && Objects.equals(this.loaderId, o.loaderId) 6919 && Objects.equals(this.timestamp, o.timestamp) 6920 && Objects.equals(this.type, o.type) 6921 && Objects.equals(this.response, o.response) 6922 && (this.hasExtraInfo == o.hasExtraInfo) 6923 && Objects.equals(this.frameId, o.frameId); 6924 } 6925 6926 /** Generates a Hash-Code for {@code 'this'} instance */ 6927 public int hashCode() 6928 { 6929 return 6930 Objects.hashCode(this.requestId) 6931 + Objects.hashCode(this.loaderId) 6932 + Objects.hashCode(this.timestamp) 6933 + Objects.hashCode(this.type) 6934 + this.response.hashCode() 6935 + (this.hasExtraInfo ? 1 : 0) 6936 + Objects.hashCode(this.frameId); 6937 } 6938 } 6939 6940 /** Fired when WebSocket is closed. */ 6941 public static class webSocketClosed 6942 extends BrowserEvent 6943 implements java.io.Serializable 6944 { 6945 /** For Object Serialization. java.io.Serializable */ 6946 protected static final long serialVersionUID = 1; 6947 6948 public boolean[] optionals() 6949 { return new boolean[] { false, false, }; } 6950 6951 /** Request identifier. */ 6952 public final String requestId; 6953 6954 /** Timestamp. */ 6955 public final Number timestamp; 6956 6957 /** 6958 * Constructor 6959 * 6960 * @param requestId Request identifier. 6961 * 6962 * @param timestamp Timestamp. 6963 */ 6964 public webSocketClosed(String requestId, Number timestamp) 6965 { 6966 super("Network", "webSocketClosed", 2); 6967 6968 // Exception-Check(s) to ensure that if any parameters which are not declared as 6969 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 6970 6971 if (requestId == null) THROWS.throwNPE("requestId"); 6972 if (timestamp == null) THROWS.throwNPE("timestamp"); 6973 6974 this.requestId = requestId; 6975 this.timestamp = timestamp; 6976 } 6977 6978 /** 6979 * JSON Object Constructor 6980 * @param jo A Json-Object having data about an instance of {@code 'webSocketClosed'}. 6981 */ 6982 public webSocketClosed (JsonObject jo) 6983 { 6984 super("Network", "webSocketClosed", 2); 6985 6986 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 6987 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 6988 } 6989 6990 6991 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 6992 public boolean equals(Object other) 6993 { 6994 if (this == other) return true; 6995 if (other == null) return false; 6996 if (other.getClass() != this.getClass()) return false; 6997 6998 webSocketClosed o = (webSocketClosed) other; 6999 7000 return 7001 Objects.equals(this.requestId, o.requestId) 7002 && Objects.equals(this.timestamp, o.timestamp); 7003 } 7004 7005 /** Generates a Hash-Code for {@code 'this'} instance */ 7006 public int hashCode() 7007 { 7008 return 7009 Objects.hashCode(this.requestId) 7010 + Objects.hashCode(this.timestamp); 7011 } 7012 } 7013 7014 /** Fired upon WebSocket creation. */ 7015 public static class webSocketCreated 7016 extends BrowserEvent 7017 implements java.io.Serializable 7018 { 7019 /** For Object Serialization. java.io.Serializable */ 7020 protected static final long serialVersionUID = 1; 7021 7022 public boolean[] optionals() 7023 { return new boolean[] { false, false, true, }; } 7024 7025 /** Request identifier. */ 7026 public final String requestId; 7027 7028 /** WebSocket request URL. */ 7029 public final String url; 7030 7031 /** 7032 * Request initiator. 7033 * <BR /><B CLASS=Opt>OPTIONAL</B> 7034 */ 7035 public final Network.Initiator initiator; 7036 7037 /** 7038 * Constructor 7039 * 7040 * @param requestId Request identifier. 7041 * 7042 * @param url WebSocket request URL. 7043 * 7044 * @param initiator Request initiator. 7045 * <BR /><B CLASS=Opt>OPTIONAL</B> 7046 */ 7047 public webSocketCreated(String requestId, String url, Network.Initiator initiator) 7048 { 7049 super("Network", "webSocketCreated", 3); 7050 7051 // Exception-Check(s) to ensure that if any parameters which are not declared as 7052 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7053 7054 if (requestId == null) THROWS.throwNPE("requestId"); 7055 if (url == null) THROWS.throwNPE("url"); 7056 7057 this.requestId = requestId; 7058 this.url = url; 7059 this.initiator = initiator; 7060 } 7061 7062 /** 7063 * JSON Object Constructor 7064 * @param jo A Json-Object having data about an instance of {@code 'webSocketCreated'}. 7065 */ 7066 public webSocketCreated (JsonObject jo) 7067 { 7068 super("Network", "webSocketCreated", 3); 7069 7070 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7071 this.url = ReadJSON.getString(jo, "url", false, true); 7072 this.initiator = ReadJSON.getObject(jo, "initiator", Network.Initiator.class, true, false); 7073 } 7074 7075 7076 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7077 public boolean equals(Object other) 7078 { 7079 if (this == other) return true; 7080 if (other == null) return false; 7081 if (other.getClass() != this.getClass()) return false; 7082 7083 webSocketCreated o = (webSocketCreated) other; 7084 7085 return 7086 Objects.equals(this.requestId, o.requestId) 7087 && Objects.equals(this.url, o.url) 7088 && Objects.equals(this.initiator, o.initiator); 7089 } 7090 7091 /** Generates a Hash-Code for {@code 'this'} instance */ 7092 public int hashCode() 7093 { 7094 return 7095 Objects.hashCode(this.requestId) 7096 + Objects.hashCode(this.url) 7097 + this.initiator.hashCode(); 7098 } 7099 } 7100 7101 /** Fired when WebSocket message error occurs. */ 7102 public static class webSocketFrameError 7103 extends BrowserEvent 7104 implements java.io.Serializable 7105 { 7106 /** For Object Serialization. java.io.Serializable */ 7107 protected static final long serialVersionUID = 1; 7108 7109 public boolean[] optionals() 7110 { return new boolean[] { false, false, false, }; } 7111 7112 /** Request identifier. */ 7113 public final String requestId; 7114 7115 /** Timestamp. */ 7116 public final Number timestamp; 7117 7118 /** WebSocket error message. */ 7119 public final String errorMessage; 7120 7121 /** 7122 * Constructor 7123 * 7124 * @param requestId Request identifier. 7125 * 7126 * @param timestamp Timestamp. 7127 * 7128 * @param errorMessage WebSocket error message. 7129 */ 7130 public webSocketFrameError(String requestId, Number timestamp, String errorMessage) 7131 { 7132 super("Network", "webSocketFrameError", 3); 7133 7134 // Exception-Check(s) to ensure that if any parameters which are not declared as 7135 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7136 7137 if (requestId == null) THROWS.throwNPE("requestId"); 7138 if (timestamp == null) THROWS.throwNPE("timestamp"); 7139 if (errorMessage == null) THROWS.throwNPE("errorMessage"); 7140 7141 this.requestId = requestId; 7142 this.timestamp = timestamp; 7143 this.errorMessage = errorMessage; 7144 } 7145 7146 /** 7147 * JSON Object Constructor 7148 * @param jo A Json-Object having data about an instance of {@code 'webSocketFrameError'}. 7149 */ 7150 public webSocketFrameError (JsonObject jo) 7151 { 7152 super("Network", "webSocketFrameError", 3); 7153 7154 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7155 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7156 this.errorMessage = ReadJSON.getString(jo, "errorMessage", false, true); 7157 } 7158 7159 7160 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7161 public boolean equals(Object other) 7162 { 7163 if (this == other) return true; 7164 if (other == null) return false; 7165 if (other.getClass() != this.getClass()) return false; 7166 7167 webSocketFrameError o = (webSocketFrameError) other; 7168 7169 return 7170 Objects.equals(this.requestId, o.requestId) 7171 && Objects.equals(this.timestamp, o.timestamp) 7172 && Objects.equals(this.errorMessage, o.errorMessage); 7173 } 7174 7175 /** Generates a Hash-Code for {@code 'this'} instance */ 7176 public int hashCode() 7177 { 7178 return 7179 Objects.hashCode(this.requestId) 7180 + Objects.hashCode(this.timestamp) 7181 + Objects.hashCode(this.errorMessage); 7182 } 7183 } 7184 7185 /** Fired when WebSocket message is received. */ 7186 public static class webSocketFrameReceived 7187 extends BrowserEvent 7188 implements java.io.Serializable 7189 { 7190 /** For Object Serialization. java.io.Serializable */ 7191 protected static final long serialVersionUID = 1; 7192 7193 public boolean[] optionals() 7194 { return new boolean[] { false, false, false, }; } 7195 7196 /** Request identifier. */ 7197 public final String requestId; 7198 7199 /** Timestamp. */ 7200 public final Number timestamp; 7201 7202 /** WebSocket response data. */ 7203 public final Network.WebSocketFrame response; 7204 7205 /** 7206 * Constructor 7207 * 7208 * @param requestId Request identifier. 7209 * 7210 * @param timestamp Timestamp. 7211 * 7212 * @param response WebSocket response data. 7213 */ 7214 public webSocketFrameReceived 7215 (String requestId, Number timestamp, Network.WebSocketFrame response) 7216 { 7217 super("Network", "webSocketFrameReceived", 3); 7218 7219 // Exception-Check(s) to ensure that if any parameters which are not declared as 7220 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7221 7222 if (requestId == null) THROWS.throwNPE("requestId"); 7223 if (timestamp == null) THROWS.throwNPE("timestamp"); 7224 if (response == null) THROWS.throwNPE("response"); 7225 7226 this.requestId = requestId; 7227 this.timestamp = timestamp; 7228 this.response = response; 7229 } 7230 7231 /** 7232 * JSON Object Constructor 7233 * @param jo A Json-Object having data about an instance of {@code 'webSocketFrameReceived'}. 7234 */ 7235 public webSocketFrameReceived (JsonObject jo) 7236 { 7237 super("Network", "webSocketFrameReceived", 3); 7238 7239 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7240 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7241 this.response = ReadJSON.getObject(jo, "response", Network.WebSocketFrame.class, false, true); 7242 } 7243 7244 7245 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7246 public boolean equals(Object other) 7247 { 7248 if (this == other) return true; 7249 if (other == null) return false; 7250 if (other.getClass() != this.getClass()) return false; 7251 7252 webSocketFrameReceived o = (webSocketFrameReceived) other; 7253 7254 return 7255 Objects.equals(this.requestId, o.requestId) 7256 && Objects.equals(this.timestamp, o.timestamp) 7257 && Objects.equals(this.response, o.response); 7258 } 7259 7260 /** Generates a Hash-Code for {@code 'this'} instance */ 7261 public int hashCode() 7262 { 7263 return 7264 Objects.hashCode(this.requestId) 7265 + Objects.hashCode(this.timestamp) 7266 + this.response.hashCode(); 7267 } 7268 } 7269 7270 /** Fired when WebSocket message is sent. */ 7271 public static class webSocketFrameSent 7272 extends BrowserEvent 7273 implements java.io.Serializable 7274 { 7275 /** For Object Serialization. java.io.Serializable */ 7276 protected static final long serialVersionUID = 1; 7277 7278 public boolean[] optionals() 7279 { return new boolean[] { false, false, false, }; } 7280 7281 /** Request identifier. */ 7282 public final String requestId; 7283 7284 /** Timestamp. */ 7285 public final Number timestamp; 7286 7287 /** WebSocket response data. */ 7288 public final Network.WebSocketFrame response; 7289 7290 /** 7291 * Constructor 7292 * 7293 * @param requestId Request identifier. 7294 * 7295 * @param timestamp Timestamp. 7296 * 7297 * @param response WebSocket response data. 7298 */ 7299 public webSocketFrameSent 7300 (String requestId, Number timestamp, Network.WebSocketFrame response) 7301 { 7302 super("Network", "webSocketFrameSent", 3); 7303 7304 // Exception-Check(s) to ensure that if any parameters which are not declared as 7305 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7306 7307 if (requestId == null) THROWS.throwNPE("requestId"); 7308 if (timestamp == null) THROWS.throwNPE("timestamp"); 7309 if (response == null) THROWS.throwNPE("response"); 7310 7311 this.requestId = requestId; 7312 this.timestamp = timestamp; 7313 this.response = response; 7314 } 7315 7316 /** 7317 * JSON Object Constructor 7318 * @param jo A Json-Object having data about an instance of {@code 'webSocketFrameSent'}. 7319 */ 7320 public webSocketFrameSent (JsonObject jo) 7321 { 7322 super("Network", "webSocketFrameSent", 3); 7323 7324 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7325 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7326 this.response = ReadJSON.getObject(jo, "response", Network.WebSocketFrame.class, false, true); 7327 } 7328 7329 7330 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7331 public boolean equals(Object other) 7332 { 7333 if (this == other) return true; 7334 if (other == null) return false; 7335 if (other.getClass() != this.getClass()) return false; 7336 7337 webSocketFrameSent o = (webSocketFrameSent) other; 7338 7339 return 7340 Objects.equals(this.requestId, o.requestId) 7341 && Objects.equals(this.timestamp, o.timestamp) 7342 && Objects.equals(this.response, o.response); 7343 } 7344 7345 /** Generates a Hash-Code for {@code 'this'} instance */ 7346 public int hashCode() 7347 { 7348 return 7349 Objects.hashCode(this.requestId) 7350 + Objects.hashCode(this.timestamp) 7351 + this.response.hashCode(); 7352 } 7353 } 7354 7355 /** Fired when WebSocket handshake response becomes available. */ 7356 public static class webSocketHandshakeResponseReceived 7357 extends BrowserEvent 7358 implements java.io.Serializable 7359 { 7360 /** For Object Serialization. java.io.Serializable */ 7361 protected static final long serialVersionUID = 1; 7362 7363 public boolean[] optionals() 7364 { return new boolean[] { false, false, false, }; } 7365 7366 /** Request identifier. */ 7367 public final String requestId; 7368 7369 /** Timestamp. */ 7370 public final Number timestamp; 7371 7372 /** WebSocket response data. */ 7373 public final Network.WebSocketResponse response; 7374 7375 /** 7376 * Constructor 7377 * 7378 * @param requestId Request identifier. 7379 * 7380 * @param timestamp Timestamp. 7381 * 7382 * @param response WebSocket response data. 7383 */ 7384 public webSocketHandshakeResponseReceived 7385 (String requestId, Number timestamp, Network.WebSocketResponse response) 7386 { 7387 super("Network", "webSocketHandshakeResponseReceived", 3); 7388 7389 // Exception-Check(s) to ensure that if any parameters which are not declared as 7390 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7391 7392 if (requestId == null) THROWS.throwNPE("requestId"); 7393 if (timestamp == null) THROWS.throwNPE("timestamp"); 7394 if (response == null) THROWS.throwNPE("response"); 7395 7396 this.requestId = requestId; 7397 this.timestamp = timestamp; 7398 this.response = response; 7399 } 7400 7401 /** 7402 * JSON Object Constructor 7403 * @param jo A Json-Object having data about an instance of {@code 'webSocketHandshakeResponseReceived'}. 7404 */ 7405 public webSocketHandshakeResponseReceived (JsonObject jo) 7406 { 7407 super("Network", "webSocketHandshakeResponseReceived", 3); 7408 7409 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7410 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7411 this.response = ReadJSON.getObject(jo, "response", Network.WebSocketResponse.class, false, true); 7412 } 7413 7414 7415 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7416 public boolean equals(Object other) 7417 { 7418 if (this == other) return true; 7419 if (other == null) return false; 7420 if (other.getClass() != this.getClass()) return false; 7421 7422 webSocketHandshakeResponseReceived o = (webSocketHandshakeResponseReceived) other; 7423 7424 return 7425 Objects.equals(this.requestId, o.requestId) 7426 && Objects.equals(this.timestamp, o.timestamp) 7427 && Objects.equals(this.response, o.response); 7428 } 7429 7430 /** Generates a Hash-Code for {@code 'this'} instance */ 7431 public int hashCode() 7432 { 7433 return 7434 Objects.hashCode(this.requestId) 7435 + Objects.hashCode(this.timestamp) 7436 + this.response.hashCode(); 7437 } 7438 } 7439 7440 /** Fired when WebSocket is about to initiate handshake. */ 7441 public static class webSocketWillSendHandshakeRequest 7442 extends BrowserEvent 7443 implements java.io.Serializable 7444 { 7445 /** For Object Serialization. java.io.Serializable */ 7446 protected static final long serialVersionUID = 1; 7447 7448 public boolean[] optionals() 7449 { return new boolean[] { false, false, false, false, }; } 7450 7451 /** Request identifier. */ 7452 public final String requestId; 7453 7454 /** Timestamp. */ 7455 public final Number timestamp; 7456 7457 /** UTC Timestamp. */ 7458 public final Number wallTime; 7459 7460 /** WebSocket request data. */ 7461 public final Network.WebSocketRequest request; 7462 7463 /** 7464 * Constructor 7465 * 7466 * @param requestId Request identifier. 7467 * 7468 * @param timestamp Timestamp. 7469 * 7470 * @param wallTime UTC Timestamp. 7471 * 7472 * @param request WebSocket request data. 7473 */ 7474 public webSocketWillSendHandshakeRequest 7475 (String requestId, Number timestamp, Number wallTime, Network.WebSocketRequest request) 7476 { 7477 super("Network", "webSocketWillSendHandshakeRequest", 4); 7478 7479 // Exception-Check(s) to ensure that if any parameters which are not declared as 7480 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7481 7482 if (requestId == null) THROWS.throwNPE("requestId"); 7483 if (timestamp == null) THROWS.throwNPE("timestamp"); 7484 if (wallTime == null) THROWS.throwNPE("wallTime"); 7485 if (request == null) THROWS.throwNPE("request"); 7486 7487 this.requestId = requestId; 7488 this.timestamp = timestamp; 7489 this.wallTime = wallTime; 7490 this.request = request; 7491 } 7492 7493 /** 7494 * JSON Object Constructor 7495 * @param jo A Json-Object having data about an instance of {@code 'webSocketWillSendHandshakeRequest'}. 7496 */ 7497 public webSocketWillSendHandshakeRequest (JsonObject jo) 7498 { 7499 super("Network", "webSocketWillSendHandshakeRequest", 4); 7500 7501 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 7502 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7503 this.wallTime = ReadNumberJSON.get(jo, "wallTime", false, true); 7504 this.request = ReadJSON.getObject(jo, "request", Network.WebSocketRequest.class, false, true); 7505 } 7506 7507 7508 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7509 public boolean equals(Object other) 7510 { 7511 if (this == other) return true; 7512 if (other == null) return false; 7513 if (other.getClass() != this.getClass()) return false; 7514 7515 webSocketWillSendHandshakeRequest o = (webSocketWillSendHandshakeRequest) other; 7516 7517 return 7518 Objects.equals(this.requestId, o.requestId) 7519 && Objects.equals(this.timestamp, o.timestamp) 7520 && Objects.equals(this.wallTime, o.wallTime) 7521 && Objects.equals(this.request, o.request); 7522 } 7523 7524 /** Generates a Hash-Code for {@code 'this'} instance */ 7525 public int hashCode() 7526 { 7527 return 7528 Objects.hashCode(this.requestId) 7529 + Objects.hashCode(this.timestamp) 7530 + Objects.hashCode(this.wallTime) 7531 + this.request.hashCode(); 7532 } 7533 } 7534 7535 /** Fired upon WebTransport creation. */ 7536 public static class webTransportCreated 7537 extends BrowserEvent 7538 implements java.io.Serializable 7539 { 7540 /** For Object Serialization. java.io.Serializable */ 7541 protected static final long serialVersionUID = 1; 7542 7543 public boolean[] optionals() 7544 { return new boolean[] { false, false, false, true, }; } 7545 7546 /** WebTransport identifier. */ 7547 public final String transportId; 7548 7549 /** WebTransport request URL. */ 7550 public final String url; 7551 7552 /** Timestamp. */ 7553 public final Number timestamp; 7554 7555 /** 7556 * Request initiator. 7557 * <BR /><B CLASS=Opt>OPTIONAL</B> 7558 */ 7559 public final Network.Initiator initiator; 7560 7561 /** 7562 * Constructor 7563 * 7564 * @param transportId WebTransport identifier. 7565 * 7566 * @param url WebTransport request URL. 7567 * 7568 * @param timestamp Timestamp. 7569 * 7570 * @param initiator Request initiator. 7571 * <BR /><B CLASS=Opt>OPTIONAL</B> 7572 */ 7573 public webTransportCreated 7574 (String transportId, String url, Number timestamp, Network.Initiator initiator) 7575 { 7576 super("Network", "webTransportCreated", 4); 7577 7578 // Exception-Check(s) to ensure that if any parameters which are not declared as 7579 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7580 7581 if (transportId == null) THROWS.throwNPE("transportId"); 7582 if (url == null) THROWS.throwNPE("url"); 7583 if (timestamp == null) THROWS.throwNPE("timestamp"); 7584 7585 this.transportId = transportId; 7586 this.url = url; 7587 this.timestamp = timestamp; 7588 this.initiator = initiator; 7589 } 7590 7591 /** 7592 * JSON Object Constructor 7593 * @param jo A Json-Object having data about an instance of {@code 'webTransportCreated'}. 7594 */ 7595 public webTransportCreated (JsonObject jo) 7596 { 7597 super("Network", "webTransportCreated", 4); 7598 7599 this.transportId = ReadJSON.getString(jo, "transportId", false, true); 7600 this.url = ReadJSON.getString(jo, "url", false, true); 7601 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7602 this.initiator = ReadJSON.getObject(jo, "initiator", Network.Initiator.class, true, false); 7603 } 7604 7605 7606 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7607 public boolean equals(Object other) 7608 { 7609 if (this == other) return true; 7610 if (other == null) return false; 7611 if (other.getClass() != this.getClass()) return false; 7612 7613 webTransportCreated o = (webTransportCreated) other; 7614 7615 return 7616 Objects.equals(this.transportId, o.transportId) 7617 && Objects.equals(this.url, o.url) 7618 && Objects.equals(this.timestamp, o.timestamp) 7619 && Objects.equals(this.initiator, o.initiator); 7620 } 7621 7622 /** Generates a Hash-Code for {@code 'this'} instance */ 7623 public int hashCode() 7624 { 7625 return 7626 Objects.hashCode(this.transportId) 7627 + Objects.hashCode(this.url) 7628 + Objects.hashCode(this.timestamp) 7629 + this.initiator.hashCode(); 7630 } 7631 } 7632 7633 /** Fired when WebTransport handshake is finished. */ 7634 public static class webTransportConnectionEstablished 7635 extends BrowserEvent 7636 implements java.io.Serializable 7637 { 7638 /** For Object Serialization. java.io.Serializable */ 7639 protected static final long serialVersionUID = 1; 7640 7641 public boolean[] optionals() 7642 { return new boolean[] { false, false, }; } 7643 7644 /** WebTransport identifier. */ 7645 public final String transportId; 7646 7647 /** Timestamp. */ 7648 public final Number timestamp; 7649 7650 /** 7651 * Constructor 7652 * 7653 * @param transportId WebTransport identifier. 7654 * 7655 * @param timestamp Timestamp. 7656 */ 7657 public webTransportConnectionEstablished(String transportId, Number timestamp) 7658 { 7659 super("Network", "webTransportConnectionEstablished", 2); 7660 7661 // Exception-Check(s) to ensure that if any parameters which are not declared as 7662 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7663 7664 if (transportId == null) THROWS.throwNPE("transportId"); 7665 if (timestamp == null) THROWS.throwNPE("timestamp"); 7666 7667 this.transportId = transportId; 7668 this.timestamp = timestamp; 7669 } 7670 7671 /** 7672 * JSON Object Constructor 7673 * @param jo A Json-Object having data about an instance of {@code 'webTransportConnectionEstablished'}. 7674 */ 7675 public webTransportConnectionEstablished (JsonObject jo) 7676 { 7677 super("Network", "webTransportConnectionEstablished", 2); 7678 7679 this.transportId = ReadJSON.getString(jo, "transportId", false, true); 7680 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7681 } 7682 7683 7684 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7685 public boolean equals(Object other) 7686 { 7687 if (this == other) return true; 7688 if (other == null) return false; 7689 if (other.getClass() != this.getClass()) return false; 7690 7691 webTransportConnectionEstablished o = (webTransportConnectionEstablished) other; 7692 7693 return 7694 Objects.equals(this.transportId, o.transportId) 7695 && Objects.equals(this.timestamp, o.timestamp); 7696 } 7697 7698 /** Generates a Hash-Code for {@code 'this'} instance */ 7699 public int hashCode() 7700 { 7701 return 7702 Objects.hashCode(this.transportId) 7703 + Objects.hashCode(this.timestamp); 7704 } 7705 } 7706 7707 /** Fired when WebTransport is disposed. */ 7708 public static class webTransportClosed 7709 extends BrowserEvent 7710 implements java.io.Serializable 7711 { 7712 /** For Object Serialization. java.io.Serializable */ 7713 protected static final long serialVersionUID = 1; 7714 7715 public boolean[] optionals() 7716 { return new boolean[] { false, false, }; } 7717 7718 /** WebTransport identifier. */ 7719 public final String transportId; 7720 7721 /** Timestamp. */ 7722 public final Number timestamp; 7723 7724 /** 7725 * Constructor 7726 * 7727 * @param transportId WebTransport identifier. 7728 * 7729 * @param timestamp Timestamp. 7730 */ 7731 public webTransportClosed(String transportId, Number timestamp) 7732 { 7733 super("Network", "webTransportClosed", 2); 7734 7735 // Exception-Check(s) to ensure that if any parameters which are not declared as 7736 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7737 7738 if (transportId == null) THROWS.throwNPE("transportId"); 7739 if (timestamp == null) THROWS.throwNPE("timestamp"); 7740 7741 this.transportId = transportId; 7742 this.timestamp = timestamp; 7743 } 7744 7745 /** 7746 * JSON Object Constructor 7747 * @param jo A Json-Object having data about an instance of {@code 'webTransportClosed'}. 7748 */ 7749 public webTransportClosed (JsonObject jo) 7750 { 7751 super("Network", "webTransportClosed", 2); 7752 7753 this.transportId = ReadJSON.getString(jo, "transportId", false, true); 7754 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7755 } 7756 7757 7758 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7759 public boolean equals(Object other) 7760 { 7761 if (this == other) return true; 7762 if (other == null) return false; 7763 if (other.getClass() != this.getClass()) return false; 7764 7765 webTransportClosed o = (webTransportClosed) other; 7766 7767 return 7768 Objects.equals(this.transportId, o.transportId) 7769 && Objects.equals(this.timestamp, o.timestamp); 7770 } 7771 7772 /** Generates a Hash-Code for {@code 'this'} instance */ 7773 public int hashCode() 7774 { 7775 return 7776 Objects.hashCode(this.transportId) 7777 + Objects.hashCode(this.timestamp); 7778 } 7779 } 7780 7781 /** 7782 * Fired upon direct_socket.TCPSocket creation. 7783 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 7784 */ 7785 public static class directTCPSocketCreated 7786 extends BrowserEvent 7787 implements java.io.Serializable 7788 { 7789 /** For Object Serialization. java.io.Serializable */ 7790 protected static final long serialVersionUID = 1; 7791 7792 public boolean[] optionals() 7793 { return new boolean[] { false, false, false, false, false, true, }; } 7794 7795 /** <CODE>[No Description Provided by Google]</CODE> */ 7796 public final String identifier; 7797 7798 /** <CODE>[No Description Provided by Google]</CODE> */ 7799 public final String remoteAddr; 7800 7801 /** Unsigned int 16. */ 7802 public final int remotePort; 7803 7804 /** <CODE>[No Description Provided by Google]</CODE> */ 7805 public final Network.DirectTCPSocketOptions options; 7806 7807 /** <CODE>[No Description Provided by Google]</CODE> */ 7808 public final Number timestamp; 7809 7810 /** 7811 * <CODE>[No Description Provided by Google]</CODE> 7812 * <BR /><B CLASS=Opt>OPTIONAL</B> 7813 */ 7814 public final Network.Initiator initiator; 7815 7816 /** 7817 * Constructor 7818 * 7819 * @param identifier - 7820 * 7821 * @param remoteAddr - 7822 * 7823 * @param remotePort Unsigned int 16. 7824 * 7825 * @param options - 7826 * 7827 * @param timestamp - 7828 * 7829 * @param initiator - 7830 * <BR /><B CLASS=Opt>OPTIONAL</B> 7831 */ 7832 public directTCPSocketCreated( 7833 String identifier, String remoteAddr, int remotePort, 7834 Network.DirectTCPSocketOptions options, Number timestamp, Network.Initiator initiator 7835 ) 7836 { 7837 super("Network", "directTCPSocketCreated", 6); 7838 7839 // Exception-Check(s) to ensure that if any parameters which are not declared as 7840 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7841 7842 if (identifier == null) THROWS.throwNPE("identifier"); 7843 if (remoteAddr == null) THROWS.throwNPE("remoteAddr"); 7844 if (options == null) THROWS.throwNPE("options"); 7845 if (timestamp == null) THROWS.throwNPE("timestamp"); 7846 7847 this.identifier = identifier; 7848 this.remoteAddr = remoteAddr; 7849 this.remotePort = remotePort; 7850 this.options = options; 7851 this.timestamp = timestamp; 7852 this.initiator = initiator; 7853 } 7854 7855 /** 7856 * JSON Object Constructor 7857 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketCreated'}. 7858 */ 7859 public directTCPSocketCreated (JsonObject jo) 7860 { 7861 super("Network", "directTCPSocketCreated", 6); 7862 7863 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 7864 this.remoteAddr = ReadJSON.getString(jo, "remoteAddr", false, true); 7865 this.remotePort = ReadPrimJSON.getInt(jo, "remotePort"); 7866 this.options = ReadJSON.getObject(jo, "options", Network.DirectTCPSocketOptions.class, false, true); 7867 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7868 this.initiator = ReadJSON.getObject(jo, "initiator", Network.Initiator.class, true, false); 7869 } 7870 7871 7872 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7873 public boolean equals(Object other) 7874 { 7875 if (this == other) return true; 7876 if (other == null) return false; 7877 if (other.getClass() != this.getClass()) return false; 7878 7879 directTCPSocketCreated o = (directTCPSocketCreated) other; 7880 7881 return 7882 Objects.equals(this.identifier, o.identifier) 7883 && Objects.equals(this.remoteAddr, o.remoteAddr) 7884 && (this.remotePort == o.remotePort) 7885 && Objects.equals(this.options, o.options) 7886 && Objects.equals(this.timestamp, o.timestamp) 7887 && Objects.equals(this.initiator, o.initiator); 7888 } 7889 7890 /** Generates a Hash-Code for {@code 'this'} instance */ 7891 public int hashCode() 7892 { 7893 return 7894 Objects.hashCode(this.identifier) 7895 + Objects.hashCode(this.remoteAddr) 7896 + this.remotePort 7897 + this.options.hashCode() 7898 + Objects.hashCode(this.timestamp) 7899 + this.initiator.hashCode(); 7900 } 7901 } 7902 7903 /** 7904 * Fired when direct_socket.TCPSocket connection is opened. 7905 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 7906 */ 7907 public static class directTCPSocketOpened 7908 extends BrowserEvent 7909 implements java.io.Serializable 7910 { 7911 /** For Object Serialization. java.io.Serializable */ 7912 protected static final long serialVersionUID = 1; 7913 7914 public boolean[] optionals() 7915 { return new boolean[] { false, false, false, false, true, true, }; } 7916 7917 /** <CODE>[No Description Provided by Google]</CODE> */ 7918 public final String identifier; 7919 7920 /** <CODE>[No Description Provided by Google]</CODE> */ 7921 public final String remoteAddr; 7922 7923 /** Expected to be unsigned integer. */ 7924 public final int remotePort; 7925 7926 /** <CODE>[No Description Provided by Google]</CODE> */ 7927 public final Number timestamp; 7928 7929 /** 7930 * <CODE>[No Description Provided by Google]</CODE> 7931 * <BR /><B CLASS=Opt>OPTIONAL</B> 7932 */ 7933 public final String localAddr; 7934 7935 /** 7936 * Expected to be unsigned integer. 7937 * <BR /><B CLASS=Opt>OPTIONAL</B> 7938 */ 7939 public final Integer localPort; 7940 7941 /** 7942 * Constructor 7943 * 7944 * @param identifier - 7945 * 7946 * @param remoteAddr - 7947 * 7948 * @param remotePort Expected to be unsigned integer. 7949 * 7950 * @param timestamp - 7951 * 7952 * @param localAddr - 7953 * <BR /><B CLASS=Opt>OPTIONAL</B> 7954 * 7955 * @param localPort Expected to be unsigned integer. 7956 * <BR /><B CLASS=Opt>OPTIONAL</B> 7957 */ 7958 public directTCPSocketOpened( 7959 String identifier, String remoteAddr, int remotePort, Number timestamp, 7960 String localAddr, Integer localPort 7961 ) 7962 { 7963 super("Network", "directTCPSocketOpened", 6); 7964 7965 // Exception-Check(s) to ensure that if any parameters which are not declared as 7966 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 7967 7968 if (identifier == null) THROWS.throwNPE("identifier"); 7969 if (remoteAddr == null) THROWS.throwNPE("remoteAddr"); 7970 if (timestamp == null) THROWS.throwNPE("timestamp"); 7971 7972 this.identifier = identifier; 7973 this.remoteAddr = remoteAddr; 7974 this.remotePort = remotePort; 7975 this.timestamp = timestamp; 7976 this.localAddr = localAddr; 7977 this.localPort = localPort; 7978 } 7979 7980 /** 7981 * JSON Object Constructor 7982 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketOpened'}. 7983 */ 7984 public directTCPSocketOpened (JsonObject jo) 7985 { 7986 super("Network", "directTCPSocketOpened", 6); 7987 7988 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 7989 this.remoteAddr = ReadJSON.getString(jo, "remoteAddr", false, true); 7990 this.remotePort = ReadPrimJSON.getInt(jo, "remotePort"); 7991 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 7992 this.localAddr = ReadJSON.getString(jo, "localAddr", true, false); 7993 this.localPort = ReadBoxedJSON.getInteger(jo, "localPort", true); 7994 } 7995 7996 7997 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 7998 public boolean equals(Object other) 7999 { 8000 if (this == other) return true; 8001 if (other == null) return false; 8002 if (other.getClass() != this.getClass()) return false; 8003 8004 directTCPSocketOpened o = (directTCPSocketOpened) other; 8005 8006 return 8007 Objects.equals(this.identifier, o.identifier) 8008 && Objects.equals(this.remoteAddr, o.remoteAddr) 8009 && (this.remotePort == o.remotePort) 8010 && Objects.equals(this.timestamp, o.timestamp) 8011 && Objects.equals(this.localAddr, o.localAddr) 8012 && Objects.equals(this.localPort, o.localPort); 8013 } 8014 8015 /** Generates a Hash-Code for {@code 'this'} instance */ 8016 public int hashCode() 8017 { 8018 return 8019 Objects.hashCode(this.identifier) 8020 + Objects.hashCode(this.remoteAddr) 8021 + this.remotePort 8022 + Objects.hashCode(this.timestamp) 8023 + Objects.hashCode(this.localAddr) 8024 + Objects.hashCode(this.localPort); 8025 } 8026 } 8027 8028 /** 8029 * Fired when direct_socket.TCPSocket is aborted. 8030 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8031 */ 8032 public static class directTCPSocketAborted 8033 extends BrowserEvent 8034 implements java.io.Serializable 8035 { 8036 /** For Object Serialization. java.io.Serializable */ 8037 protected static final long serialVersionUID = 1; 8038 8039 public boolean[] optionals() 8040 { return new boolean[] { false, false, false, }; } 8041 8042 /** <CODE>[No Description Provided by Google]</CODE> */ 8043 public final String identifier; 8044 8045 /** <CODE>[No Description Provided by Google]</CODE> */ 8046 public final String errorMessage; 8047 8048 /** <CODE>[No Description Provided by Google]</CODE> */ 8049 public final Number timestamp; 8050 8051 /** 8052 * Constructor 8053 * 8054 * @param identifier - 8055 * 8056 * @param errorMessage - 8057 * 8058 * @param timestamp - 8059 */ 8060 public directTCPSocketAborted(String identifier, String errorMessage, Number timestamp) 8061 { 8062 super("Network", "directTCPSocketAborted", 3); 8063 8064 // Exception-Check(s) to ensure that if any parameters which are not declared as 8065 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8066 8067 if (identifier == null) THROWS.throwNPE("identifier"); 8068 if (errorMessage == null) THROWS.throwNPE("errorMessage"); 8069 if (timestamp == null) THROWS.throwNPE("timestamp"); 8070 8071 this.identifier = identifier; 8072 this.errorMessage = errorMessage; 8073 this.timestamp = timestamp; 8074 } 8075 8076 /** 8077 * JSON Object Constructor 8078 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketAborted'}. 8079 */ 8080 public directTCPSocketAborted (JsonObject jo) 8081 { 8082 super("Network", "directTCPSocketAborted", 3); 8083 8084 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8085 this.errorMessage = ReadJSON.getString(jo, "errorMessage", false, true); 8086 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8087 } 8088 8089 8090 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8091 public boolean equals(Object other) 8092 { 8093 if (this == other) return true; 8094 if (other == null) return false; 8095 if (other.getClass() != this.getClass()) return false; 8096 8097 directTCPSocketAborted o = (directTCPSocketAborted) other; 8098 8099 return 8100 Objects.equals(this.identifier, o.identifier) 8101 && Objects.equals(this.errorMessage, o.errorMessage) 8102 && Objects.equals(this.timestamp, o.timestamp); 8103 } 8104 8105 /** Generates a Hash-Code for {@code 'this'} instance */ 8106 public int hashCode() 8107 { 8108 return 8109 Objects.hashCode(this.identifier) 8110 + Objects.hashCode(this.errorMessage) 8111 + Objects.hashCode(this.timestamp); 8112 } 8113 } 8114 8115 /** 8116 * Fired when direct_socket.TCPSocket is closed. 8117 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8118 */ 8119 public static class directTCPSocketClosed 8120 extends BrowserEvent 8121 implements java.io.Serializable 8122 { 8123 /** For Object Serialization. java.io.Serializable */ 8124 protected static final long serialVersionUID = 1; 8125 8126 public boolean[] optionals() 8127 { return new boolean[] { false, false, }; } 8128 8129 /** <CODE>[No Description Provided by Google]</CODE> */ 8130 public final String identifier; 8131 8132 /** <CODE>[No Description Provided by Google]</CODE> */ 8133 public final Number timestamp; 8134 8135 /** 8136 * Constructor 8137 * 8138 * @param identifier - 8139 * 8140 * @param timestamp - 8141 */ 8142 public directTCPSocketClosed(String identifier, Number timestamp) 8143 { 8144 super("Network", "directTCPSocketClosed", 2); 8145 8146 // Exception-Check(s) to ensure that if any parameters which are not declared as 8147 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8148 8149 if (identifier == null) THROWS.throwNPE("identifier"); 8150 if (timestamp == null) THROWS.throwNPE("timestamp"); 8151 8152 this.identifier = identifier; 8153 this.timestamp = timestamp; 8154 } 8155 8156 /** 8157 * JSON Object Constructor 8158 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketClosed'}. 8159 */ 8160 public directTCPSocketClosed (JsonObject jo) 8161 { 8162 super("Network", "directTCPSocketClosed", 2); 8163 8164 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8165 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8166 } 8167 8168 8169 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8170 public boolean equals(Object other) 8171 { 8172 if (this == other) return true; 8173 if (other == null) return false; 8174 if (other.getClass() != this.getClass()) return false; 8175 8176 directTCPSocketClosed o = (directTCPSocketClosed) other; 8177 8178 return 8179 Objects.equals(this.identifier, o.identifier) 8180 && Objects.equals(this.timestamp, o.timestamp); 8181 } 8182 8183 /** Generates a Hash-Code for {@code 'this'} instance */ 8184 public int hashCode() 8185 { 8186 return 8187 Objects.hashCode(this.identifier) 8188 + Objects.hashCode(this.timestamp); 8189 } 8190 } 8191 8192 /** 8193 * Fired when data is sent to tcp direct socket stream. 8194 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8195 */ 8196 public static class directTCPSocketChunkSent 8197 extends BrowserEvent 8198 implements java.io.Serializable 8199 { 8200 /** For Object Serialization. java.io.Serializable */ 8201 protected static final long serialVersionUID = 1; 8202 8203 public boolean[] optionals() 8204 { return new boolean[] { false, false, false, }; } 8205 8206 /** <CODE>[No Description Provided by Google]</CODE> */ 8207 public final String identifier; 8208 8209 /** <CODE>[No Description Provided by Google]</CODE> */ 8210 public final String data; 8211 8212 /** <CODE>[No Description Provided by Google]</CODE> */ 8213 public final Number timestamp; 8214 8215 /** 8216 * Constructor 8217 * 8218 * @param identifier - 8219 * 8220 * @param data - 8221 * 8222 * @param timestamp - 8223 */ 8224 public directTCPSocketChunkSent(String identifier, String data, Number timestamp) 8225 { 8226 super("Network", "directTCPSocketChunkSent", 3); 8227 8228 // Exception-Check(s) to ensure that if any parameters which are not declared as 8229 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8230 8231 if (identifier == null) THROWS.throwNPE("identifier"); 8232 if (data == null) THROWS.throwNPE("data"); 8233 if (timestamp == null) THROWS.throwNPE("timestamp"); 8234 8235 this.identifier = identifier; 8236 this.data = data; 8237 this.timestamp = timestamp; 8238 } 8239 8240 /** 8241 * JSON Object Constructor 8242 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketChunkSent'}. 8243 */ 8244 public directTCPSocketChunkSent (JsonObject jo) 8245 { 8246 super("Network", "directTCPSocketChunkSent", 3); 8247 8248 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8249 this.data = ReadJSON.getString(jo, "data", false, true); 8250 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8251 } 8252 8253 8254 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8255 public boolean equals(Object other) 8256 { 8257 if (this == other) return true; 8258 if (other == null) return false; 8259 if (other.getClass() != this.getClass()) return false; 8260 8261 directTCPSocketChunkSent o = (directTCPSocketChunkSent) other; 8262 8263 return 8264 Objects.equals(this.identifier, o.identifier) 8265 && Objects.equals(this.data, o.data) 8266 && Objects.equals(this.timestamp, o.timestamp); 8267 } 8268 8269 /** Generates a Hash-Code for {@code 'this'} instance */ 8270 public int hashCode() 8271 { 8272 return 8273 Objects.hashCode(this.identifier) 8274 + Objects.hashCode(this.data) 8275 + Objects.hashCode(this.timestamp); 8276 } 8277 } 8278 8279 /** 8280 * Fired when data is received from tcp direct socket stream. 8281 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8282 */ 8283 public static class directTCPSocketChunkReceived 8284 extends BrowserEvent 8285 implements java.io.Serializable 8286 { 8287 /** For Object Serialization. java.io.Serializable */ 8288 protected static final long serialVersionUID = 1; 8289 8290 public boolean[] optionals() 8291 { return new boolean[] { false, false, false, }; } 8292 8293 /** <CODE>[No Description Provided by Google]</CODE> */ 8294 public final String identifier; 8295 8296 /** <CODE>[No Description Provided by Google]</CODE> */ 8297 public final String data; 8298 8299 /** <CODE>[No Description Provided by Google]</CODE> */ 8300 public final Number timestamp; 8301 8302 /** 8303 * Constructor 8304 * 8305 * @param identifier - 8306 * 8307 * @param data - 8308 * 8309 * @param timestamp - 8310 */ 8311 public directTCPSocketChunkReceived(String identifier, String data, Number timestamp) 8312 { 8313 super("Network", "directTCPSocketChunkReceived", 3); 8314 8315 // Exception-Check(s) to ensure that if any parameters which are not declared as 8316 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8317 8318 if (identifier == null) THROWS.throwNPE("identifier"); 8319 if (data == null) THROWS.throwNPE("data"); 8320 if (timestamp == null) THROWS.throwNPE("timestamp"); 8321 8322 this.identifier = identifier; 8323 this.data = data; 8324 this.timestamp = timestamp; 8325 } 8326 8327 /** 8328 * JSON Object Constructor 8329 * @param jo A Json-Object having data about an instance of {@code 'directTCPSocketChunkReceived'}. 8330 */ 8331 public directTCPSocketChunkReceived (JsonObject jo) 8332 { 8333 super("Network", "directTCPSocketChunkReceived", 3); 8334 8335 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8336 this.data = ReadJSON.getString(jo, "data", false, true); 8337 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8338 } 8339 8340 8341 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8342 public boolean equals(Object other) 8343 { 8344 if (this == other) return true; 8345 if (other == null) return false; 8346 if (other.getClass() != this.getClass()) return false; 8347 8348 directTCPSocketChunkReceived o = (directTCPSocketChunkReceived) other; 8349 8350 return 8351 Objects.equals(this.identifier, o.identifier) 8352 && Objects.equals(this.data, o.data) 8353 && Objects.equals(this.timestamp, o.timestamp); 8354 } 8355 8356 /** Generates a Hash-Code for {@code 'this'} instance */ 8357 public int hashCode() 8358 { 8359 return 8360 Objects.hashCode(this.identifier) 8361 + Objects.hashCode(this.data) 8362 + Objects.hashCode(this.timestamp); 8363 } 8364 } 8365 8366 /** 8367 * Fired upon direct_socket.UDPSocket creation. 8368 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8369 */ 8370 public static class directUDPSocketCreated 8371 extends BrowserEvent 8372 implements java.io.Serializable 8373 { 8374 /** For Object Serialization. java.io.Serializable */ 8375 protected static final long serialVersionUID = 1; 8376 8377 public boolean[] optionals() 8378 { return new boolean[] { false, false, false, true, }; } 8379 8380 /** <CODE>[No Description Provided by Google]</CODE> */ 8381 public final String identifier; 8382 8383 /** <CODE>[No Description Provided by Google]</CODE> */ 8384 public final Network.DirectUDPSocketOptions options; 8385 8386 /** <CODE>[No Description Provided by Google]</CODE> */ 8387 public final Number timestamp; 8388 8389 /** 8390 * <CODE>[No Description Provided by Google]</CODE> 8391 * <BR /><B CLASS=Opt>OPTIONAL</B> 8392 */ 8393 public final Network.Initiator initiator; 8394 8395 /** 8396 * Constructor 8397 * 8398 * @param identifier - 8399 * 8400 * @param options - 8401 * 8402 * @param timestamp - 8403 * 8404 * @param initiator - 8405 * <BR /><B CLASS=Opt>OPTIONAL</B> 8406 */ 8407 public directUDPSocketCreated( 8408 String identifier, Network.DirectUDPSocketOptions options, Number timestamp, 8409 Network.Initiator initiator 8410 ) 8411 { 8412 super("Network", "directUDPSocketCreated", 4); 8413 8414 // Exception-Check(s) to ensure that if any parameters which are not declared as 8415 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8416 8417 if (identifier == null) THROWS.throwNPE("identifier"); 8418 if (options == null) THROWS.throwNPE("options"); 8419 if (timestamp == null) THROWS.throwNPE("timestamp"); 8420 8421 this.identifier = identifier; 8422 this.options = options; 8423 this.timestamp = timestamp; 8424 this.initiator = initiator; 8425 } 8426 8427 /** 8428 * JSON Object Constructor 8429 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketCreated'}. 8430 */ 8431 public directUDPSocketCreated (JsonObject jo) 8432 { 8433 super("Network", "directUDPSocketCreated", 4); 8434 8435 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8436 this.options = ReadJSON.getObject(jo, "options", Network.DirectUDPSocketOptions.class, false, true); 8437 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8438 this.initiator = ReadJSON.getObject(jo, "initiator", Network.Initiator.class, true, false); 8439 } 8440 8441 8442 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8443 public boolean equals(Object other) 8444 { 8445 if (this == other) return true; 8446 if (other == null) return false; 8447 if (other.getClass() != this.getClass()) return false; 8448 8449 directUDPSocketCreated o = (directUDPSocketCreated) other; 8450 8451 return 8452 Objects.equals(this.identifier, o.identifier) 8453 && Objects.equals(this.options, o.options) 8454 && Objects.equals(this.timestamp, o.timestamp) 8455 && Objects.equals(this.initiator, o.initiator); 8456 } 8457 8458 /** Generates a Hash-Code for {@code 'this'} instance */ 8459 public int hashCode() 8460 { 8461 return 8462 Objects.hashCode(this.identifier) 8463 + this.options.hashCode() 8464 + Objects.hashCode(this.timestamp) 8465 + this.initiator.hashCode(); 8466 } 8467 } 8468 8469 /** 8470 * Fired when direct_socket.UDPSocket connection is opened. 8471 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8472 */ 8473 public static class directUDPSocketOpened 8474 extends BrowserEvent 8475 implements java.io.Serializable 8476 { 8477 /** For Object Serialization. java.io.Serializable */ 8478 protected static final long serialVersionUID = 1; 8479 8480 public boolean[] optionals() 8481 { return new boolean[] { false, false, false, false, true, true, }; } 8482 8483 /** <CODE>[No Description Provided by Google]</CODE> */ 8484 public final String identifier; 8485 8486 /** <CODE>[No Description Provided by Google]</CODE> */ 8487 public final String localAddr; 8488 8489 /** Expected to be unsigned integer. */ 8490 public final int localPort; 8491 8492 /** <CODE>[No Description Provided by Google]</CODE> */ 8493 public final Number timestamp; 8494 8495 /** 8496 * <CODE>[No Description Provided by Google]</CODE> 8497 * <BR /><B CLASS=Opt>OPTIONAL</B> 8498 */ 8499 public final String remoteAddr; 8500 8501 /** 8502 * Expected to be unsigned integer. 8503 * <BR /><B CLASS=Opt>OPTIONAL</B> 8504 */ 8505 public final Integer remotePort; 8506 8507 /** 8508 * Constructor 8509 * 8510 * @param identifier - 8511 * 8512 * @param localAddr - 8513 * 8514 * @param localPort Expected to be unsigned integer. 8515 * 8516 * @param timestamp - 8517 * 8518 * @param remoteAddr - 8519 * <BR /><B CLASS=Opt>OPTIONAL</B> 8520 * 8521 * @param remotePort Expected to be unsigned integer. 8522 * <BR /><B CLASS=Opt>OPTIONAL</B> 8523 */ 8524 public directUDPSocketOpened( 8525 String identifier, String localAddr, int localPort, Number timestamp, 8526 String remoteAddr, Integer remotePort 8527 ) 8528 { 8529 super("Network", "directUDPSocketOpened", 6); 8530 8531 // Exception-Check(s) to ensure that if any parameters which are not declared as 8532 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8533 8534 if (identifier == null) THROWS.throwNPE("identifier"); 8535 if (localAddr == null) THROWS.throwNPE("localAddr"); 8536 if (timestamp == null) THROWS.throwNPE("timestamp"); 8537 8538 this.identifier = identifier; 8539 this.localAddr = localAddr; 8540 this.localPort = localPort; 8541 this.timestamp = timestamp; 8542 this.remoteAddr = remoteAddr; 8543 this.remotePort = remotePort; 8544 } 8545 8546 /** 8547 * JSON Object Constructor 8548 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketOpened'}. 8549 */ 8550 public directUDPSocketOpened (JsonObject jo) 8551 { 8552 super("Network", "directUDPSocketOpened", 6); 8553 8554 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8555 this.localAddr = ReadJSON.getString(jo, "localAddr", false, true); 8556 this.localPort = ReadPrimJSON.getInt(jo, "localPort"); 8557 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8558 this.remoteAddr = ReadJSON.getString(jo, "remoteAddr", true, false); 8559 this.remotePort = ReadBoxedJSON.getInteger(jo, "remotePort", true); 8560 } 8561 8562 8563 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8564 public boolean equals(Object other) 8565 { 8566 if (this == other) return true; 8567 if (other == null) return false; 8568 if (other.getClass() != this.getClass()) return false; 8569 8570 directUDPSocketOpened o = (directUDPSocketOpened) other; 8571 8572 return 8573 Objects.equals(this.identifier, o.identifier) 8574 && Objects.equals(this.localAddr, o.localAddr) 8575 && (this.localPort == o.localPort) 8576 && Objects.equals(this.timestamp, o.timestamp) 8577 && Objects.equals(this.remoteAddr, o.remoteAddr) 8578 && Objects.equals(this.remotePort, o.remotePort); 8579 } 8580 8581 /** Generates a Hash-Code for {@code 'this'} instance */ 8582 public int hashCode() 8583 { 8584 return 8585 Objects.hashCode(this.identifier) 8586 + Objects.hashCode(this.localAddr) 8587 + this.localPort 8588 + Objects.hashCode(this.timestamp) 8589 + Objects.hashCode(this.remoteAddr) 8590 + Objects.hashCode(this.remotePort); 8591 } 8592 } 8593 8594 /** 8595 * Fired when direct_socket.UDPSocket is aborted. 8596 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8597 */ 8598 public static class directUDPSocketAborted 8599 extends BrowserEvent 8600 implements java.io.Serializable 8601 { 8602 /** For Object Serialization. java.io.Serializable */ 8603 protected static final long serialVersionUID = 1; 8604 8605 public boolean[] optionals() 8606 { return new boolean[] { false, false, false, }; } 8607 8608 /** <CODE>[No Description Provided by Google]</CODE> */ 8609 public final String identifier; 8610 8611 /** <CODE>[No Description Provided by Google]</CODE> */ 8612 public final String errorMessage; 8613 8614 /** <CODE>[No Description Provided by Google]</CODE> */ 8615 public final Number timestamp; 8616 8617 /** 8618 * Constructor 8619 * 8620 * @param identifier - 8621 * 8622 * @param errorMessage - 8623 * 8624 * @param timestamp - 8625 */ 8626 public directUDPSocketAborted(String identifier, String errorMessage, Number timestamp) 8627 { 8628 super("Network", "directUDPSocketAborted", 3); 8629 8630 // Exception-Check(s) to ensure that if any parameters which are not declared as 8631 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8632 8633 if (identifier == null) THROWS.throwNPE("identifier"); 8634 if (errorMessage == null) THROWS.throwNPE("errorMessage"); 8635 if (timestamp == null) THROWS.throwNPE("timestamp"); 8636 8637 this.identifier = identifier; 8638 this.errorMessage = errorMessage; 8639 this.timestamp = timestamp; 8640 } 8641 8642 /** 8643 * JSON Object Constructor 8644 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketAborted'}. 8645 */ 8646 public directUDPSocketAborted (JsonObject jo) 8647 { 8648 super("Network", "directUDPSocketAborted", 3); 8649 8650 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8651 this.errorMessage = ReadJSON.getString(jo, "errorMessage", false, true); 8652 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8653 } 8654 8655 8656 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8657 public boolean equals(Object other) 8658 { 8659 if (this == other) return true; 8660 if (other == null) return false; 8661 if (other.getClass() != this.getClass()) return false; 8662 8663 directUDPSocketAborted o = (directUDPSocketAborted) other; 8664 8665 return 8666 Objects.equals(this.identifier, o.identifier) 8667 && Objects.equals(this.errorMessage, o.errorMessage) 8668 && Objects.equals(this.timestamp, o.timestamp); 8669 } 8670 8671 /** Generates a Hash-Code for {@code 'this'} instance */ 8672 public int hashCode() 8673 { 8674 return 8675 Objects.hashCode(this.identifier) 8676 + Objects.hashCode(this.errorMessage) 8677 + Objects.hashCode(this.timestamp); 8678 } 8679 } 8680 8681 /** 8682 * Fired when direct_socket.UDPSocket is closed. 8683 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8684 */ 8685 public static class directUDPSocketClosed 8686 extends BrowserEvent 8687 implements java.io.Serializable 8688 { 8689 /** For Object Serialization. java.io.Serializable */ 8690 protected static final long serialVersionUID = 1; 8691 8692 public boolean[] optionals() 8693 { return new boolean[] { false, false, }; } 8694 8695 /** <CODE>[No Description Provided by Google]</CODE> */ 8696 public final String identifier; 8697 8698 /** <CODE>[No Description Provided by Google]</CODE> */ 8699 public final Number timestamp; 8700 8701 /** 8702 * Constructor 8703 * 8704 * @param identifier - 8705 * 8706 * @param timestamp - 8707 */ 8708 public directUDPSocketClosed(String identifier, Number timestamp) 8709 { 8710 super("Network", "directUDPSocketClosed", 2); 8711 8712 // Exception-Check(s) to ensure that if any parameters which are not declared as 8713 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8714 8715 if (identifier == null) THROWS.throwNPE("identifier"); 8716 if (timestamp == null) THROWS.throwNPE("timestamp"); 8717 8718 this.identifier = identifier; 8719 this.timestamp = timestamp; 8720 } 8721 8722 /** 8723 * JSON Object Constructor 8724 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketClosed'}. 8725 */ 8726 public directUDPSocketClosed (JsonObject jo) 8727 { 8728 super("Network", "directUDPSocketClosed", 2); 8729 8730 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8731 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8732 } 8733 8734 8735 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8736 public boolean equals(Object other) 8737 { 8738 if (this == other) return true; 8739 if (other == null) return false; 8740 if (other.getClass() != this.getClass()) return false; 8741 8742 directUDPSocketClosed o = (directUDPSocketClosed) other; 8743 8744 return 8745 Objects.equals(this.identifier, o.identifier) 8746 && Objects.equals(this.timestamp, o.timestamp); 8747 } 8748 8749 /** Generates a Hash-Code for {@code 'this'} instance */ 8750 public int hashCode() 8751 { 8752 return 8753 Objects.hashCode(this.identifier) 8754 + Objects.hashCode(this.timestamp); 8755 } 8756 } 8757 8758 /** 8759 * Fired when message is sent to udp direct socket stream. 8760 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8761 */ 8762 public static class directUDPSocketChunkSent 8763 extends BrowserEvent 8764 implements java.io.Serializable 8765 { 8766 /** For Object Serialization. java.io.Serializable */ 8767 protected static final long serialVersionUID = 1; 8768 8769 public boolean[] optionals() 8770 { return new boolean[] { false, false, false, }; } 8771 8772 /** <CODE>[No Description Provided by Google]</CODE> */ 8773 public final String identifier; 8774 8775 /** <CODE>[No Description Provided by Google]</CODE> */ 8776 public final Network.DirectUDPMessage message; 8777 8778 /** <CODE>[No Description Provided by Google]</CODE> */ 8779 public final Number timestamp; 8780 8781 /** 8782 * Constructor 8783 * 8784 * @param identifier - 8785 * 8786 * @param message - 8787 * 8788 * @param timestamp - 8789 */ 8790 public directUDPSocketChunkSent 8791 (String identifier, Network.DirectUDPMessage message, Number timestamp) 8792 { 8793 super("Network", "directUDPSocketChunkSent", 3); 8794 8795 // Exception-Check(s) to ensure that if any parameters which are not declared as 8796 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8797 8798 if (identifier == null) THROWS.throwNPE("identifier"); 8799 if (message == null) THROWS.throwNPE("message"); 8800 if (timestamp == null) THROWS.throwNPE("timestamp"); 8801 8802 this.identifier = identifier; 8803 this.message = message; 8804 this.timestamp = timestamp; 8805 } 8806 8807 /** 8808 * JSON Object Constructor 8809 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketChunkSent'}. 8810 */ 8811 public directUDPSocketChunkSent (JsonObject jo) 8812 { 8813 super("Network", "directUDPSocketChunkSent", 3); 8814 8815 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8816 this.message = ReadJSON.getObject(jo, "message", Network.DirectUDPMessage.class, false, true); 8817 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8818 } 8819 8820 8821 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8822 public boolean equals(Object other) 8823 { 8824 if (this == other) return true; 8825 if (other == null) return false; 8826 if (other.getClass() != this.getClass()) return false; 8827 8828 directUDPSocketChunkSent o = (directUDPSocketChunkSent) other; 8829 8830 return 8831 Objects.equals(this.identifier, o.identifier) 8832 && Objects.equals(this.message, o.message) 8833 && Objects.equals(this.timestamp, o.timestamp); 8834 } 8835 8836 /** Generates a Hash-Code for {@code 'this'} instance */ 8837 public int hashCode() 8838 { 8839 return 8840 Objects.hashCode(this.identifier) 8841 + this.message.hashCode() 8842 + Objects.hashCode(this.timestamp); 8843 } 8844 } 8845 8846 /** 8847 * Fired when message is received from udp direct socket stream. 8848 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8849 */ 8850 public static class directUDPSocketChunkReceived 8851 extends BrowserEvent 8852 implements java.io.Serializable 8853 { 8854 /** For Object Serialization. java.io.Serializable */ 8855 protected static final long serialVersionUID = 1; 8856 8857 public boolean[] optionals() 8858 { return new boolean[] { false, false, false, }; } 8859 8860 /** <CODE>[No Description Provided by Google]</CODE> */ 8861 public final String identifier; 8862 8863 /** <CODE>[No Description Provided by Google]</CODE> */ 8864 public final Network.DirectUDPMessage message; 8865 8866 /** <CODE>[No Description Provided by Google]</CODE> */ 8867 public final Number timestamp; 8868 8869 /** 8870 * Constructor 8871 * 8872 * @param identifier - 8873 * 8874 * @param message - 8875 * 8876 * @param timestamp - 8877 */ 8878 public directUDPSocketChunkReceived 8879 (String identifier, Network.DirectUDPMessage message, Number timestamp) 8880 { 8881 super("Network", "directUDPSocketChunkReceived", 3); 8882 8883 // Exception-Check(s) to ensure that if any parameters which are not declared as 8884 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 8885 8886 if (identifier == null) THROWS.throwNPE("identifier"); 8887 if (message == null) THROWS.throwNPE("message"); 8888 if (timestamp == null) THROWS.throwNPE("timestamp"); 8889 8890 this.identifier = identifier; 8891 this.message = message; 8892 this.timestamp = timestamp; 8893 } 8894 8895 /** 8896 * JSON Object Constructor 8897 * @param jo A Json-Object having data about an instance of {@code 'directUDPSocketChunkReceived'}. 8898 */ 8899 public directUDPSocketChunkReceived (JsonObject jo) 8900 { 8901 super("Network", "directUDPSocketChunkReceived", 3); 8902 8903 this.identifier = ReadJSON.getString(jo, "identifier", false, true); 8904 this.message = ReadJSON.getObject(jo, "message", Network.DirectUDPMessage.class, false, true); 8905 this.timestamp = ReadNumberJSON.get(jo, "timestamp", false, true); 8906 } 8907 8908 8909 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 8910 public boolean equals(Object other) 8911 { 8912 if (this == other) return true; 8913 if (other == null) return false; 8914 if (other.getClass() != this.getClass()) return false; 8915 8916 directUDPSocketChunkReceived o = (directUDPSocketChunkReceived) other; 8917 8918 return 8919 Objects.equals(this.identifier, o.identifier) 8920 && Objects.equals(this.message, o.message) 8921 && Objects.equals(this.timestamp, o.timestamp); 8922 } 8923 8924 /** Generates a Hash-Code for {@code 'this'} instance */ 8925 public int hashCode() 8926 { 8927 return 8928 Objects.hashCode(this.identifier) 8929 + this.message.hashCode() 8930 + Objects.hashCode(this.timestamp); 8931 } 8932 } 8933 8934 /** 8935 * Fired when additional information about a requestWillBeSent event is available from the 8936 * network stack. Not every requestWillBeSent event will have an additional 8937 * requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent 8938 * or requestWillBeSentExtraInfo will be fired first for the same request. 8939 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8940 */ 8941 public static class requestWillBeSentExtraInfo 8942 extends BrowserEvent 8943 implements java.io.Serializable 8944 { 8945 /** For Object Serialization. java.io.Serializable */ 8946 protected static final long serialVersionUID = 1; 8947 8948 public boolean[] optionals() 8949 { return new boolean[] { false, false, false, false, true, true, }; } 8950 8951 /** Request identifier. Used to match this information to an existing requestWillBeSent event. */ 8952 public final String requestId; 8953 8954 /** 8955 * A list of cookies potentially associated to the requested URL. This includes both cookies sent with 8956 * the request and the ones not sent; the latter are distinguished by having blockedReasons field set. 8957 */ 8958 public final Network.AssociatedCookie[] associatedCookies; 8959 8960 /** Raw request headers as they will be sent over the wire. */ 8961 public final JsonObject headers; 8962 8963 /** 8964 * Connection timing information for the request. 8965 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8966 */ 8967 public final Network.ConnectTiming connectTiming; 8968 8969 /** 8970 * The client security state set for the request. 8971 * <BR /><B CLASS=Opt>OPTIONAL</B> 8972 */ 8973 public final Network.ClientSecurityState clientSecurityState; 8974 8975 /** 8976 * Whether the site has partitioned cookies stored in a partition different than the current one. 8977 * <BR /><B CLASS=Opt>OPTIONAL</B> 8978 */ 8979 public final Boolean siteHasCookieInOtherPartition; 8980 8981 /** 8982 * Constructor 8983 * 8984 * @param requestId Request identifier. Used to match this information to an existing requestWillBeSent event. 8985 * 8986 * @param associatedCookies 8987 * A list of cookies potentially associated to the requested URL. This includes both cookies sent with 8988 * the request and the ones not sent; the latter are distinguished by having blockedReasons field set. 8989 * 8990 * @param headers Raw request headers as they will be sent over the wire. 8991 * 8992 * @param connectTiming Connection timing information for the request. 8993 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 8994 * 8995 * @param clientSecurityState The client security state set for the request. 8996 * <BR /><B CLASS=Opt>OPTIONAL</B> 8997 * 8998 * @param siteHasCookieInOtherPartition Whether the site has partitioned cookies stored in a partition different than the current one. 8999 * <BR /><B CLASS=Opt>OPTIONAL</B> 9000 */ 9001 public requestWillBeSentExtraInfo( 9002 String requestId, Network.AssociatedCookie[] associatedCookies, JsonObject headers, 9003 Network.ConnectTiming connectTiming, 9004 Network.ClientSecurityState clientSecurityState, 9005 Boolean siteHasCookieInOtherPartition 9006 ) 9007 { 9008 super("Network", "requestWillBeSentExtraInfo", 6); 9009 9010 // Exception-Check(s) to ensure that if any parameters which are not declared as 9011 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9012 9013 if (requestId == null) THROWS.throwNPE("requestId"); 9014 if (associatedCookies == null) THROWS.throwNPE("associatedCookies"); 9015 if (headers == null) THROWS.throwNPE("headers"); 9016 if (connectTiming == null) THROWS.throwNPE("connectTiming"); 9017 9018 this.requestId = requestId; 9019 this.associatedCookies = associatedCookies; 9020 this.headers = headers; 9021 this.connectTiming = connectTiming; 9022 this.clientSecurityState = clientSecurityState; 9023 this.siteHasCookieInOtherPartition = siteHasCookieInOtherPartition; 9024 } 9025 9026 /** 9027 * JSON Object Constructor 9028 * @param jo A Json-Object having data about an instance of {@code 'requestWillBeSentExtraInfo'}. 9029 */ 9030 public requestWillBeSentExtraInfo (JsonObject jo) 9031 { 9032 super("Network", "requestWillBeSentExtraInfo", 6); 9033 9034 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9035 this.associatedCookies = (jo.getJsonArray("associatedCookies") == null) 9036 ? null 9037 : RJArrIntoStream.objArr(jo.getJsonArray("associatedCookies"), null, 0, Network.AssociatedCookie.class).toArray(Network.AssociatedCookie[]::new); 9038 9039 this.headers = jo.getJsonObject("headers"); 9040 this.connectTiming = ReadJSON.getObject(jo, "connectTiming", Network.ConnectTiming.class, false, true); 9041 this.clientSecurityState = ReadJSON.getObject(jo, "clientSecurityState", Network.ClientSecurityState.class, true, false); 9042 this.siteHasCookieInOtherPartition = ReadBoxedJSON.getBoolean(jo, "siteHasCookieInOtherPartition", true); 9043 } 9044 9045 9046 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9047 public boolean equals(Object other) 9048 { 9049 if (this == other) return true; 9050 if (other == null) return false; 9051 if (other.getClass() != this.getClass()) return false; 9052 9053 requestWillBeSentExtraInfo o = (requestWillBeSentExtraInfo) other; 9054 9055 return 9056 Objects.equals(this.requestId, o.requestId) 9057 && Arrays.deepEquals(this.associatedCookies, o.associatedCookies) 9058 && Objects.equals(this.headers, o.headers) 9059 && Objects.equals(this.connectTiming, o.connectTiming) 9060 && Objects.equals(this.clientSecurityState, o.clientSecurityState) 9061 && Objects.equals(this.siteHasCookieInOtherPartition, o.siteHasCookieInOtherPartition); 9062 } 9063 9064 /** Generates a Hash-Code for {@code 'this'} instance */ 9065 public int hashCode() 9066 { 9067 return 9068 Objects.hashCode(this.requestId) 9069 + Arrays.deepHashCode(this.associatedCookies) 9070 + this.headers.hashCode() 9071 + this.connectTiming.hashCode() 9072 + this.clientSecurityState.hashCode() 9073 + Objects.hashCode(this.siteHasCookieInOtherPartition); 9074 } 9075 } 9076 9077 /** 9078 * Fired when additional information about a responseReceived event is available from the network 9079 * stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for 9080 * it, and responseReceivedExtraInfo may be fired before or after responseReceived. 9081 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9082 */ 9083 public static class responseReceivedExtraInfo 9084 extends BrowserEvent 9085 implements java.io.Serializable 9086 { 9087 /** For Object Serialization. java.io.Serializable */ 9088 protected static final long serialVersionUID = 1; 9089 9090 public boolean[] optionals() 9091 { return new boolean[] { false, false, false, false, false, true, true, true, true, }; } 9092 9093 /** Request identifier. Used to match this information to another responseReceived event. */ 9094 public final String requestId; 9095 9096 /** 9097 * A list of cookies which were not stored from the response along with the corresponding 9098 * reasons for blocking. The cookies here may not be valid due to syntax errors, which 9099 * are represented by the invalid cookie line string instead of a proper cookie. 9100 */ 9101 public final Network.BlockedSetCookieWithReason[] blockedCookies; 9102 9103 /** 9104 * Raw response headers as they were received over the wire. 9105 * Duplicate headers in the response are represented as a single key with their values 9106 * concatentated using {@code \n} as the separator. 9107 * See also {@code headersText} that contains verbatim text for HTTP/1.*. 9108 */ 9109 public final JsonObject headers; 9110 9111 /** 9112 * The IP address space of the resource. The address space can only be determined once the transport 9113 * established the connection, so we can't send it in {@code requestWillBeSentExtraInfo}. 9114 */ 9115 public final String resourceIPAddressSpace; 9116 9117 /** 9118 * The status code of the response. This is useful in cases the request failed and no responseReceived 9119 * event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code 9120 * for cached requests, where the status in responseReceived is a 200 and this will be 304. 9121 */ 9122 public final int statusCode; 9123 9124 /** 9125 * Raw response header text as it was received over the wire. The raw text may not always be 9126 * available, such as in the case of HTTP/2 or QUIC. 9127 * <BR /><B CLASS=Opt>OPTIONAL</B> 9128 */ 9129 public final String headersText; 9130 9131 /** 9132 * The cookie partition key that will be used to store partitioned cookies set in this response. 9133 * Only sent when partitioned cookies are enabled. 9134 * <BR /><B CLASS=Opt>OPTIONAL</B> 9135 <B CLASS=Exp>EXPERIMENTAL</B> 9136 */ 9137 public final Network.CookiePartitionKey cookiePartitionKey; 9138 9139 /** 9140 * True if partitioned cookies are enabled, but the partition key is not serializable to string. 9141 * <BR /><B CLASS=Opt>OPTIONAL</B> 9142 */ 9143 public final Boolean cookiePartitionKeyOpaque; 9144 9145 /** 9146 * A list of cookies which should have been blocked by 3PCD but are exempted and stored from 9147 * the response with the corresponding reason. 9148 * <BR /><B CLASS=Opt>OPTIONAL</B> 9149 */ 9150 public final Network.ExemptedSetCookieWithReason[] exemptedCookies; 9151 9152 /** 9153 * Constructor 9154 * 9155 * @param requestId Request identifier. Used to match this information to another responseReceived event. 9156 * 9157 * @param blockedCookies 9158 * A list of cookies which were not stored from the response along with the corresponding 9159 * reasons for blocking. The cookies here may not be valid due to syntax errors, which 9160 * are represented by the invalid cookie line string instead of a proper cookie. 9161 * 9162 * @param headers 9163 * Raw response headers as they were received over the wire. 9164 * Duplicate headers in the response are represented as a single key with their values 9165 * concatentated using {@code \n} as the separator. 9166 * See also {@code headersText} that contains verbatim text for HTTP/1.*. 9167 * 9168 * @param resourceIPAddressSpace 9169 * The IP address space of the resource. The address space can only be determined once the transport 9170 * established the connection, so we can't send it in {@code requestWillBeSentExtraInfo}. 9171 * 9172 * @param statusCode 9173 * The status code of the response. This is useful in cases the request failed and no responseReceived 9174 * event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code 9175 * for cached requests, where the status in responseReceived is a 200 and this will be 304. 9176 * 9177 * @param headersText 9178 * Raw response header text as it was received over the wire. The raw text may not always be 9179 * available, such as in the case of HTTP/2 or QUIC. 9180 * <BR /><B CLASS=Opt>OPTIONAL</B> 9181 * 9182 * @param cookiePartitionKey 9183 * The cookie partition key that will be used to store partitioned cookies set in this response. 9184 * Only sent when partitioned cookies are enabled. 9185 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 9186 * 9187 * @param cookiePartitionKeyOpaque True if partitioned cookies are enabled, but the partition key is not serializable to string. 9188 * <BR /><B CLASS=Opt>OPTIONAL</B> 9189 * 9190 * @param exemptedCookies 9191 * A list of cookies which should have been blocked by 3PCD but are exempted and stored from 9192 * the response with the corresponding reason. 9193 * <BR /><B CLASS=Opt>OPTIONAL</B> 9194 */ 9195 public responseReceivedExtraInfo( 9196 String requestId, Network.BlockedSetCookieWithReason[] blockedCookies, 9197 JsonObject headers, String resourceIPAddressSpace, int statusCode, 9198 String headersText, Network.CookiePartitionKey cookiePartitionKey, 9199 Boolean cookiePartitionKeyOpaque, 9200 Network.ExemptedSetCookieWithReason[] exemptedCookies 9201 ) 9202 { 9203 super("Network", "responseReceivedExtraInfo", 9); 9204 9205 // Exception-Check(s) to ensure that if any parameters which are not declared as 9206 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9207 9208 if (requestId == null) THROWS.throwNPE("requestId"); 9209 if (blockedCookies == null) THROWS.throwNPE("blockedCookies"); 9210 if (headers == null) THROWS.throwNPE("headers"); 9211 if (resourceIPAddressSpace == null) THROWS.throwNPE("resourceIPAddressSpace"); 9212 9213 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9214 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9215 9216 THROWS.checkIAE("resourceIPAddressSpace", resourceIPAddressSpace, "Network.IPAddressSpace", Network.IPAddressSpace); 9217 9218 this.requestId = requestId; 9219 this.blockedCookies = blockedCookies; 9220 this.headers = headers; 9221 this.resourceIPAddressSpace = resourceIPAddressSpace; 9222 this.statusCode = statusCode; 9223 this.headersText = headersText; 9224 this.cookiePartitionKey = cookiePartitionKey; 9225 this.cookiePartitionKeyOpaque = cookiePartitionKeyOpaque; 9226 this.exemptedCookies = exemptedCookies; 9227 } 9228 9229 /** 9230 * JSON Object Constructor 9231 * @param jo A Json-Object having data about an instance of {@code 'responseReceivedExtraInfo'}. 9232 */ 9233 public responseReceivedExtraInfo (JsonObject jo) 9234 { 9235 super("Network", "responseReceivedExtraInfo", 9); 9236 9237 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9238 this.blockedCookies = (jo.getJsonArray("blockedCookies") == null) 9239 ? null 9240 : RJArrIntoStream.objArr(jo.getJsonArray("blockedCookies"), null, 0, Network.BlockedSetCookieWithReason.class).toArray(Network.BlockedSetCookieWithReason[]::new); 9241 9242 this.headers = jo.getJsonObject("headers"); 9243 this.resourceIPAddressSpace = ReadJSON.getString(jo, "resourceIPAddressSpace", false, true); 9244 this.statusCode = ReadPrimJSON.getInt(jo, "statusCode"); 9245 this.headersText = ReadJSON.getString(jo, "headersText", true, false); 9246 this.cookiePartitionKey = ReadJSON.getObject(jo, "cookiePartitionKey", Network.CookiePartitionKey.class, true, false); 9247 this.cookiePartitionKeyOpaque = ReadBoxedJSON.getBoolean(jo, "cookiePartitionKeyOpaque", true); 9248 this.exemptedCookies = (jo.getJsonArray("exemptedCookies") == null) 9249 ? null 9250 : RJArrIntoStream.objArr(jo.getJsonArray("exemptedCookies"), null, 0, Network.ExemptedSetCookieWithReason.class).toArray(Network.ExemptedSetCookieWithReason[]::new); 9251 9252 } 9253 9254 9255 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9256 public boolean equals(Object other) 9257 { 9258 if (this == other) return true; 9259 if (other == null) return false; 9260 if (other.getClass() != this.getClass()) return false; 9261 9262 responseReceivedExtraInfo o = (responseReceivedExtraInfo) other; 9263 9264 return 9265 Objects.equals(this.requestId, o.requestId) 9266 && Arrays.deepEquals(this.blockedCookies, o.blockedCookies) 9267 && Objects.equals(this.headers, o.headers) 9268 && Objects.equals(this.resourceIPAddressSpace, o.resourceIPAddressSpace) 9269 && (this.statusCode == o.statusCode) 9270 && Objects.equals(this.headersText, o.headersText) 9271 && Objects.equals(this.cookiePartitionKey, o.cookiePartitionKey) 9272 && Objects.equals(this.cookiePartitionKeyOpaque, o.cookiePartitionKeyOpaque) 9273 && Arrays.deepEquals(this.exemptedCookies, o.exemptedCookies); 9274 } 9275 9276 /** Generates a Hash-Code for {@code 'this'} instance */ 9277 public int hashCode() 9278 { 9279 return 9280 Objects.hashCode(this.requestId) 9281 + Arrays.deepHashCode(this.blockedCookies) 9282 + this.headers.hashCode() 9283 + Objects.hashCode(this.resourceIPAddressSpace) 9284 + this.statusCode 9285 + Objects.hashCode(this.headersText) 9286 + this.cookiePartitionKey.hashCode() 9287 + Objects.hashCode(this.cookiePartitionKeyOpaque) 9288 + Arrays.deepHashCode(this.exemptedCookies); 9289 } 9290 } 9291 9292 /** 9293 * Fired when 103 Early Hints headers is received in addition to the common response. 9294 * Not every responseReceived event will have an responseReceivedEarlyHints fired. 9295 * Only one responseReceivedEarlyHints may be fired for eached responseReceived event. 9296 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9297 */ 9298 public static class responseReceivedEarlyHints 9299 extends BrowserEvent 9300 implements java.io.Serializable 9301 { 9302 /** For Object Serialization. java.io.Serializable */ 9303 protected static final long serialVersionUID = 1; 9304 9305 public boolean[] optionals() 9306 { return new boolean[] { false, false, }; } 9307 9308 /** Request identifier. Used to match this information to another responseReceived event. */ 9309 public final String requestId; 9310 9311 /** 9312 * Raw response headers as they were received over the wire. 9313 * Duplicate headers in the response are represented as a single key with their values 9314 * concatentated using {@code \n} as the separator. 9315 * See also {@code headersText} that contains verbatim text for HTTP/1.*. 9316 */ 9317 public final JsonObject headers; 9318 9319 /** 9320 * Constructor 9321 * 9322 * @param requestId Request identifier. Used to match this information to another responseReceived event. 9323 * 9324 * @param headers 9325 * Raw response headers as they were received over the wire. 9326 * Duplicate headers in the response are represented as a single key with their values 9327 * concatentated using {@code \n} as the separator. 9328 * See also {@code headersText} that contains verbatim text for HTTP/1.*. 9329 */ 9330 public responseReceivedEarlyHints(String requestId, JsonObject headers) 9331 { 9332 super("Network", "responseReceivedEarlyHints", 2); 9333 9334 // Exception-Check(s) to ensure that if any parameters which are not declared as 9335 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9336 9337 if (requestId == null) THROWS.throwNPE("requestId"); 9338 if (headers == null) THROWS.throwNPE("headers"); 9339 9340 this.requestId = requestId; 9341 this.headers = headers; 9342 } 9343 9344 /** 9345 * JSON Object Constructor 9346 * @param jo A Json-Object having data about an instance of {@code 'responseReceivedEarlyHints'}. 9347 */ 9348 public responseReceivedEarlyHints (JsonObject jo) 9349 { 9350 super("Network", "responseReceivedEarlyHints", 2); 9351 9352 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9353 this.headers = jo.getJsonObject("headers"); 9354 } 9355 9356 9357 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9358 public boolean equals(Object other) 9359 { 9360 if (this == other) return true; 9361 if (other == null) return false; 9362 if (other.getClass() != this.getClass()) return false; 9363 9364 responseReceivedEarlyHints o = (responseReceivedEarlyHints) other; 9365 9366 return 9367 Objects.equals(this.requestId, o.requestId) 9368 && Objects.equals(this.headers, o.headers); 9369 } 9370 9371 /** Generates a Hash-Code for {@code 'this'} instance */ 9372 public int hashCode() 9373 { 9374 return 9375 Objects.hashCode(this.requestId) 9376 + this.headers.hashCode(); 9377 } 9378 } 9379 9380 /** 9381 * Fired exactly once for each Trust Token operation. Depending on 9382 * the type of the operation and whether the operation succeeded or 9383 * failed, the event is fired before the corresponding request was sent 9384 * or after the response was received. 9385 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9386 */ 9387 public static class trustTokenOperationDone 9388 extends BrowserEvent 9389 implements java.io.Serializable 9390 { 9391 /** For Object Serialization. java.io.Serializable */ 9392 protected static final long serialVersionUID = 1; 9393 9394 public boolean[] optionals() 9395 { return new boolean[] { false, false, false, true, true, true, }; } 9396 9397 /** 9398 * Detailed success or error status of the operation. 9399 * 'AlreadyExists' also signifies a successful operation, as the result 9400 * of the operation already exists und thus, the operation was abort 9401 * preemptively (e.g. a cache hit). 9402 */ 9403 public final String status; 9404 9405 /** <CODE>[No Description Provided by Google]</CODE> */ 9406 public final String type; 9407 9408 /** <CODE>[No Description Provided by Google]</CODE> */ 9409 public final String requestId; 9410 9411 /** 9412 * Top level origin. The context in which the operation was attempted. 9413 * <BR /><B CLASS=Opt>OPTIONAL</B> 9414 */ 9415 public final String topLevelOrigin; 9416 9417 /** 9418 * Origin of the issuer in case of a "Issuance" or "Redemption" operation. 9419 * <BR /><B CLASS=Opt>OPTIONAL</B> 9420 */ 9421 public final String issuerOrigin; 9422 9423 /** 9424 * The number of obtained Trust Tokens on a successful "Issuance" operation. 9425 * <BR /><B CLASS=Opt>OPTIONAL</B> 9426 */ 9427 public final Integer issuedTokenCount; 9428 9429 /** 9430 * Constructor 9431 * 9432 * @param status 9433 * Detailed success or error status of the operation. 9434 * 'AlreadyExists' also signifies a successful operation, as the result 9435 * of the operation already exists und thus, the operation was abort 9436 * preemptively (e.g. a cache hit). 9437 * <BR />Acceptable Values: ["Ok", "InvalidArgument", "MissingIssuerKeys", "FailedPrecondition", "ResourceExhausted", "AlreadyExists", "ResourceLimited", "Unauthorized", "BadResponse", "InternalError", "UnknownError", "FulfilledLocally", "SiteIssuerLimit"] 9438 * 9439 * @param type - 9440 * 9441 * @param requestId - 9442 * 9443 * @param topLevelOrigin Top level origin. The context in which the operation was attempted. 9444 * <BR /><B CLASS=Opt>OPTIONAL</B> 9445 * 9446 * @param issuerOrigin Origin of the issuer in case of a "Issuance" or "Redemption" operation. 9447 * <BR /><B CLASS=Opt>OPTIONAL</B> 9448 * 9449 * @param issuedTokenCount The number of obtained Trust Tokens on a successful "Issuance" operation. 9450 * <BR /><B CLASS=Opt>OPTIONAL</B> 9451 */ 9452 public trustTokenOperationDone( 9453 String status, String type, String requestId, String topLevelOrigin, 9454 String issuerOrigin, Integer issuedTokenCount 9455 ) 9456 { 9457 super("Network", "trustTokenOperationDone", 6); 9458 9459 // Exception-Check(s) to ensure that if any parameters which are not declared as 9460 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9461 9462 if (status == null) THROWS.throwNPE("status"); 9463 if (type == null) THROWS.throwNPE("type"); 9464 if (requestId == null) THROWS.throwNPE("requestId"); 9465 9466 // Exception-Check(s) to ensure that if any parameters which must adhere to a 9467 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 9468 9469 THROWS.checkIAE( 9470 "status", status, 9471 "Ok", "InvalidArgument", "MissingIssuerKeys", "FailedPrecondition", "ResourceExhausted", "AlreadyExists", "ResourceLimited", "Unauthorized", "BadResponse", "InternalError", "UnknownError", "FulfilledLocally", "SiteIssuerLimit" 9472 ); 9473 THROWS.checkIAE("type", type, "Network.TrustTokenOperationType", Network.TrustTokenOperationType); 9474 9475 this.status = status; 9476 this.type = type; 9477 this.requestId = requestId; 9478 this.topLevelOrigin = topLevelOrigin; 9479 this.issuerOrigin = issuerOrigin; 9480 this.issuedTokenCount = issuedTokenCount; 9481 } 9482 9483 /** 9484 * JSON Object Constructor 9485 * @param jo A Json-Object having data about an instance of {@code 'trustTokenOperationDone'}. 9486 */ 9487 public trustTokenOperationDone (JsonObject jo) 9488 { 9489 super("Network", "trustTokenOperationDone", 6); 9490 9491 this.status = ReadJSON.getString(jo, "status", false, true); 9492 this.type = ReadJSON.getString(jo, "type", false, true); 9493 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9494 this.topLevelOrigin = ReadJSON.getString(jo, "topLevelOrigin", true, false); 9495 this.issuerOrigin = ReadJSON.getString(jo, "issuerOrigin", true, false); 9496 this.issuedTokenCount = ReadBoxedJSON.getInteger(jo, "issuedTokenCount", true); 9497 } 9498 9499 9500 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9501 public boolean equals(Object other) 9502 { 9503 if (this == other) return true; 9504 if (other == null) return false; 9505 if (other.getClass() != this.getClass()) return false; 9506 9507 trustTokenOperationDone o = (trustTokenOperationDone) other; 9508 9509 return 9510 Objects.equals(this.status, o.status) 9511 && Objects.equals(this.type, o.type) 9512 && Objects.equals(this.requestId, o.requestId) 9513 && Objects.equals(this.topLevelOrigin, o.topLevelOrigin) 9514 && Objects.equals(this.issuerOrigin, o.issuerOrigin) 9515 && Objects.equals(this.issuedTokenCount, o.issuedTokenCount); 9516 } 9517 9518 /** Generates a Hash-Code for {@code 'this'} instance */ 9519 public int hashCode() 9520 { 9521 return 9522 Objects.hashCode(this.status) 9523 + Objects.hashCode(this.type) 9524 + Objects.hashCode(this.requestId) 9525 + Objects.hashCode(this.topLevelOrigin) 9526 + Objects.hashCode(this.issuerOrigin) 9527 + Objects.hashCode(this.issuedTokenCount); 9528 } 9529 } 9530 9531 /** 9532 * Fired once when parsing the .wbn file has succeeded. 9533 * The event contains the information about the web bundle contents. 9534 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9535 */ 9536 public static class subresourceWebBundleMetadataReceived 9537 extends BrowserEvent 9538 implements java.io.Serializable 9539 { 9540 /** For Object Serialization. java.io.Serializable */ 9541 protected static final long serialVersionUID = 1; 9542 9543 public boolean[] optionals() 9544 { return new boolean[] { false, false, }; } 9545 9546 /** Request identifier. Used to match this information to another event. */ 9547 public final String requestId; 9548 9549 /** A list of URLs of resources in the subresource Web Bundle. */ 9550 public final String[] urls; 9551 9552 /** 9553 * Constructor 9554 * 9555 * @param requestId Request identifier. Used to match this information to another event. 9556 * 9557 * @param urls A list of URLs of resources in the subresource Web Bundle. 9558 */ 9559 public subresourceWebBundleMetadataReceived(String requestId, String[] urls) 9560 { 9561 super("Network", "subresourceWebBundleMetadataReceived", 2); 9562 9563 // Exception-Check(s) to ensure that if any parameters which are not declared as 9564 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9565 9566 if (requestId == null) THROWS.throwNPE("requestId"); 9567 if (urls == null) THROWS.throwNPE("urls"); 9568 9569 this.requestId = requestId; 9570 this.urls = urls; 9571 } 9572 9573 /** 9574 * JSON Object Constructor 9575 * @param jo A Json-Object having data about an instance of {@code 'subresourceWebBundleMetadataReceived'}. 9576 */ 9577 public subresourceWebBundleMetadataReceived (JsonObject jo) 9578 { 9579 super("Network", "subresourceWebBundleMetadataReceived", 2); 9580 9581 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9582 this.urls = (jo.getJsonArray("urls") == null) 9583 ? null 9584 : RJArrIntoStream.strArr(jo.getJsonArray("urls"), null, 0).toArray(String[]::new); 9585 9586 } 9587 9588 9589 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9590 public boolean equals(Object other) 9591 { 9592 if (this == other) return true; 9593 if (other == null) return false; 9594 if (other.getClass() != this.getClass()) return false; 9595 9596 subresourceWebBundleMetadataReceived o = (subresourceWebBundleMetadataReceived) other; 9597 9598 return 9599 Objects.equals(this.requestId, o.requestId) 9600 && Arrays.deepEquals(this.urls, o.urls); 9601 } 9602 9603 /** Generates a Hash-Code for {@code 'this'} instance */ 9604 public int hashCode() 9605 { 9606 return 9607 Objects.hashCode(this.requestId) 9608 + Arrays.deepHashCode(this.urls); 9609 } 9610 } 9611 9612 /** 9613 * Fired once when parsing the .wbn file has failed. 9614 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9615 */ 9616 public static class subresourceWebBundleMetadataError 9617 extends BrowserEvent 9618 implements java.io.Serializable 9619 { 9620 /** For Object Serialization. java.io.Serializable */ 9621 protected static final long serialVersionUID = 1; 9622 9623 public boolean[] optionals() 9624 { return new boolean[] { false, false, }; } 9625 9626 /** Request identifier. Used to match this information to another event. */ 9627 public final String requestId; 9628 9629 /** Error message */ 9630 public final String errorMessage; 9631 9632 /** 9633 * Constructor 9634 * 9635 * @param requestId Request identifier. Used to match this information to another event. 9636 * 9637 * @param errorMessage Error message 9638 */ 9639 public subresourceWebBundleMetadataError(String requestId, String errorMessage) 9640 { 9641 super("Network", "subresourceWebBundleMetadataError", 2); 9642 9643 // Exception-Check(s) to ensure that if any parameters which are not declared as 9644 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9645 9646 if (requestId == null) THROWS.throwNPE("requestId"); 9647 if (errorMessage == null) THROWS.throwNPE("errorMessage"); 9648 9649 this.requestId = requestId; 9650 this.errorMessage = errorMessage; 9651 } 9652 9653 /** 9654 * JSON Object Constructor 9655 * @param jo A Json-Object having data about an instance of {@code 'subresourceWebBundleMetadataError'}. 9656 */ 9657 public subresourceWebBundleMetadataError (JsonObject jo) 9658 { 9659 super("Network", "subresourceWebBundleMetadataError", 2); 9660 9661 this.requestId = ReadJSON.getString(jo, "requestId", false, true); 9662 this.errorMessage = ReadJSON.getString(jo, "errorMessage", false, true); 9663 } 9664 9665 9666 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9667 public boolean equals(Object other) 9668 { 9669 if (this == other) return true; 9670 if (other == null) return false; 9671 if (other.getClass() != this.getClass()) return false; 9672 9673 subresourceWebBundleMetadataError o = (subresourceWebBundleMetadataError) other; 9674 9675 return 9676 Objects.equals(this.requestId, o.requestId) 9677 && Objects.equals(this.errorMessage, o.errorMessage); 9678 } 9679 9680 /** Generates a Hash-Code for {@code 'this'} instance */ 9681 public int hashCode() 9682 { 9683 return 9684 Objects.hashCode(this.requestId) 9685 + Objects.hashCode(this.errorMessage); 9686 } 9687 } 9688 9689 /** 9690 * Fired when handling requests for resources within a .wbn file. 9691 * Note: this will only be fired for resources that are requested by the webpage. 9692 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9693 */ 9694 public static class subresourceWebBundleInnerResponseParsed 9695 extends BrowserEvent 9696 implements java.io.Serializable 9697 { 9698 /** For Object Serialization. java.io.Serializable */ 9699 protected static final long serialVersionUID = 1; 9700 9701 public boolean[] optionals() 9702 { return new boolean[] { false, false, true, }; } 9703 9704 /** Request identifier of the subresource request */ 9705 public final String innerRequestId; 9706 9707 /** URL of the subresource resource. */ 9708 public final String innerRequestURL; 9709 9710 /** 9711 * Bundle request identifier. Used to match this information to another event. 9712 * This made be absent in case when the instrumentation was enabled only 9713 * after webbundle was parsed. 9714 * <BR /><B CLASS=Opt>OPTIONAL</B> 9715 */ 9716 public final String bundleRequestId; 9717 9718 /** 9719 * Constructor 9720 * 9721 * @param innerRequestId Request identifier of the subresource request 9722 * 9723 * @param innerRequestURL URL of the subresource resource. 9724 * 9725 * @param bundleRequestId 9726 * Bundle request identifier. Used to match this information to another event. 9727 * This made be absent in case when the instrumentation was enabled only 9728 * after webbundle was parsed. 9729 * <BR /><B CLASS=Opt>OPTIONAL</B> 9730 */ 9731 public subresourceWebBundleInnerResponseParsed 9732 (String innerRequestId, String innerRequestURL, String bundleRequestId) 9733 { 9734 super("Network", "subresourceWebBundleInnerResponseParsed", 3); 9735 9736 // Exception-Check(s) to ensure that if any parameters which are not declared as 9737 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9738 9739 if (innerRequestId == null) THROWS.throwNPE("innerRequestId"); 9740 if (innerRequestURL == null) THROWS.throwNPE("innerRequestURL"); 9741 9742 this.innerRequestId = innerRequestId; 9743 this.innerRequestURL = innerRequestURL; 9744 this.bundleRequestId = bundleRequestId; 9745 } 9746 9747 /** 9748 * JSON Object Constructor 9749 * @param jo A Json-Object having data about an instance of {@code 'subresourceWebBundleInnerResponseParsed'}. 9750 */ 9751 public subresourceWebBundleInnerResponseParsed (JsonObject jo) 9752 { 9753 super("Network", "subresourceWebBundleInnerResponseParsed", 3); 9754 9755 this.innerRequestId = ReadJSON.getString(jo, "innerRequestId", false, true); 9756 this.innerRequestURL = ReadJSON.getString(jo, "innerRequestURL", false, true); 9757 this.bundleRequestId = ReadJSON.getString(jo, "bundleRequestId", true, false); 9758 } 9759 9760 9761 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9762 public boolean equals(Object other) 9763 { 9764 if (this == other) return true; 9765 if (other == null) return false; 9766 if (other.getClass() != this.getClass()) return false; 9767 9768 subresourceWebBundleInnerResponseParsed o = (subresourceWebBundleInnerResponseParsed) other; 9769 9770 return 9771 Objects.equals(this.innerRequestId, o.innerRequestId) 9772 && Objects.equals(this.innerRequestURL, o.innerRequestURL) 9773 && Objects.equals(this.bundleRequestId, o.bundleRequestId); 9774 } 9775 9776 /** Generates a Hash-Code for {@code 'this'} instance */ 9777 public int hashCode() 9778 { 9779 return 9780 Objects.hashCode(this.innerRequestId) 9781 + Objects.hashCode(this.innerRequestURL) 9782 + Objects.hashCode(this.bundleRequestId); 9783 } 9784 } 9785 9786 /** 9787 * Fired when request for resources within a .wbn file failed. 9788 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9789 */ 9790 public static class subresourceWebBundleInnerResponseError 9791 extends BrowserEvent 9792 implements java.io.Serializable 9793 { 9794 /** For Object Serialization. java.io.Serializable */ 9795 protected static final long serialVersionUID = 1; 9796 9797 public boolean[] optionals() 9798 { return new boolean[] { false, false, false, true, }; } 9799 9800 /** Request identifier of the subresource request */ 9801 public final String innerRequestId; 9802 9803 /** URL of the subresource resource. */ 9804 public final String innerRequestURL; 9805 9806 /** Error message */ 9807 public final String errorMessage; 9808 9809 /** 9810 * Bundle request identifier. Used to match this information to another event. 9811 * This made be absent in case when the instrumentation was enabled only 9812 * after webbundle was parsed. 9813 * <BR /><B CLASS=Opt>OPTIONAL</B> 9814 */ 9815 public final String bundleRequestId; 9816 9817 /** 9818 * Constructor 9819 * 9820 * @param innerRequestId Request identifier of the subresource request 9821 * 9822 * @param innerRequestURL URL of the subresource resource. 9823 * 9824 * @param errorMessage Error message 9825 * 9826 * @param bundleRequestId 9827 * Bundle request identifier. Used to match this information to another event. 9828 * This made be absent in case when the instrumentation was enabled only 9829 * after webbundle was parsed. 9830 * <BR /><B CLASS=Opt>OPTIONAL</B> 9831 */ 9832 public subresourceWebBundleInnerResponseError( 9833 String innerRequestId, String innerRequestURL, String errorMessage, 9834 String bundleRequestId 9835 ) 9836 { 9837 super("Network", "subresourceWebBundleInnerResponseError", 4); 9838 9839 // Exception-Check(s) to ensure that if any parameters which are not declared as 9840 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9841 9842 if (innerRequestId == null) THROWS.throwNPE("innerRequestId"); 9843 if (innerRequestURL == null) THROWS.throwNPE("innerRequestURL"); 9844 if (errorMessage == null) THROWS.throwNPE("errorMessage"); 9845 9846 this.innerRequestId = innerRequestId; 9847 this.innerRequestURL = innerRequestURL; 9848 this.errorMessage = errorMessage; 9849 this.bundleRequestId = bundleRequestId; 9850 } 9851 9852 /** 9853 * JSON Object Constructor 9854 * @param jo A Json-Object having data about an instance of {@code 'subresourceWebBundleInnerResponseError'}. 9855 */ 9856 public subresourceWebBundleInnerResponseError (JsonObject jo) 9857 { 9858 super("Network", "subresourceWebBundleInnerResponseError", 4); 9859 9860 this.innerRequestId = ReadJSON.getString(jo, "innerRequestId", false, true); 9861 this.innerRequestURL = ReadJSON.getString(jo, "innerRequestURL", false, true); 9862 this.errorMessage = ReadJSON.getString(jo, "errorMessage", false, true); 9863 this.bundleRequestId = ReadJSON.getString(jo, "bundleRequestId", true, false); 9864 } 9865 9866 9867 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9868 public boolean equals(Object other) 9869 { 9870 if (this == other) return true; 9871 if (other == null) return false; 9872 if (other.getClass() != this.getClass()) return false; 9873 9874 subresourceWebBundleInnerResponseError o = (subresourceWebBundleInnerResponseError) other; 9875 9876 return 9877 Objects.equals(this.innerRequestId, o.innerRequestId) 9878 && Objects.equals(this.innerRequestURL, o.innerRequestURL) 9879 && Objects.equals(this.errorMessage, o.errorMessage) 9880 && Objects.equals(this.bundleRequestId, o.bundleRequestId); 9881 } 9882 9883 /** Generates a Hash-Code for {@code 'this'} instance */ 9884 public int hashCode() 9885 { 9886 return 9887 Objects.hashCode(this.innerRequestId) 9888 + Objects.hashCode(this.innerRequestURL) 9889 + Objects.hashCode(this.errorMessage) 9890 + Objects.hashCode(this.bundleRequestId); 9891 } 9892 } 9893 9894 /** 9895 * Is sent whenever a new report is added. 9896 * And after 'enableReportingApi' for all existing reports. 9897 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9898 */ 9899 public static class reportingApiReportAdded 9900 extends BrowserEvent 9901 implements java.io.Serializable 9902 { 9903 /** For Object Serialization. java.io.Serializable */ 9904 protected static final long serialVersionUID = 1; 9905 9906 public boolean[] optionals() 9907 { return new boolean[] { false, }; } 9908 9909 /** <CODE>[No Description Provided by Google]</CODE> */ 9910 public final Network.ReportingApiReport report; 9911 9912 /** 9913 * Constructor 9914 * 9915 * @param report - 9916 */ 9917 public reportingApiReportAdded(Network.ReportingApiReport report) 9918 { 9919 super("Network", "reportingApiReportAdded", 1); 9920 9921 // Exception-Check(s) to ensure that if any parameters which are not declared as 9922 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9923 9924 if (report == null) THROWS.throwNPE("report"); 9925 9926 this.report = report; 9927 } 9928 9929 /** 9930 * JSON Object Constructor 9931 * @param jo A Json-Object having data about an instance of {@code 'reportingApiReportAdded'}. 9932 */ 9933 public reportingApiReportAdded (JsonObject jo) 9934 { 9935 super("Network", "reportingApiReportAdded", 1); 9936 9937 this.report = ReadJSON.getObject(jo, "report", Network.ReportingApiReport.class, false, true); 9938 } 9939 9940 9941 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 9942 public boolean equals(Object other) 9943 { 9944 if (this == other) return true; 9945 if (other == null) return false; 9946 if (other.getClass() != this.getClass()) return false; 9947 9948 reportingApiReportAdded o = (reportingApiReportAdded) other; 9949 9950 return 9951 Objects.equals(this.report, o.report); 9952 } 9953 9954 /** Generates a Hash-Code for {@code 'this'} instance */ 9955 public int hashCode() 9956 { 9957 return 9958 this.report.hashCode(); 9959 } 9960 } 9961 9962 /** 9963 * <CODE>[No Description Provided by Google]</CODE> 9964 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 9965 */ 9966 public static class reportingApiReportUpdated 9967 extends BrowserEvent 9968 implements java.io.Serializable 9969 { 9970 /** For Object Serialization. java.io.Serializable */ 9971 protected static final long serialVersionUID = 1; 9972 9973 public boolean[] optionals() 9974 { return new boolean[] { false, }; } 9975 9976 /** <CODE>[No Description Provided by Google]</CODE> */ 9977 public final Network.ReportingApiReport report; 9978 9979 /** 9980 * Constructor 9981 * 9982 * @param report - 9983 */ 9984 public reportingApiReportUpdated(Network.ReportingApiReport report) 9985 { 9986 super("Network", "reportingApiReportUpdated", 1); 9987 9988 // Exception-Check(s) to ensure that if any parameters which are not declared as 9989 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 9990 9991 if (report == null) THROWS.throwNPE("report"); 9992 9993 this.report = report; 9994 } 9995 9996 /** 9997 * JSON Object Constructor 9998 * @param jo A Json-Object having data about an instance of {@code 'reportingApiReportUpdated'}. 9999 */ 10000 public reportingApiReportUpdated (JsonObject jo) 10001 { 10002 super("Network", "reportingApiReportUpdated", 1); 10003 10004 this.report = ReadJSON.getObject(jo, "report", Network.ReportingApiReport.class, false, true); 10005 } 10006 10007 10008 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 10009 public boolean equals(Object other) 10010 { 10011 if (this == other) return true; 10012 if (other == null) return false; 10013 if (other.getClass() != this.getClass()) return false; 10014 10015 reportingApiReportUpdated o = (reportingApiReportUpdated) other; 10016 10017 return 10018 Objects.equals(this.report, o.report); 10019 } 10020 10021 /** Generates a Hash-Code for {@code 'this'} instance */ 10022 public int hashCode() 10023 { 10024 return 10025 this.report.hashCode(); 10026 } 10027 } 10028 10029 /** 10030 * <CODE>[No Description Provided by Google]</CODE> 10031 * <BR /><B CLASS=Exp>EXPERIMENTAL</B> 10032 */ 10033 public static class reportingApiEndpointsChangedForOrigin 10034 extends BrowserEvent 10035 implements java.io.Serializable 10036 { 10037 /** For Object Serialization. java.io.Serializable */ 10038 protected static final long serialVersionUID = 1; 10039 10040 public boolean[] optionals() 10041 { return new boolean[] { false, false, }; } 10042 10043 /** Origin of the document(s) which configured the endpoints. */ 10044 public final String origin; 10045 10046 /** <CODE>[No Description Provided by Google]</CODE> */ 10047 public final Network.ReportingApiEndpoint[] endpoints; 10048 10049 /** 10050 * Constructor 10051 * 10052 * @param origin Origin of the document(s) which configured the endpoints. 10053 * 10054 * @param endpoints - 10055 */ 10056 public reportingApiEndpointsChangedForOrigin 10057 (String origin, Network.ReportingApiEndpoint[] endpoints) 10058 { 10059 super("Network", "reportingApiEndpointsChangedForOrigin", 2); 10060 10061 // Exception-Check(s) to ensure that if any parameters which are not declared as 10062 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10063 10064 if (origin == null) THROWS.throwNPE("origin"); 10065 if (endpoints == null) THROWS.throwNPE("endpoints"); 10066 10067 this.origin = origin; 10068 this.endpoints = endpoints; 10069 } 10070 10071 /** 10072 * JSON Object Constructor 10073 * @param jo A Json-Object having data about an instance of {@code 'reportingApiEndpointsChangedForOrigin'}. 10074 */ 10075 public reportingApiEndpointsChangedForOrigin (JsonObject jo) 10076 { 10077 super("Network", "reportingApiEndpointsChangedForOrigin", 2); 10078 10079 this.origin = ReadJSON.getString(jo, "origin", false, true); 10080 this.endpoints = (jo.getJsonArray("endpoints") == null) 10081 ? null 10082 : RJArrIntoStream.objArr(jo.getJsonArray("endpoints"), null, 0, Network.ReportingApiEndpoint.class).toArray(Network.ReportingApiEndpoint[]::new); 10083 10084 } 10085 10086 10087 /** Checks whether {@code 'this'} equals an input Java-{@code Object} */ 10088 public boolean equals(Object other) 10089 { 10090 if (this == other) return true; 10091 if (other == null) return false; 10092 if (other.getClass() != this.getClass()) return false; 10093 10094 reportingApiEndpointsChangedForOrigin o = (reportingApiEndpointsChangedForOrigin) other; 10095 10096 return 10097 Objects.equals(this.origin, o.origin) 10098 && Arrays.deepEquals(this.endpoints, o.endpoints); 10099 } 10100 10101 /** Generates a Hash-Code for {@code 'this'} instance */ 10102 public int hashCode() 10103 { 10104 return 10105 Objects.hashCode(this.origin) 10106 + Arrays.deepHashCode(this.endpoints); 10107 } 10108 } 10109 10110 10111 // Counter for keeping the WebSocket Request ID's distinct. 10112 private static int counter = 1; 10113 10114 /** 10115 * Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted. 10116 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 10117 * 10118 * @param encodings List of accepted content encodings. 10119 * 10120 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10121 * {@link Ret0}></CODE> 10122 * 10123 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10124 * browser receives the invocation-request. 10125 * 10126 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10127 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10128 * {@code >} to ensure the Browser Function has run to completion. 10129 */ 10130 public static Script<String, JsonObject, Ret0> setAcceptedEncodings(String[] encodings) 10131 { 10132 // Exception-Check(s) to ensure that if any parameters which are not declared as 10133 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10134 10135 if (encodings == null) THROWS.throwNPE("encodings"); 10136 10137 final int webSocketID = 33000000 + counter++; 10138 final boolean[] optionals = { false, }; 10139 10140 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10141 String requestJSON = WriteJSON.get( 10142 parameterTypes.get("setAcceptedEncodings"), 10143 parameterNames.get("setAcceptedEncodings"), 10144 optionals, webSocketID, 10145 "Network.setAcceptedEncodings", 10146 (Object) encodings 10147 ); 10148 10149 // This Remote Command does not have a Return-Value. 10150 return new Script<> 10151 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10152 } 10153 10154 /** 10155 * Clears accepted encodings set by setAcceptedEncodings 10156 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 10157 * 10158 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10159 * {@link Ret0}></CODE> 10160 * 10161 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10162 * browser receives the invocation-request. 10163 * 10164 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10165 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10166 * {@code >} to ensure the Browser Function has run to completion. 10167 */ 10168 public static Script<String, JsonObject, Ret0> clearAcceptedEncodingsOverride() 10169 { 10170 final int webSocketID = 33001000 + counter++; 10171 final boolean[] optionals = new boolean[0]; 10172 10173 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10174 String requestJSON = WriteJSON.get( 10175 parameterTypes.get("clearAcceptedEncodingsOverride"), 10176 parameterNames.get("clearAcceptedEncodingsOverride"), 10177 optionals, webSocketID, 10178 "Network.clearAcceptedEncodingsOverride" 10179 ); 10180 10181 // This Remote Command does not have a Return-Value. 10182 return new Script<> 10183 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10184 } 10185 10186 /** 10187 * Tells whether clearing browser cache is supported. 10188 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 10189 * 10190 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10191 * Boolean></CODE> 10192 * 10193 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10194 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10195 * Boolean></CODE> will be returned. 10196 * 10197 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10198 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10199 * may be retrieved.</I> 10200 * 10201 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10202 * <BR /><BR /><UL CLASS=JDUL> 10203 * <LI><CODE>Boolean (<B>result</B></CODE>) 10204 * <BR />True if browser cache can be cleared. 10205 * </LI> 10206 * </UL> */ 10207 public static Script<String, JsonObject, Boolean> canClearBrowserCache() 10208 { 10209 final int webSocketID = 33002000 + counter++; 10210 final boolean[] optionals = new boolean[0]; 10211 10212 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10213 String requestJSON = WriteJSON.get( 10214 parameterTypes.get("canClearBrowserCache"), 10215 parameterNames.get("canClearBrowserCache"), 10216 optionals, webSocketID, 10217 "Network.canClearBrowserCache" 10218 ); 10219 10220 // 'JSON Binding' ... Converts Browser Response-JSON to 'Boolean' 10221 Function<JsonObject, Boolean> responseProcessor = (JsonObject jo) -> 10222 ReadPrimJSON.getBoolean(jo, "result"); 10223 10224 return new Script<>(webSocketID, requestJSON, responseProcessor); 10225 } 10226 10227 /** 10228 * Tells whether clearing browser cookies is supported. 10229 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 10230 * 10231 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10232 * Boolean></CODE> 10233 * 10234 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10235 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10236 * Boolean></CODE> will be returned. 10237 * 10238 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10239 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10240 * may be retrieved.</I> 10241 * 10242 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10243 * <BR /><BR /><UL CLASS=JDUL> 10244 * <LI><CODE>Boolean (<B>result</B></CODE>) 10245 * <BR />True if browser cookies can be cleared. 10246 * </LI> 10247 * </UL> */ 10248 public static Script<String, JsonObject, Boolean> canClearBrowserCookies() 10249 { 10250 final int webSocketID = 33003000 + counter++; 10251 final boolean[] optionals = new boolean[0]; 10252 10253 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10254 String requestJSON = WriteJSON.get( 10255 parameterTypes.get("canClearBrowserCookies"), 10256 parameterNames.get("canClearBrowserCookies"), 10257 optionals, webSocketID, 10258 "Network.canClearBrowserCookies" 10259 ); 10260 10261 // 'JSON Binding' ... Converts Browser Response-JSON to 'Boolean' 10262 Function<JsonObject, Boolean> responseProcessor = (JsonObject jo) -> 10263 ReadPrimJSON.getBoolean(jo, "result"); 10264 10265 return new Script<>(webSocketID, requestJSON, responseProcessor); 10266 } 10267 10268 /** 10269 * Tells whether emulation of network conditions is supported. 10270 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 10271 * 10272 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10273 * Boolean></CODE> 10274 * 10275 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10276 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10277 * Boolean></CODE> will be returned. 10278 * 10279 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10280 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10281 * may be retrieved.</I> 10282 * 10283 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10284 * <BR /><BR /><UL CLASS=JDUL> 10285 * <LI><CODE>Boolean (<B>result</B></CODE>) 10286 * <BR />True if emulation of network conditions is supported. 10287 * </LI> 10288 * </UL> */ 10289 public static Script<String, JsonObject, Boolean> canEmulateNetworkConditions() 10290 { 10291 final int webSocketID = 33004000 + counter++; 10292 final boolean[] optionals = new boolean[0]; 10293 10294 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10295 String requestJSON = WriteJSON.get( 10296 parameterTypes.get("canEmulateNetworkConditions"), 10297 parameterNames.get("canEmulateNetworkConditions"), 10298 optionals, webSocketID, 10299 "Network.canEmulateNetworkConditions" 10300 ); 10301 10302 // 'JSON Binding' ... Converts Browser Response-JSON to 'Boolean' 10303 Function<JsonObject, Boolean> responseProcessor = (JsonObject jo) -> 10304 ReadPrimJSON.getBoolean(jo, "result"); 10305 10306 return new Script<>(webSocketID, requestJSON, responseProcessor); 10307 } 10308 10309 /** 10310 * Clears browser cache. 10311 * 10312 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10313 * {@link Ret0}></CODE> 10314 * 10315 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10316 * browser receives the invocation-request. 10317 * 10318 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10319 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10320 * {@code >} to ensure the Browser Function has run to completion. 10321 */ 10322 public static Script<String, JsonObject, Ret0> clearBrowserCache() 10323 { 10324 final int webSocketID = 33005000 + counter++; 10325 final boolean[] optionals = new boolean[0]; 10326 10327 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10328 String requestJSON = WriteJSON.get( 10329 parameterTypes.get("clearBrowserCache"), 10330 parameterNames.get("clearBrowserCache"), 10331 optionals, webSocketID, 10332 "Network.clearBrowserCache" 10333 ); 10334 10335 // This Remote Command does not have a Return-Value. 10336 return new Script<> 10337 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10338 } 10339 10340 /** 10341 * Clears browser cookies. 10342 * 10343 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10344 * {@link Ret0}></CODE> 10345 * 10346 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10347 * browser receives the invocation-request. 10348 * 10349 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10350 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10351 * {@code >} to ensure the Browser Function has run to completion. 10352 */ 10353 public static Script<String, JsonObject, Ret0> clearBrowserCookies() 10354 { 10355 final int webSocketID = 33006000 + counter++; 10356 final boolean[] optionals = new boolean[0]; 10357 10358 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10359 String requestJSON = WriteJSON.get( 10360 parameterTypes.get("clearBrowserCookies"), 10361 parameterNames.get("clearBrowserCookies"), 10362 optionals, webSocketID, 10363 "Network.clearBrowserCookies" 10364 ); 10365 10366 // This Remote Command does not have a Return-Value. 10367 return new Script<> 10368 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10369 } 10370 10371 /** 10372 * Response to Network.requestIntercepted which either modifies the request to continue with any 10373 * modifications, or blocks it, or completes it with the provided response bytes. If a network 10374 * fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted 10375 * event will be sent with the same InterceptionId. 10376 * Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead. 10377 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 10378 * 10379 * @param interceptionId - 10380 * 10381 * @param errorReason 10382 * If set this causes the request to fail with the given reason. Passing {@code Aborted} for requests 10383 * marked with {@code isNavigationRequest} also cancels the navigation. Must not be set in response 10384 * to an authChallenge. 10385 * <BR /><B CLASS=Opt>OPTIONAL</B> 10386 * 10387 * @param rawResponse 10388 * If set the requests completes using with the provided base64 encoded raw response, including 10389 * HTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON) 10390 * <BR /><B CLASS=Opt>OPTIONAL</B> 10391 * 10392 * @param url 10393 * If set the request url will be modified in a way that's not observable by page. Must not be 10394 * set in response to an authChallenge. 10395 * <BR /><B CLASS=Opt>OPTIONAL</B> 10396 * 10397 * @param method 10398 * If set this allows the request method to be overridden. Must not be set in response to an 10399 * authChallenge. 10400 * <BR /><B CLASS=Opt>OPTIONAL</B> 10401 * 10402 * @param postData If set this allows postData to be set. Must not be set in response to an authChallenge. 10403 * <BR /><B CLASS=Opt>OPTIONAL</B> 10404 * 10405 * @param headers 10406 * If set this allows the request headers to be changed. Must not be set in response to an 10407 * authChallenge. 10408 * <BR /><B CLASS=Opt>OPTIONAL</B> 10409 * 10410 * @param authChallengeResponse Response to a requestIntercepted with an authChallenge. Must not be set otherwise. 10411 * <BR /><B CLASS=Opt>OPTIONAL</B> 10412 * 10413 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10414 * {@link Ret0}></CODE> 10415 * 10416 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10417 * browser receives the invocation-request. 10418 * 10419 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10420 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10421 * {@code >} to ensure the Browser Function has run to completion. 10422 */ 10423 public static Script<String, JsonObject, Ret0> continueInterceptedRequest( 10424 String interceptionId, String errorReason, String rawResponse, String url, 10425 String method, String postData, JsonObject headers, 10426 Network.AuthChallengeResponse authChallengeResponse 10427 ) 10428 { 10429 // Exception-Check(s) to ensure that if any parameters which are not declared as 10430 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10431 10432 if (interceptionId == null) THROWS.throwNPE("interceptionId"); 10433 10434 // Exception-Check(s) to ensure that if any parameters which must adhere to a 10435 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 10436 10437 THROWS.checkIAE("errorReason", errorReason, "Network.ErrorReason", Network.ErrorReason); 10438 10439 final int webSocketID = 33007000 + counter++; 10440 final boolean[] optionals = { false, true, true, true, true, true, true, true, }; 10441 10442 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10443 String requestJSON = WriteJSON.get( 10444 parameterTypes.get("continueInterceptedRequest"), 10445 parameterNames.get("continueInterceptedRequest"), 10446 optionals, webSocketID, 10447 "Network.continueInterceptedRequest", 10448 interceptionId, errorReason, rawResponse, url, method, postData, headers, 10449 authChallengeResponse 10450 ); 10451 10452 // This Remote Command does not have a Return-Value. 10453 return new Script<> 10454 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10455 } 10456 10457 /** 10458 * Deletes browser cookies with matching name and url or domain/path/partitionKey pair. 10459 * 10460 * @param name Name of the cookies to remove. 10461 * 10462 * @param url 10463 * If specified, deletes all the cookies with the given name where domain and path match 10464 * provided URL. 10465 * <BR /><B CLASS=Opt>OPTIONAL</B> 10466 * 10467 * @param domain If specified, deletes only cookies with the exact domain. 10468 * <BR /><B CLASS=Opt>OPTIONAL</B> 10469 * 10470 * @param path If specified, deletes only cookies with the exact path. 10471 * <BR /><B CLASS=Opt>OPTIONAL</B> 10472 * 10473 * @param partitionKey 10474 * If specified, deletes only cookies with the the given name and partitionKey where 10475 * all partition key attributes match the cookie partition key attribute. 10476 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10477 * 10478 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10479 * {@link Ret0}></CODE> 10480 * 10481 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10482 * browser receives the invocation-request. 10483 * 10484 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10485 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10486 * {@code >} to ensure the Browser Function has run to completion. 10487 */ 10488 public static Script<String, JsonObject, Ret0> deleteCookies( 10489 String name, String url, String domain, String path, 10490 Network.CookiePartitionKey partitionKey 10491 ) 10492 { 10493 // Exception-Check(s) to ensure that if any parameters which are not declared as 10494 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10495 10496 if (name == null) THROWS.throwNPE("name"); 10497 10498 final int webSocketID = 33008000 + counter++; 10499 final boolean[] optionals = { false, true, true, true, true, }; 10500 10501 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10502 String requestJSON = WriteJSON.get( 10503 parameterTypes.get("deleteCookies"), 10504 parameterNames.get("deleteCookies"), 10505 optionals, webSocketID, 10506 "Network.deleteCookies", 10507 name, url, domain, path, partitionKey 10508 ); 10509 10510 // This Remote Command does not have a Return-Value. 10511 return new Script<> 10512 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10513 } 10514 10515 /** 10516 * Disables network tracking, prevents network events from being sent to the client. 10517 * 10518 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10519 * {@link Ret0}></CODE> 10520 * 10521 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10522 * browser receives the invocation-request. 10523 * 10524 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10525 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10526 * {@code >} to ensure the Browser Function has run to completion. 10527 */ 10528 public static Script<String, JsonObject, Ret0> disable() 10529 { 10530 final int webSocketID = 33009000 + counter++; 10531 final boolean[] optionals = new boolean[0]; 10532 10533 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10534 String requestJSON = WriteJSON.get( 10535 parameterTypes.get("disable"), 10536 parameterNames.get("disable"), 10537 optionals, webSocketID, 10538 "Network.disable" 10539 ); 10540 10541 // This Remote Command does not have a Return-Value. 10542 return new Script<> 10543 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10544 } 10545 10546 /** 10547 * Activates emulation of network conditions. 10548 * 10549 * @param offline True to emulate internet disconnection. 10550 * 10551 * @param latency Minimum latency from request sent to response headers received (ms). 10552 * 10553 * @param downloadThroughput Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. 10554 * 10555 * @param uploadThroughput Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. 10556 * 10557 * @param connectionType Connection type if known. 10558 * <BR /><B CLASS=Opt>OPTIONAL</B> 10559 * 10560 * @param packetLoss WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets. 10561 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10562 * 10563 * @param packetQueueLength WebRTC packet queue length (packet). 0 removes any queue length limitations. 10564 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10565 * 10566 * @param packetReordering WebRTC packetReordering feature. 10567 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10568 * 10569 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10570 * {@link Ret0}></CODE> 10571 * 10572 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10573 * browser receives the invocation-request. 10574 * 10575 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10576 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10577 * {@code >} to ensure the Browser Function has run to completion. 10578 */ 10579 public static Script<String, JsonObject, Ret0> emulateNetworkConditions( 10580 boolean offline, Number latency, Number downloadThroughput, Number uploadThroughput, 10581 String connectionType, Number packetLoss, Integer packetQueueLength, 10582 Boolean packetReordering 10583 ) 10584 { 10585 // Exception-Check(s) to ensure that if any parameters which are not declared as 10586 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10587 10588 if (latency == null) THROWS.throwNPE("latency"); 10589 if (downloadThroughput == null) THROWS.throwNPE("downloadThroughput"); 10590 if (uploadThroughput == null) THROWS.throwNPE("uploadThroughput"); 10591 10592 // Exception-Check(s) to ensure that if any parameters which must adhere to a 10593 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 10594 10595 THROWS.checkIAE("connectionType", connectionType, "Network.ConnectionType", Network.ConnectionType); 10596 10597 final int webSocketID = 33010000 + counter++; 10598 final boolean[] optionals = { false, false, false, false, true, true, true, true, }; 10599 10600 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10601 String requestJSON = WriteJSON.get( 10602 parameterTypes.get("emulateNetworkConditions"), 10603 parameterNames.get("emulateNetworkConditions"), 10604 optionals, webSocketID, 10605 "Network.emulateNetworkConditions", 10606 offline, latency, downloadThroughput, uploadThroughput, connectionType, packetLoss, 10607 packetQueueLength, packetReordering 10608 ); 10609 10610 // This Remote Command does not have a Return-Value. 10611 return new Script<> 10612 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10613 } 10614 10615 /** 10616 * Enables network tracking, network events will now be delivered to the client. 10617 * 10618 * @param maxTotalBufferSize Buffer size in bytes to use when preserving network payloads (XHRs, etc). 10619 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10620 * 10621 * @param maxResourceBufferSize Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc). 10622 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10623 * 10624 * @param maxPostDataSize Longest post body size (in bytes) that would be included in requestWillBeSent notification 10625 * <BR /><B CLASS=Opt>OPTIONAL</B> 10626 * 10627 * @param reportDirectSocketTraffic Whether DirectSocket chunk send/receive events should be reported. 10628 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 10629 * 10630 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10631 * {@link Ret0}></CODE> 10632 * 10633 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 10634 * browser receives the invocation-request. 10635 * 10636 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 10637 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 10638 * {@code >} to ensure the Browser Function has run to completion. 10639 */ 10640 public static Script<String, JsonObject, Ret0> enable( 10641 Integer maxTotalBufferSize, Integer maxResourceBufferSize, Integer maxPostDataSize, 10642 Boolean reportDirectSocketTraffic 10643 ) 10644 { 10645 final int webSocketID = 33011000 + counter++; 10646 final boolean[] optionals = { true, true, true, true, }; 10647 10648 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10649 String requestJSON = WriteJSON.get( 10650 parameterTypes.get("enable"), 10651 parameterNames.get("enable"), 10652 optionals, webSocketID, 10653 "Network.enable", 10654 maxTotalBufferSize, maxResourceBufferSize, maxPostDataSize, reportDirectSocketTraffic 10655 ); 10656 10657 // This Remote Command does not have a Return-Value. 10658 return new Script<> 10659 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 10660 } 10661 10662 /** 10663 * Returns all browser cookies. Depending on the backend support, will return detailed cookie 10664 * information in the {@code cookies} field. 10665 * Deprecated. Use Storage.getCookies instead. 10666 * <BR /><B CLASS=Dep-Top>DEPRECATED</B> 10667 * 10668 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10669 * {@link Network.Cookie}[]></CODE> 10670 * 10671 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10672 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10673 * {@link Network.Cookie}[]></CODE> will be returned. 10674 * 10675 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10676 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10677 * may be retrieved.</I> 10678 * 10679 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10680 * <BR /><BR /><UL CLASS=JDUL> 10681 * <LI><CODE>{@link Network.Cookie}[] (<B>cookies</B></CODE>) 10682 * <BR />Array of cookie objects. 10683 * </LI> 10684 * </UL> */ 10685 public static Script<String, JsonObject, Network.Cookie[]> getAllCookies() 10686 { 10687 final int webSocketID = 33012000 + counter++; 10688 final boolean[] optionals = new boolean[0]; 10689 10690 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10691 String requestJSON = WriteJSON.get( 10692 parameterTypes.get("getAllCookies"), 10693 parameterNames.get("getAllCookies"), 10694 optionals, webSocketID, 10695 "Network.getAllCookies" 10696 ); 10697 10698 // 'JSON Binding' ... Converts Browser Response-JSON to 'Network.Cookie[]' 10699 Function<JsonObject, Network.Cookie[]> responseProcessor = (JsonObject jo) -> 10700 (jo.getJsonArray("cookies") == null) 10701 ? null 10702 : RJArrIntoStream.objArr(jo.getJsonArray("cookies"), null, 0, Network.Cookie.class).toArray(Network.Cookie[]::new); 10703 10704 return new Script<>(webSocketID, requestJSON, responseProcessor); 10705 } 10706 10707 /** 10708 * Returns the DER-encoded certificate. 10709 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 10710 * 10711 * @param origin Origin to get certificate for. 10712 * 10713 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10714 * String[]></CODE> 10715 * 10716 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10717 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10718 * String[]></CODE> will be returned. 10719 * 10720 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10721 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10722 * may be retrieved.</I> 10723 * 10724 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10725 * <BR /><BR /><UL CLASS=JDUL> 10726 * <LI><CODE>String[] (<B>tableNames</B></CODE>) 10727 * <BR />- 10728 * </LI> 10729 * </UL> */ 10730 public static Script<String, JsonObject, String[]> getCertificate(String origin) 10731 { 10732 // Exception-Check(s) to ensure that if any parameters which are not declared as 10733 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10734 10735 if (origin == null) THROWS.throwNPE("origin"); 10736 10737 final int webSocketID = 33013000 + counter++; 10738 final boolean[] optionals = { false, }; 10739 10740 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10741 String requestJSON = WriteJSON.get( 10742 parameterTypes.get("getCertificate"), 10743 parameterNames.get("getCertificate"), 10744 optionals, webSocketID, 10745 "Network.getCertificate", 10746 origin 10747 ); 10748 10749 // 'JSON Binding' ... Converts Browser Response-JSON to 'String[]' 10750 Function<JsonObject, String[]> responseProcessor = (JsonObject jo) -> 10751 (jo.getJsonArray("tableNames") == null) 10752 ? null 10753 : RJArrIntoStream.strArr(jo.getJsonArray("tableNames"), null, 0).toArray(String[]::new); 10754 10755 return new Script<>(webSocketID, requestJSON, responseProcessor); 10756 } 10757 10758 /** 10759 * Returns all browser cookies for the current URL. Depending on the backend support, will return 10760 * detailed cookie information in the {@code cookies} field. 10761 * 10762 * @param urls 10763 * The list of URLs for which applicable cookies will be fetched. 10764 * If not specified, it's assumed to be set to the list containing 10765 * the URLs of the page and all of its subframes. 10766 * <BR /><B CLASS=Opt>OPTIONAL</B> 10767 * 10768 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10769 * {@link Network.Cookie}[]></CODE> 10770 * 10771 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10772 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10773 * {@link Network.Cookie}[]></CODE> will be returned. 10774 * 10775 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10776 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10777 * may be retrieved.</I> 10778 * 10779 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10780 * <BR /><BR /><UL CLASS=JDUL> 10781 * <LI><CODE>{@link Network.Cookie}[] (<B>cookies</B></CODE>) 10782 * <BR />Array of cookie objects. 10783 * </LI> 10784 * </UL> */ 10785 public static Script<String, JsonObject, Network.Cookie[]> getCookies(String[] urls) 10786 { 10787 final int webSocketID = 33014000 + counter++; 10788 final boolean[] optionals = { true, }; 10789 10790 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10791 String requestJSON = WriteJSON.get( 10792 parameterTypes.get("getCookies"), 10793 parameterNames.get("getCookies"), 10794 optionals, webSocketID, 10795 "Network.getCookies", 10796 (Object) urls 10797 ); 10798 10799 // 'JSON Binding' ... Converts Browser Response-JSON to 'Network.Cookie[]' 10800 Function<JsonObject, Network.Cookie[]> responseProcessor = (JsonObject jo) -> 10801 (jo.getJsonArray("cookies") == null) 10802 ? null 10803 : RJArrIntoStream.objArr(jo.getJsonArray("cookies"), null, 0, Network.Cookie.class).toArray(Network.Cookie[]::new); 10804 10805 return new Script<>(webSocketID, requestJSON, responseProcessor); 10806 } 10807 10808 /** 10809 * Returns content served for the given request. 10810 * 10811 * @param requestId Identifier of the network request to get content for. 10812 * 10813 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10814 * {@link Ret2}></CODE> 10815 * 10816 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 10817 * {@link Script#exec()}), and a {@link Promise} returned. 10818 * 10819 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 10820 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 10821 * be returned from that call. 10822 * 10823 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 10824 * in an instance of <B>{@link Ret2}</B> 10825 * 10826 * <BR /><BR /><UL CLASS=JDUL> 10827 * <LI><CODE><B>Ret2.a:</B> String (<B>body</B>)</CODE> 10828 * <BR />Response body. 10829 * <BR /><BR /></LI> 10830 * <LI><CODE><B>Ret2.b:</B> Boolean (<B>base64Encoded</B>)</CODE> 10831 * <BR />True, if content was sent as base64. 10832 * </LI> 10833 * </UL> 10834 */ 10835 public static Script<String, JsonObject, Ret2<String, Boolean>> getResponseBody 10836 (String requestId) 10837 { 10838 // Exception-Check(s) to ensure that if any parameters which are not declared as 10839 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10840 10841 if (requestId == null) THROWS.throwNPE("requestId"); 10842 10843 final int webSocketID = 33015000 + counter++; 10844 final boolean[] optionals = { false, }; 10845 10846 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10847 String requestJSON = WriteJSON.get( 10848 parameterTypes.get("getResponseBody"), 10849 parameterNames.get("getResponseBody"), 10850 optionals, webSocketID, 10851 "Network.getResponseBody", 10852 requestId 10853 ); 10854 10855 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 10856 Function<JsonObject, Ret2<String, Boolean>> 10857 responseProcessor = (JsonObject jo) -> new Ret2<>( 10858 ReadJSON.getString(jo, "body", false, true), 10859 ReadBoxedJSON.getBoolean(jo, "base64Encoded", true) 10860 ); 10861 10862 return new Script<>(webSocketID, requestJSON, responseProcessor); 10863 } 10864 10865 /** 10866 * Returns post data sent with the request. Returns an error when no data was sent with the request. 10867 * 10868 * @param requestId Identifier of the network request to get content for. 10869 * 10870 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10871 * String></CODE> 10872 * 10873 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10874 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10875 * String></CODE> will be returned. 10876 * 10877 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10878 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10879 * may be retrieved.</I> 10880 * 10881 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10882 * <BR /><BR /><UL CLASS=JDUL> 10883 * <LI><CODE>String (<B>postData</B></CODE>) 10884 * <BR />Request body string, omitting files from multipart requests 10885 * </LI> 10886 * </UL> */ 10887 public static Script<String, JsonObject, String> getRequestPostData(String requestId) 10888 { 10889 // Exception-Check(s) to ensure that if any parameters which are not declared as 10890 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10891 10892 if (requestId == null) THROWS.throwNPE("requestId"); 10893 10894 final int webSocketID = 33016000 + counter++; 10895 final boolean[] optionals = { false, }; 10896 10897 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10898 String requestJSON = WriteJSON.get( 10899 parameterTypes.get("getRequestPostData"), 10900 parameterNames.get("getRequestPostData"), 10901 optionals, webSocketID, 10902 "Network.getRequestPostData", 10903 requestId 10904 ); 10905 10906 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 10907 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 10908 ReadJSON.getString(jo, "postData", false, true); 10909 10910 return new Script<>(webSocketID, requestJSON, responseProcessor); 10911 } 10912 10913 /** 10914 * Returns content served for the given currently intercepted request. 10915 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 10916 * 10917 * @param interceptionId Identifier for the intercepted request to get body for. 10918 * 10919 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10920 * {@link Ret2}></CODE> 10921 * 10922 * <BR /><BR />This {@link Script} may be <B STYLE='color:red'>executed</B> (using 10923 * {@link Script#exec()}), and a {@link Promise} returned. 10924 * 10925 * <BR /><BR />When the {@code Promise} is <B STYLE='color: red'>awaited</B> 10926 * (using {@link Promise#await()}), the {@code Ret2} will subsequently 10927 * be returned from that call. 10928 * 10929 * <BR /><BR />The <B STYLE='color: red'>returned</B> values are encapsulated 10930 * in an instance of <B>{@link Ret2}</B> 10931 * 10932 * <BR /><BR /><UL CLASS=JDUL> 10933 * <LI><CODE><B>Ret2.a:</B> String (<B>body</B>)</CODE> 10934 * <BR />Response body. 10935 * <BR /><BR /></LI> 10936 * <LI><CODE><B>Ret2.b:</B> Boolean (<B>base64Encoded</B>)</CODE> 10937 * <BR />True, if content was sent as base64. 10938 * </LI> 10939 * </UL> 10940 */ 10941 public static Script<String, JsonObject, Ret2<String, Boolean>> getResponseBodyForInterception 10942 (String interceptionId) 10943 { 10944 // Exception-Check(s) to ensure that if any parameters which are not declared as 10945 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 10946 10947 if (interceptionId == null) THROWS.throwNPE("interceptionId"); 10948 10949 final int webSocketID = 33017000 + counter++; 10950 final boolean[] optionals = { false, }; 10951 10952 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 10953 String requestJSON = WriteJSON.get( 10954 parameterTypes.get("getResponseBodyForInterception"), 10955 parameterNames.get("getResponseBodyForInterception"), 10956 optionals, webSocketID, 10957 "Network.getResponseBodyForInterception", 10958 interceptionId 10959 ); 10960 10961 // 'JSON Binding' ... Converts Browser Response-JSON into Java-Type 'Ret2' 10962 Function<JsonObject, Ret2<String, Boolean>> 10963 responseProcessor = (JsonObject jo) -> new Ret2<>( 10964 ReadJSON.getString(jo, "body", false, true), 10965 ReadBoxedJSON.getBoolean(jo, "base64Encoded", true) 10966 ); 10967 10968 return new Script<>(webSocketID, requestJSON, responseProcessor); 10969 } 10970 10971 /** 10972 * Returns a handle to the stream representing the response body. Note that after this command, 10973 * the intercepted request can't be continued as is -- you either need to cancel it or to provide 10974 * the response body. The stream only supports sequential read, IO.read will fail if the position 10975 * is specified. 10976 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 10977 * 10978 * @param interceptionId - 10979 * 10980 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 10981 * String></CODE> 10982 * 10983 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 10984 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 10985 * String></CODE> will be returned. 10986 * 10987 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 10988 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 10989 * may be retrieved.</I> 10990 * 10991 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 10992 * <BR /><BR /><UL CLASS=JDUL> 10993 * <LI><CODE>String (<B>stream</B></CODE>) 10994 * <BR />- 10995 * </LI> 10996 * </UL> */ 10997 public static Script<String, JsonObject, String> takeResponseBodyForInterceptionAsStream 10998 (String interceptionId) 10999 { 11000 // Exception-Check(s) to ensure that if any parameters which are not declared as 11001 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11002 11003 if (interceptionId == null) THROWS.throwNPE("interceptionId"); 11004 11005 final int webSocketID = 33018000 + counter++; 11006 final boolean[] optionals = { false, }; 11007 11008 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11009 String requestJSON = WriteJSON.get( 11010 parameterTypes.get("takeResponseBodyForInterceptionAsStream"), 11011 parameterNames.get("takeResponseBodyForInterceptionAsStream"), 11012 optionals, webSocketID, 11013 "Network.takeResponseBodyForInterceptionAsStream", 11014 interceptionId 11015 ); 11016 11017 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 11018 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 11019 ReadJSON.getString(jo, "stream", false, true); 11020 11021 return new Script<>(webSocketID, requestJSON, responseProcessor); 11022 } 11023 11024 /** 11025 * This method sends a new XMLHttpRequest which is identical to the original one. The following 11026 * parameters should be identical: method, url, async, request body, extra headers, withCredentials 11027 * attribute, user, password. 11028 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11029 * 11030 * @param requestId Identifier of XHR to replay. 11031 * 11032 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11033 * {@link Ret0}></CODE> 11034 * 11035 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11036 * browser receives the invocation-request. 11037 * 11038 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11039 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11040 * {@code >} to ensure the Browser Function has run to completion. 11041 */ 11042 public static Script<String, JsonObject, Ret0> replayXHR(String requestId) 11043 { 11044 // Exception-Check(s) to ensure that if any parameters which are not declared as 11045 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11046 11047 if (requestId == null) THROWS.throwNPE("requestId"); 11048 11049 final int webSocketID = 33019000 + counter++; 11050 final boolean[] optionals = { false, }; 11051 11052 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11053 String requestJSON = WriteJSON.get( 11054 parameterTypes.get("replayXHR"), 11055 parameterNames.get("replayXHR"), 11056 optionals, webSocketID, 11057 "Network.replayXHR", 11058 requestId 11059 ); 11060 11061 // This Remote Command does not have a Return-Value. 11062 return new Script<> 11063 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11064 } 11065 11066 /** 11067 * Searches for given string in response content. 11068 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11069 * 11070 * @param requestId Identifier of the network response to search. 11071 * 11072 * @param query String to search for. 11073 * 11074 * @param caseSensitive If true, search is case sensitive. 11075 * <BR /><B CLASS=Opt>OPTIONAL</B> 11076 * 11077 * @param isRegex If true, treats string parameter as regex. 11078 * <BR /><B CLASS=Opt>OPTIONAL</B> 11079 * 11080 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11081 * {@link Debugger.SearchMatch}[]></CODE> 11082 * 11083 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 11084 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 11085 * {@link Debugger.SearchMatch}[]></CODE> will be returned. 11086 * 11087 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 11088 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 11089 * may be retrieved.</I> 11090 * 11091 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 11092 * <BR /><BR /><UL CLASS=JDUL> 11093 * <LI><CODE>{@link Debugger.SearchMatch}[] (<B>result</B></CODE>) 11094 * <BR />List of search matches. 11095 * </LI> 11096 * </UL> */ 11097 public static Script<String, JsonObject, Debugger.SearchMatch[]> searchInResponseBody 11098 (String requestId, String query, Boolean caseSensitive, Boolean isRegex) 11099 { 11100 // Exception-Check(s) to ensure that if any parameters which are not declared as 11101 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11102 11103 if (requestId == null) THROWS.throwNPE("requestId"); 11104 if (query == null) THROWS.throwNPE("query"); 11105 11106 final int webSocketID = 33020000 + counter++; 11107 final boolean[] optionals = { false, false, true, true, }; 11108 11109 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11110 String requestJSON = WriteJSON.get( 11111 parameterTypes.get("searchInResponseBody"), 11112 parameterNames.get("searchInResponseBody"), 11113 optionals, webSocketID, 11114 "Network.searchInResponseBody", 11115 requestId, query, caseSensitive, isRegex 11116 ); 11117 11118 // 'JSON Binding' ... Converts Browser Response-JSON to 'Debugger.SearchMatch[]' 11119 Function<JsonObject, Debugger.SearchMatch[]> responseProcessor = (JsonObject jo) -> 11120 (jo.getJsonArray("result") == null) 11121 ? null 11122 : RJArrIntoStream.objArr(jo.getJsonArray("result"), null, 0, Debugger.SearchMatch.class).toArray(Debugger.SearchMatch[]::new); 11123 11124 return new Script<>(webSocketID, requestJSON, responseProcessor); 11125 } 11126 11127 /** 11128 * Blocks URLs from loading. 11129 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11130 * 11131 * @param urls URL patterns to block. Wildcards ('*') are allowed. 11132 * 11133 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11134 * {@link Ret0}></CODE> 11135 * 11136 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11137 * browser receives the invocation-request. 11138 * 11139 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11140 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11141 * {@code >} to ensure the Browser Function has run to completion. 11142 */ 11143 public static Script<String, JsonObject, Ret0> setBlockedURLs(String[] urls) 11144 { 11145 // Exception-Check(s) to ensure that if any parameters which are not declared as 11146 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11147 11148 if (urls == null) THROWS.throwNPE("urls"); 11149 11150 final int webSocketID = 33021000 + counter++; 11151 final boolean[] optionals = { false, }; 11152 11153 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11154 String requestJSON = WriteJSON.get( 11155 parameterTypes.get("setBlockedURLs"), 11156 parameterNames.get("setBlockedURLs"), 11157 optionals, webSocketID, 11158 "Network.setBlockedURLs", 11159 (Object) urls 11160 ); 11161 11162 // This Remote Command does not have a Return-Value. 11163 return new Script<> 11164 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11165 } 11166 11167 /** 11168 * Toggles ignoring of service worker for each request. 11169 * 11170 * @param bypass Bypass service worker and load from network. 11171 * 11172 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11173 * {@link Ret0}></CODE> 11174 * 11175 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11176 * browser receives the invocation-request. 11177 * 11178 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11179 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11180 * {@code >} to ensure the Browser Function has run to completion. 11181 */ 11182 public static Script<String, JsonObject, Ret0> setBypassServiceWorker(boolean bypass) 11183 { 11184 final int webSocketID = 33022000 + counter++; 11185 final boolean[] optionals = { false, }; 11186 11187 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11188 String requestJSON = WriteJSON.get( 11189 parameterTypes.get("setBypassServiceWorker"), 11190 parameterNames.get("setBypassServiceWorker"), 11191 optionals, webSocketID, 11192 "Network.setBypassServiceWorker", 11193 bypass 11194 ); 11195 11196 // This Remote Command does not have a Return-Value. 11197 return new Script<> 11198 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11199 } 11200 11201 /** 11202 * Toggles ignoring cache for each request. If {@code true}, cache will not be used. 11203 * 11204 * @param cacheDisabled Cache disabled state. 11205 * 11206 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11207 * {@link Ret0}></CODE> 11208 * 11209 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11210 * browser receives the invocation-request. 11211 * 11212 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11213 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11214 * {@code >} to ensure the Browser Function has run to completion. 11215 */ 11216 public static Script<String, JsonObject, Ret0> setCacheDisabled(boolean cacheDisabled) 11217 { 11218 final int webSocketID = 33023000 + counter++; 11219 final boolean[] optionals = { false, }; 11220 11221 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11222 String requestJSON = WriteJSON.get( 11223 parameterTypes.get("setCacheDisabled"), 11224 parameterNames.get("setCacheDisabled"), 11225 optionals, webSocketID, 11226 "Network.setCacheDisabled", 11227 cacheDisabled 11228 ); 11229 11230 // This Remote Command does not have a Return-Value. 11231 return new Script<> 11232 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11233 } 11234 11235 /** 11236 * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist. 11237 * 11238 * @param name Cookie name. 11239 * 11240 * @param value Cookie value. 11241 * 11242 * @param url 11243 * The request-URI to associate with the setting of the cookie. This value can affect the 11244 * default domain, path, source port, and source scheme values of the created cookie. 11245 * <BR /><B CLASS=Opt>OPTIONAL</B> 11246 * 11247 * @param domain Cookie domain. 11248 * <BR /><B CLASS=Opt>OPTIONAL</B> 11249 * 11250 * @param path Cookie path. 11251 * <BR /><B CLASS=Opt>OPTIONAL</B> 11252 * 11253 * @param secure True if cookie is secure. 11254 * <BR /><B CLASS=Opt>OPTIONAL</B> 11255 * 11256 * @param httpOnly True if cookie is http-only. 11257 * <BR /><B CLASS=Opt>OPTIONAL</B> 11258 * 11259 * @param sameSite Cookie SameSite type. 11260 * <BR /><B CLASS=Opt>OPTIONAL</B> 11261 * 11262 * @param expires Cookie expiration date, session cookie if not set 11263 * <BR /><B CLASS=Opt>OPTIONAL</B> 11264 * 11265 * @param priority Cookie Priority type. 11266 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11267 * 11268 * @param sameParty True if cookie is SameParty. 11269 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11270 * 11271 * @param sourceScheme Cookie source scheme type. 11272 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11273 * 11274 * @param sourcePort 11275 * Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port. 11276 * An unspecified port value allows protocol clients to emulate legacy cookie scope for the port. 11277 * This is a temporary ability and it will be removed in the future. 11278 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11279 * 11280 * @param partitionKey Cookie partition key. If not set, the cookie will be set as not partitioned. 11281 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11282 * 11283 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11284 * Boolean></CODE> 11285 * 11286 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 11287 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 11288 * Boolean></CODE> will be returned. 11289 * 11290 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 11291 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 11292 * may be retrieved.</I> 11293 * 11294 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 11295 * <BR /><BR /><UL CLASS=JDUL> 11296 * <LI><CODE>Boolean (<B>success</B></CODE>) 11297 * <BR />Always set to true. If an error occurs, the response indicates protocol error. 11298 * </LI> 11299 * </UL> */ 11300 public static Script<String, JsonObject, Boolean> setCookie( 11301 String name, String value, String url, String domain, String path, Boolean secure, 11302 Boolean httpOnly, String sameSite, Number expires, String priority, Boolean sameParty, 11303 String sourceScheme, Integer sourcePort, Network.CookiePartitionKey partitionKey 11304 ) 11305 { 11306 // Exception-Check(s) to ensure that if any parameters which are not declared as 11307 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11308 11309 if (name == null) THROWS.throwNPE("name"); 11310 if (value == null) THROWS.throwNPE("value"); 11311 11312 // Exception-Check(s) to ensure that if any parameters which must adhere to a 11313 // provided List of Enumerated Values, fails, then IllegalArgumentException shall throw. 11314 11315 THROWS.checkIAE("sameSite", sameSite, "Network.CookieSameSite", Network.CookieSameSite); 11316 THROWS.checkIAE("priority", priority, "Network.CookiePriority", Network.CookiePriority); 11317 THROWS.checkIAE("sourceScheme", sourceScheme, "Network.CookieSourceScheme", Network.CookieSourceScheme); 11318 11319 final int webSocketID = 33024000 + counter++; 11320 final boolean[] optionals = { false, false, true, true, true, true, true, true, true, true, true, true, true, true, }; 11321 11322 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11323 String requestJSON = WriteJSON.get( 11324 parameterTypes.get("setCookie"), 11325 parameterNames.get("setCookie"), 11326 optionals, webSocketID, 11327 "Network.setCookie", 11328 name, value, url, domain, path, secure, httpOnly, sameSite, expires, priority, 11329 sameParty, sourceScheme, sourcePort, partitionKey 11330 ); 11331 11332 // 'JSON Binding' ... Converts Browser Response-JSON to 'Boolean' 11333 Function<JsonObject, Boolean> responseProcessor = (JsonObject jo) -> 11334 ReadPrimJSON.getBoolean(jo, "success"); 11335 11336 return new Script<>(webSocketID, requestJSON, responseProcessor); 11337 } 11338 11339 /** 11340 * Sets given cookies. 11341 * 11342 * @param cookies Cookies to be set. 11343 * 11344 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11345 * {@link Ret0}></CODE> 11346 * 11347 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11348 * browser receives the invocation-request. 11349 * 11350 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11351 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11352 * {@code >} to ensure the Browser Function has run to completion. 11353 */ 11354 public static Script<String, JsonObject, Ret0> setCookies(Network.CookieParam[] cookies) 11355 { 11356 // Exception-Check(s) to ensure that if any parameters which are not declared as 11357 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11358 11359 if (cookies == null) THROWS.throwNPE("cookies"); 11360 11361 final int webSocketID = 33025000 + counter++; 11362 final boolean[] optionals = { false, }; 11363 11364 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11365 String requestJSON = WriteJSON.get( 11366 parameterTypes.get("setCookies"), 11367 parameterNames.get("setCookies"), 11368 optionals, webSocketID, 11369 "Network.setCookies", 11370 (Object) cookies 11371 ); 11372 11373 // This Remote Command does not have a Return-Value. 11374 return new Script<> 11375 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11376 } 11377 11378 /** 11379 * Specifies whether to always send extra HTTP headers with the requests from this page. 11380 * 11381 * @param headers Map with extra HTTP headers. 11382 * 11383 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11384 * {@link Ret0}></CODE> 11385 * 11386 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11387 * browser receives the invocation-request. 11388 * 11389 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11390 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11391 * {@code >} to ensure the Browser Function has run to completion. 11392 */ 11393 public static Script<String, JsonObject, Ret0> setExtraHTTPHeaders(JsonObject headers) 11394 { 11395 // Exception-Check(s) to ensure that if any parameters which are not declared as 11396 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11397 11398 if (headers == null) THROWS.throwNPE("headers"); 11399 11400 final int webSocketID = 33026000 + counter++; 11401 final boolean[] optionals = { false, }; 11402 11403 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11404 String requestJSON = WriteJSON.get( 11405 parameterTypes.get("setExtraHTTPHeaders"), 11406 parameterNames.get("setExtraHTTPHeaders"), 11407 optionals, webSocketID, 11408 "Network.setExtraHTTPHeaders", 11409 headers 11410 ); 11411 11412 // This Remote Command does not have a Return-Value. 11413 return new Script<> 11414 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11415 } 11416 11417 /** 11418 * Specifies whether to attach a page script stack id in requests 11419 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11420 * 11421 * @param enabled Whether to attach a page script stack for debugging purpose. 11422 * 11423 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11424 * {@link Ret0}></CODE> 11425 * 11426 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11427 * browser receives the invocation-request. 11428 * 11429 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11430 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11431 * {@code >} to ensure the Browser Function has run to completion. 11432 */ 11433 public static Script<String, JsonObject, Ret0> setAttachDebugStack(boolean enabled) 11434 { 11435 final int webSocketID = 33027000 + counter++; 11436 final boolean[] optionals = { false, }; 11437 11438 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11439 String requestJSON = WriteJSON.get( 11440 parameterTypes.get("setAttachDebugStack"), 11441 parameterNames.get("setAttachDebugStack"), 11442 optionals, webSocketID, 11443 "Network.setAttachDebugStack", 11444 enabled 11445 ); 11446 11447 // This Remote Command does not have a Return-Value. 11448 return new Script<> 11449 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11450 } 11451 11452 /** 11453 * Sets the requests to intercept that match the provided patterns and optionally resource types. 11454 * Deprecated, please use Fetch.enable instead. 11455 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B><B CLASS=Dep-Top>DEPRECATED</B> 11456 * 11457 * @param patterns 11458 * Requests matching any of these patterns will be forwarded and wait for the corresponding 11459 * continueInterceptedRequest call. 11460 * 11461 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11462 * {@link Ret0}></CODE> 11463 * 11464 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11465 * browser receives the invocation-request. 11466 * 11467 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11468 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11469 * {@code >} to ensure the Browser Function has run to completion. 11470 */ 11471 public static Script<String, JsonObject, Ret0> setRequestInterception 11472 (Network.RequestPattern[] patterns) 11473 { 11474 // Exception-Check(s) to ensure that if any parameters which are not declared as 11475 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11476 11477 if (patterns == null) THROWS.throwNPE("patterns"); 11478 11479 final int webSocketID = 33028000 + counter++; 11480 final boolean[] optionals = { false, }; 11481 11482 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11483 String requestJSON = WriteJSON.get( 11484 parameterTypes.get("setRequestInterception"), 11485 parameterNames.get("setRequestInterception"), 11486 optionals, webSocketID, 11487 "Network.setRequestInterception", 11488 (Object) patterns 11489 ); 11490 11491 // This Remote Command does not have a Return-Value. 11492 return new Script<> 11493 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11494 } 11495 11496 /** 11497 * Allows overriding user agent with the given string. 11498 * 11499 * @param userAgent User agent to use. 11500 * 11501 * @param acceptLanguage Browser language to emulate. 11502 * <BR /><B CLASS=Opt>OPTIONAL</B> 11503 * 11504 * @param platform The platform navigator.platform should return. 11505 * <BR /><B CLASS=Opt>OPTIONAL</B> 11506 * 11507 * @param userAgentMetadata To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData 11508 * <BR /><B CLASS=Opt>OPTIONAL</B><B CLASS=Exp>EXPERIMENTAL</B> 11509 * 11510 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11511 * {@link Ret0}></CODE> 11512 * 11513 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11514 * browser receives the invocation-request. 11515 * 11516 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11517 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11518 * {@code >} to ensure the Browser Function has run to completion. 11519 */ 11520 public static Script<String, JsonObject, Ret0> setUserAgentOverride( 11521 String userAgent, String acceptLanguage, String platform, 11522 Emulation.UserAgentMetadata userAgentMetadata 11523 ) 11524 { 11525 // Exception-Check(s) to ensure that if any parameters which are not declared as 11526 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11527 11528 if (userAgent == null) THROWS.throwNPE("userAgent"); 11529 11530 final int webSocketID = 33029000 + counter++; 11531 final boolean[] optionals = { false, true, true, true, }; 11532 11533 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11534 String requestJSON = WriteJSON.get( 11535 parameterTypes.get("setUserAgentOverride"), 11536 parameterNames.get("setUserAgentOverride"), 11537 optionals, webSocketID, 11538 "Network.setUserAgentOverride", 11539 userAgent, acceptLanguage, platform, userAgentMetadata 11540 ); 11541 11542 // This Remote Command does not have a Return-Value. 11543 return new Script<> 11544 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11545 } 11546 11547 /** 11548 * Enables streaming of the response for the given requestId. 11549 * If enabled, the dataReceived event contains the data that was received during streaming. 11550 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11551 * 11552 * @param requestId Identifier of the request to stream. 11553 * 11554 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11555 * String></CODE> 11556 * 11557 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 11558 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 11559 * String></CODE> will be returned. 11560 * 11561 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 11562 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 11563 * may be retrieved.</I> 11564 * 11565 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 11566 * <BR /><BR /><UL CLASS=JDUL> 11567 * <LI><CODE>String (<B>bufferedData</B></CODE>) 11568 * <BR />Data that has been buffered until streaming is enabled. (Encoded as a base64 string when passed over JSON) 11569 * </LI> 11570 * </UL> */ 11571 public static Script<String, JsonObject, String> streamResourceContent(String requestId) 11572 { 11573 // Exception-Check(s) to ensure that if any parameters which are not declared as 11574 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11575 11576 if (requestId == null) THROWS.throwNPE("requestId"); 11577 11578 final int webSocketID = 33030000 + counter++; 11579 final boolean[] optionals = { false, }; 11580 11581 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11582 String requestJSON = WriteJSON.get( 11583 parameterTypes.get("streamResourceContent"), 11584 parameterNames.get("streamResourceContent"), 11585 optionals, webSocketID, 11586 "Network.streamResourceContent", 11587 requestId 11588 ); 11589 11590 // 'JSON Binding' ... Converts Browser Response-JSON to 'String' 11591 Function<JsonObject, String> responseProcessor = (JsonObject jo) -> 11592 ReadJSON.getString(jo, "bufferedData", false, true); 11593 11594 return new Script<>(webSocketID, requestJSON, responseProcessor); 11595 } 11596 11597 /** 11598 * Returns information about the COEP/COOP isolation status. 11599 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11600 * 11601 * @param frameId If no frameId is provided, the status of the target is provided. 11602 * <BR /><B CLASS=Opt>OPTIONAL</B> 11603 * 11604 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11605 * {@link Network.SecurityIsolationStatus}></CODE> 11606 * 11607 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 11608 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 11609 * {@link Network.SecurityIsolationStatus}></CODE> will be returned. 11610 * 11611 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 11612 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 11613 * may be retrieved.</I> 11614 * 11615 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 11616 * <BR /><BR /><UL CLASS=JDUL> 11617 * <LI><CODE>{@link Network.SecurityIsolationStatus} (<B>status</B></CODE>) 11618 * <BR />- 11619 * </LI> 11620 * </UL> */ 11621 public static Script<String, JsonObject, Network.SecurityIsolationStatus> getSecurityIsolationStatus 11622 (String frameId) 11623 { 11624 final int webSocketID = 33031000 + counter++; 11625 final boolean[] optionals = { true, }; 11626 11627 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11628 String requestJSON = WriteJSON.get( 11629 parameterTypes.get("getSecurityIsolationStatus"), 11630 parameterNames.get("getSecurityIsolationStatus"), 11631 optionals, webSocketID, 11632 "Network.getSecurityIsolationStatus", 11633 frameId 11634 ); 11635 11636 // 'JSON Binding' ... Converts Browser Response-JSON to 'Network.SecurityIsolationStatus' 11637 Function<JsonObject, Network.SecurityIsolationStatus> responseProcessor = (JsonObject jo) -> 11638 ReadJSON.getObject(jo, "status", Network.SecurityIsolationStatus.class, false, true); 11639 11640 return new Script<>(webSocketID, requestJSON, responseProcessor); 11641 } 11642 11643 /** 11644 * Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. 11645 * Enabling triggers 'reportingApiReportAdded' for all existing reports. 11646 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11647 * 11648 * @param enable Whether to enable or disable events for the Reporting API 11649 * 11650 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11651 * {@link Ret0}></CODE> 11652 * 11653 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11654 * browser receives the invocation-request. 11655 * 11656 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11657 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11658 * {@code >} to ensure the Browser Function has run to completion. 11659 */ 11660 public static Script<String, JsonObject, Ret0> enableReportingApi(boolean enable) 11661 { 11662 final int webSocketID = 33032000 + counter++; 11663 final boolean[] optionals = { false, }; 11664 11665 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11666 String requestJSON = WriteJSON.get( 11667 parameterTypes.get("enableReportingApi"), 11668 parameterNames.get("enableReportingApi"), 11669 optionals, webSocketID, 11670 "Network.enableReportingApi", 11671 enable 11672 ); 11673 11674 // This Remote Command does not have a Return-Value. 11675 return new Script<> 11676 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11677 } 11678 11679 /** 11680 * Fetches the resource and returns the content. 11681 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11682 * 11683 * @param frameId 11684 * Frame id to get the resource for. Mandatory for frame targets, and 11685 * should be omitted for worker targets. 11686 * <BR /><B CLASS=Opt>OPTIONAL</B> 11687 * 11688 * @param url URL of the resource to get content for. 11689 * 11690 * @param options Options for the request. 11691 * 11692 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11693 * {@link Network.LoadNetworkResourcePageResult}></CODE> 11694 * 11695 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 11696 * {@link Script#exec()}, and afterwards, a {@link Promise}<CODE><JsonObject, 11697 * {@link Network.LoadNetworkResourcePageResult}></CODE> will be returned. 11698 * 11699 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 11700 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 11701 * may be retrieved.</I> 11702 * 11703 * <BR /><BR />This Browser Function <B STYLE='color: red'>returns</B> 11704 * <BR /><BR /><UL CLASS=JDUL> 11705 * <LI><CODE>{@link Network.LoadNetworkResourcePageResult} (<B>resource</B></CODE>) 11706 * <BR />- 11707 * </LI> 11708 * </UL> */ 11709 public static Script<String, JsonObject, Network.LoadNetworkResourcePageResult> loadNetworkResource 11710 (String frameId, String url, Network.LoadNetworkResourceOptions options) 11711 { 11712 // Exception-Check(s) to ensure that if any parameters which are not declared as 11713 // 'Optional', but have a 'null' value anyway, that a NullPointerException shall throw. 11714 11715 if (url == null) THROWS.throwNPE("url"); 11716 if (options == null) THROWS.throwNPE("options"); 11717 11718 final int webSocketID = 33033000 + counter++; 11719 final boolean[] optionals = { true, false, false, }; 11720 11721 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11722 String requestJSON = WriteJSON.get( 11723 parameterTypes.get("loadNetworkResource"), 11724 parameterNames.get("loadNetworkResource"), 11725 optionals, webSocketID, 11726 "Network.loadNetworkResource", 11727 frameId, url, options 11728 ); 11729 11730 // 'JSON Binding' ... Converts Browser Response-JSON to 'Network.LoadNetworkResourcePageResult' 11731 Function<JsonObject, Network.LoadNetworkResourcePageResult> responseProcessor = (JsonObject jo) -> 11732 ReadJSON.getObject(jo, "resource", Network.LoadNetworkResourcePageResult.class, false, true); 11733 11734 return new Script<>(webSocketID, requestJSON, responseProcessor); 11735 } 11736 11737 /** 11738 * Sets Controls for third-party cookie access 11739 * Page reload is required before the new cookie behavior will be observed 11740 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 11741 * 11742 * @param enableThirdPartyCookieRestriction Whether 3pc restriction is enabled. 11743 * 11744 * @param disableThirdPartyCookieMetadata Whether 3pc grace period exception should be enabled; false by default. 11745 * 11746 * @param disableThirdPartyCookieHeuristics Whether 3pc heuristics exceptions should be enabled; false by default. 11747 * 11748 * @return An instance of <CODE>{@link Script}<String, {@link JsonObject}, 11749 * {@link Ret0}></CODE> 11750 * 11751 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 11752 * browser receives the invocation-request. 11753 * 11754 * <BR /><BR />This Browser-Function <I>does not have</I> a return-value. You may choose to 11755 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <JsonObject,} {@link Ret0} 11756 * {@code >} to ensure the Browser Function has run to completion. 11757 */ 11758 public static Script<String, JsonObject, Ret0> setCookieControls( 11759 boolean enableThirdPartyCookieRestriction, boolean disableThirdPartyCookieMetadata, 11760 boolean disableThirdPartyCookieHeuristics 11761 ) 11762 { 11763 final int webSocketID = 33034000 + counter++; 11764 final boolean[] optionals = { false, false, false, }; 11765 11766 // Convert Method Parameters into JSON. Build the JSON Request-Object (as a String) 11767 String requestJSON = WriteJSON.get( 11768 parameterTypes.get("setCookieControls"), 11769 parameterNames.get("setCookieControls"), 11770 optionals, webSocketID, 11771 "Network.setCookieControls", 11772 enableThirdPartyCookieRestriction, disableThirdPartyCookieMetadata, 11773 disableThirdPartyCookieHeuristics 11774 ); 11775 11776 // This Remote Command does not have a Return-Value. 11777 return new Script<> 11778 (webSocketID, requestJSON, VOID_RETURN.NoReturnValues); 11779 } 11780 11781}