mailchimp_api 1.0.0.pre.3 → 1.0.0.pre.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76805822022f1da1a8eacd1834b33b1b200ea2beabaed4cd5016dbdd70f6de28
4
- data.tar.gz: ebda6362eb0c1adfbb45a23a9bd2e97ebf056386ceeaa3c75c13596cb47ae1a3
3
+ metadata.gz: 0f6662f6dfad303fd828eb9df95de86a641620a27a85944cce1d53f3f7f411df
4
+ data.tar.gz: cd5d3527ab3214c0d21fe79158c25f37efcfaa3241f98783f4915208e5451036
5
5
  SHA512:
6
- metadata.gz: c2b01d96e1f90427a78736ad4ec1e9f28efc64cbd5f72065d676850a73416ec790c0a8f4622842c0cbfa774c99dbc00b1b447272f32228977932ace7da383299
7
- data.tar.gz: d0eaaf838a6396d538fb3a3673fbad6516e9706cabe2bd31fac8c5ef824058327e48615c8e08b124ef5988182914805b67f41f809508e0716f7b7c74596e1964
6
+ metadata.gz: 533a7857bcfa6a661624f1de76454887b0b050e66b8dde985370a745a1405b52ae13f2a21e8ea2b832e86a1916db727ae222818d900079ec1c274baadf7a4393
7
+ data.tar.gz: da4f9b6291ddae2fc59469179052b31e47b0531a496d701745b6978f2f1138d3ac6e0d2e5ea9e0ddc1ee366ef8b4ffad2de4e477f4c5a54a90fa298aadd0fb31
data/CHANGELOG.md CHANGED
@@ -8,4 +8,5 @@
8
8
  - Support of '/lists/<id>/interest-categories'
9
9
  - Support of 'lists/<id>/interest-categories/<id>/interests'
10
10
  - Support of '/lists/<id>/members'
11
+ - Support of '/lists/<id>/members/<id>/notes'
11
12
  - `.count` support
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI::CollectionParsers
4
+ class Note < Base
5
+ end
6
+ end
@@ -18,8 +18,8 @@ module MailchimpAPI
18
18
  # https://github.com/rails/activeresource/blob/4accda8bc03ceae0ad626f8cec0b4751e89a58ad/lib/active_resource/associations.rb#L151
19
19
  #
20
20
  # Using a has_many, there is no way to include the `list_id`, so we just create our own interests method.
21
- def interests
22
- @interests ||= MailchimpAPI::Interest.find(:all, params: { interest_category_id: id }.merge(prefix_options))
21
+ def interests(params = {})
22
+ @interests ||= MailchimpAPI::Interest.find(:all, params: { interest_category_id: id }.deep_merge(prefix_options).deep_merge(params))
23
23
  end
24
24
  end
25
25
  end
@@ -10,6 +10,16 @@ module MailchimpAPI
10
10
 
11
11
  self.prefix = '/3.0/lists/:list_id/'
12
12
 
13
+ # The path to get notes is '/3.0/lists/:list_id/members/:member_id'
14
+ # Unfortunately, ActiveResource does not support nested resources, only single parent resources:
15
+ #
16
+ # https://github.com/rails/activeresource/blob/4accda8bc03ceae0ad626f8cec0b4751e89a58ad/lib/active_resource/associations.rb#L151
17
+ #
18
+ # Using a has_many, there is no way to include the `list_id`, so we just create our own notes method.
19
+ def notes(params = {})
20
+ @notes ||= MailchimpAPI::Note.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))
21
+ end
22
+
13
23
  # non-RESTful actions
14
24
 
15
25
  # Delete all personally identifiable information related to a list member, and remove them from a list. This will make it impossible to re-import the list member
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI
4
+ class Note < Base
5
+ extend MailchimpAPI::Support::Countable
6
+
7
+ include MailchimpAPI::Support::PatchUpdate
8
+
9
+ self.collection_parser = CollectionParsers::Note
10
+
11
+ self.prefix = '/3.0/lists/:list_id/members/:member_id/'
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailchimpAPI
4
- VERSION = '1.0.0.pre.3'
4
+ VERSION = '1.0.0.pre.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailchimp_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.3
4
+ version: 1.0.0.pre.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - rewind.io
@@ -183,6 +183,7 @@ files:
183
183
  - lib/mailchimp_api/collection_parsers/link.rb
184
184
  - lib/mailchimp_api/collection_parsers/list.rb
185
185
  - lib/mailchimp_api/collection_parsers/member.rb
186
+ - lib/mailchimp_api/collection_parsers/note.rb
186
187
  - lib/mailchimp_api/configuration.rb
187
188
  - lib/mailchimp_api/connection.rb
188
189
  - lib/mailchimp_api/detailed_log_subscriber.rb
@@ -196,8 +197,9 @@ files:
196
197
  - lib/mailchimp_api/resources/link.rb
197
198
  - lib/mailchimp_api/resources/list.rb
198
199
  - lib/mailchimp_api/resources/member.rb
200
+ - lib/mailchimp_api/resources/note.rb
199
201
  - lib/mailchimp_api/resources/support/countable.rb
200
- - lib/mailchimp_api/resources/support/patch_upadate.rb
202
+ - lib/mailchimp_api/resources/support/patch_update.rb
201
203
  - lib/mailchimp_api/session.rb
202
204
  - lib/mailchimp_api/version.rb
203
205
  homepage: https://github.com/rewindio/mailchimp_api.git