mailchimp_api 1.0.0.pre.7 → 1.0.0.pre.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fea228ec4a58be19a447166064e3e33dd0a7b8ffb9c94acbfd287dc4003a87cc
4
- data.tar.gz: 191338f5c88aa58ccc9dd63cbea8441fc7443d251617e534c4e2e56e10c16033
3
+ metadata.gz: '0081d7c1916745429b0e90367973161edf969dd8411bab3d2c8df67acac0c1a6'
4
+ data.tar.gz: d14d5ad8f7958c2f25de02e09c6dda109fb3d78531a23d8c20cb5e668d7c6f3b
5
5
  SHA512:
6
- metadata.gz: 8f74c01ffdd941263f349d2981917a6674027b881548e476ac7a5195e496691042d4ecfa4eda618ea67f7d0c9f03f9cf99e1d8cd8507f251933498e5acbe1941
7
- data.tar.gz: 66ef7623bc4a8ce9aaf3206f8d269822cf1df8a40607e642d78755b6ad0cfc976ad69c2ca9f27687a435a04a48ea7eac107c7ba3d76531fc3e4cfe13c34bc533
6
+ metadata.gz: 961da4ea13078c22bad06e2b07ded6aa4b47a54c340fc5b60bbb5954c180e928ce02394bb79107a4ee40a839ffe7ee297e8e18ca7c21139ba50bf928bdc98fd2
7
+ data.tar.gz: b3b467a8194be96c11e1371c3b25697e7fef6fdb7054aaf23b7270facb0710e1d7033ddcdf5bb24cf30f75c5ce467a1638f4d21dc260784c2f0940e623872aa2
data/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@
9
9
  - Support of '/lists/<id>/interest-categories/<id>/interests'
10
10
  - Support of '/lists/<id>/members'
11
11
  - Support of '/lists/<id>/members/<id>/notes'
12
+ - Support of '/lists/<id>/members/<id>/tags'
12
13
  - Support of '/lists/<id>/segments'
13
14
  - Support of '/lists/<id>/merge-fields'
14
15
  - Support of '/lists/<id>/signup-forms'
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI::CollectionParsers
4
+ class Tag < Base
5
+ end
6
+ end
@@ -4,6 +4,8 @@ module MailchimpAPI
4
4
  class List < Base
5
5
  extend MailchimpAPI::Support::Countable
6
6
 
7
+ include MailchimpAPI::Support::PatchUpdate
8
+
7
9
  self.collection_parser = CollectionParsers::List
8
10
 
9
11
  has_many :interest_categories, class_name: 'MailchimpAPI::InterestCategory'
@@ -20,6 +20,16 @@ module MailchimpAPI
20
20
  @notes ||= MailchimpAPI::Note.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))
21
21
  end
22
22
 
23
+ # The path to get tags is '/3.0/lists/:list_id/members/:member_id'
24
+ # Unfortunately, ActiveResource does not support nested resources, only single parent resources:
25
+ #
26
+ # https://github.com/rails/activeresource/blob/4accda8bc03ceae0ad626f8cec0b4751e89a58ad/lib/active_resource/associations.rb#L151
27
+ #
28
+ # Using a has_many, there is no way to include the `list_id`, so we just create our own tags method.
29
+ def tags(params = {})
30
+ @tags ||= MailchimpAPI::Tag.find(:all, params: { member_id: id }.deep_merge(prefix_options).deep_merge(params))
31
+ end
32
+
23
33
  # non-RESTful actions
24
34
 
25
35
  # 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,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MailchimpAPI
4
+ class Tag < Base
5
+ extend MailchimpAPI::Support::Countable
6
+
7
+ self.collection_parser = CollectionParsers::Tag
8
+
9
+ self.prefix = '/3.0/lists/:list_id/members/:member_id/'
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MailchimpAPI
4
- VERSION = '1.0.0.pre.7'
4
+ VERSION = '1.0.0.pre.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailchimp_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.7
4
+ version: 1.0.0.pre.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - rewind.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-07 00:00:00.000000000 Z
11
+ date: 2019-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -187,6 +187,7 @@ files:
187
187
  - lib/mailchimp_api/collection_parsers/note.rb
188
188
  - lib/mailchimp_api/collection_parsers/segment.rb
189
189
  - lib/mailchimp_api/collection_parsers/signup_form.rb
190
+ - lib/mailchimp_api/collection_parsers/tag.rb
190
191
  - lib/mailchimp_api/configuration.rb
191
192
  - lib/mailchimp_api/connection.rb
192
193
  - lib/mailchimp_api/detailed_log_subscriber.rb
@@ -207,6 +208,7 @@ files:
207
208
  - lib/mailchimp_api/resources/support/countable.rb
208
209
  - lib/mailchimp_api/resources/support/patch_update.rb
209
210
  - lib/mailchimp_api/resources/support/post_update.rb
211
+ - lib/mailchimp_api/resources/tag.rb
210
212
  - lib/mailchimp_api/session.rb
211
213
  - lib/mailchimp_api/version.rb
212
214
  homepage: https://github.com/rewindio/mailchimp_api.git