active_campaign_webhooks 0.2.14 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +9 -2
  4. data/lib/active_campaign/webhooks/request/account.rb +7 -7
  5. data/lib/active_campaign/webhooks/request/account_add_request.rb +0 -10
  6. data/lib/active_campaign/webhooks/request/account_contact.rb +7 -7
  7. data/lib/active_campaign/webhooks/request/account_contact_add_request.rb +0 -10
  8. data/lib/active_campaign/webhooks/request/account_contact_removed.rb +7 -7
  9. data/lib/active_campaign/webhooks/request/account_update_request.rb +0 -10
  10. data/lib/active_campaign/webhooks/request/base_record.rb +49 -0
  11. data/lib/active_campaign/webhooks/request/base_request.rb +9 -27
  12. data/lib/active_campaign/webhooks/request/campaign.rb +8 -8
  13. data/lib/active_campaign/webhooks/request/click_request.rb +3 -11
  14. data/lib/active_campaign/webhooks/request/contact.rb +5 -5
  15. data/lib/active_campaign/webhooks/request/contact_tag_added_request.rb +2 -10
  16. data/lib/active_campaign/webhooks/request/contact_task_add_request.rb +0 -8
  17. data/lib/active_campaign/webhooks/request/deal.rb +19 -19
  18. data/lib/active_campaign/webhooks/request/deal_add_request.rb +0 -8
  19. data/lib/active_campaign/webhooks/request/deal_pipeline_add_request.rb +0 -8
  20. data/lib/active_campaign/webhooks/request/deal_stage_add_request.rb +0 -8
  21. data/lib/active_campaign/webhooks/request/deal_task_add_request.rb +0 -8
  22. data/lib/active_campaign/webhooks/request/deal_task_complete_request.rb +0 -8
  23. data/lib/active_campaign/webhooks/request/deal_tasktype_add_request.rb +0 -8
  24. data/lib/active_campaign/webhooks/request/deal_update_request.rb +0 -8
  25. data/lib/active_campaign/webhooks/request/fields.rb +1 -1
  26. data/lib/active_campaign/webhooks/request/form.rb +3 -3
  27. data/lib/active_campaign/webhooks/request/forward.rb +3 -3
  28. data/lib/active_campaign/webhooks/request/forward_request.rb +2 -10
  29. data/lib/active_campaign/webhooks/request/link.rb +3 -3
  30. data/lib/active_campaign/webhooks/request/list.rb +1 -1
  31. data/lib/active_campaign/webhooks/request/list_add_request.rb +0 -8
  32. data/lib/active_campaign/webhooks/request/open_request.rb +2 -10
  33. data/lib/active_campaign/webhooks/request/pipeline.rb +3 -3
  34. data/lib/active_campaign/webhooks/request/reply_request.rb +2 -10
  35. data/lib/active_campaign/webhooks/request/sent_request.rb +2 -10
  36. data/lib/active_campaign/webhooks/request/share.rb +3 -3
  37. data/lib/active_campaign/webhooks/request/share_request.rb +2 -10
  38. data/lib/active_campaign/webhooks/request/stage.rb +3 -3
  39. data/lib/active_campaign/webhooks/request/subscribe_request.rb +2 -10
  40. data/lib/active_campaign/webhooks/request/task.rb +9 -9
  41. data/lib/active_campaign/webhooks/request/tasktype.rb +3 -3
  42. data/lib/active_campaign/webhooks/request/unsubscribe.rb +1 -1
  43. data/lib/active_campaign/webhooks/request/unsubscribe_request.rb +2 -10
  44. data/lib/active_campaign/webhooks/request/updated_fields.rb +1 -1
  45. data/lib/active_campaign/webhooks/version.rb +1 -1
  46. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc989f9ff83a5a9b0ee569863d776b70d6d735ee13f65e9bedb47b440a805cbc
4
- data.tar.gz: eae22bdaa2b7cf24aeec4f3c79966cff160e5ef4111edbde3d6004041a730f99
3
+ metadata.gz: 9780bd69114fc941e7dbec7a47350def2d330f927f2bfb2ab1abf43957b25b5a
4
+ data.tar.gz: 0325d378d3d74f57f34fe761f6f51212df985fd933e34ceaadec40032f6eff4f
5
5
  SHA512:
6
- metadata.gz: e8bbb3194b9a7115043f8515165f41b0110fc94a177f588b41dd7b91f86405d9e65bbf0e36edc75a02daa0d560b4901b27b10ea4cc1b8d339aeb30d1c8161188
7
- data.tar.gz: 679a169d61f62c7c8b71ffd6bcdfa7f9c15875ae9f6814a1ebb2beffd196182bd00e39020520665d5faf0bf1f27e1d45411525b5d7433ed161ecd57d1e6dc28c
6
+ metadata.gz: 177a1ba68dab623c4289626c3d63c75cd83c6e50ba648f040a8265542ef0901ade96d3f0606e5b964196713936508353ae7df08f6c1a0addbd56bb478f3e93cf
7
+ data.tar.gz: 6f965a026c03fb2b8da37bd3823ecd27b604284e7c00df7f909f20d641f88dfe2cc205c89f08017dd4c9a5bb21d3a447e0de763f44500932d027ded9df95e351
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_campaign_webhooks (0.2.13)
4
+ active_campaign_webhooks (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # ActiveCampaignWebhooks
2
-
2
+ ### --- WIP --- ###
3
+ Structs and helpers for ActiveCampaign Webhooks
3
4
 
4
5
  ## Installation
5
6
 
@@ -19,7 +20,13 @@ Or install it yourself as:
19
20
 
20
21
  ## Usage
21
22
 
22
- TODO: Write usage instructions here
23
+ ```ruby
24
+ # creates new request object with documented accessors
25
+ ActiveCampaign::Webhooks::Request::DealUpdateRequest.new {deal: {id: 1}}
26
+
27
+ # returns the relevant object based on the type field
28
+ ActiveCampaign::Webhooks::Request::Helpers.get_request {type: 'deal_update', deal: {id: 1}}
29
+ ```
23
30
 
24
31
  ## Development
25
32
 
@@ -4,17 +4,17 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Account
7
- class Account < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Account < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  # @return [String]
11
11
  attribute :account_name
12
12
  # @return [String]
13
13
  attribute :account_url
14
- # @return [String]
15
- attribute :created_timestamp
16
- # @return [String]
17
- attribute :updated_timestamp
14
+ # @return [DateTime]
15
+ attribute :created_timestamp, :DateTime
16
+ # @return [DateTime]
17
+ attribute :updated_timestamp, :DateTime
18
18
  # @return [Hash]
19
19
  attribute :fields
20
20
  end
@@ -5,16 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct AccountAddRequest
7
7
  class AccountAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :account_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_from
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :list
18
8
  # @return [Account]
19
9
  attribute :account, :Account
20
10
  end
@@ -4,13 +4,13 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct AccountContact
7
- class AccountContact < BaseRequest
8
- # @return [String]
9
- attribute :id
10
- # @return [String]
11
- attribute :account
12
- # @return [String]
13
- attribute :contact
7
+ class AccountContact < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
+ # @return [Number]
11
+ attribute :account, :Number
12
+ # @return [Number]
13
+ attribute :contact, :Number
14
14
  # @return [String]
15
15
  attribute :job_title
16
16
  end
@@ -5,16 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct AccountContactAddRequest
7
7
  class AccountContactAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :account_contact_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_from
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :list
18
8
  # @return [Account]
19
9
  attribute :account, :Account
20
10
  # @return [AccountContact]
@@ -4,13 +4,13 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct AccountContactRemoved
7
- class AccountContactRemoved < BaseRequest
8
- # @return [String]
9
- attribute :id
10
- # @return [String]
11
- attribute :account
12
- # @return [String]
13
- attribute :contact
7
+ class AccountContactRemoved < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
+ # @return [Number]
11
+ attribute :account, :Number
12
+ # @return [Number]
13
+ attribute :contact, :Number
14
14
  end
15
15
  end
16
16
  end
@@ -5,16 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct AccountUpdateRequest
7
7
  class AccountUpdateRequest < BaseRequest
8
- # @return [String]
9
- attribute :account_update_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_from
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :list
18
8
  # @return [Account]
19
9
  attribute :account, :Account
20
10
  end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # Base Record
7
+ class BaseRecord
8
+
9
+ PARSE_MAP = {
10
+ Integer: -> (value) { value&.to_i },
11
+ Float: -> (value) { value&.to_f },
12
+ Date: -> (value) { value.nil? ? nil : Date.parse(value) },
13
+ DateTime: -> (value) { value.nil? ? nil : DateTime.parse(value) }
14
+ }
15
+
16
+ class << self
17
+ attr_accessor :attribute_map
18
+
19
+ def attribute name, classname = nil
20
+ attr_accessor name
21
+ self.attribute_map = {} if self.attribute_map.nil?
22
+ self.attribute_map[name] = classname unless classname.nil?
23
+ end
24
+ end
25
+
26
+ self.attribute_map = {}
27
+
28
+ def initialize(hash = {})
29
+ hash.each do |k, v|
30
+ unless self.class.attribute_map[k.to_sym].nil?
31
+ class_name = self.class.attribute_map[k.to_sym]
32
+ unless PARSE_MAP[class_name].nil?
33
+ v = PARSE_MAP[class_name][v]
34
+ else
35
+ class_obj = ActiveCampaign::Webhooks::Request.const_get(class_name)
36
+ v = class_obj.new(v.as_json)
37
+ end
38
+ end
39
+ public_send("#{k}=", v) if respond_to? "#{k}="
40
+ end
41
+ end
42
+
43
+ def slice attributes = []
44
+ as_json.slice(*attributes.map(&:to_s))
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -4,35 +4,17 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # Base Request
7
- class BaseRequest
8
- class << self
9
- attr_accessor :attribute_map
10
-
11
- def attribute name, classname = nil
12
- attr_accessor name
13
- self.attribute_map = {} if self.attribute_map.nil?
14
- self.attribute_map[name] = classname unless classname.nil?
15
- end
16
- end
17
-
18
- self.attribute_map = {}
19
-
7
+ class BaseRequest < BaseRecord
20
8
  # @return [String]
21
9
  attribute :type
22
-
23
- def initialize(hash = {})
24
- hash.each do |k, v|
25
- unless self.class.attribute_map[k.to_sym].nil?
26
- class_obj = ActiveCampaign::Webhooks::Request.const_get(self.class.attribute_map[k.to_sym])
27
- v = class_obj.new(v.as_json)
28
- end
29
- public_send("#{k}=", v) if respond_to? "#{k}="
30
- end
31
- end
32
-
33
- def slice attributes = []
34
- as_json.slice(*attributes.map(&:to_s))
35
- end
10
+ # @return [DateTime]
11
+ attribute :date_time, :DateTime
12
+ # @return [String]
13
+ attribute :initiated_from
14
+ # @return [String]
15
+ attribute :initiated_by
16
+ # @return [Number]
17
+ attribute :list, :Number
36
18
  end
37
19
  end
38
20
  end
@@ -4,15 +4,15 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Campaign
7
- class Campaign < BaseRequest
7
+ class Campaign < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
+ # @return [Number]
11
+ attribute :status, :Number
12
+ # @return [Number]
13
+ attribute :recipients, :Number
8
14
  # @return [String]
9
- attribute :id
10
- # @return [String]
11
- attribute :status
12
- # @return [String]
13
- attribute :recipients
14
- # @return [String]
15
- attribute :campaign_type
15
+ attribute :webcopy_url
16
16
  end
17
17
  end
18
18
  end
@@ -4,19 +4,11 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct ClickRequest
7
- class ClickRequest < BaseRequest
7
+ class ClickRequest < BaseRecord
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :click_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  # @return [Contact]
@@ -4,15 +4,15 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Contact
7
- class Contact < BaseRequest
7
+ class Contact < BaseRecord
8
8
  # @return [String]
9
9
  attribute :email
10
10
  # @return [String]
11
11
  attribute :first_name
12
12
  # @return [String]
13
13
  attribute :last_name
14
- # @return [String]
15
- attribute :id
14
+ # @return [Number]
15
+ attribute :id, :Number
16
16
  # @return [String]
17
17
  attribute :tags
18
18
  # @return [String]
@@ -21,8 +21,8 @@ module ActiveCampaign
21
21
  attribute :phone
22
22
  # @return [String]
23
23
  attribute :customer_acct_name
24
- # @return [String]
25
- attribute :customer_acct_id
24
+ # @return [Number]
25
+ attribute :customer_acct_id, :Number
26
26
  # @return [Hash]
27
27
  attribute :fields
28
28
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class ContactTagAddedRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :contact_tag_added_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [String]
21
13
  attribute :tag
22
14
  # @return [Contact]
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct ContactAddTaskRequest
7
7
  class ContactAddTaskRequest < BaseRequest
8
- # @return [String]
9
- attribute :contact_add_task_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Contact]
17
9
  attribute :contact, :Contact
18
10
  # @return [Task]
@@ -4,7 +4,7 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Deal
7
- class Deal < BaseRequest
7
+ class Deal < BaseRecord
8
8
  STATUS_OPEN = '0'
9
9
  STATUS_WON = '1'
10
10
  STATUS_LOST = '2'
@@ -13,16 +13,16 @@ module ActiveCampaign
13
13
  attribute :currency_symbol
14
14
  # @return [String]
15
15
  attribute :currency
16
- # @return [String]
17
- attribute :customer_acct_id
18
- # @return [String]
19
- attribute :stageid
20
- # @return [String]
21
- attribute :owner
16
+ # @return [Number]
17
+ attribute :customer_acct_id, :Number
18
+ # @return [Number]
19
+ attribute :stageid, :Number
20
+ # @return [Number]
21
+ attribute :owner, :Number
22
22
  # @return [String]
23
23
  attribute :contact_lastname
24
- # @return [String]
25
- attribute :id
24
+ # @return [Number]
25
+ attribute :id, :Number
26
26
  # @return [String]
27
27
  attribute :pipeline_title
28
28
  # @return [String]
@@ -31,24 +31,24 @@ module ActiveCampaign
31
31
  attribute :customer_acct_name
32
32
  # @return [String]
33
33
  attribute :stage_title
34
- # @return [String]
35
- attribute :pipelineid
34
+ # @return [Number]
35
+ attribute :pipelineid, :Number
36
36
  # @return [String]
37
37
  attribute :note
38
- # @return [String]
39
- attribute :contactid
40
- # @return [String]
41
- attribute :status
38
+ # @return [Number]
39
+ attribute :contactid, :Number
40
+ # @return [Number]
41
+ attribute :status, :Number
42
42
  # @return [String]
43
43
  attribute :contact_firstname
44
44
  # @return [String]
45
45
  attribute :contact_email
46
46
  # @return [String]
47
47
  attribute :contact_avatar
48
- # @return [String]
49
- attribute :age
50
- # @return [String]
51
- attribute :value
48
+ # @return [Float]
49
+ attribute :age, :Float
50
+ # @return [Float]
51
+ attribute :value, :Float
52
52
  # @return [String]
53
53
  attribute :owner_firstname
54
54
  # @return [String]
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealAddRequest
7
7
  class DealAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Deal]
17
9
  attribute :deal, :Deal
18
10
  end
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealPipelineAddRequest
7
7
  class DealPipelineAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_pipeline_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Pipeline]
17
9
  attribute :pipeline, :Pipeline
18
10
  end
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealStageAddRequest
7
7
  class DealStageAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_stage_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Stage]
17
9
  attribute :stage, :Stage
18
10
  end
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealTaskAddRequest
7
7
  class DealTaskAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_task_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Deal]
17
9
  attribute :deal, :Deal
18
10
  # @return [Task]
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealTaskCompleteRequest
7
7
  class DealTaskCompleteRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_task_complete_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Deal]
17
9
  attribute :deal, :Deal
18
10
  # @return [Task]
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealTasktypeAddRequest
7
7
  class DealTasktypeAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_tasktype_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Tasktype]
17
9
  attribute :tasktype, :Tasktype
18
10
  end
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct DealUpdateRequest
7
7
  class DealUpdateRequest < BaseRequest
8
- # @return [String]
9
- attribute :deal_update_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [Deal]
17
9
  attribute :deal, :Deal
18
10
  # @return [Hash]
@@ -4,7 +4,7 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Fields
7
- class Fields < BaseRequest
7
+ class Fields < BaseRecord
8
8
  end
9
9
  end
10
10
  end
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Form
7
- class Form < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Form < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  end
11
11
  end
12
12
  end
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Forward
7
- class Forward < BaseRequest
8
- # @return [String]
9
- attribute :count
7
+ class Forward < BaseRecord
8
+ # @return [Number]
9
+ attribute :count, :Number
10
10
  end
11
11
  end
12
12
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class ForwardRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :forward_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  # @return [Contact]
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Link
7
- class Link < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Link < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  # @return [String]
11
11
  attribute :url
12
12
  end
@@ -4,7 +4,7 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct List
7
- class List < BaseRequest
7
+ class List < BaseRecord
8
8
  # @return [String]
9
9
  attribute :sender_url
10
10
  # @return [String]
@@ -5,14 +5,6 @@ module ActiveCampaign
5
5
  module Request
6
6
  # AC Request Struct ListAddRequest
7
7
  class ListAddRequest < BaseRequest
8
- # @return [String]
9
- attribute :list_add_request_type
10
- # @return [String]
11
- attribute :date_time
12
- # @return [String]
13
- attribute :initiated_by
14
- # @return [String]
15
- attribute :initiated_from
16
8
  # @return [List]
17
9
  attribute :list, :List
18
10
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class OpenRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :open_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  # @return [Contact]
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Pipeline
7
- class Pipeline < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Pipeline < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  # @return [String]
11
11
  attribute :title
12
12
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class ReplyRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :reply_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  # @return [Contact]
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class SentRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :sent_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  end
@@ -4,11 +4,11 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Share
7
- class Share < BaseRequest
7
+ class Share < BaseRecord
8
8
  # @return [String]
9
9
  attribute :network
10
- # @return [String]
11
- attribute :network_id
10
+ # @return [Number]
11
+ attribute :network_id, :Number
12
12
  # @return [String]
13
13
  attribute :content
14
14
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class ShareRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :share_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :campaign, :Campaign
22
14
  # @return [Contact]
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Share
7
- class Stage < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Stage < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  # @return [String]
11
11
  attribute :title
12
12
  # @return [String]
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class SubscribeRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :subscribe_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Form]
21
13
  attribute :form, :Form
22
14
  # @return [Contact]
@@ -4,21 +4,21 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Task
7
- class Task < BaseRequest
7
+ class Task < BaseRecord
8
8
  # @return [String]
9
9
  attribute :note
10
- # @return [String]
11
- attribute :id
12
- # @return [String]
13
- attribute :duedate
14
- # @return [String]
15
- attribute :donedate
10
+ # @return [Number]
11
+ attribute :id, :Number
12
+ # @return [DateTime]
13
+ attribute :duedate, :DateTime
14
+ # @return [DateTime]
15
+ attribute :donedate, :DateTime
16
16
  # @return [String]
17
17
  attribute :type_title
18
18
  # @return [String]
19
19
  attribute :title
20
- # @return [String]
21
- attribute :type_id
20
+ # @return [Number]
21
+ attribute :type_id, :Number
22
22
  end
23
23
  end
24
24
  end
@@ -4,9 +4,9 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Tasktype
7
- class Tasktype < BaseRequest
8
- # @return [String]
9
- attribute :id
7
+ class Tasktype < BaseRecord
8
+ # @return [Number]
9
+ attribute :id, :Number
10
10
  # @return [String]
11
11
  attribute :title
12
12
  end
@@ -4,7 +4,7 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Unsubscribe
7
- class Unsubscribe < BaseRequest
7
+ class Unsubscribe < BaseRecord
8
8
  # @return [String]
9
9
  attribute :reason
10
10
  end
@@ -7,16 +7,8 @@ module ActiveCampaign
7
7
  class UnsubscribeRequest < BaseRequest
8
8
  # @return [String]
9
9
  attribute :url
10
- # @return [String]
11
- attribute :unsubscribe_request_type
12
- # @return [String]
13
- attribute :date_time
14
- # @return [String]
15
- attribute :initiated_by
16
- # @return [String]
17
- attribute :initiated_from
18
- # @return [String]
19
- attribute :list
10
+ # @return [Number]
11
+ attribute :list, :Number
20
12
  # @return [Campaign]
21
13
  attribute :form, :Campaign
22
14
  # @return [Campaign]
@@ -4,7 +4,7 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct UpdatedFields
7
- class UpdatedFields < BaseRequest
7
+ class UpdatedFields < BaseRecord
8
8
  end
9
9
  end
10
10
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveCampaign
4
4
  module Webhooks
5
- VERSION = '0.2.14'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_campaign_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Boyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-06 00:00:00.000000000 Z
11
+ date: 2020-10-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -32,6 +32,7 @@ files:
32
32
  - lib/active_campaign/webhooks/request/account_contact_add_request.rb
33
33
  - lib/active_campaign/webhooks/request/account_contact_removed.rb
34
34
  - lib/active_campaign/webhooks/request/account_update_request.rb
35
+ - lib/active_campaign/webhooks/request/base_record.rb
35
36
  - lib/active_campaign/webhooks/request/base_request.rb
36
37
  - lib/active_campaign/webhooks/request/campaign.rb
37
38
  - lib/active_campaign/webhooks/request/click_request.rb