// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #nullable enable using System.Collections.Generic; namespace Microsoft.PowerShell.Commands { /// /// FormObject used in HtmlWebResponseObject. /// public class FormObject { /// /// Gets the Id property. /// public string Id { get; } /// /// Gets the Method property. /// public string Method { get; } /// /// Gets the Action property. /// public string Action { get; } /// /// Gets the Fields property. /// public Dictionary Fields { get; } /// /// Initializes a new instance of the class. /// /// /// /// public FormObject(string id, string method, string action) { Id = id; Method = method; Action = action; Fields = new Dictionary(); } internal void AddField(string key, string value) { if (key is not null && !Fields.TryGetValue(key, out string? _)) { Fields[key] = value; } } } }