|
| 1 | +// <copyright file="BiDiJsonSerializerContext.cs" company="Selenium Committers"> |
| 2 | +// Licensed to the Software Freedom Conservancy (SFC) under one |
| 3 | +// or more contributor license agreements. See the NOTICE file |
| 4 | +// distributed with this work for additional information |
| 5 | +// regarding copyright ownership. The SFC licenses this file |
| 6 | +// to you under the Apache License, Version 2.0 (the |
| 7 | +// "License"); you may not use this file except in compliance |
| 8 | +// with the License. You may obtain a copy of the License at |
| 9 | +// |
| 10 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +// |
| 12 | +// Unless required by applicable law or agreed to in writing, |
| 13 | +// software distributed under the License is distributed on an |
| 14 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +// KIND, either express or implied. See the License for the |
| 16 | +// specific language governing permissions and limitations |
| 17 | +// under the License. |
| 18 | +// </copyright> |
| 19 | + |
| 20 | +using System.Collections.Generic; |
| 21 | +using System.Text.Json.Serialization; |
| 22 | + |
| 23 | +namespace OpenQA.Selenium.BiDi.Communication.Json; |
| 24 | + |
| 25 | +#region https://github.com/dotnet/runtime/issues/72604 |
| 26 | +[JsonSerializable(typeof(MessageSuccess))] |
| 27 | +[JsonSerializable(typeof(MessageError))] |
| 28 | +[JsonSerializable(typeof(MessageEvent))] |
| 29 | + |
| 30 | +[JsonSerializable(typeof(Modules.Script.EvaluateResult.Success))] |
| 31 | +[JsonSerializable(typeof(Modules.Script.EvaluateResult.Exception))] |
| 32 | + |
| 33 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Number), TypeInfoPropertyName = "Script_RemoteValue_Number")] |
| 34 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Boolean), TypeInfoPropertyName = "Script_RemoteValue_Boolean")] |
| 35 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.String), TypeInfoPropertyName = "Script_RemoteValue_String")] |
| 36 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Null), TypeInfoPropertyName = "Script_RemoteValue_Null")] |
| 37 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Undefined), TypeInfoPropertyName = "Script_RemoteValue_Undefined")] |
| 38 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Symbol))] |
| 39 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Array), TypeInfoPropertyName = "Script_RemoteValue_Array")] |
| 40 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Object), TypeInfoPropertyName = "Script_RemoteValue_Object")] |
| 41 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Function))] |
| 42 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.RegExp), TypeInfoPropertyName = "Script_RemoteValue_RegExp")] |
| 43 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.RegExp.RegExpValue), TypeInfoPropertyName = "Script_RemoteValue_RegExp_RegExpValue")] |
| 44 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Date), TypeInfoPropertyName = "Script_RemoteValue_Date")] |
| 45 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Map), TypeInfoPropertyName = "Script_RemoteValue_Map")] |
| 46 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Set), TypeInfoPropertyName = "Script_RemoteValue_Set")] |
| 47 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.WeakMap))] |
| 48 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.WeakSet))] |
| 49 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Generator))] |
| 50 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Error))] |
| 51 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Proxy))] |
| 52 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Promise))] |
| 53 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.TypedArray))] |
| 54 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.ArrayBuffer))] |
| 55 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.NodeList))] |
| 56 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.HtmlCollection))] |
| 57 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.Node))] |
| 58 | +[JsonSerializable(typeof(Modules.Script.RemoteValue.WindowProxy))] |
| 59 | + |
| 60 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.Window))] |
| 61 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.DedicatedWorker))] |
| 62 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.SharedWorker))] |
| 63 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.ServiceWorker))] |
| 64 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.Worker))] |
| 65 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.PaintWorklet))] |
| 66 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.AudioWorklet))] |
| 67 | +[JsonSerializable(typeof(Modules.Script.RealmInfo.Worklet))] |
| 68 | + |
| 69 | +[JsonSerializable(typeof(Modules.Log.Entry.Console))] |
| 70 | +[JsonSerializable(typeof(Modules.Log.Entry.Javascript))] |
| 71 | +#endregion |
| 72 | + |
| 73 | +[JsonSerializable(typeof(Command))] |
| 74 | +[JsonSerializable(typeof(Message))] |
| 75 | + |
| 76 | +[JsonSerializable(typeof(Modules.Session.StatusResult))] |
| 77 | +[JsonSerializable(typeof(Modules.Session.NewResult))] |
| 78 | + |
| 79 | +[JsonSerializable(typeof(Modules.Browser.CloseCommand), TypeInfoPropertyName = "Browser_CloseCommand")] |
| 80 | +[JsonSerializable(typeof(Modules.Browser.GetUserContextsResult))] |
| 81 | +[JsonSerializable(typeof(IReadOnlyList<Modules.Browser.UserContextInfo>))] |
| 82 | + |
| 83 | +[JsonSerializable(typeof(Modules.BrowsingContext.CloseCommand), TypeInfoPropertyName = "BrowsingContext_CloseCommand")] |
| 84 | +[JsonSerializable(typeof(Modules.BrowsingContext.CreateResult))] |
| 85 | +[JsonSerializable(typeof(Modules.BrowsingContext.BrowsingContextInfo))] |
| 86 | +[JsonSerializable(typeof(Modules.BrowsingContext.NavigateResult))] |
| 87 | +[JsonSerializable(typeof(Modules.BrowsingContext.NavigationInfo))] |
| 88 | +[JsonSerializable(typeof(Modules.BrowsingContext.TraverseHistoryResult))] |
| 89 | +[JsonSerializable(typeof(Modules.BrowsingContext.LocateNodesResult))] |
| 90 | +[JsonSerializable(typeof(Modules.BrowsingContext.CaptureScreenshotResult))] |
| 91 | +[JsonSerializable(typeof(Modules.BrowsingContext.GetTreeResult))] |
| 92 | +[JsonSerializable(typeof(Modules.BrowsingContext.PrintResult))] |
| 93 | +[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptOpenedEventArgs))] |
| 94 | +[JsonSerializable(typeof(Modules.BrowsingContext.UserPromptClosedEventArgs))] |
| 95 | +[JsonSerializable(typeof(Modules.BrowsingContext.Origin), TypeInfoPropertyName = "BrowsingContext_Origin")] |
| 96 | + |
| 97 | +[JsonSerializable(typeof(Modules.Network.BytesValue.String), TypeInfoPropertyName = "Network_BytesValue_String")] |
| 98 | +[JsonSerializable(typeof(Modules.Network.UrlPattern.String), TypeInfoPropertyName = "Network_UrlPattern_String")] |
| 99 | +[JsonSerializable(typeof(Modules.Network.ContinueWithAuthParameters.Default), TypeInfoPropertyName = "Network_ContinueWithAuthParameters_Default")] |
| 100 | +[JsonSerializable(typeof(Modules.Network.AddInterceptResult))] |
| 101 | +[JsonSerializable(typeof(Modules.Network.BeforeRequestSentEventArgs))] |
| 102 | +[JsonSerializable(typeof(Modules.Network.ResponseStartedEventArgs))] |
| 103 | +[JsonSerializable(typeof(Modules.Network.ResponseCompletedEventArgs))] |
| 104 | +[JsonSerializable(typeof(Modules.Network.FetchErrorEventArgs))] |
| 105 | +[JsonSerializable(typeof(Modules.Network.AuthRequiredEventArgs))] |
| 106 | + |
| 107 | +[JsonSerializable(typeof(Modules.Script.Channel), TypeInfoPropertyName = "Script_Channel")] |
| 108 | +[JsonSerializable(typeof(Modules.Script.LocalValue.String), TypeInfoPropertyName = "Script_LocalValue_String")] |
| 109 | +[JsonSerializable(typeof(Modules.Script.Target.Realm), TypeInfoPropertyName = "Script_Target_Realm")] |
| 110 | +[JsonSerializable(typeof(Modules.Script.Target.Context), TypeInfoPropertyName = "Script_Target_Context")] |
| 111 | +[JsonSerializable(typeof(Modules.Script.AddPreloadScriptResult))] |
| 112 | +[JsonSerializable(typeof(Modules.Script.EvaluateResult))] |
| 113 | +[JsonSerializable(typeof(Modules.Script.GetRealmsResult))] |
| 114 | +[JsonSerializable(typeof(Modules.Script.MessageEventArgs))] |
| 115 | +[JsonSerializable(typeof(Modules.Script.RealmDestroyedEventArgs))] |
| 116 | +[JsonSerializable(typeof(IReadOnlyList<Modules.Script.RealmInfo>))] |
| 117 | + |
| 118 | +[JsonSerializable(typeof(Modules.Log.Entry))] |
| 119 | + |
| 120 | +[JsonSerializable(typeof(Modules.Storage.GetCookiesResult))] |
| 121 | +[JsonSerializable(typeof(Modules.Storage.DeleteCookiesResult))] |
| 122 | +[JsonSerializable(typeof(Modules.Storage.SetCookieResult))] |
| 123 | + |
| 124 | +[JsonSerializable(typeof(Modules.Input.PerformActionsCommand))] |
| 125 | +[JsonSerializable(typeof(Modules.Input.Pointer.Down), TypeInfoPropertyName = "Input_Pointer_Down")] |
| 126 | +[JsonSerializable(typeof(Modules.Input.Pointer.Up), TypeInfoPropertyName = "Input_Pointer_Up")] |
| 127 | +[JsonSerializable(typeof(Modules.Input.Pointer.Move), TypeInfoPropertyName = "Input_Pointer_Move")] |
| 128 | +[JsonSerializable(typeof(Modules.Input.Key.Down), TypeInfoPropertyName = "Input_Key_Down")] |
| 129 | +[JsonSerializable(typeof(Modules.Input.Key.Up), TypeInfoPropertyName = "Input_Key_Up")] |
| 130 | +[JsonSerializable(typeof(IEnumerable<Modules.Input.IPointerSourceAction>))] |
| 131 | +[JsonSerializable(typeof(IEnumerable<Modules.Input.IKeySourceAction>))] |
| 132 | +[JsonSerializable(typeof(IEnumerable<Modules.Input.INoneSourceAction>))] |
| 133 | +[JsonSerializable(typeof(IEnumerable<Modules.Input.IWheelSourceAction>))] |
| 134 | + |
| 135 | +internal partial class BiDiJsonSerializerContext : JsonSerializerContext; |
0 commit comments