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 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
package sns
import (
"github.com/AdRoll/goamz/aws"
)
type Topic struct {
TopicArn string
}
type Subscription struct {
Endpoint string
Owner string
Protocol string
SubscriptionArn string
TopicArn string
}
type Attribute struct {
Key string `xml:"key"`
Value string `xml:"value"`
}
type Permission struct {
ActionName string
AccountId string
}
type PlatformApplication struct {
Attributes []Attribute `xml:"Attributes>entry"`
PlatformApplicationArn string
}
type Endpoint struct {
EndpointArn string `xml:"EndpointArn"`
Attributes []Attribute `xml:"Attributes>entry"`
}
// ============ Request ============
type PublishOptions struct {
Message string
MessageStructure string
Subject string
TopicArn string
TargetArn string
}
type PlatformEndpointOptions struct {
Attributes []Attribute
PlatformApplicationArn string
CustomUserData string
Token string
}
// ============ Response ============
type ListTopicsResponse struct {
NextToken string `xml:"ListTopicsResult>NextToken"`
Topics []Topic `xml:"ListTopicsResult>Topics>member"`
ResponseMetadata aws.ResponseMetadata
Error aws.Error
}
type CreateTopicResponse struct {
Topic Topic `xml:"CreateTopicResult"`
ResponseMetadata aws.ResponseMetadata
}
type DeleteTopicResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type ListSubscriptionsResponse struct {
NextToken string `xml:"ListSubscriptionsResult>NextToken"`
Subscriptions []Subscription `xml:"ListSubscriptionsResult>Subscriptions>member"`
ResponseMetadata aws.ResponseMetadata
}
type GetTopicAttributesResponse struct {
Attributes []Attribute `xml:"GetTopicAttributesResult>Attributes>entry"`
ResponseMetadata aws.ResponseMetadata
}
type SetTopicAttributesResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type PublishResponse struct {
MessageId string `xml:"PublishResult>MessageId"`
ResponseMetadata aws.ResponseMetadata
}
type SubscribeResponse struct {
SubscriptionArn string `xml:"SubscribeResult>SubscriptionArn"`
ResponseMetadata aws.ResponseMetadata
}
type UnsubscribeResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type GetSubscriptionAttributesResponse struct {
Attributes []Attribute `xml:"GetSubscriptionAttributesResult>Attributes>entry"`
ResponseMetadata aws.ResponseMetadata
}
type SetSubscriptionAttributesResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type ConfirmSubscriptionResponse struct {
SubscriptionArn string `xml:"ConfirmSubscriptionResult>SubscriptionArn"`
ResponseMetadata aws.ResponseMetadata
}
type AddPermissionResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type RemovePermissionResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type ListSubscriptionByTopicResponse struct {
NextToken string `xml:"ListSubscriptionsByTopicResult>NextToken"`
Subscriptions []Subscription `xml:"ListSubscriptionsByTopicResult>Subscriptions>member"`
ResponseMetadata aws.ResponseMetadata
}
type CreatePlatformApplicationResponse struct {
PlatformApplicationArn string `xml:"CreatePlatformApplicationResult>PlatformApplicationArn"`
ResponseMetadata aws.ResponseMetadata
}
type CreatePlatformEndpointResponse struct {
EndpointArn string `xml:"CreatePlatformEndpointResult>EndpointArn"`
ResponseMetadata aws.ResponseMetadata
}
type DeleteEndpointResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type DeletePlatformApplicationResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type GetEndpointAttributesResponse struct {
Attributes []Attribute `xml:"GetEndpointAttributesResult>Attributes>entry"`
ResponseMetadata aws.ResponseMetadata
}
type GetPlatformApplicationAttributesResponse struct {
Attributes []Attribute `xml:"GetPlatformApplicationAttributesResult>Attributes>entry"`
ResponseMetadata aws.ResponseMetadata
}
type ListEndpointsByPlatformApplicationResponse struct {
NextToken string `xml:"ListEndpointsByPlatformApplicationResult>NextToken"`
Endpoints []Endpoint `xml:"ListEndpointsByPlatformApplicationResult>Endpoints>member"`
ResponseMetadata aws.ResponseMetadata
}
type ListPlatformApplicationsResponse struct {
NextToken string `xml:"ListPlatformApplicationsResult>NextToken"`
PlatformApplications []PlatformApplication `xml:"ListPlatformApplicationsResult>PlatformApplications>member"`
ResponseMetadata aws.ResponseMetadata
}
type SetEndpointAttributesResponse struct {
ResponseMetadata aws.ResponseMetadata
}
type SetPlatformApplicationAttributesResponse struct {
ResponseMetadata aws.ResponseMetadata
}
|