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AAM,CAE9B;CACJ;AAED,qBAAa,oBAAqB,SAAQ,eAAe;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAM/D,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;CACJ;AAED,qBAAa,6BAA8B,SAAQ,eAAe;IAC9D,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAS;gBAEf,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMpE,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,UAAU,IAAI,MAAM,CAE9B;CACJ;AAED,qBAAa,8BAA+B,SAAQ,eAAe;IAC/D,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,WAAW,CAAoB;gBAE3B,YAAY,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IAM5F,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IAED,IAAW,OAAO,IAAI,iBAAiB,CAEtC;CACJ;AAED,qBAAa,0BAA2B,SAAQ,eAAe;IAC3D,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,WAAW,CAAoB;gBAE3B,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IAMxF,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,OAAO,IAAI,iBAAiB,CAEtC;CACJ","file":"ConnectionEvents.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\n// tslint:disable:max-classes-per-file\r\n\r\nimport { ConnectionMessage } from \"./ConnectionMessage\";\r\nimport { IStringDictionary } from \"./IDictionary\";\r\nimport { EventType, PlatformEvent } from \"./PlatformEvent\";\r\n\r\nexport class ServiceEvent extends PlatformEvent {\r\n    private privJsonResult: string;\r\n\r\n    constructor(eventName: string, jsonstring: string, eventType: EventType = EventType.Info) {\r\n      super(eventName, eventType);\r\n      this.privJsonResult = jsonstring;\r\n    }\r\n\r\n    public get jsonString(): string {\r\n        return this.privJsonResult;\r\n    }\r\n}\r\n\r\nexport class ConnectionEvent extends PlatformEvent {\r\n    private privConnectionId: string;\r\n\r\n    constructor(eventName: string, connectionId: string, eventType: EventType = EventType.Info) {\r\n        super(eventName, eventType);\r\n        this.privConnectionId = connectionId;\r\n    }\r\n\r\n    public get connectionId(): string {\r\n        return this.privConnectionId;\r\n    }\r\n}\r\n\r\nexport class ConnectionStartEvent extends ConnectionEvent {\r\n    private privUri: string;\r\n    private privHeaders: IStringDictionary<string>;\r\n\r\n    constructor(connectionId: string, uri: string, headers?: IStringDictionary<string>) {\r\n        super(\"ConnectionStartEvent\", connectionId);\r\n        this.privUri = uri;\r\n        this.privHeaders = headers;\r\n    }\r\n\r\n    public get uri(): string {\r\n        return this.privUri;\r\n    }\r\n\r\n    public get headers(): IStringDictionary<string> {\r\n        return this.privHeaders;\r\n    }\r\n}\r\n\r\nexport class ConnectionEstablishedEvent extends ConnectionEvent {\r\n    constructor(connectionId: string, metadata?: IStringDictionary<string>) {\r\n        super(\"ConnectionEstablishedEvent\", connectionId);\r\n    }\r\n}\r\n\r\nexport class ConnectionClosedEvent extends ConnectionEvent {\r\n    private privReason: string;\r\n    private privStatusCode: number;\r\n\r\n    constructor(connectionId: string, statusCode: number, reason: string) {\r\n        super(\"ConnectionClosedEvent\", connectionId, EventType.Debug);\r\n        this.privReason = reason;\r\n        this.privStatusCode = statusCode;\r\n    }\r\n\r\n    public get reason(): string {\r\n        return this.privReason;\r\n    }\r\n\r\n    public get statusCode(): number {\r\n        return this.privStatusCode;\r\n    }\r\n}\r\n\r\nexport class ConnectionErrorEvent extends ConnectionEvent {\r\n    private readonly privMessage: string;\r\n    private readonly privType: string;\r\n\r\n    constructor(connectionId: string, message: string, type: string) {\r\n        super(\"ConnectionErrorEvent\", connectionId, EventType.Debug);\r\n        this.privMessage = message;\r\n        this.privType = type;\r\n    }\r\n\r\n    public get message(): string {\r\n        return this.privMessage;\r\n    }\r\n\r\n    public get type(): string {\r\n        return this.privType;\r\n    }\r\n}\r\n\r\nexport class ConnectionEstablishErrorEvent extends ConnectionEvent {\r\n    private privStatusCode: number;\r\n    private privReason: string;\r\n\r\n    constructor(connectionId: string, statuscode: number, reason: string) {\r\n        super(\"ConnectionEstablishErrorEvent\", connectionId, EventType.Error);\r\n        this.privStatusCode = statuscode;\r\n        this.privReason = reason;\r\n    }\r\n\r\n    public get reason(): string {\r\n        return this.privReason;\r\n    }\r\n\r\n    public get statusCode(): number {\r\n        return this.privStatusCode;\r\n    }\r\n}\r\n\r\nexport class ConnectionMessageReceivedEvent extends ConnectionEvent {\r\n    private privNetworkReceivedTime: string;\r\n    private privMessage: ConnectionMessage;\r\n\r\n    constructor(connectionId: string, networkReceivedTimeISO: string, message: ConnectionMessage) {\r\n        super(\"ConnectionMessageReceivedEvent\", connectionId);\r\n        this.privNetworkReceivedTime = networkReceivedTimeISO;\r\n        this.privMessage = message;\r\n    }\r\n\r\n    public get networkReceivedTime(): string {\r\n        return this.privNetworkReceivedTime;\r\n    }\r\n\r\n    public get message(): ConnectionMessage {\r\n        return this.privMessage;\r\n    }\r\n}\r\n\r\nexport class ConnectionMessageSentEvent extends ConnectionEvent {\r\n    private privNetworkSentTime: string;\r\n    private privMessage: ConnectionMessage;\r\n\r\n    constructor(connectionId: string, networkSentTimeISO: string, message: ConnectionMessage) {\r\n        super(\"ConnectionMessageSentEvent\", connectionId);\r\n        this.privNetworkSentTime = networkSentTimeISO;\r\n        this.privMessage = message;\r\n    }\r\n\r\n    public get networkSentTime(): string {\r\n        return this.privNetworkSentTime;\r\n    }\r\n\r\n    public get message(): ConnectionMessage {\r\n        return this.privMessage;\r\n    }\r\n}\r\n"]}