import "Base.bond"

namespace AI

[Description("System variables for a telemetry item.")]
struct Envelope
{
    [Description("Envelope version. For internal use only. By assigning this the default, it will not be serialized within the payload unless changed to a value other than #1.")]
    [Name("SchemaVersion")]
    10: int32 	 ver = 1;
    
    [Description("Type name of telemetry data item.")]
    [Name("DataTypeName")]
    [MaxStringLength("1024")]
    20: required string 	 name;
    
    [Description("Event date time when telemetry item was created. This is the wall clock time on the client when the event was generated. There is no guarantee that the client's time is accurate. This field must be formatted in UTC ISO 8601 format, with a trailing 'Z' character, as described publicly on https://en.wikipedia.org/wiki/ISO_8601#UTC. Note: the number of decimal seconds digits provided are variable (and unspecified). Consumers should handle this, i.e. managed code consumers should not use format 'O' for parsing as it specifies a fixed length. Example: 2009-06-15T13:45:30.0000000Z.")]
    [Name("DateTime")]
    [CSType("DateTimeOffset")]
    [JSType("Date")]
    [HockeyAppMinDateOffsetFromNow("2592000000")]
    [MinDateOffsetFromNow("172800000")]
    [MaxDateOffsetFromNow("7200000")]
    30: required string 	 time;
    
    [Name("SamplingRate")]
    [Description("Sampling rate used in application. This telemetry item represents 1 / sampleRate actual telemetry items.")]
    40: double 	 sampleRate = 100.0;
    
    [Description("Sequence field used to track absolute order of uploaded events.")]
    [Name("SequenceNumber")]
    [MaxStringLength("64")]
    50: string 	 seq;
    
    [Description("The application's instrumentation key.")]
    [Name("InstrumentationKey")]
    [MaxStringLength("40")]
    60: string 	 iKey;
    
    [Name("Tags")]
    [TypeAlias("ContextTagKeys")]
    [Description("Key/value collection of context properties. See ContextTagKeys for information on available properties.")]
    500: map<string, string> 	 tags;
    
    [Name("TelemetryData")]
    [Description("Telemetry data item.")]
    999: Base 	 data;
    
}
