forked from RichardKnop/go-mailchimp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
suite_test.go
112 lines (108 loc) · 4.01 KB
/
suite_test.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
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
package mailchimp_test
var notFoundErrorResponse = `{
"type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title": "Resource Not Found",
"status": 404,
"detail": "The requested resource could not be found.",
"instance": ""
}`
var alreadySubscribedErrorResponse = `{
"type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title": "Member Exists",
"status": 400,
"detail": " is already a list member. Use PUT to insert or update list members.",
"instance": ""
}`
var invalidMergeFieldsErrorResponse = `{
"type": "http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",
"title": "Invalid Resource",
"status": 400,
"detail": "Your merge fields were invalid.",
"instance": ""
}`
var successResponse = `{
"id": "11bf13d1eb58116eba1de370b2bd796b",
"email_address": "john@reese.com",
"unique_email_id": "1b757e82a3",
"email_type": "html",
"status": "subscribed",
"merge_fields": {
"FNAME": "",
"LNAME": "",
"MMERGE4": "",
"MMERGE5": "",
"MMERGE3": ""
},
"stats": {
"avg_open_rate": 0,
"avg_click_rate": 0
},
"ip_signup": "",
"timestamp_signup": "",
"ip_opt": "101.8.90.86",
"timestamp_opt": "2016-06-03T07:13:07+00:00",
"member_rating": 2,
"last_changed": "2016-06-03T07:13:07+00:00",
"language": "",
"vip": false,
"email_client": "",
"location": {
"latitude": 0,
"longitude": 0,
"gmtoff": 0,
"dstoff": 0,
"country_code": "",
"timezone": ""
},
"list_id": "0f6b836652",
"_links": [
{
"rel": "self",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b",
"method": "GET",
"targetSchema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"
},
{
"rel": "parent",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members",
"method": "GET",
"targetSchema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json",
"schema": "https://us13.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Members.json"
},
{
"rel": "update",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b",
"method": "PATCH",
"schema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"
},
{
"rel": "upsert",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b",
"method": "PUT",
"schema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Instance.json"
},
{
"rel": "delete",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b",
"method": "DELETE"
},
{
"rel": "activity",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b/activity",
"method": "GET",
"targetSchema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Activity/Collection.json"
},
{
"rel": "goals",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b/goals",
"method": "GET",
"targetSchema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Goals/Collection.json"
},
{
"rel": "notes",
"href": "https://us13.api.mailchimp.com/3.0/lists/0f6b836652/members/11bf13d1eb58116eba1de370b2bd796b/notes",
"method": "GET",
"targetSchema": "https://us13.api.mailchimp.com/schema/3.0/Lists/Members/Notes/Collection.json"
}
]
}`