Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/third_party/dotnet/devtools/src/generator/Templates/command.hbs
1865 views
// <auto-generated />

#nullable enable

namespace {{rootNamespace}}.{{domain.Name}}
{
    using System.Text.Json.Serialization;

    /// <summary>
    /// {{xml-code-comment command.Description 1}}
    /// </summary>
    public sealed class {{className}}CommandSettings : ICommand
    {
        private const string DevToolsRemoteInterface_CommandName = "{{domain.Name}}.{{command.Name}}";

        /// <summary>
        /// Gets the name of the command.
        /// </summary>
        [JsonIgnore]
        public string CommandName => DevToolsRemoteInterface_CommandName;

    {{#each command.Parameters}}
        {{#if Description}}
        /// <summary>
        /// {{xml-code-comment Description 2}}
        /// </summary>
        {{else}}
        /// <summary>
        /// Gets or sets the {{Name}}
        /// </summary>
        {{/if}}
        [JsonPropertyName("{{Name}}")]
        {{#if Optional}}[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]{{/if}}
        public {{typemap ../context}} {{dehumanize Name}} { get; set; }{{#unless Optional}} = default!;{{/unless}}

    {{/each}}
    }

    /// <summary>
    /// Response for {{xml-code-comment command.Description 1}}
    /// </summary>
    public sealed class {{className}}CommandResponse : ICommandResponse<{{className}}CommandSettings>
    {
    {{#each command.Returns}}
        {{#if Description}}
        /// <summary>
        /// {{xml-code-comment Description 2}}
        ///</summary>
        {{else}}
        /// <summary>
        /// Gets or sets the {{Name}}
        /// </summary>
        {{/if}}
        [JsonPropertyName("{{Name}}")]
        {{#if Optional}}[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]{{/if}}
        public {{typemap ../context}} {{dehumanize Name}} { get; set; }{{#unless Optional}} = default!;{{/unless}}

    {{/each}}
    }
}