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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
package sns
import (
"fmt"
"strconv"
)
type DeleteEndpointResponse struct {
ResponseMetadata
}
type GetEndpointAttributesResponse struct {
Attributes []AttributeEntry `xml:"GetEndpointAttributesResult>Attributes>entry"`
ResponseMetadata
}
type PlatformEndpointOpt struct {
Attributes []AttributeEntry
PlatformApplicationArn string
CustomUserData string
Token string
}
type CreatePlatformEndpointResponse struct {
EndpointArn string `xml:"CreatePlatformEndpointResult>EndpointArn"`
ResponseMetadata
}
type PlatformEndpoints struct {
EndpointArn string `xml:"EndpointArn"`
Attributes []AttributeEntry `xml:"Attributes>entry"`
}
type ListEndpointsByPlatformApplicationResponse struct {
Endpoints []PlatformEndpoints `xml:"ListEndpointsByPlatformApplicationResult>Endpoints>member"`
ResponseMetadata
}
type SetEndpointAttributesOpt struct {
Attributes []AttributeEntry
EndpointArn string
}
type SetEndpointAttributesResponse struct {
ResponseMetadata
}
// DeleteEndpoint
//
// See http://goo.gl/9SlUD9 for more details.
func (sns *SNS) DeleteEndpoint(endpointArn string) (resp *DeleteEndpointResponse, err error) {
resp = &DeleteEndpointResponse{}
params := makeParams("DeleteEndpoint")
params["EndpointArn"] = endpointArn
err = sns.query(params, resp)
return
}
// GetEndpointAttributes
//
// See http://goo.gl/c8E5X1 for more details.
func (sns *SNS) GetEndpointAttributes(endpointArn string) (resp *GetEndpointAttributesResponse, err error) {
resp = &GetEndpointAttributesResponse{}
params := makeParams("GetEndpointAttributes")
params["EndpointArn"] = endpointArn
err = sns.query(params, resp)
return
}
// CreatePlatformEndpoint
//
// See http://goo.gl/4tnngi for more details.
func (sns *SNS) CreatePlatformEndpoint(options *PlatformEndpointOpt) (resp *CreatePlatformEndpointResponse, err error) {
resp = &CreatePlatformEndpointResponse{}
params := makeParams("CreatePlatformEndpoint")
params["PlatformApplicationArn"] = options.PlatformApplicationArn
params["Token"] = options.Token
if options.CustomUserData != "" {
params["CustomUserData"] = options.CustomUserData
}
err = sns.query(params, resp)
return
}
// ListEndpointsByPlatformApplication
//
// See http://goo.gl/L7ioyR for more detail.
func (sns *SNS) ListEndpointsByPlatformApplication(platformApplicationArn, nextToken string) (resp *ListEndpointsByPlatformApplicationResponse, err error) {
resp = &ListEndpointsByPlatformApplicationResponse{}
params := makeParams("ListEndpointsByPlatformApplication")
params["PlatformApplicationArn"] = platformApplicationArn
if nextToken != "" {
params["NextToken"] = nextToken
}
err = sns.query(params, resp)
return
}
// SetEndpointAttributes
//
// See http://goo.gl/GTktCj for more detail.
func (sns *SNS) SetEndpointAttributes(options *SetEndpointAttributesOpt) (resp *SetEndpointAttributesResponse, err error) {
resp = &SetEndpointAttributesResponse{}
params := makeParams("SetEndpointAttributes")
params["EndpointArn"] = options.EndpointArn
for i, attr := range options.Attributes {
params[fmt.Sprintf("Attributes.entry.%s.key", strconv.Itoa(i+1))] = attr.Key
params[fmt.Sprintf("Attributes.entry.%s.value", strconv.Itoa(i+1))] = attr.Value
}
err = sns.query(params, resp)
return
}
|