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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a97167c83c6180ed64a12e483ff069272c7f926d43724332e392317c54ad584e
4
+ data.tar.gz: 163bf16718cbd2b7b372e052827a97ec7e35fb080b4a76719a8fbefe0a05060d
5
+ SHA512:
6
+ metadata.gz: 8008bdae9fab2147a8f3ef84733c5f17c858d03c2e1dc9cca9491dd5a7fd907483134e7224a427875592ea6d212382ca02aa4730c38975918d99d54ec00930b4
7
+ data.tar.gz: 75f59f37cbb59f20a16b6992909643e25e8b8f7e0773276eab82a32d1a5e6a801b8d621f0a5b03fcdd0c2883eeb0cf639365afba61f03b80ff58d93fb74020ff
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in active_campaign_webhooks.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 12.0'
9
+ gem 'yard'
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_campaign_webhooks (0.2.12)
5
+ yard
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ rake (12.3.3)
11
+ yard (0.9.25)
12
+
13
+ PLATFORMS
14
+ ruby
15
+
16
+ DEPENDENCIES
17
+ active_campaign_webhooks!
18
+ rake (~> 12.0)
19
+ yard
20
+
21
+ BUNDLED WITH
22
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Sam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # ActiveCampaignWebhooks
2
+
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'active_campaign_webhooks'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ $ bundle install
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install active_campaign_webhooks
19
+
20
+ ## Usage
21
+
22
+ TODO: Write usage instructions here
23
+
24
+ ## Development
25
+
26
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
27
+
28
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
29
+
30
+ ## Contributing
31
+
32
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Hoppelite/active_campaign_webhooks.
33
+
34
+
35
+ ## License
36
+
37
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/active_campaign/webhooks/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'active_campaign_webhooks'
7
+ spec.version = ActiveCampaign::Webhooks::VERSION
8
+ spec.authors = ['Sam Boyne']
9
+ spec.email = ['sam@banqer.co']
10
+
11
+ spec.summary = 'Structs and Helpers for Active Campaign webhooks'
12
+ spec.homepage = 'https://github.com/Hoppelite/active_campaign_webhooks'
13
+ spec.license = 'MIT'
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
+
16
+ spec.metadata['homepage_uri'] = spec.homepage
17
+ spec.metadata['source_code_uri'] = 'https://github.com/Hoppelite/active_campaign_webhooks'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/Hoppelite/active_campaign_webhooks'
19
+
20
+ spec.add_dependency "yard"
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
+ end
27
+ spec.bindir = 'exe'
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ['lib']
30
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "active_campaign_webhooks"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Account
7
+ class Account < BaseRequest
8
+ # @return [String]
9
+ attribute :id
10
+ # @return [String]
11
+ attribute :account_name
12
+ # @return [String]
13
+ attribute :account_url
14
+ # @return [String]
15
+ attribute :created_timestamp
16
+ # @return [String]
17
+ attribute :updated_timestamp
18
+ # @return [Hash]
19
+ attribute :fields
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct AccountAddRequest
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
+ # @return [Account]
19
+ attribute :account, :Account
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
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
14
+ # @return [String]
15
+ attribute :job_title
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct AccountContactAddRequest
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
+ # @return [Account]
19
+ attribute :account, :Account
20
+ # @return [AccountContact]
21
+ attribute :account_contact, :AccountContact
22
+ # @return [AccountContactRemoved]
23
+ attribute :account_contact_removed, :AccountContactRemoved
24
+ # @return [Contact]
25
+ attribute :contact, :Contact
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
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
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct AccountUpdateRequest
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
+ # @return [Account]
19
+ attribute :account, :Account
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
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
+
20
+ # @return [String]
21
+ 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
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Campaign
7
+ class Campaign < BaseRequest
8
+ # @return [String]
9
+ attribute :id
10
+ # @return [String]
11
+ attribute :status
12
+ # @return [String]
13
+ attribute :recipients
14
+ # @return [String]
15
+ attribute :campaign_type
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct ClickRequest
7
+ class ClickRequest < BaseRequest
8
+ # @return [String]
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
20
+ # @return [Campaign]
21
+ attribute :campaign, :Campaign
22
+ # @return [Contact]
23
+ attribute :contact, :Contact
24
+ # @return [Link]
25
+ attribute :link, :Link
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct Contact
7
+ class Contact < BaseRequest
8
+ # @return [String]
9
+ attribute :email
10
+ # @return [String]
11
+ attribute :first_name
12
+ # @return [String]
13
+ attribute :last_name
14
+ # @return [String]
15
+ attribute :id
16
+ # @return [String]
17
+ attribute :tags
18
+ # @return [String]
19
+ attribute :ip
20
+ # @return [String]
21
+ attribute :phone
22
+ # @return [String]
23
+ attribute :customer_acct_name
24
+ # @return [String]
25
+ attribute :customer_acct_id
26
+ # @return [Hash]
27
+ attribute :fields
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ActiveCampaign
4
+ module Webhooks
5
+ module Request
6
+ # AC Request Struct ContactTagAddedRequest
7
+ class ContactTagAddedRequest < BaseRequest
8
+ # @return [String]
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
20
+ # @return [String]
21
+ attribute :tag
22
+ # @return [Contact]
23
+ attribute :contact, :Contact
24
+ end
25
+ end
26
+ end
27
+ end