active_campaign_webhooks 0.2.13 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -2
  3. data/Gemfile.lock +1 -4
  4. data/README.md +9 -2
  5. data/active_campaign_webhooks.gemspec +0 -2
  6. data/lib/active_campaign/webhooks/request/account.rb +7 -7
  7. data/lib/active_campaign/webhooks/request/account_add_request.rb +0 -10
  8. data/lib/active_campaign/webhooks/request/account_contact.rb +7 -7
  9. data/lib/active_campaign/webhooks/request/account_contact_add_request.rb +0 -10
  10. data/lib/active_campaign/webhooks/request/account_contact_removed.rb +7 -7
  11. data/lib/active_campaign/webhooks/request/account_update_request.rb +0 -10
  12. data/lib/active_campaign/webhooks/request/base_record.rb +49 -0
  13. data/lib/active_campaign/webhooks/request/base_request.rb +9 -27
  14. data/lib/active_campaign/webhooks/request/campaign.rb +8 -8
  15. data/lib/active_campaign/webhooks/request/click_request.rb +3 -11
  16. data/lib/active_campaign/webhooks/request/contact.rb +5 -5
  17. data/lib/active_campaign/webhooks/request/contact_tag_added_request.rb +2 -10
  18. data/lib/active_campaign/webhooks/request/contact_task_add_request.rb +0 -8
  19. data/lib/active_campaign/webhooks/request/deal.rb +24 -22
  20. data/lib/active_campaign/webhooks/request/deal_add_request.rb +0 -8
  21. data/lib/active_campaign/webhooks/request/deal_pipeline_add_request.rb +0 -8
  22. data/lib/active_campaign/webhooks/request/deal_stage_add_request.rb +0 -8
  23. data/lib/active_campaign/webhooks/request/deal_task_add_request.rb +0 -8
  24. data/lib/active_campaign/webhooks/request/deal_task_complete_request.rb +0 -8
  25. data/lib/active_campaign/webhooks/request/deal_tasktype_add_request.rb +0 -8
  26. data/lib/active_campaign/webhooks/request/deal_update_request.rb +0 -8
  27. data/lib/active_campaign/webhooks/request/fields.rb +1 -1
  28. data/lib/active_campaign/webhooks/request/form.rb +3 -3
  29. data/lib/active_campaign/webhooks/request/forward.rb +3 -3
  30. data/lib/active_campaign/webhooks/request/forward_request.rb +2 -10
  31. data/lib/active_campaign/webhooks/request/link.rb +3 -3
  32. data/lib/active_campaign/webhooks/request/list.rb +1 -1
  33. data/lib/active_campaign/webhooks/request/list_add_request.rb +0 -8
  34. data/lib/active_campaign/webhooks/request/open_request.rb +2 -10
  35. data/lib/active_campaign/webhooks/request/pipeline.rb +3 -3
  36. data/lib/active_campaign/webhooks/request/reply_request.rb +2 -10
  37. data/lib/active_campaign/webhooks/request/sent_request.rb +2 -10
  38. data/lib/active_campaign/webhooks/request/share.rb +3 -3
  39. data/lib/active_campaign/webhooks/request/share_request.rb +2 -10
  40. data/lib/active_campaign/webhooks/request/stage.rb +3 -3
  41. data/lib/active_campaign/webhooks/request/subscribe_request.rb +2 -10
  42. data/lib/active_campaign/webhooks/request/task.rb +9 -9
  43. data/lib/active_campaign/webhooks/request/tasktype.rb +3 -3
  44. data/lib/active_campaign/webhooks/request/unsubscribe.rb +1 -1
  45. data/lib/active_campaign/webhooks/request/unsubscribe_request.rb +2 -10
  46. data/lib/active_campaign/webhooks/request/updated_fields.rb +1 -1
  47. data/lib/active_campaign/webhooks/version.rb +1 -1
  48. metadata +4 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a97167c83c6180ed64a12e483ff069272c7f926d43724332e392317c54ad584e
4
- data.tar.gz: 163bf16718cbd2b7b372e052827a97ec7e35fb080b4a76719a8fbefe0a05060d
3
+ metadata.gz: 06c9de491d4e052ac71ea20aee18512e039cf6b82f05653403eabaf97db85c99
4
+ data.tar.gz: 37afd8e4ba9a7a9434ab05d25ab207842178435b929e52ece613cfe5cf3f57e5
5
5
  SHA512:
6
- metadata.gz: 8008bdae9fab2147a8f3ef84733c5f17c858d03c2e1dc9cca9491dd5a7fd907483134e7224a427875592ea6d212382ca02aa4730c38975918d99d54ec00930b4
7
- data.tar.gz: 75f59f37cbb59f20a16b6992909643e25e8b8f7e0773276eab82a32d1a5e6a801b8d621f0a5b03fcdd0c2883eeb0cf639365afba61f03b80ff58d93fb74020ff
6
+ metadata.gz: 29d5bd7e4f0b216176c663e77c97d2d400895bdbbe765a84276449ab59d96e5e9e13d7bc0f383bc7d969f3f321b55d1f1b8303457d63e0bc6030bf88ac5a206e
7
+ data.tar.gz: 93c7649201c93d8b7dbe468140f0492699bcde677f6dfa8a856e4506c79077044e2c53c6d28a8f5478a510d92a4bdbb6d25a2294344f0dce2501e0e79a108422
data/Gemfile CHANGED
@@ -5,5 +5,4 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in active_campaign_webhooks.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rake', '~> 12.0'
9
- gem 'yard'
8
+ gem 'rake', '~> 12.0'
@@ -1,14 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_campaign_webhooks (0.2.12)
5
- yard
4
+ active_campaign_webhooks (0.3.3)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
9
8
  specs:
10
9
  rake (12.3.3)
11
- yard (0.9.25)
12
10
 
13
11
  PLATFORMS
14
12
  ruby
@@ -16,7 +14,6 @@ PLATFORMS
16
14
  DEPENDENCIES
17
15
  active_campaign_webhooks!
18
16
  rake (~> 12.0)
19
- yard
20
17
 
21
18
  BUNDLED WITH
22
19
  2.1.4
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
 
@@ -17,8 +17,6 @@ Gem::Specification.new do |spec|
17
17
  spec.metadata['source_code_uri'] = 'https://github.com/Hoppelite/active_campaign_webhooks'
18
18
  spec.metadata['changelog_uri'] = 'https://github.com/Hoppelite/active_campaign_webhooks'
19
19
 
20
- spec.add_dependency "yard"
21
-
22
20
  # Specify which files should be added to the gem when it is released.
23
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
@@ -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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
9
+ attribute :id, :Integer
10
+ # @return [Integer]
11
+ attribute :account, :Integer
12
+ # @return [Integer]
13
+ attribute :contact, :Integer
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 [Integer]
9
+ attribute :id, :Integer
10
+ # @return [Integer]
11
+ attribute :account, :Integer
12
+ # @return [Integer]
13
+ attribute :contact, :Integer
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 [Integer]
17
+ attribute :list, :Integer
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 [Integer]
9
+ attribute :id, :Integer
10
+ # @return [Integer]
11
+ attribute :status, :Integer
12
+ # @return [Integer]
13
+ attribute :recipients, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
15
+ attribute :id, :Integer
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 [Integer]
25
+ attribute :customer_acct_id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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,51 +4,53 @@ module ActiveCampaign
4
4
  module Webhooks
5
5
  module Request
6
6
  # AC Request Struct Deal
7
- class Deal < BaseRequest
8
- STATUS_OPEN = '0'
9
- STATUS_WON = '1'
10
- STATUS_LOST = '2'
7
+ class Deal < BaseRecord
8
+ STATUS_OPEN = 0
9
+ STATUS_WON = 1
10
+ STATUS_LOST = 2
11
11
 
12
12
  # @return [String]
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 [Integer]
17
+ attribute :customer_acct_id, :Integer
18
+ # @return [Integer]
19
+ attribute :stageid, :Integer
20
+ # @return [Integer]
21
+ attribute :owner, :Integer
22
22
  # @return [String]
23
23
  attribute :contact_lastname
24
- # @return [String]
25
- attribute :id
24
+ # @return [Integer]
25
+ attribute :id, :Integer
26
26
  # @return [String]
27
27
  attribute :pipeline_title
28
28
  # @return [String]
29
29
  attribute :title
30
+ # @return [DateTime]
31
+ attribute :create_date, :DateTime
30
32
  # @return [String]
31
33
  attribute :customer_acct_name
32
34
  # @return [String]
33
35
  attribute :stage_title
34
- # @return [String]
35
- attribute :pipelineid
36
+ # @return [Integer]
37
+ attribute :pipelineid, :Integer
36
38
  # @return [String]
37
39
  attribute :note
38
- # @return [String]
39
- attribute :contactid
40
- # @return [String]
41
- attribute :status
40
+ # @return [Integer]
41
+ attribute :contactid, :Integer
42
+ # @return [Integer]
43
+ attribute :status, :Integer
42
44
  # @return [String]
43
45
  attribute :contact_firstname
44
46
  # @return [String]
45
47
  attribute :contact_email
46
48
  # @return [String]
47
49
  attribute :contact_avatar
48
- # @return [String]
49
- attribute :age
50
- # @return [String]
51
- attribute :value
50
+ # @return [Float]
51
+ attribute :age, :Float
52
+ # @return [Float]
53
+ attribute :value, :Float
52
54
  # @return [String]
53
55
  attribute :owner_firstname
54
56
  # @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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
9
+ attribute :count, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
11
+ attribute :network_id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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 [Integer]
11
+ attribute :id, :Integer
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 [Integer]
21
+ attribute :type_id, :Integer
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 [Integer]
9
+ attribute :id, :Integer
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 [Integer]
11
+ attribute :list, :Integer
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.13'
5
+ VERSION = '0.3.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_campaign_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.13
4
+ version: 0.3.3
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
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: yard
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
11
+ date: 2020-10-11 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description:
28
14
  email:
29
15
  - sam@banqer.co
@@ -46,6 +32,7 @@ files:
46
32
  - lib/active_campaign/webhooks/request/account_contact_add_request.rb
47
33
  - lib/active_campaign/webhooks/request/account_contact_removed.rb
48
34
  - lib/active_campaign/webhooks/request/account_update_request.rb
35
+ - lib/active_campaign/webhooks/request/base_record.rb
49
36
  - lib/active_campaign/webhooks/request/base_request.rb
50
37
  - lib/active_campaign/webhooks/request/campaign.rb
51
38
  - lib/active_campaign/webhooks/request/click_request.rb