/
connect.go
50 lines (41 loc) · 1.86 KB
/
connect.go
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
// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
package events
// ConnectEvent contains the data structure for a Connect event.
type ConnectEvent struct {
Details ConnectDetails `json:"Details"`
Name string `json:"Name"` // The name of the event.
}
// ConnectDetails holds the details of a Connect event
type ConnectDetails struct {
ContactData ConnectContactData `json:"ContactData"`
// The parameters that have been set in the Connect instance at the time of the Lambda invocation.
Parameters map[string]string `json:"Parameters"`
}
// ConnectContactData holds all of the contact information for the user that invoked the Connect event.
type ConnectContactData struct {
// The custom attributes from Connect that the Lambda function was invoked with.
Attributes map[string]string `json:"Attributes"`
Channel string `json:"Channel"`
ContactID string `json:"ContactId"`
CustomerEndpoint ConnectEndpoint `json:"CustomerEndpoint"`
InitialContactID string `json:"InitialContactId"`
// Either: INBOUND/OUTBOUND/TRANSFER/CALLBACK
InitiationMethod string `json:"InitiationMethod"`
PreviousContactID string `json:"PreviousContactId"`
Queue ConnectQueue `json:"Queue"`
SystemEndpoint ConnectEndpoint `json:"SystemEndpoint"`
InstanceARN string `json:"InstanceARN"`
}
// ConnectEndpoint represents routing information.
type ConnectEndpoint struct {
Address string `json:"Address"`
Type string `json:"Type"`
}
// ConnectQueue represents a queue object.
type ConnectQueue struct {
Name string `json:"Name"`
ARN string `json:"ARN"`
}
// ConnectResponse is the structure that Connect expects to get back from Lambda.
// These return values can be used in Connect to perform further routing decisions.
type ConnectResponse map[string]string