aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Http/wixext/Symbols/HttpCertificateSymbol.cs
blob: 1e361b54801485818f2707771114dc5d9c0fa8a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Http
{
    using WixToolset.Data;
    using WixToolset.Http.Symbols;

    public static partial class HttpSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition HttpCertificate = new IntermediateSymbolDefinition(
            HttpSymbolDefinitionType.HttpCertificate.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Host), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Port), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Thumbprint), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.AppId), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Store), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.HandleExisting), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.CertificateType), IntermediateFieldType.Number),
                new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.ComponentRef), IntermediateFieldType.String),
            },
            typeof(HttpCertificateSymbol));
    }
}

namespace WixToolset.Http.Symbols
{
    using WixToolset.Data;

    public enum HttpCertificateSymbolFields
    {
        Host,
        Port,
        Thumbprint,
        AppId,
        Store,
        HandleExisting,
        CertificateType,
        ComponentRef,
    }

    public class HttpCertificateSymbol : IntermediateSymbol
    {
        public HttpCertificateSymbol() : base(HttpSymbolDefinitions.HttpCertificate, null, null)
        {
        }

        public HttpCertificateSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpSymbolDefinitions.HttpCertificate, sourceLineNumber, id)
        {
        }

        public IntermediateField this[HttpCertificateSymbolFields index] => this.Fields[(int)index];

        public string Host
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.Host].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.Host, value);
        }

        public string Port
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.Port].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.Port, value);
        }

        public string Thumbprint
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.Thumbprint].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.Thumbprint, value);
        }

        public string AppId
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.AppId].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.AppId, value);
        }

        public string Store
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.Store].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.Store, value);
        }

        public HandleExisting HandleExisting
        {
            get => (HandleExisting)this.Fields[(int)HttpCertificateSymbolFields.HandleExisting].AsNumber();
            set => this.Set((int)HttpCertificateSymbolFields.HandleExisting, (int)value);
        }

        public CertificateType CertificateType
        {
            get => (CertificateType)this.Fields[(int)HttpCertificateSymbolFields.CertificateType].AsNumber();
            set => this.Set((int)HttpCertificateSymbolFields.CertificateType, (int)value);
        }

        public string ComponentRef
        {
            get => this.Fields[(int)HttpCertificateSymbolFields.ComponentRef].AsString();
            set => this.Set((int)HttpCertificateSymbolFields.ComponentRef, value);
        }
    }
}