workarea-mail_chimp 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +15 -0
  3. data/.gitignore +55 -0
  4. data/.markdownlint.json +10 -0
  5. data/.rails-rubocop.yml +119 -0
  6. data/.rubocop.yml +8 -0
  7. data/.scss-lint.yml +188 -0
  8. data/CHANGELOG.md +244 -0
  9. data/Gemfile +9 -0
  10. data/README.md +115 -0
  11. data/Rakefile +53 -0
  12. data/app/assets/javascripts/workarea/storefront/mail_chimp/mail_chimp_tracking.js +15 -0
  13. data/app/controllers/workarea/storefront/application_controller.decorator +11 -0
  14. data/app/controllers/workarea/storefront/cart_items_controller.decorator +18 -0
  15. data/app/controllers/workarea/storefront/checkout/addresses_controller.decorator +13 -0
  16. data/app/controllers/workarea/storefront/checkout/shipping_controller.decorator +13 -0
  17. data/app/controllers/workarea/storefront/users/accounts_controller.decorator +37 -0
  18. data/app/models/workarea/catalog/product.decorator +7 -0
  19. data/app/models/workarea/mail_chimp/group.rb +39 -0
  20. data/app/models/workarea/mail_chimp/store.rb +26 -0
  21. data/app/models/workarea/order.decorator +9 -0
  22. data/app/models/workarea/user.decorator +31 -0
  23. data/app/services/workarea/mail_chimp/address.rb +28 -0
  24. data/app/services/workarea/mail_chimp/cart.rb +78 -0
  25. data/app/services/workarea/mail_chimp/order.rb +97 -0
  26. data/app/services/workarea/mail_chimp/product.rb +43 -0
  27. data/app/services/workarea/mail_chimp/variant.rb +43 -0
  28. data/app/view_models/workarea/storefront/user_view_model.decorator +16 -0
  29. data/app/views/workarea/storefront/mail_chimp/_ecommerce_javascript.html.haml +2 -0
  30. data/app/views/workarea/storefront/users/accounts/_edit.html.haml +12 -0
  31. data/app/views/workarea/storefront/users/accounts/_email_interests.html.haml +13 -0
  32. data/app/workers/workarea/mail_chimp/ecommerce/save_cart.rb +40 -0
  33. data/app/workers/workarea/mail_chimp/ecommerce/save_order.rb +31 -0
  34. data/app/workers/workarea/mail_chimp/ecommerce/save_product.rb +31 -0
  35. data/app/workers/workarea/mail_chimp/list_subscriber.rb +30 -0
  36. data/app/workers/workarea/mail_chimp/list_unsubscriber.rb +22 -0
  37. data/app/workers/workarea/mail_chimp/subscription_edit.rb +28 -0
  38. data/bin/rails +19 -0
  39. data/config/initializers/appends.rb +21 -0
  40. data/config/initializers/workarea.rb +14 -0
  41. data/config/locales/en.yml +15 -0
  42. data/lib/gibbon/request_decorator.rb +10 -0
  43. data/lib/integrations/workarea/mail_chimp/bogus_api_request.rb +30 -0
  44. data/lib/integrations/workarea/mail_chimp/bogus_gateway.rb +35 -0
  45. data/lib/integrations/workarea/mail_chimp/bogus_request.rb +78 -0
  46. data/lib/integrations/workarea/mail_chimp/gateway.rb +86 -0
  47. data/lib/integrations/workarea/mail_chimp/gateway/list.rb +47 -0
  48. data/lib/integrations/workarea/mail_chimp/gateway/members.rb +61 -0
  49. data/lib/integrations/workarea/mail_chimp/gateway/subscribe_argument_builder.rb +101 -0
  50. data/lib/tasks/mail_chimp.rake +71 -0
  51. data/lib/workarea/mail_chimp.rb +72 -0
  52. data/lib/workarea/mail_chimp/engine.rb +14 -0
  53. data/lib/workarea/mail_chimp/errors.rb +2 -0
  54. data/lib/workarea/mail_chimp/tasks/ecommerce.rb +43 -0
  55. data/lib/workarea/mail_chimp/version.rb +5 -0
  56. data/script/admin_ci +9 -0
  57. data/script/ci +11 -0
  58. data/script/core_ci +9 -0
  59. data/script/plugins_ci +9 -0
  60. data/script/storefront_ci +9 -0
  61. data/test/dummy/Rakefile +6 -0
  62. data/test/dummy/app/assets/config/manifest.js +4 -0
  63. data/test/dummy/app/assets/images/.keep +0 -0
  64. data/test/dummy/app/assets/javascripts/application.js +13 -0
  65. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  66. data/test/dummy/app/controllers/application_controller.rb +3 -0
  67. data/test/dummy/app/controllers/concerns/.keep +0 -0
  68. data/test/dummy/app/helpers/application_helper.rb +2 -0
  69. data/test/dummy/app/jobs/application_job.rb +2 -0
  70. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  71. data/test/dummy/app/models/concerns/.keep +0 -0
  72. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  73. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  74. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  75. data/test/dummy/bin/bundle +3 -0
  76. data/test/dummy/bin/rails +4 -0
  77. data/test/dummy/bin/rake +4 -0
  78. data/test/dummy/bin/setup +34 -0
  79. data/test/dummy/bin/update +29 -0
  80. data/test/dummy/config.ru +5 -0
  81. data/test/dummy/config/application.rb +23 -0
  82. data/test/dummy/config/boot.rb +5 -0
  83. data/test/dummy/config/cable.yml +9 -0
  84. data/test/dummy/config/environment.rb +5 -0
  85. data/test/dummy/config/environments/development.rb +56 -0
  86. data/test/dummy/config/environments/production.rb +86 -0
  87. data/test/dummy/config/environments/test.rb +43 -0
  88. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  89. data/test/dummy/config/initializers/assets.rb +11 -0
  90. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  91. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  92. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  93. data/test/dummy/config/initializers/inflections.rb +16 -0
  94. data/test/dummy/config/initializers/mime_types.rb +4 -0
  95. data/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
  96. data/test/dummy/config/initializers/session_store.rb +3 -0
  97. data/test/dummy/config/initializers/workarea.rb +5 -0
  98. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  99. data/test/dummy/config/locales/en.yml +23 -0
  100. data/test/dummy/config/puma.rb +47 -0
  101. data/test/dummy/config/routes.rb +5 -0
  102. data/test/dummy/config/secrets.yml +22 -0
  103. data/test/dummy/config/spring.rb +6 -0
  104. data/test/dummy/db/seeds.rb +2 -0
  105. data/test/dummy/lib/assets/.keep +0 -0
  106. data/test/factories/mail_chimp.rb +50 -0
  107. data/test/integration/workarea/mailchimp/subscription_test.rb +52 -0
  108. data/test/integration/workarea/mailchimp/tracking_params_test.rb +50 -0
  109. data/test/integration/workarea/mailchimp/unsubscribe_test.rb +14 -0
  110. data/test/integration/workarea/storefront/mail_chimp_order_test.rb +106 -0
  111. data/test/integration/workarea/storefront/mail_chimp_product_test.rb +51 -0
  112. data/test/integration/workarea/storefront/mail_chimp_site_javascript_test.rb +25 -0
  113. data/test/lib/workarea/mailchimp/gateway/list_test.rb +48 -0
  114. data/test/lib/workarea/mailchimp/gateway_test.rb +196 -0
  115. data/test/lib/workarea/mailchimp/tasks/ecommerce_test.rb +40 -0
  116. data/test/services/workarea/mail_chimp/cart_test.rb +44 -0
  117. data/test/services/workarea/mail_chimp/order_test.rb +50 -0
  118. data/test/services/workarea/mail_chimp/product_test.rb +29 -0
  119. data/test/support/workarea/mail_chimp_api_config.rb +33 -0
  120. data/test/system/workarea/storefront/campaign_tracking_test.rb +14 -0
  121. data/test/system/workarea/storefront/group_test.rb +33 -0
  122. data/test/system/workarea/storefront/mail_chimp_accounts_system_test.rb +79 -0
  123. data/test/test_helper.rb +17 -0
  124. data/test/vcr_cassettes/get_default_list_interests.yml +104 -0
  125. data/test/vcr_cassettes/get_member_details_no_match.yml +51 -0
  126. data/test/vcr_cassettes/get_member_details_unsubscribed.yml +51 -0
  127. data/test/vcr_cassettes/interest_categories_read.yml +104 -0
  128. data/test/vcr_cassettes/mail_chimp/tasks/create_store-successful.yml +97 -0
  129. data/test/vcr_cassettes/mc_order_test.yml +381 -0
  130. data/test/vcr_cassettes/mc_product_test.yml +234 -0
  131. data/test/vcr_cassettes/subscribe_to_default_list.yml +254 -0
  132. data/test/vcr_cassettes/subscribe_to_default_list_interest_groups.yml +254 -0
  133. data/test/vcr_cassettes/subscribe_to_default_list_with_groupings.yml +254 -0
  134. data/test/vcr_cassettes/subscribe_to_default_list_with_user_details.yml +254 -0
  135. data/test/vcr_cassettes/unsubscribe_from_default_list.yml +53 -0
  136. data/test/vcr_cassettes/update_member_on_default_list_change_email.yml +254 -0
  137. data/test/vcr_cassettes/update_member_on_default_list_change_groupings.yml +254 -0
  138. data/test/workers/workarea/mail_chimp/ecommerce/save_cart_test.rb +28 -0
  139. data/test/workers/workarea/mail_chimp/ecommerce/save_order_test.rb +15 -0
  140. data/test/workers/workarea/mail_chimp/ecommerce/save_product_test.rb +15 -0
  141. data/workarea-mail_chimp.gemspec +20 -0
  142. metadata +212 -0
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ module Storefront
5
+ class CampaignTrackingTest < Workarea::SystemTest
6
+
7
+ def test_tracking_cookie
8
+ visit storefront.root_path(mc_cid: 'kittens')
9
+
10
+ assert(page.driver.browser.manage.cookie_named('mc_cid').present?)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,33 @@
1
+ require "test_helper"
2
+
3
+ module Workarea
4
+ class MailChimp::GroupTest < Workarea::SystemTest
5
+ def new_group(interest)
6
+ Workarea::MailChimp::Group.new(_id: 1, interests: { interest + "id" => interest })
7
+ end
8
+
9
+ def test_invalid_without__id_or_name
10
+ refute(Workarea::MailChimp::Group.new(interests: { "id" => "foo" }).valid?)
11
+ end
12
+
13
+ def test_valid_with_just__id
14
+ assert(Workarea::MailChimp::Group.new(_id: 1).valid?)
15
+ end
16
+
17
+ def test_valid_with_just_name
18
+ assert(Workarea::MailChimp::Group.new(name: "foo").valid?)
19
+ end
20
+
21
+ def test_equality_of_groups
22
+ group_1 = Workarea::MailChimp::Group.new(name: "foo", interests: { "id" => "foo" })
23
+ group_2 = Workarea::MailChimp::Group.new(name: "foo", interests: { "id" => "foo" })
24
+ group_3 = Workarea::MailChimp::Group.new(name: "foo", interests: { "id" => "bar" })
25
+ group_4 = Workarea::MailChimp::Group.new(name: "bar", interests: { "id" => "bar" })
26
+
27
+ assert(group_1 == (group_1))
28
+ assert(group_1 == (group_2))
29
+ refute(group_1 == (group_3))
30
+ refute(group_3 == (group_4))
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,79 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ module Storefront
5
+ class MailChimpAccountsSystemTest < Workarea::SystemTest
6
+ setup :set_user
7
+
8
+ def test_editing_mail_chimp_interests
9
+ set_current_user(@user)
10
+ visit storefront.edit_users_account_path
11
+
12
+ interests = MailChimp.gateway.interests.map(&:interests).reduce(:merge).values.sample(3)
13
+
14
+ within '#info_form' do
15
+ interests.each do |interest|
16
+ check interest
17
+ end
18
+ click_button t('workarea.storefront.forms.save')
19
+ end
20
+
21
+ @user.reload
22
+
23
+ assert_equal interests.sort, @user.groups.map(&:interests).reduce(&:merge).values.sort
24
+
25
+ old_interests = interests.sample 2
26
+ new_interests = interests - old_interests
27
+
28
+ visit storefront.edit_users_account_path
29
+
30
+ within '#info_form' do
31
+ old_interests.each do |interest|
32
+ uncheck interest
33
+ end
34
+ click_button t('workarea.storefront.forms.save')
35
+ end
36
+
37
+ @user.reload
38
+
39
+ assert_equal new_interests.sort, @user.groups.map(&:interests).reduce(&:merge).values.sort
40
+ end
41
+
42
+ def test_saving_without_editing_mail_chimp_interests
43
+ set_current_user(@user)
44
+
45
+ interests = MailChimp.gateway.interests.map(&:interests).reduce(:merge).values.sample(3)
46
+
47
+ visit storefront.edit_users_account_path
48
+ within '#info_form' do
49
+ interests.each do |interest|
50
+ check interest
51
+ end
52
+ click_button t('workarea.storefront.forms.save')
53
+ end
54
+
55
+ @user.reload
56
+
57
+ assert_equal interests.sort, @user.groups.map(&:interests).reduce(&:merge).values.sort
58
+
59
+ visit storefront.edit_users_account_path
60
+ within '#info_form' do
61
+ click_button t('workarea.storefront.forms.save')
62
+ end
63
+
64
+ @user.reload
65
+ assert_equal interests.sort, @user.groups.map(&:interests).reduce(&:merge).values.sort
66
+ end
67
+
68
+ private
69
+
70
+ def set_user
71
+ @user = create_user(
72
+ email: 'bcrouse@workarea.com',
73
+ password: 'W3bl1nc!',
74
+ name: 'Ben Crouse'
75
+ )
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,17 @@
1
+ require "simplecov"
2
+
3
+ SimpleCov.start "rails" do
4
+ add_filter "lib/workarea/mail_chimp/version.rb"
5
+ add_filter "lib/workarea/mail_chimp.rb"
6
+ end
7
+
8
+ ENV["RAILS_ENV"] = "test"
9
+
10
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
11
+
12
+ require "rails/test_help"
13
+ require "workarea/test_help"
14
+
15
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
16
+ # to be shown.
17
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,104 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Authorization:
13
+ - Basic YQo=
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ X-Request-Id:
30
+ - 00071f95-a8f6-435e-9a43-4d910b026ecf
31
+ Link:
32
+ - <https://us16.api.mailchimp.com/schema/3.0/Lists/InterestCategories/Collection.json>;
33
+ rel="describedBy"
34
+ Vary:
35
+ - Accept-Encoding
36
+ Date:
37
+ - Tue, 07 May 2019 14:02:16 GMT
38
+ Content-Length:
39
+ - '2389'
40
+ Connection:
41
+ - keep-alive
42
+ Set-Cookie:
43
+ - _AVESTA_ENVIRONMENT=prod; path=/
44
+ - _mcid=1.1a121ccfbc5a7420551a4437d81ffd10; expires=Wed, 06-May-2020 14:02:16
45
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"list_id":"fcd2925136","categories":[{"list_id":"fcd2925136","id":"443f5598e4","title":"Email
49
+ Interests","display_order":0,"type":"checkboxes","_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/InterestCategories.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"DELETE"},{"rel":"interests","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"}]}],"total_items":1,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/InterestCategories.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Response.json"},{"rel":"create","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"POST","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/POST.json"}]}'
50
+ http_version:
51
+ recorded_at: Tue, 07 May 2019 14:03:08 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
61
+ Authorization:
62
+ - Basic YQo=
63
+ Content-Type:
64
+ - application/json
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ Accept:
68
+ - "*/*"
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - openresty
76
+ Content-Type:
77
+ - application/json; charset=utf-8
78
+ X-Request-Id:
79
+ - fcc82f58-ad54-497f-ab7a-ab32975c7950
80
+ Link:
81
+ - <https://us16.api.mailchimp.com/schema/3.0/Lists/Interests/Collection.json>;
82
+ rel="describedBy"
83
+ Vary:
84
+ - Accept-Encoding
85
+ Date:
86
+ - Tue, 07 May 2019 14:02:16 GMT
87
+ Content-Length:
88
+ - '5873'
89
+ Connection:
90
+ - keep-alive
91
+ Set-Cookie:
92
+ - _AVESTA_ENVIRONMENT=prod; path=/
93
+ - _mcid=1.c3f6f35789119e2cbb5ca5c6518ac335; expires=Wed, 06-May-2020 14:02:16
94
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
95
+ body:
96
+ encoding: UTF-8
97
+ string: '{"interests":[{"category_id":"443f5598e4","list_id":"fcd2925136","id":"7ca6cc1d86","name":"Specials
98
+ and Promotions","subscriber_count":"27","display_order":1,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"8911545594","name":"Local
99
+ Events","subscriber_count":"27","display_order":2,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"542a7ec7bb","name":"Restaurant
100
+ News and Events","subscriber_count":"27","display_order":3,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"6908d70674","name":"Corporate
101
+ Gifts and Awards","subscriber_count":"27","display_order":4,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"DELETE"}]}],"list_id":"fcd2925136","category_id":"443f5598e4","total_items":4,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json"},{"rel":"create","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"POST","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/POST.json"}]}'
102
+ http_version:
103
+ recorded_at: Tue, 07 May 2019 14:03:08 GMT
104
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us16.api.mailchimp.com/3.0/lists/fcd2925136/members/f169f2112ef4e6341653a17e91f72a2f
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Authorization:
13
+ - Basic YQo=
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - openresty
27
+ Content-Type:
28
+ - application/problem+json; charset=utf-8
29
+ X-Request-Id:
30
+ - bb1f25a5-d2db-4d3d-b7c1-c282e8e34f82
31
+ Link:
32
+ - <https://us16.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
33
+ Vary:
34
+ - Accept-Encoding
35
+ Date:
36
+ - Tue, 07 May 2019 14:02:22 GMT
37
+ Content-Length:
38
+ - '234'
39
+ Connection:
40
+ - keep-alive
41
+ Set-Cookie:
42
+ - _AVESTA_ENVIRONMENT=prod; path=/
43
+ - _mcid=1.160717249b5aa3fef741db2afda9c584; expires=Wed, 06-May-2020 14:02:22
44
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Resource
48
+ Not Found","status":404,"detail":"The requested resource could not be found.","instance":"bb1f25a5-d2db-4d3d-b7c1-c282e8e34f82"}'
49
+ http_version:
50
+ recorded_at: Tue, 07 May 2019 14:03:14 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us16.api.mailchimp.com/3.0/lists//members/4e58a837c85b99821524ce56a2901101
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Authorization:
13
+ - Basic YQo=
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 404
23
+ message: Not Found
24
+ headers:
25
+ Server:
26
+ - openresty
27
+ Content-Type:
28
+ - application/problem+json; charset=utf-8
29
+ X-Request-Id:
30
+ - 221dd0ac-2f13-455d-a680-1c05ca797d30
31
+ Link:
32
+ - <https://us16.api.mailchimp.com/schema/3.0/ProblemDetailDocument.json>; rel="describedBy"
33
+ Vary:
34
+ - Accept-Encoding
35
+ Date:
36
+ - Tue, 07 May 2019 14:02:20 GMT
37
+ Content-Length:
38
+ - '204'
39
+ Connection:
40
+ - keep-alive
41
+ Set-Cookie:
42
+ - _AVESTA_ENVIRONMENT=prod; path=/
43
+ - _mcid=1.111ba818771f32126833d71778060490; expires=Wed, 06-May-2020 14:02:20
44
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"type":"http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/","title":"Resource
48
+ Not Found","status":404,"detail":"Invalid path","instance":"221dd0ac-2f13-455d-a680-1c05ca797d30"}'
49
+ http_version:
50
+ recorded_at: Tue, 07 May 2019 14:03:12 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,104 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.15.4
12
+ Authorization:
13
+ - Basic YQo=
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ Accept:
19
+ - "*/*"
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Server:
26
+ - openresty
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ X-Request-Id:
30
+ - bc0e9970-b026-4302-9d14-5f656ecd88cb
31
+ Link:
32
+ - <https://us16.api.mailchimp.com/schema/3.0/Lists/InterestCategories/Collection.json>;
33
+ rel="describedBy"
34
+ Vary:
35
+ - Accept-Encoding
36
+ Date:
37
+ - Tue, 07 May 2019 14:26:12 GMT
38
+ Content-Length:
39
+ - '2389'
40
+ Connection:
41
+ - keep-alive
42
+ Set-Cookie:
43
+ - _AVESTA_ENVIRONMENT=prod; path=/
44
+ - _mcid=1.22b97f26723dd1ad92cebf1023d17c27; expires=Wed, 06-May-2020 14:26:11
45
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"list_id":"fcd2925136","categories":[{"list_id":"fcd2925136","id":"443f5598e4","title":"Email
49
+ Interests","display_order":0,"type":"checkboxes","_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/InterestCategories.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"DELETE"},{"rel":"interests","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"}]}],"total_items":1,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/InterestCategories.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Response.json"},{"rel":"create","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories","method":"POST","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/POST.json"}]}'
50
+ http_version:
51
+ recorded_at: Tue, 07 May 2019 14:26:12 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.15.4
61
+ Authorization:
62
+ - Basic YQo=
63
+ Content-Type:
64
+ - application/json
65
+ Accept-Encoding:
66
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
67
+ Accept:
68
+ - "*/*"
69
+ response:
70
+ status:
71
+ code: 200
72
+ message: OK
73
+ headers:
74
+ Server:
75
+ - openresty
76
+ Content-Type:
77
+ - application/json; charset=utf-8
78
+ X-Request-Id:
79
+ - e849e341-f5cb-426b-af4b-be4b6bb74fc2
80
+ Link:
81
+ - <https://us16.api.mailchimp.com/schema/3.0/Lists/Interests/Collection.json>;
82
+ rel="describedBy"
83
+ Vary:
84
+ - Accept-Encoding
85
+ Date:
86
+ - Tue, 07 May 2019 14:26:12 GMT
87
+ Content-Length:
88
+ - '5873'
89
+ Connection:
90
+ - keep-alive
91
+ Set-Cookie:
92
+ - _AVESTA_ENVIRONMENT=prod; path=/
93
+ - _mcid=1.7bb454e431650f2e2cdd44482bd734b7; expires=Wed, 06-May-2020 14:26:12
94
+ GMT; Max-Age=31536000; path=/; domain=.mailchimp.com
95
+ body:
96
+ encoding: UTF-8
97
+ string: '{"interests":[{"category_id":"443f5598e4","list_id":"fcd2925136","id":"7ca6cc1d86","name":"Specials
98
+ and Promotions","subscriber_count":"27","display_order":1,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/7ca6cc1d86","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"8911545594","name":"Local
99
+ Events","subscriber_count":"27","display_order":2,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/8911545594","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"542a7ec7bb","name":"Restaurant
100
+ News and Events","subscriber_count":"27","display_order":3,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/542a7ec7bb","method":"DELETE"}]},{"category_id":"443f5598e4","list_id":"fcd2925136","id":"6908d70674","name":"Corporate
101
+ Gifts and Awards","subscriber_count":"27","display_order":4,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"update","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"PATCH","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/PATCH.json"},{"rel":"delete","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests/6908d70674","method":"DELETE"}]}],"list_id":"fcd2925136","category_id":"443f5598e4","total_items":4,"_links":[{"rel":"self","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/CollectionResponse.json","schema":"https://us16.api.mailchimp.com/schema/3.0/CollectionLinks/Lists/Interests.json"},{"rel":"parent","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4","method":"GET","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/InterestCategories/Response.json"},{"rel":"create","href":"https://us16.api.mailchimp.com/3.0/lists/fcd2925136/interest-categories/443f5598e4/interests","method":"POST","targetSchema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/Response.json","schema":"https://us16.api.mailchimp.com/schema/3.0/Definitions/Lists/Interests/POST.json"}]}'
102
+ http_version:
103
+ recorded_at: Tue, 07 May 2019 14:26:12 GMT
104
+ recorded_with: VCR 2.9.3