-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrustpilot.go
51 lines (42 loc) · 1.68 KB
/
trustpilot.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
51
package trustpilot
import (
"context"
)
// Trustpilot defines the Trustpilot API client interface.
type Trustpilot interface {
CreateInvitation(ctx context.Context, r *CreateInvitationRequest) (*CreateInvitationResponse, error)
ListTemplates(ctx context.Context, r *ListTemplatesRequest) (*ListTemplatesResponse, error)
}
type CreateInvitationRequest struct {
BusinessUnitID string // Required.
ConsumerEmail string `json:"consumerEmail"` // Required.
ReplyTo string `json:"replyTo,omitempty"`
ReferenceNumber string `json:"referenceNumber,omitempty"` // The customer’s internal reference number.
ConsumerName string `json:"consumerName,omitempty"`
Locale string `json:"locale,omitempty"`
LocationID string `json:"locationId,omitempty"`
SenderEmail string `json:"senderEmail,omitempty"`
SenderName string `json:"senderName,omitempty"`
ServiceReviewInvitation *ServiceReviewInvitation `json:"serviceReviewInvitation,omitempty"`
}
type ServiceReviewInvitation struct {
PreferredSendTime string `json:"preferredSendTime,omitempty"` // ISO8601 UTC.
RedirectURI string `json:"redirectUri,omitempty"`
Tags []string `json:"tags,omitempty"`
TemplateID string `json:"templateId,omitempty"`
}
type CreateInvitationResponse struct {
}
type ListTemplatesRequest struct {
BusinessUnitID string // Required.
}
type ListTemplatesResponse struct {
Templates []Template `json:"templates"`
}
type Template struct {
ID string `json:"id"`
Name string `json:"name"`
IsDefaultTemplate bool `json:"isDefaultTemplate"`
Locale string `json:"locale,omitempty"`
Type string `json:"type"`
}