active_campaign_webhooks 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +22 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +37 -0
  7. data/Rakefile +2 -0
  8. data/active_campaign_webhooks.gemspec +30 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/lib/active_campaign/webhooks/request/account.rb +23 -0
  12. data/lib/active_campaign/webhooks/request/account_add_request.rb +23 -0
  13. data/lib/active_campaign/webhooks/request/account_contact.rb +19 -0
  14. data/lib/active_campaign/webhooks/request/account_contact_add_request.rb +29 -0
  15. data/lib/active_campaign/webhooks/request/account_contact_removed.rb +17 -0
  16. data/lib/active_campaign/webhooks/request/account_update_request.rb +23 -0
  17. data/lib/active_campaign/webhooks/request/base_request.rb +39 -0
  18. data/lib/active_campaign/webhooks/request/campaign.rb +19 -0
  19. data/lib/active_campaign/webhooks/request/click_request.rb +29 -0
  20. data/lib/active_campaign/webhooks/request/contact.rb +31 -0
  21. data/lib/active_campaign/webhooks/request/contact_tag_added_request.rb +27 -0
  22. data/lib/active_campaign/webhooks/request/contact_task_add_request.rb +23 -0
  23. data/lib/active_campaign/webhooks/request/deal.rb +59 -0
  24. data/lib/active_campaign/webhooks/request/deal_add_request.rb +21 -0
  25. data/lib/active_campaign/webhooks/request/deal_pipeline_add_request.rb +21 -0
  26. data/lib/active_campaign/webhooks/request/deal_stage_add_request.rb +21 -0
  27. data/lib/active_campaign/webhooks/request/deal_task_add_request.rb +23 -0
  28. data/lib/active_campaign/webhooks/request/deal_task_complete_request.rb +25 -0
  29. data/lib/active_campaign/webhooks/request/deal_tasktype_add_request.rb +21 -0
  30. data/lib/active_campaign/webhooks/request/deal_update_request.rb +23 -0
  31. data/lib/active_campaign/webhooks/request/fields.rb +11 -0
  32. data/lib/active_campaign/webhooks/request/form.rb +13 -0
  33. data/lib/active_campaign/webhooks/request/forward.rb +13 -0
  34. data/lib/active_campaign/webhooks/request/forward_request.rb +29 -0
  35. data/lib/active_campaign/webhooks/request/helpers.rb +16 -0
  36. data/lib/active_campaign/webhooks/request/link.rb +15 -0
  37. data/lib/active_campaign/webhooks/request/list.rb +27 -0
  38. data/lib/active_campaign/webhooks/request/list_add_request.rb +21 -0
  39. data/lib/active_campaign/webhooks/request/open_request.rb +27 -0
  40. data/lib/active_campaign/webhooks/request/pipeline.rb +15 -0
  41. data/lib/active_campaign/webhooks/request/reply_request.rb +31 -0
  42. data/lib/active_campaign/webhooks/request/sent_request.rb +25 -0
  43. data/lib/active_campaign/webhooks/request/share.rb +17 -0
  44. data/lib/active_campaign/webhooks/request/share_request.rb +29 -0
  45. data/lib/active_campaign/webhooks/request/stage.rb +17 -0
  46. data/lib/active_campaign/webhooks/request/subscribe_request.rb +27 -0
  47. data/lib/active_campaign/webhooks/request/task.rb +25 -0
  48. data/lib/active_campaign/webhooks/request/tasktype.rb +15 -0
  49. data/lib/active_campaign/webhooks/request/unsubscribe.rb +13 -0
  50. data/lib/active_campaign/webhooks/request/unsubscribe_request.rb +31 -0
  51. data/lib/active_campaign/webhooks/request/updated_fields.rb +11 -0
  52. data/lib/active_campaign/webhooks/version.rb +7 -0
  53. data/lib/active_campaign_webhooks.rb +24 -0
  54. metadata +112 -0
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct ContactAddTaskRequest
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
+ # @return [Contact]
17
+ attribute :contact, :Contact
18
+ # @return [Task]
19
+ attribute :task, :Task
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Deal
7
+ class Deal < BaseRequest
8
+ STATUS_OPEN = '0'
9
+ STATUS_WON = '1'
10
+ STATUS_LOST = '2'
11
+
12
+ # @return [String]
13
+ attribute :currency_symbol
14
+ # @return [String]
15
+ attribute :currency
16
+ # @return [String]
17
+ attribute :customer_acct_id
18
+ # @return [String]
19
+ attribute :stageid
20
+ # @return [String]
21
+ attribute :owner
22
+ # @return [String]
23
+ attribute :contact_lastname
24
+ # @return [String]
25
+ attribute :id
26
+ # @return [String]
27
+ attribute :pipeline_title
28
+ # @return [String]
29
+ attribute :title
30
+ # @return [String]
31
+ attribute :customer_acct_name
32
+ # @return [String]
33
+ attribute :stage_title
34
+ # @return [String]
35
+ attribute :pipelineid
36
+ # @return [String]
37
+ attribute :note
38
+ # @return [String]
39
+ attribute :contactid
40
+ # @return [String]
41
+ attribute :status
42
+ # @return [String]
43
+ attribute :contact_firstname
44
+ # @return [String]
45
+ attribute :contact_email
46
+ # @return [String]
47
+ attribute :contact_avatar
48
+ # @return [String]
49
+ attribute :age
50
+ # @return [String]
51
+ attribute :value
52
+ # @return [String]
53
+ attribute :owner_firstname
54
+ # @return [String]
55
+ attribute :owner_lastname
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealAddRequest
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
+ # @return [Deal]
17
+ attribute :deal, :Deal
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealPipelineAddRequest
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
+ # @return [Pipeline]
17
+ attribute :pipeline, :Pipeline
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealStageAddRequest
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
+ # @return [Stage]
17
+ attribute :stage, :Stage
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealTaskAddRequest
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
+ # @return [Deal]
17
+ attribute :deal, :Deal
18
+ # @return [Task]
19
+ attribute :task, :Task
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealTaskCompleteRequest
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
+ # @return [Deal]
17
+ attribute :deal, :Deal
18
+ # @return [Task]
19
+ attribute :task, :Task
20
+ # @return [Contact]
21
+ attribute :contact, :Contact
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealTasktypeAddRequest
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
+ # @return [Tasktype]
17
+ attribute :tasktype, :Tasktype
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct DealUpdateRequest
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
+ # @return [Deal]
17
+ attribute :deal, :Deal
18
+ # @return [Hash]
19
+ attribute :updated_fields
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Fields
7
+ class Fields < BaseRequest
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Form
7
+ class Form < BaseRequest
8
+ # @return [String]
9
+ attribute :id
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Forward
7
+ class Forward < BaseRequest
8
+ # @return [String]
9
+ attribute :count
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct ForwardRequest
7
+ class ForwardRequest < BaseRequest
8
+ # @return [String]
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
20
+ # @return [Campaign]
21
+ attribute :campaign, :Campaign
22
+ # @return [Contact]
23
+ attribute :contact, :Contact
24
+ # @return [Forward]
25
+ attribute :forward, :Forward
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ class Helpers
7
+ def self.get_request(data)
8
+ type = "#{data[:type]}_request"
9
+ request_model = "ActiveCampaign::Webhooks::Request::#{type.classify}".constantize
10
+
11
+ request_model.new data
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Link
7
+ class Link < BaseRequest
8
+ # @return [String]
9
+ attribute :id
10
+ # @return [String]
11
+ attribute :url
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct List
7
+ class List < BaseRequest
8
+ # @return [String]
9
+ attribute :sender_url
10
+ # @return [String]
11
+ attribute :sender_country
12
+ # @return [String]
13
+ attribute :sender_addr1
14
+ # @return [String]
15
+ attribute :sender_reminder
16
+ # @return [String]
17
+ attribute :sender_city
18
+ # @return [String]
19
+ attribute :sender_addr2
20
+ # @return [String]
21
+ attribute :sender_state
22
+ # @return [String]
23
+ attribute :sender_zip
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct ListAddRequest
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
+ # @return [List]
17
+ attribute :list, :List
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct OpenRequest
7
+ class OpenRequest < BaseRequest
8
+ # @return [String]
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
20
+ # @return [Campaign]
21
+ attribute :campaign, :Campaign
22
+ # @return [Contact]
23
+ attribute :contact, :Contact
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Pipeline
7
+ class Pipeline < BaseRequest
8
+ # @return [String]
9
+ attribute :id
10
+ # @return [String]
11
+ attribute :title
12
+ end
13
+ end
14
+ end
15
+ end