﻿//------------------------------------------------------------------------------
// This code was generated by a tool.
//
//   Tool : Bond Compiler 0.10.0.0
//   File : Schema3_1_types.cs
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// <auto-generated />
//------------------------------------------------------------------------------


// suppress "Missing XML comment for publicly visible type or member"

using System.Collections;

#pragma warning disable 1591

namespace Microsoft.Applications.Events.DataModels
{
    using System;
    using System.Collections.Generic;

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Ingest
    {
        public long time { get; set; }

        public string clientIp { get; set; }

        public long auth { get; set; }

        public long quality { get; set; }

        public long uploadTime { get; set; }

        public string userAgent { get; set; }

        public string client { get; set; }

        public Ingest()
            : this("Microsoft.Applications.Events.DataModels.Bond.Ingest", "Ingest")
        { }

        protected Ingest(string fullName, string name)
        {
            clientIp = "";
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class User
    {
        public string id { get; set; }

        public string localId { get; set; }

        public string authId { get; set; }

        public string locale { get; set; }

        public User()
            : this("Microsoft.Applications.Events.DataModels.Bond.User", "User")
        { }

        protected User(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Device
    {
        public string id { get; set; }

        public string localId { get; set; }

        public string authId { get; set; }

        public string authSecId { get; set; }

        public string deviceClass { get; set; }

        public string orgId { get; set; }

        public string make { get; set; }

        public string orgAuthId { get; set; }

        public string model { get; set; }

        public Device()
            : this("Microsoft.Applications.Events.DataModels.Bond.Device", "Device")
        { }

        protected Device(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Os
    {
        public string locale { get; set; }

        public string expId { get; set; }

        public int bootId { get; set; }

        public string name { get; set; }

        public string ver { get; set; }

        public Os()
            : this("Microsoft.Applications.Events.DataModels.Bond.Os", "Os")
        { }

        protected Os(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class App
    {
        public string expId { get; set; }

        public string userId { get; set; }

        public string env { get; set; }

        public int asId { get; set; }

        public string id { get; set; }

        public string ver { get; set; }

        public string locale { get; set; }

        public string name { get; set; }

        public App()
            : this("Microsoft.Applications.Events.DataModels.Bond.App", "App")
        { }

        protected App(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Utc
    {
        public string stId { get; set; }

        public string aId { get; set; }

        public string raId { get; set; }

        public string op { get; set; }

        public long cat { get; set; }

        public long flags { get; set; }

        public string sqmId { get; set; }

        public string mon { get; set; }

        public int cpId { get; set; }

        public string bSeq { get; set; }

        public string epoch { get; set; }

        public long seq { get; set; }

        public Utc()
            : this("Microsoft.Applications.Events.DataModels.Bond.Utc", "Utc")
        { }

        protected Utc(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Xbl
    {
        public Dictionary<string, string> claims { get; set; }

        public string nbf { get; set; }

        public string exp { get; set; }

        public string sbx { get; set; }

        public string dty { get; set; }

        public string did { get; set; }

        public string xid { get; set; }

        public ulong uts { get; set; }

        public string pid { get; set; }

        public string dvr { get; set; }

        public uint tid { get; set; }

        public string tvr { get; set; }

        public string sty { get; set; }

        public string sid { get; set; }

        public long? eid { get; set; }

        public string ip { get; set; }

        public Xbl()
            : this("Microsoft.Applications.Events.DataModels.Bond.Xbl", "Xbl")
        { }

        protected Xbl(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Javascript
    {
        public string libVer { get; set; }

        public string osName { get; set; }

        public string browser { get; set; }

        public string browserVersion { get; set; }

        public string platform { get; set; }

        public string make { get; set; }

        public string model { get; set; }

        public string screenSize { get; set; }

        public string mc1Id { get; set; }

        public ulong mc1Lu { get; set; }

        public bool isMc1New { get; set; }

        public string ms0 { get; set; }

        public string anid { get; set; }

        public string a { get; set; }

        public string msResearch { get; set; }

        public string csrvc { get; set; }

        public string rtCell { get; set; }

        public string rtEndAction { get; set; }

        public string rtPermId { get; set; }

        public string r { get; set; }

        public string wtFpc { get; set; }

        public string omniId { get; set; }

        public string gsfxSession { get; set; }


        public string domain { get; set; }

        public string dnt { get; set; }

        public Javascript()
            : this("Microsoft.Applications.Events.DataModels.Bond.Javascript", "Javascript")
        { }

        protected Javascript(string fullName, string name)
        {
            libVer = "";
            osName = "";
            browser = "";
            browserVersion = "";
            platform = "";
            make = "";
            model = "";
            screenSize = "";
            mc1Id = "";
            ms0 = "";
            anid = "";
            a = "";
            msResearch = "";
            csrvc = "";
            rtCell = "";
            rtEndAction = "";
            rtPermId = "";
            r = "";
            wtFpc = "";
            omniId = "";
            gsfxSession = "";
            domain = "";
            dnt = "";
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Protocol
    {
        public int metadataCrc { get; set; }

        public List<List<string>> ticketKeys { get; set; }

        public Protocol()
            : this("Microsoft.Applications.Events.DataModels.Bond.Protocol", "Protocol")
        { }

        protected Protocol(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Receipts
    {
        public long originalTime { get; set; }

        public long uploadTime { get; set; }

        public Receipts()
            : this("Microsoft.Applications.Events.DataModels.Bond.Receipts", "Receipts")
        { }

        protected Receipts(string fullName, string name)
        {

        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal enum ValueKind
    {
        ValueInt64 = unchecked((int)0),
        ValueUInt64 = unchecked((int)1),
        ValueInt32 = unchecked((int)2),
        ValueUInt32 = unchecked((int)3),
        ValueDouble = unchecked((int)4),
        ValueString = unchecked((int)5),
        ValueBool = unchecked((int)6),
        ValueDateTime = unchecked((int)7),
        ValueGuid = unchecked((int)8),
        ValueArrayInt64 = unchecked((int)9),
        ValueArrayUInt64 = unchecked((int)10),
        ValueArrayInt32 = unchecked((int)11),
        ValueArrayUInt32 = unchecked((int)12),
        ValueArrayDouble = unchecked((int)13),
        ValueArrayString = unchecked((int)14),
        ValueArrayBool = unchecked((int)15),
        ValueArrayDateTime = unchecked((int)16),
        ValueArrayGuid = unchecked((int)17),
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal enum PIIKind
    {
        NotSet = unchecked((int)0),
        DistinguishedName = unchecked((int)1),
        GenericData = unchecked((int)2),
        IPV4Address = unchecked((int)3),
        IPv6Address = unchecked((int)4),
        MailSubject = unchecked((int)5),
        PhoneNumber = unchecked((int)6),
        QueryString = unchecked((int)7),
        SipAddress = unchecked((int)8),
        SmtpAddress = unchecked((int)9),
        Identity = unchecked((int)10),
        Uri = unchecked((int)11),
        Fqdn = unchecked((int)12),
        IPV4AddressLegacy = unchecked((int)13),
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class PII
    {
        public PIIKind Kind { get; set; }

        public PII()
            : this("Microsoft.Applications.Events.DataModels.Bond.PII", "PII")
        { }

        protected PII(string fullName, string name)
        {
            Kind = PIIKind.NotSet;
        }

        public static implicit operator List<object>(PII v)
        {
            throw new NotImplementedException();
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal enum CustomerContentKind
    {
        NotSet = unchecked((int)0),
        GenericContent = unchecked((int)1),
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class CustomerContent
    {
        public CustomerContentKind Kind { get; set; }

        public CustomerContent()
            : this("Microsoft.Applications.Events.DataModels.Bond.CustomerContent", "CustomerContent")
        { }

        protected CustomerContent(string fullName, string name)
        {
            Kind = CustomerContentKind.NotSet;
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Attributes
    {
        public List<PII> pii { get; set; }

        public List<CustomerContent> customerContent { get; set; }

        public Attributes()
            : this("Microsoft.Applications.Events.DataModels.Bond.Attributes", "Attributes")
        { }

        protected Attributes(string fullName, string name)
        { }

        internal void Release()
        {
            customerContent = null;
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Value
    {
        public ValueKind type { get; set; }

        public List<Attributes> attributes { get; set; }

        public string stringValue { get; set; }

        public long longValue { get; set; }

        public double doubleValue { get; set; }

        public List<List<byte>> guidValue { get; set; }

        public List<List<string>> stringArray { get; set; }

        public List<List<long>> longArray { get; set; }

        public List<List<double>> doubleArray { get; set; }

        public List<List<List<long>>> guidArray { get; set; }

        public Value()
            : this("Microsoft.Applications.Events.DataModels.Bond.Value", "Value")
        { }

        protected Value(string fullName, string name)
        {
            type = ValueKind.ValueString;
        }

        internal void Release()
        {
            if (attributes != null)
                foreach (var att in attributes)
                    att.Release();

            attributes = null;
            guidValue = null;
            stringArray = null;
            longArray = null;
            doubleArray = null;
            guidArray = null;
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Data
    {
        public Dictionary<string, Value> properties { get; set; }

        public Data()
            : this("Microsoft.Applications.Events.DataModels.Data", "Data")
        { }

        protected Data(string fullName, string name)
        {
            properties = new Dictionary<string, Value>();
        }

        internal void Release()
        {
            if (properties != null)
                foreach (var prop in properties)
                    prop.Value.Release();

            if (properties != null)
            {
                properties.Clear();
            }
            properties = null;
        }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Loc
    {
        public string id { get; set; }
        public string country { get; set; }
        public string timezone { get; set; }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Net
    {
        public string provider { get; set; }
        public string cost { get; set; }
        public string type { get; set; }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Sdk
    {
        public string libVer { get; set; }
        public string epoch { get; set; }
        public Int64 seq { get; set; }
        public string installId { get; set; }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class Cloud
    {
        public string fullEnvName { get; set; }
        public string location { get; set; }
        public string environment { get; set; }
        public string deploymentUnit { get; set; }
        public string name { get; set; }
        public string roleInstance { get; set; }
        public string role { get; set; }
    }

    [System.CodeDom.Compiler.GeneratedCode("gbc", "0.10.0.0")]
    internal partial class CsEvent
    {
        public string ver { get; set; }

        public string name { get; set; }

        public long time { get; set; }

        public double popSample { get; set; }

        public string iKey { get; set; }

        public long flags { get; set; }

        public string cV { get; set; }

        public List<Ingest> extIngest { get; set; }

        public List<Protocol> extProtocol { get; set; }

        public List<User> extUser { get; set; }

        public List<Device> extDevice { get; set; }

        public List<Os> extOs { get; set; }

        public List<App> extApp { get; set; }

        public List<Utc> extUtc { get; set; }

        public List<Xbl> extXbl { get; set; }

        public List<Javascript> extJavascript { get; set; }

        public List<Receipts> extReceipts { get; set; }

        public List<Net> extNet { get; set; }

        public List<Sdk> extSdk { get; set; }

        public List<Loc> extLoc { get; set; }

        public List<Cloud> extCloud { get; set; }

        public List<Data> ext { get; set; }

        public Dictionary<string, string> tags { get; set; }

        public string baseType { get; set; }

        public List<Data> baseData { get; set; }

        public List<Data> data { get; set; }

        public CsEvent()
            : this("Microsoft.Applications.Events.DataModels.CsEvent", "CsEvent")
        { }

        protected CsEvent(string fullName, string name)
        {
            ver = "";
            this.name = "";
            popSample = 100.0;
            tags = new Dictionary<string, string>();
        }

        internal void Reset()
        {
            if (ext != null)
                foreach (var dataElem in ext)
                    dataElem.Release();

            if (data != null)
                foreach (var dataElem in data)
                    dataElem.Release();

            if (baseData != null)
                foreach (var dataElem in baseData)
                    dataElem.Release();

            ver = String.Empty;
            name = String.Empty;
            time = 0;
            popSample = 0;
            iKey = String.Empty;
            flags = 0;
            cV = String.Empty;
            SafeClear(ext);
            SafeClear(extIngest);
            SafeClear(extProtocol);
            SafeClear(extUser);
            SafeClear(extDevice);
            SafeClear(extOs);
            SafeClear(extApp);
            SafeClear(extUtc);
            SafeClear(extNet);
            SafeClear(extDevice);
            SafeClear(extCloud);
            SafeClear(extLoc);
            SafeClear(extXbl);
            SafeClear(extSdk);
            SafeClear(extJavascript);
            SafeClear(extReceipts);
            SafeClear(ext);
            if (tags != null) tags.Clear();
            if (baseType != null) baseType = string.Empty;
            SafeClear(baseData);
            SafeClear(data);

            ext = null;
            extIngest = null;
            extProtocol = null;
            extUser = null;
            extDevice = null;
            extOs = null;
            extApp = null;
            extUtc = null;
            extNet = null;
            extDevice = null;
            extCloud = null;
            extLoc = null;
            extXbl = null;
            extSdk = null;
            extJavascript = null;
            extReceipts = null;
            ext = null;
            tags = null;
            baseType = String.Empty;
            baseData = null;
            data = null;
        }

        private static void SafeClear(IList list)
        {
            if (list != null)
            {
                list.Clear();
            }
        }
    }
} // Microsoft.Applications.Events.DataModels.Bond
