mailchimp_api_v3 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/lib/mailchimp_api_v3/client/remote.rb +12 -8
  4. data/lib/mailchimp_api_v3/collection.rb +1 -1
  5. data/lib/mailchimp_api_v3/collection/paging.rb +1 -1
  6. data/lib/mailchimp_api_v3/instance.rb +5 -1
  7. data/lib/mailchimp_api_v3/version.rb +1 -1
  8. data/spec/fixtures/cassettes/account.yml +92 -0
  9. data/spec/fixtures/cassettes/client.yml +223 -0
  10. data/spec/fixtures/cassettes/exception.yml +179 -0
  11. data/spec/fixtures/cassettes/interest.yml +384 -0
  12. data/spec/fixtures/cassettes/interest_categories.yml +637 -0
  13. data/spec/fixtures/cassettes/interest_category.yml +389 -0
  14. data/spec/fixtures/cassettes/interests.yml +723 -0
  15. data/spec/fixtures/cassettes/list.yml +176 -0
  16. data/spec/fixtures/cassettes/lists.yml +47 -0
  17. data/spec/fixtures/cassettes/mailchimp.yml +6 -886
  18. data/spec/fixtures/cassettes/member.yml +267 -0
  19. data/spec/fixtures/cassettes/members.yml +17 -6
  20. data/spec/mailchimp_api_v3/account_spec.rb +1 -1
  21. data/spec/mailchimp_api_v3/client_spec.rb +1 -1
  22. data/spec/mailchimp_api_v3/exception_spec.rb +1 -1
  23. data/spec/mailchimp_api_v3/interest_categories_spec.rb +21 -33
  24. data/spec/mailchimp_api_v3/interest_category_spec.rb +7 -7
  25. data/spec/mailchimp_api_v3/interest_spec.rb +9 -6
  26. data/spec/mailchimp_api_v3/interests_spec.rb +24 -28
  27. data/spec/mailchimp_api_v3/list_spec.rb +1 -1
  28. data/spec/mailchimp_api_v3/lists_spec.rb +1 -1
  29. data/spec/mailchimp_api_v3/member_spec.rb +4 -3
  30. data/spec/mailchimp_api_v3/members_spec.rb +1 -1
  31. data/spec/support/vcr_setup.rb +1 -1
  32. metadata +23 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8f048d1673768ca49fb00ab3a0b8965c16a8a60
4
- data.tar.gz: 98310035ec6e4de642b1d1df78aa1676e7185a53
3
+ metadata.gz: 61eb0ac85e729bf6310175b16636c5f5664710d1
4
+ data.tar.gz: 892f6d64134d54cd1a50cf7c2d206fb52210f355
5
5
  SHA512:
6
- metadata.gz: f412aafb47730c2e7c5f4f2ac54586261758bcdec8ad8690fef9e3b6b88a6438ebe1781a2df3ffa25025aee18b1d3eb13c3cb697e9f1a641ac8f0ef121e8c699
7
- data.tar.gz: d207f73778a05e6ef54b66884c3d80989a3c3d42ef16263c401767fad0a4af7a52a2e681ac3fbefa8cda3f605517d6ca1ed6c0fa1c2e0cc76dc16b6ed5214092
6
+ metadata.gz: 4b5e4925fcaf4b8d0898b7621ccaef0b0b8e4b148b04ecca3ace715e460346bf3146743b5667d2a1627b634e29912edd475bddd4e173b94aa88fec209dd7fd11
7
+ data.tar.gz: 970507bbd172fd7fbf2334fa9bd7f73642a61ccde8434deb41d34aa2c18c14a1137fda97e13ee3ff148516b6b5bd99c32c15c71dfdf3201aeb8155bb2cc082a6
data/.rubocop.yml CHANGED
@@ -1,4 +1,8 @@
1
1
  ---
2
+ AllCops:
3
+ Exclude:
4
+ - 'tmp/**/*'
5
+
2
6
  StringLiterals:
3
7
  EnforcedStyle: single_quotes
4
8
  Enabled: true
@@ -5,22 +5,26 @@ module Mailchimp
5
5
  class Client
6
6
  module Remote
7
7
  def get(path = '', options = {})
8
- managed_remote path, options, :get
8
+ managed_remote path, :get, options
9
9
  end
10
10
 
11
- def post(data, path = '', options = {})
12
- managed_remote path, options, :post, data
11
+ def post(path, data, options = {})
12
+ managed_remote path, :post, options, data
13
13
  end
14
14
 
15
- def patch(data, path = '', options = {})
16
- managed_remote path, options, :patch, data
15
+ def patch(path, data, options = {})
16
+ managed_remote path, :patch, options, data
17
+ end
18
+
19
+ def delete(path)
20
+ managed_remote path, :delete
17
21
  end
18
22
 
19
23
  private
20
24
 
21
25
  RETRY_EXCEPTIONS = [SocketError]
22
26
 
23
- def managed_remote(path = '', options = {}, method = :get, payload = nil)
27
+ def managed_remote(path, method = :get, options = {}, payload = nil)
24
28
  headers_and_params = headers.merge params_from(options)
25
29
  YAML.load naked_remote("#{url_stub}#{path}", method, headers_and_params, payload)
26
30
  rescue *RETRY_EXCEPTIONS => e
@@ -51,11 +55,11 @@ module Mailchimp
51
55
  end
52
56
  end
53
57
 
54
- def remote_no_payload(url, method = :get, headers_and_params = {})
58
+ def remote_no_payload(url, method, headers_and_params = {})
55
59
  RestClient.__send__ method, url, headers_and_params
56
60
  end
57
61
 
58
- def remote_with_payload(url, payload, method = :post, headers_and_params = {})
62
+ def remote_with_payload(url, payload, method, headers_and_params = {})
59
63
  RestClient.__send__ method, url, payload.to_json, headers_and_params
60
64
  end
61
65
 
@@ -38,7 +38,7 @@ module Mailchimp
38
38
  end
39
39
 
40
40
  def create(data)
41
- response = @client.post data, path
41
+ response = @client.post path, data
42
42
  self.class::CHILD_CLASS.new @client, response, path
43
43
  end
44
44
 
@@ -9,7 +9,7 @@ module Mailchimp
9
9
  end
10
10
 
11
11
  def fetch_options
12
- links_delim = self.class::DATA_KEY.empty? ? '' : '.'
12
+ links_delim = self.class::DATA_KEY.empty? ? '' : '._links,'
13
13
 
14
14
  {
15
15
  'exclude_fields' => "#{self.class::DATA_KEY}#{links_delim}_links",
@@ -17,10 +17,14 @@ module Mailchimp
17
17
  end
18
18
 
19
19
  def update(new_data)
20
- @data = @client.patch(new_data, path)
20
+ @data = @client.patch(path, new_data)
21
21
  self
22
22
  end
23
23
 
24
+ def delete
25
+ @client.delete(path)
26
+ end
27
+
24
28
  def path
25
29
  @path ||= "#{@collection_path}/#{@data['id']}"
26
30
  end
@@ -1,3 +1,3 @@
1
1
  module Mailchimp
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -0,0 +1,92 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Authorization:
15
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
16
+ User-Agent:
17
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
18
+ response:
19
+ status:
20
+ code: 301
21
+ message: Moved Permanently
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Content-Type:
26
+ - text/html; charset=iso-8859-1
27
+ Content-Length:
28
+ - '242'
29
+ Location:
30
+ - http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
31
+ Date:
32
+ - Tue, 07 Jul 2015 11:29:33 GMT
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
39
+ <html><head>
40
+ <title>301 Moved Permanently</title>
41
+ </head><body>
42
+ <h1>Moved Permanently</h1>
43
+ <p>The document has moved <a href="http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/">here</a>.</p>
44
+ </body></html>
45
+ http_version:
46
+ recorded_at: Tue, 07 Jul 2015 11:29:33 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Authorization:
59
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
60
+ User-Agent:
61
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
62
+ Cookie:
63
+ - ''
64
+ response:
65
+ status:
66
+ code: 200
67
+ message: OK
68
+ headers:
69
+ Server:
70
+ - nginx
71
+ Content-Type:
72
+ - application/json; charset=utf-8
73
+ Content-Length:
74
+ - '2003'
75
+ X-Request-Id:
76
+ - c13f91ae-88d3-4dda-b545-8ffa3583b1d8
77
+ Link:
78
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json>; rel="describedBy"
79
+ Vary:
80
+ - Accept-Encoding
81
+ Date:
82
+ - Tue, 07 Jul 2015 11:29:33 GMT
83
+ Connection:
84
+ - keep-alive
85
+ body:
86
+ encoding: ASCII-8BIT
87
+ string: '{"account_id":"1dbca289fd41b54838bcbb501","account_name":"InSite Arts","contact":{"company":"InSite
88
+ Arts","addr1":"300 Burdett Road","addr2":"London","city":"London","state":"","zip":"E14
89
+ 7DQ","country":"GB"},"last_login":"2015-07-07 11:24:31","total_subscribers":2,"_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json"},{"rel":"lists","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json"},{"rel":"reports","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/reports","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Reports/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Reports.json"},{"rel":"conversations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/conversations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Conversations/Collection.json"},{"rel":"campaigns","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/campaigns","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Campaigns/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Campaigns.json"},{"rel":"automations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/automations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Automations/Collection.json"},{"rel":"templates","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/templates","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Templates/Collection.json"},{"rel":"file-manager","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/file-manager","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/FileManager/Namespace.json"},{"rel":"authorized-apps","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/authorized-apps","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/AuthorizedApps/Collection.json"}]}'
90
+ http_version:
91
+ recorded_at: Tue, 07 Jul 2015 11:29:33 GMT
92
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,223 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Authorization:
15
+ - apikey xxxxxxxxxx-us11
16
+ User-Agent:
17
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
18
+ response:
19
+ status:
20
+ code: 301
21
+ message: Moved Permanently
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Content-Type:
26
+ - text/html; charset=iso-8859-1
27
+ Content-Length:
28
+ - '242'
29
+ Location:
30
+ - http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
31
+ Date:
32
+ - Tue, 07 Jul 2015 11:29:35 GMT
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
39
+ <html><head>
40
+ <title>301 Moved Permanently</title>
41
+ </head><body>
42
+ <h1>Moved Permanently</h1>
43
+ <p>The document has moved <a href="http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/">here</a>.</p>
44
+ </body></html>
45
+ http_version:
46
+ recorded_at: Tue, 07 Jul 2015 11:29:35 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Authorization:
59
+ - apikey xxxxxxxxxx-us11
60
+ User-Agent:
61
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
62
+ Cookie:
63
+ - ''
64
+ response:
65
+ status:
66
+ code: 401
67
+ message: Unauthorized
68
+ headers:
69
+ Server:
70
+ - nginx
71
+ Content-Type:
72
+ - application/problem+json; charset=utf-8
73
+ Content-Length:
74
+ - '250'
75
+ Link:
76
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
77
+ Vary:
78
+ - Accept-Encoding
79
+ Date:
80
+ - Tue, 07 Jul 2015 11:29:35 GMT
81
+ Connection:
82
+ - keep-alive
83
+ body:
84
+ encoding: ASCII-8BIT
85
+ string: '{"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-invalid","title":"API
86
+ Key Invalid","status":401,"detail":"Your API key may be invalid, or you''ve
87
+ attempted to access the wrong datacenter.","instance":"b979a616-d948-4e32-abe1-930719fe1671"}'
88
+ http_version:
89
+ recorded_at: Tue, 07 Jul 2015 11:29:35 GMT
90
+ - request:
91
+ method: get
92
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0
93
+ body:
94
+ encoding: US-ASCII
95
+ string: ''
96
+ headers:
97
+ Accept:
98
+ - "*/*; q=0.5, application/xml"
99
+ Accept-Encoding:
100
+ - gzip, deflate
101
+ Authorization:
102
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
103
+ User-Agent:
104
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
105
+ response:
106
+ status:
107
+ code: 301
108
+ message: Moved Permanently
109
+ headers:
110
+ Server:
111
+ - nginx
112
+ Content-Type:
113
+ - text/html; charset=iso-8859-1
114
+ Content-Length:
115
+ - '242'
116
+ Location:
117
+ - http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
118
+ Date:
119
+ - Tue, 07 Jul 2015 11:29:35 GMT
120
+ Connection:
121
+ - keep-alive
122
+ body:
123
+ encoding: UTF-8
124
+ string: |
125
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
126
+ <html><head>
127
+ <title>301 Moved Permanently</title>
128
+ </head><body>
129
+ <h1>Moved Permanently</h1>
130
+ <p>The document has moved <a href="http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/">here</a>.</p>
131
+ </body></html>
132
+ http_version:
133
+ recorded_at: Tue, 07 Jul 2015 11:29:35 GMT
134
+ - request:
135
+ method: get
136
+ uri: http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
137
+ body:
138
+ encoding: US-ASCII
139
+ string: ''
140
+ headers:
141
+ Accept:
142
+ - "*/*; q=0.5, application/xml"
143
+ Accept-Encoding:
144
+ - gzip, deflate
145
+ Authorization:
146
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
147
+ User-Agent:
148
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
149
+ Cookie:
150
+ - ''
151
+ response:
152
+ status:
153
+ code: 200
154
+ message: OK
155
+ headers:
156
+ Server:
157
+ - nginx
158
+ Content-Type:
159
+ - application/json; charset=utf-8
160
+ Content-Length:
161
+ - '2003'
162
+ X-Request-Id:
163
+ - 088a39c2-676a-4e5a-8764-cdcfbef3a812
164
+ Link:
165
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json>; rel="describedBy"
166
+ Vary:
167
+ - Accept-Encoding
168
+ Date:
169
+ - Tue, 07 Jul 2015 11:29:35 GMT
170
+ Connection:
171
+ - keep-alive
172
+ body:
173
+ encoding: ASCII-8BIT
174
+ string: '{"account_id":"1dbca289fd41b54838bcbb501","account_name":"InSite Arts","contact":{"company":"InSite
175
+ Arts","addr1":"300 Burdett Road","addr2":"London","city":"London","state":"","zip":"E14
176
+ 7DQ","country":"GB"},"last_login":"2015-07-07 11:24:31","total_subscribers":2,"_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json"},{"rel":"lists","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json"},{"rel":"reports","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/reports","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Reports/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Reports.json"},{"rel":"conversations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/conversations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Conversations/Collection.json"},{"rel":"campaigns","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/campaigns","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Campaigns/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Campaigns.json"},{"rel":"automations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/automations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Automations/Collection.json"},{"rel":"templates","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/templates","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Templates/Collection.json"},{"rel":"file-manager","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/file-manager","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/FileManager/Namespace.json"},{"rel":"authorized-apps","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/authorized-apps","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/AuthorizedApps/Collection.json"}]}'
177
+ http_version:
178
+ recorded_at: Tue, 07 Jul 2015 11:29:35 GMT
179
+ - request:
180
+ method: get
181
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists?count=500&exclude_fields=lists._links,_links&offset=0
182
+ body:
183
+ encoding: US-ASCII
184
+ string: ''
185
+ headers:
186
+ Accept:
187
+ - "*/*; q=0.5, application/xml"
188
+ Accept-Encoding:
189
+ - gzip, deflate
190
+ Authorization:
191
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
192
+ User-Agent:
193
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
194
+ response:
195
+ status:
196
+ code: 200
197
+ message: OK
198
+ headers:
199
+ Server:
200
+ - nginx
201
+ Content-Type:
202
+ - application/json; charset=utf-8
203
+ Content-Length:
204
+ - '1174'
205
+ X-Request-Id:
206
+ - 93502109-b814-4728-b585-d98751ff35d5
207
+ Link:
208
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json>; rel="describedBy"
209
+ Vary:
210
+ - Accept-Encoding
211
+ Date:
212
+ - Tue, 07 Jul 2015 11:29:36 GMT
213
+ Connection:
214
+ - keep-alive
215
+ body:
216
+ encoding: ASCII-8BIT
217
+ string: '{"lists":[{"id":"e73f5910ca","name":"My first list","contact":{"company":"InSite
218
+ Arts","address1":"300 Burdett Road","address2":"London","city":"London","state":"","zip":"E14
219
+ 7DQ","country":"262","phone":"07917153555"},"permission_reminder":"Opt-in
220
+ only","use_archive_bar":true,"campaign_defaults":{"from_name":"Sam Sayers","from_email":"sam@sayers.cc","subject":"","language":"en"},"notify_on_subscribe":"","notify_on_unsubscribe":"","date_created":"2015-06-27T14:49:18+00:00","list_rating":0,"email_type_option":false,"subscribe_url_short":"http://eepurl.com/brGTO9","subscribe_url_long":"http://insitearts.us11.list-manage1.com/subscribe?u=1dbca289fd41b54838bcbb501&id=e73f5910ca","beamer_address":"us11-6692a2b3c3-bcd2a8b144@inbound.mailchimp.com","visibility":"pub","modules":[],"stats":{"member_count":2,"unsubscribe_count":0,"cleaned_count":0,"member_count_since_send":2,"unsubscribe_count_since_send":0,"cleaned_count_since_send":0,"campaign_count":0,"campaign_last_sent":"","merge_field_count":2,"avg_sub_rate":0,"avg_unsub_rate":0,"target_sub_rate":0,"open_rate":0,"click_rate":0,"last_sub_date":"2015-06-27T14:50:39+00:00","last_unsub_date":""}}],"total_items":1}'
221
+ http_version:
222
+ recorded_at: Tue, 07 Jul 2015 11:29:36 GMT
223
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,179 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Authorization:
15
+ - apikey xxxxxxxxxx-us11
16
+ User-Agent:
17
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
18
+ response:
19
+ status:
20
+ code: 301
21
+ message: Moved Permanently
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Content-Type:
26
+ - text/html; charset=iso-8859-1
27
+ Content-Length:
28
+ - '242'
29
+ Location:
30
+ - http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
31
+ Date:
32
+ - Tue, 07 Jul 2015 11:29:28 GMT
33
+ Connection:
34
+ - keep-alive
35
+ body:
36
+ encoding: UTF-8
37
+ string: |
38
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
39
+ <html><head>
40
+ <title>301 Moved Permanently</title>
41
+ </head><body>
42
+ <h1>Moved Permanently</h1>
43
+ <p>The document has moved <a href="http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/">here</a>.</p>
44
+ </body></html>
45
+ http_version:
46
+ recorded_at: Tue, 07 Jul 2015 11:29:28 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Authorization:
59
+ - apikey xxxxxxxxxx-us11
60
+ User-Agent:
61
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
62
+ Cookie:
63
+ - ''
64
+ response:
65
+ status:
66
+ code: 401
67
+ message: Unauthorized
68
+ headers:
69
+ Server:
70
+ - nginx
71
+ Content-Type:
72
+ - application/problem+json; charset=utf-8
73
+ Content-Length:
74
+ - '250'
75
+ Link:
76
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
77
+ Vary:
78
+ - Accept-Encoding
79
+ Date:
80
+ - Tue, 07 Jul 2015 11:29:28 GMT
81
+ Connection:
82
+ - keep-alive
83
+ body:
84
+ encoding: ASCII-8BIT
85
+ string: '{"type":"http://kb.mailchimp.com/api/error-docs/401-api-key-invalid","title":"API
86
+ Key Invalid","status":401,"detail":"Your API key may be invalid, or you''ve
87
+ attempted to access the wrong datacenter.","instance":"983ad578-00e3-4155-86b8-017f8c979a7e"}'
88
+ http_version:
89
+ recorded_at: Tue, 07 Jul 2015 11:29:28 GMT
90
+ - request:
91
+ method: get
92
+ uri: https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0
93
+ body:
94
+ encoding: US-ASCII
95
+ string: ''
96
+ headers:
97
+ Accept:
98
+ - "*/*; q=0.5, application/xml"
99
+ Accept-Encoding:
100
+ - gzip, deflate
101
+ Authorization:
102
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
103
+ User-Agent:
104
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
105
+ response:
106
+ status:
107
+ code: 301
108
+ message: Moved Permanently
109
+ headers:
110
+ Server:
111
+ - nginx
112
+ Content-Type:
113
+ - text/html; charset=iso-8859-1
114
+ Content-Length:
115
+ - '242'
116
+ Location:
117
+ - http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
118
+ Date:
119
+ - Tue, 07 Jul 2015 11:29:29 GMT
120
+ Connection:
121
+ - keep-alive
122
+ body:
123
+ encoding: UTF-8
124
+ string: |
125
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
126
+ <html><head>
127
+ <title>301 Moved Permanently</title>
128
+ </head><body>
129
+ <h1>Moved Permanently</h1>
130
+ <p>The document has moved <a href="http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/">here</a>.</p>
131
+ </body></html>
132
+ http_version:
133
+ recorded_at: Tue, 07 Jul 2015 11:29:29 GMT
134
+ - request:
135
+ method: get
136
+ uri: http://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/
137
+ body:
138
+ encoding: US-ASCII
139
+ string: ''
140
+ headers:
141
+ Accept:
142
+ - "*/*; q=0.5, application/xml"
143
+ Accept-Encoding:
144
+ - gzip, deflate
145
+ Authorization:
146
+ - apikey <%= ENV['MAILCHIMP_API_KEY'] %>
147
+ User-Agent:
148
+ - Mailchimp API v3 Ruby gem https://rubygems.org/gems/mailchimp_api_v3
149
+ Cookie:
150
+ - ''
151
+ response:
152
+ status:
153
+ code: 200
154
+ message: OK
155
+ headers:
156
+ Server:
157
+ - nginx
158
+ Content-Type:
159
+ - application/json; charset=utf-8
160
+ Content-Length:
161
+ - '2003'
162
+ X-Request-Id:
163
+ - c0624e62-31b4-4299-95ec-38ad4b805a78
164
+ Link:
165
+ - <https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json>; rel="describedBy"
166
+ Vary:
167
+ - Accept-Encoding
168
+ Date:
169
+ - Tue, 07 Jul 2015 11:29:29 GMT
170
+ Connection:
171
+ - keep-alive
172
+ body:
173
+ encoding: ASCII-8BIT
174
+ string: '{"account_id":"1dbca289fd41b54838bcbb501","account_name":"InSite Arts","contact":{"company":"InSite
175
+ Arts","addr1":"300 Burdett Road","addr2":"London","city":"London","state":"","zip":"E14
176
+ 7DQ","country":"GB"},"last_login":"2015-07-07 11:24:31","total_subscribers":2,"_links":[{"rel":"self","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Root.json"},{"rel":"lists","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/lists","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Lists/Collection.json"},{"rel":"reports","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/reports","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Reports/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Reports.json"},{"rel":"conversations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/conversations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Conversations/Collection.json"},{"rel":"campaigns","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/campaigns","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Campaigns/Collection.json","schema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/CollectionLinks/Campaigns.json"},{"rel":"automations","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/automations","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Automations/Collection.json"},{"rel":"templates","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/templates","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/Templates/Collection.json"},{"rel":"file-manager","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/file-manager","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/FileManager/Namespace.json"},{"rel":"authorized-apps","href":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/3.0/authorized-apps","method":"GET","targetSchema":"https://<%= ENV['MAILCHIMP_DC'] %>.api.mailchimp.com/schema/3.0/AuthorizedApps/Collection.json"}]}'
177
+ http_version:
178
+ recorded_at: Tue, 07 Jul 2015 11:29:29 GMT
179
+ recorded_with: VCR 2.9.3