frederick_api 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: d6ff0a40eec01831507d741f192e4069725eed3d
4
- data.tar.gz: b73d7492fb9ef6663d0d949da42a413cd729c323
3
+ metadata.gz: 7585f21ab85ccf59525a4d78a455952b54d8f902
4
+ data.tar.gz: 38057990239e4c0af5b99ad07c36aa2cf6aea783
5
5
  SHA512:
6
- metadata.gz: cad40384ffd14ab4ab6c7e82bce9e28a5df7dae345299f457e85f518503b429b97dde5de198f11bb5160349a2aa00c8c9a6143e55d96b1b295756cec57683a99
7
- data.tar.gz: c86f5bfae286ede2b4e7c615c8a062c105ee7c42ca94f5ee20412b8763ae884cd9d2f77b26a3dfede4e8af8abec1051ef1e55209395f5662709340366861e366
6
+ metadata.gz: 6b603fee87f814268d6b9eb6a163e1941996a33e819c983a152227a44bd3e36077a4341021533b97323dabff808683af25eaa47e57a40103bc756b3c89a08e2b
7
+ data.tar.gz: a3a0a5a8b77cdb1e76010a78a0079ca1733938cb1aaa973d8d412c3e0287d7c63d05ad36f5d2a53c0c3f460d5e124fad661664808b3404cc1eba507293dfaead
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FrederickAPI
4
+ module V2
5
+ # /v2/locations/:location_id/automations
6
+ class Automation < Resource
7
+ belongs_to :location
8
+ self.read_only_attributes += [:location_id]
9
+ end
10
+ end
11
+ end
@@ -5,6 +5,14 @@ module FrederickAPI
5
5
  # /v2/locations/:location_id/contacts
6
6
  class Contact < Resource
7
7
  belongs_to :location
8
+ has_one :contact_type
9
+ has_one :parent, class_name: 'FrederickAPI::V2::Contact'
10
+ has_one :referred_by_contact, class_name: 'FrederickAPI::V2::Contact'
11
+ has_many :children, class_name: 'FrederickAPI::V2::Contact'
12
+ has_many :referred_contacts, class_name: 'FrederickAPI::V2::Contact'
13
+ has_many :contact_lists
14
+ has_many :interactions
15
+
8
16
  self.read_only_attributes += [:location_id]
9
17
  end
10
18
  end
@@ -5,6 +5,9 @@ module FrederickAPI
5
5
  # /v2/locations/:location_id/contact_lists
6
6
  class ContactList < Resource
7
7
  belongs_to :location
8
+ has_many :contacts
9
+ has_one :contact_type
10
+
8
11
  self.read_only_attributes += [:location_id]
9
12
  end
10
13
  end
@@ -5,6 +5,8 @@ module FrederickAPI
5
5
  # /v2/locations/:location_id/contact_properties
6
6
  class ContactProperty < Resource
7
7
  belongs_to :location
8
+ has_one :contact_type
9
+
8
10
  self.read_only_attributes += [:location_id]
9
11
  end
10
12
  end
@@ -5,6 +5,9 @@ module FrederickAPI
5
5
  # /v2/locations/:location_id/contact_types
6
6
  class ContactType < Resource
7
7
  belongs_to :location
8
+ has_many :contact_properties
9
+ has_many :contacts
10
+
8
11
  self.read_only_attributes += [:location_id]
9
12
  end
10
13
  end
@@ -5,6 +5,8 @@ module FrederickAPI
5
5
  # /v2/locations/:location_id/interactions
6
6
  class Interaction < Resource
7
7
  belongs_to :location
8
+ has_one :contact
9
+
8
10
  self.read_only_attributes += [:location_id]
9
11
  end
10
12
  end
@@ -37,6 +37,10 @@ module FrederickAPI
37
37
  def self.custom_headers
38
38
  super.merge(x_api_key: top_level_namespace.config.api_key)
39
39
  end
40
+
41
+ def self._header_store
42
+ Thread.current['frederick_api_header_store'] ||= {}
43
+ end
40
44
  end
41
45
  end
42
46
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module FrederickAPI
4
4
  # Current gem version
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
data/lib/frederick_api.rb CHANGED
@@ -19,6 +19,7 @@ require 'frederick_api/v2/location'
19
19
  require 'frederick_api/v2/business_category'
20
20
 
21
21
  # Froldoex resources
22
+ require 'frederick_api/v2/automation'
22
23
  require 'frederick_api/v2/contact'
23
24
  require 'frederick_api/v2/contact_property'
24
25
  require 'frederick_api/v2/contact_list'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frederick_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederick Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-05 00:00:00.000000000 Z
11
+ date: 2017-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json_api_client
@@ -35,6 +35,7 @@ files:
35
35
  - README.md
36
36
  - lib/frederick_api.rb
37
37
  - lib/frederick_api/configuration.rb
38
+ - lib/frederick_api/v2/automation.rb
38
39
  - lib/frederick_api/v2/business_category.rb
39
40
  - lib/frederick_api/v2/contact.rb
40
41
  - lib/frederick_api/v2/contact_list.rb