aladtec 0.3.2 → 1.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fe187974f6bb3afdfee9fa734097e8e9aa644e3d8e6d62eb5c3aeca466e3f84
4
- data.tar.gz: 31d54f6839c062dba60924565d4d42e65b4521d106dc0bcc614d61889b87cf63
3
+ metadata.gz: 4bb6e0cb78ea7cc6446e1a62611ff179318d2ee0de1e94cbc1d29be51b3390d8
4
+ data.tar.gz: 719e483534d65051256f493bad7eb74632b735de7e2bb4985848ba1963fedc3e
5
5
  SHA512:
6
- metadata.gz: 3e29cd58cef7d9a02caacc815d6db9fb8b5a4e3279c6b4530d4d7ee6851289b759539881aa2660020c00c9fd0085ba411853cabb442a32a048c52e8ddc084af6
7
- data.tar.gz: 6eafb4634d7659680d1b99d305b95ed0e8e9ca46c05885c8a145d837018a88286219b1dc6c5572e97591d1b0d4056a2333648eea69403986cd649c096f662e10
6
+ metadata.gz: ee5b6ecb37f26e1912447418e79489f5f33050705490fa3ca11061d19942ba7f593e9957fc7b18869a0a18604c20561ec757c7011b52e2ba7d64c0b3ce42c76c
7
+ data.tar.gz: a3dafeb15699a88737e5bd20ecc99d0d0af00b6d3baefe3d1fd6943718ea7549c5c74b9f28c7378a5487e1360a6ea8b1c205f9afbcab7f494fd5283e709cd9fb
data/aladtec.gemspec CHANGED
@@ -22,13 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
23
  spec.require_paths = ['lib']
24
24
 
25
- spec.add_development_dependency 'bundler', '~> 2.0'
25
+ spec.add_development_dependency 'bundler'
26
26
  spec.add_development_dependency 'pry'
27
27
  spec.add_development_dependency 'rake'
28
28
  spec.add_development_dependency 'rspec'
29
29
  spec.add_development_dependency 'webmock'
30
30
 
31
- spec.add_dependency 'dry-configurable', '~> 0.11', '>= 0.11.4'
31
+ spec.add_dependency 'dry-configurable', '>= 1.0.0'
32
32
  spec.add_dependency 'dry-initializer'
33
33
  spec.add_dependency 'http'
34
34
  end
@@ -13,9 +13,7 @@ module Aladtec
13
13
  class Client
14
14
  attr_reader :config
15
15
  def initialize(args = {})
16
- @config = Aladtec.config.dup.tap do |c|
17
- c.update(args)
18
- end
16
+ @config = Aladtec.config.dup.update(args)
19
17
  end
20
18
 
21
19
  def configure
@@ -30,8 +28,8 @@ module Aladtec
30
28
  client_secret: config.client_secret }
31
29
  response = HTTP.post(URI.join(config.endpoint, 'oauth/token'), json: body)
32
30
  body = response.parse
33
- @auth_token = body.fetch('token')
34
- @auth_expiration = Time.at body.fetch('expires')
31
+ @auth_token = body.fetch('access_token')
32
+ @auth_expiration = Time.now + body.fetch('expires_in')
35
33
  response.status.success?
36
34
  end
37
35
 
@@ -47,29 +45,30 @@ module Aladtec
47
45
  ed = options.fetch(:end_time) do
48
46
  raise ArgumentError, 'You must supply a :end_time option!'
49
47
  end
50
- events = request('events', range_start: format_time(bd),
51
- range_stop: format_time(ed))
52
- events.values.flatten.map { |event| Event.new(event) }
48
+ events = request('events', range_start_datetime: format_time(bd),
49
+ range_stop_datetime: format_time(ed))
50
+ events['data'].flat_map { |dates| dates['event_records'] }.map { |event| Event.new(event) }
53
51
  end
54
52
 
53
+ MAX = 1000
54
+
55
55
  # Public: Get a list of members
56
56
  #
57
57
  def members
58
- res = request('members', include_attributes: true)
59
- res.map { |member| Member.new(member) }
58
+ paginated_get('members', {}, self).map { |member| Member.new(member) }
60
59
  end
61
60
 
62
61
  # Public: Get a list of schedules
63
62
  #
64
63
  def schedules
65
64
  res = request('schedules')
66
- res.map { |schedule| Schedule.new(schedule) }
65
+ res['data'].map { |schedule| Schedule.new(schedule) }
67
66
  end
68
67
 
69
68
  # Public: Get list of members scheduled now
70
69
  def scheduled_now(options = {})
71
70
  res = request('scheduled-time/members-scheduled-now', options)
72
- res.map { |schedule| ScheduledNow.new(schedule) }
71
+ res['data'].map { |schedule| ScheduledNow.new(schedule) }
73
72
  end
74
73
 
75
74
  # Public: Get list of members scheduled in a time range
@@ -84,13 +83,11 @@ module Aladtec
84
83
  et = options.fetch(:end_time) do
85
84
  raise ArgumentError, 'You must supply an :end_time!'
86
85
  end
87
- scheduled_time = request('scheduled-time', range_start: format_time(bt),
88
- range_stop: format_time(et))
89
- scheduled_time.values.flatten.map { |range| Range.new(range) }
86
+ scheduled_time = request('scheduled-time', range_start_datetime: format_time(bt),
87
+ range_stop_datetime: format_time(et))
88
+ scheduled_time['data'].flat_map { |date| date['time_records'] }.map { |range| Range.new(range) }
90
89
  end
91
90
 
92
- private
93
-
94
91
  def request(path, options = {})
95
92
  if auth_expired? && !authenticate
96
93
  raise Aladtec::Error, 'authentication failed'
@@ -103,12 +100,61 @@ module Aladtec
103
100
  res.parse
104
101
  end
105
102
 
103
+ private
104
+
106
105
  def format_time(time)
107
- (time.is_a?(Time) ? time : Time.parse(time)).strftime('%FT%R')
106
+ (time.is_a?(Time) ? time : Time.parse(time)).strftime('%FT%T%:z')
108
107
  end
109
108
 
110
109
  def auth_expired?
111
110
  !@auth_token || !@auth_expiration || Time.now >= @auth_expiration
112
111
  end
112
+
113
+ def paginated_get(path, params, client)
114
+ Cursor.new(path, params, client)
115
+ end
116
+
117
+ class Cursor
118
+ include Enumerable
119
+
120
+ def initialize(path, options = {}, client)
121
+ @path = path
122
+ @params = options.dup
123
+ @client = client
124
+
125
+ @collection = []
126
+ @offset = @params.fetch(:offset, nil)
127
+ @limit = @params.fetch(:limit, 50)
128
+ end
129
+
130
+ def each(start = 0, &block)
131
+ return to_enum(:each, start) unless block
132
+
133
+ Array(@collection[start..]).each(&block)
134
+
135
+ unless finished?
136
+ start = [@collection.size, start].max
137
+
138
+ fetch_next_page
139
+
140
+ each(start, &block)
141
+ end
142
+ end
143
+
144
+ private
145
+
146
+ def fetch_next_page
147
+ response = @client.request(@path, @params.merge(offset: @collection.length, limit: @limit))
148
+ data = response['data']
149
+ @last_response_empty = data.empty? || data.length < @limit
150
+ @collection += data
151
+ end
152
+
153
+ MAX = 1000
154
+
155
+ def finished?
156
+ @last_response_empty || @collection.length >= MAX
157
+ end
158
+ end
113
159
  end
114
160
  end
@@ -8,9 +8,10 @@ module Aladtec
8
8
  extend Dry::Initializer
9
9
 
10
10
  option :member_id, as: :id
11
- option :name
11
+ option :first_name
12
+ option :last_name
12
13
  option :is_active
13
- option :attributes, [] do
14
+ option :custom_attributes, [] do
14
15
  option :attribute_id, as: :id
15
16
  option :value
16
17
  end
@@ -18,5 +19,9 @@ module Aladtec
18
19
  def self.new(params)
19
20
  super **params.transform_keys(&:to_sym)
20
21
  end
22
+
23
+ def name
24
+ [first_name, last_name].join(' ')
25
+ end
21
26
  end
22
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aladtec
4
- VERSION = '0.3.2'
4
+ VERSION = '1.0.0.pre2'
5
5
  end
data/lib/aladtec.rb CHANGED
@@ -8,7 +8,7 @@ require 'aladtec/client'
8
8
  module Aladtec
9
9
  extend Dry::Configurable
10
10
 
11
- setting :endpoint, default: 'https://secure.aladtec.com/example/api/'
11
+ setting :endpoint, default: 'https://secure.aladtec.com/example/api/v3/'
12
12
  setting :user_agent, default: "Aladtec API Ruby Gem #{Aladtec::VERSION}"
13
13
  setting :client_id
14
14
  setting :client_secret
@@ -8,7 +8,7 @@ describe Aladtec do
8
8
  end
9
9
 
10
10
  describe '.configure' do
11
- Aladtec.settings.each do |key|
11
+ Aladtec.settings.keys.each do |key|
12
12
  it "should set the #{key}" do
13
13
  Aladtec.configure do |config|
14
14
  config.public_send("#{key}=", key)
@@ -3,47 +3,48 @@
3
3
  require_relative File.join('..', 'spec_helper')
4
4
 
5
5
  describe Aladtec::Client do
6
- let(:start_time) { Time.now.strftime('%FT%R') }
7
- let(:end_time) { (Time.now + 60 * 60 * 24).strftime('%FT%R') }
6
+ let(:start_time) { Time.now.strftime('%FT%T%:z') }
7
+ let(:end_time) { (Time.now + 60 * 60 * 24).strftime('%FT%T%:z') }
8
8
  let(:client_id) { 'foo' }
9
9
  let(:client_secret) { 'bar' }
10
+ let(:endpoint) { subject.config.endpoint }
10
11
 
11
12
  before(:each) do
12
13
  subject.configure do |config|
13
14
  config.client_id = client_id
14
15
  config.client_secret = client_secret
15
16
  end
16
- stub_request(:post, 'https://secure.aladtec.com/example/api/oauth/token')
17
- .to_return(body: { token: 'baz', expires: (Time.now + 3600).to_i }.to_json,
17
+ stub_request(:post, URI.join(endpoint, 'oauth/token'))
18
+ .to_return(body: { "access_token": "<string>", "token_type": "Bearer", "expires_in": 3600, "scope": "<string>" }.to_json,
18
19
  headers: { 'Content-Type': 'application/json' })
19
20
  end
20
21
 
21
22
  describe '#members' do
22
23
  let(:members) { subject.members }
23
24
  before(:each) do
24
- stub_request(:get, 'https://secure.aladtec.com/example/api/members')
25
- .with(query: { include_attributes: true })
25
+ stub_request(:get, URI.join(endpoint, 'members'))
26
+ .with(query: { offset: 0, limit: 50 })
26
27
  .to_return(body: fixture('members.json'),
27
28
  headers: { 'Content-Type': 'application/json' })
28
29
  end
29
30
  it 'returns a list of members' do
30
- expect(members.length).to eq(2)
31
+ expect(members.length).to eq(1)
31
32
  end
32
33
 
33
34
  let(:ed) { members.first }
34
35
  it 'returns members with names' do
35
- expect(ed.name).to eq('Ed Mercer')
36
+ expect(ed.name).to eq('John Smith')
36
37
  end
37
38
  it 'returns members with ids' do
38
- expect(ed.id).to eq(42)
39
+ expect(ed.id).to eq(3)
39
40
  end
40
41
  end
41
42
 
42
43
  describe '#events' do
43
44
  let(:events) { subject.events(begin_time: start_time, end_time: end_time) }
44
45
  before(:each) do
45
- stub_request(:get, 'https://secure.aladtec.com/example/api/events')
46
- .with(query: { range_start: start_time, range_stop: end_time })
46
+ stub_request(:get, URI.join(endpoint, 'events'))
47
+ .with(query: { range_start_datetime: start_time, range_stop_datetime: end_time })
47
48
  .to_return(body: fixture('events.json'),
48
49
  headers: { 'Content-Type': 'application/json' })
49
50
  end
@@ -57,7 +58,7 @@ describe Aladtec::Client do
57
58
  end
58
59
 
59
60
  it 'returns events with a description' do
60
- expect(event.description).to eq('open to the community')
61
+ expect(event.description).to eq('Open to the community')
61
62
  end
62
63
 
63
64
  it 'returns events with location' do
@@ -65,18 +66,18 @@ describe Aladtec::Client do
65
66
  end
66
67
 
67
68
  it 'returns events with begin date' do
68
- expect(event.starts_at).to eq(Time.parse('2018-01-16T09:00'))
69
+ expect(event.starts_at).to eq(Time.parse('2018-01-16T09:00-05:00'))
69
70
  end
70
71
 
71
72
  it 'returns events with end date' do
72
- expect(event.ends_at).to eq(Time.parse('2018-01-16T11:00'))
73
+ expect(event.ends_at).to eq(Time.parse('2018-01-16T11:00-05:00'))
73
74
  end
74
75
  end
75
76
 
76
77
  describe '#schedules' do
77
78
  let(:schedules) { subject.schedules }
78
79
  before(:each) do
79
- stub_request(:get, 'https://secure.aladtec.com/example/api/schedules')
80
+ stub_request(:get, URI.join(endpoint, 'schedules'))
80
81
  .to_return(body: fixture('schedules.json'),
81
82
  headers: { 'Content-Type': 'application/json' })
82
83
  end
@@ -97,7 +98,7 @@ describe Aladtec::Client do
97
98
  describe '#scheduled_now' do
98
99
  let(:schedules) { subject.scheduled_now }
99
100
  before(:each) do
100
- stub_request(:get, 'https://secure.aladtec.com/example/api/scheduled-time/members-scheduled-now')
101
+ stub_request(:get, URI.join(endpoint, 'scheduled-time/members-scheduled-now'))
101
102
  .to_return(body: fixture('scheduled_time_now.json'),
102
103
  headers: { 'Content-Type': 'application/json' })
103
104
  end
@@ -121,8 +122,8 @@ describe Aladtec::Client do
121
122
  end_time: end_time)
122
123
  end
123
124
  before(:each) do
124
- stub_request(:get, 'https://secure.aladtec.com/example/api/scheduled-time')
125
- .with(query: { range_start: start_time, range_stop: end_time })
125
+ stub_request(:get, URI.join(endpoint, 'scheduled-time'))
126
+ .with(query: { range_start_datetime: start_time, range_stop_datetime: end_time })
126
127
  .to_return(body: fixture('scheduled_time.json'),
127
128
  headers: { 'Content-Type': 'application/json' })
128
129
  end
@@ -152,7 +153,7 @@ describe Aladtec::Client do
152
153
  end
153
154
  end
154
155
 
155
- let(:valid_keys) { Aladtec.settings }
156
+ let(:valid_keys) { Aladtec.settings.keys }
156
157
  context 'with module configuration' do
157
158
  before(:each) do
158
159
  Aladtec.configure do |config|
@@ -1,55 +1,57 @@
1
1
  {
2
- "2018-01-16": [
2
+ "data": [
3
3
  {
4
- "event_id": 22,
5
- "title": "EMS Monthly Meeting",
6
- "description": "open to the community",
7
- "location": "EMS Station",
8
- "start_datetime": "2018-01-16T09:00",
9
- "stop_datetime": "2018-01-16T11:00",
10
- "start_timestamp": "1547629200",
11
- "stop_timestamp": "1547636400",
12
- "extends_before": true,
13
- "extends_after": false,
14
- "schedules": [
15
- 1,
16
- 2
17
- ],
18
- "public": true
4
+ "daily_split_date": "2018-01-16",
5
+ "event_records": [
6
+ {
7
+ "event_id": 22,
8
+ "title": "EMS Monthly Meeting",
9
+ "description": "Open to the community",
10
+ "location": "EMS Station",
11
+ "start_datetime": "2018-01-16T09:00:00-05:00",
12
+ "stop_datetime": "2018-01-16T11:00:00-05:00",
13
+ "extends_before": true,
14
+ "extends_after": false,
15
+ "schedules": [
16
+ 1,
17
+ 2
18
+ ]
19
+ },
20
+ {
21
+ "event_id": 43,
22
+ "title": "Game Night",
23
+ "description": "Bring some games and have some fun!",
24
+ "location": "Event Hall",
25
+ "start_datetime": "2018-01-16T22:00:00-05:00",
26
+ "stop_datetime": "2018-01-16T00:00:00-05:00",
27
+ "extends_before": false,
28
+ "extends_after": false,
29
+ "schedules": [
30
+ 2
31
+ ]
32
+ }
33
+ ]
19
34
  },
20
35
  {
21
- "event_id": 43,
22
- "title": "Game Night",
23
- "description": "Bring some games and have some fun!",
24
- "location": "Event Hall",
25
- "start_datetime": "2018-01-16T22:00",
26
- "stop_datetime": "2018-01-16T00:00",
27
- "start_timestamp": "1526526000",
28
- "stop_timestamp": "1526533200",
29
- "extends_before": false,
30
- "extends_after": false,
31
- "schedules": [
32
- 2
33
- ],
34
- "public": false
36
+ "daily_split_date": "2018-01-17",
37
+ "event_records": [
38
+ {
39
+ "event_id": 43,
40
+ "title": "EMS Coverage for Football Game",
41
+ "description": "High School Football Game",
42
+ "location": "Ramer Field",
43
+ "start_datetime": "2018-01-17T18:00:00-05:00",
44
+ "stop_datetime": "2018-01-17T04:00:00-05:00",
45
+ "extends_before": false,
46
+ "extends_after": true,
47
+ "schedules": [
48
+ 2
49
+ ]
50
+ }
51
+ ]
35
52
  }
36
53
  ],
37
- "2018-01-17": [
38
- {
39
- "event_id": 43,
40
- "title": "EMS Coverage for Football Game",
41
- "description": "High School Football Game",
42
- "location": "Ramer Field",
43
- "start_datetime": "2018-01-17T18:00",
44
- "stop_datetime": "2018-01-17T04:00",
45
- "start_timestamp": "1547748000",
46
- "stop_timestamp": "1547758800",
47
- "extends_before": false,
48
- "extends_after": true,
49
- "schedules": [
50
- 2
51
- ],
52
- "public": false
53
- }
54
- ]
54
+ "meta": {
55
+ "generated_at_datetime": "2022-01-01T07:42:33-06:00"
56
+ }
55
57
  }
@@ -1,39 +1,43 @@
1
- [
2
- {
3
- "member_id": 42,
4
- "is_active": true,
5
- "name": "Ed Mercer",
6
- "attributes": [
7
- {
8
- "attribute_id": 1,
9
- "value": "Ed"
10
- },
11
- {
12
- "attribute_id": 3,
13
- "value": "Mercer"
14
- },
15
- {
16
- "attribute_id": 19,
17
- "value": [
18
- "Morning",
19
- "Evening"
20
- ]
21
- }
22
- ]
23
- },
24
- {
25
- "member_id": 2,
26
- "is_active": false,
27
- "name": "Joyner Lucas",
28
- "attributes": [
29
- {
30
- "attribute_id": 1,
31
- "value": "Joyner"
32
- },
33
- {
34
- "attribute_id": 3,
35
- "value": "Lucas"
36
- }
37
- ]
1
+ {
2
+ "data": [
3
+ {
4
+ "member_id": 3,
5
+ "is_active": true,
6
+ "first_name": "John",
7
+ "last_name": "Smith",
8
+ "login": "johnsmith",
9
+ "primary_email": "jsmith@company.com",
10
+ "secondary_emails": [
11
+ "jsmith@example.com"
12
+ ],
13
+ "employee_type_id": 7,
14
+ "work_group_id": 5,
15
+ "date_hired": "2019-01-01",
16
+ "schedule_ids": [
17
+ 1,
18
+ 2
19
+ ],
20
+ "position_qualification_ids": [
21
+ 1,
22
+ 2,
23
+ 3
24
+ ],
25
+ "custom_attributes": [
26
+ {
27
+ "attribute_id": 11,
28
+ "value": ""
29
+ },
30
+ {
31
+ "attribute_id": 10,
32
+ "value": [
33
+ 2,
34
+ 3
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ ],
40
+ "meta": {
41
+ "generated_at_datetime": "2022-01-01T07:42:33-06:00"
38
42
  }
39
- ]
43
+ }
@@ -1,54 +1,65 @@
1
1
  {
2
- "2018-05-18" : [
2
+ "data": [
3
3
  {
4
- "member_id" : 3,
5
- "schedule_id" : 16,
6
- "position_id" : 50,
7
- "time_type": "Regular",
8
- "start_datetime" : "2018-05-18T07:00",
9
- "start_timestamp" : 1526644800,
10
- "stop_datetime" : "2018-05-19T07:00",
11
- "stop_timestamp" : 1526731200,
12
- "extends_before": true,
13
- "extends_after": false
4
+ "daily_split_date": "2018-05-18",
5
+ "time_records": [
6
+ {
7
+ "member_id": 3,
8
+ "schedule_id": 16,
9
+ "position_id": 50,
10
+ "position_qualification_id": 1,
11
+ "time_type_id": 1,
12
+ "time_type": "Regular",
13
+ "start_datetime": "2018-05-18T07:00:00-05:00",
14
+ "stop_datetime": "2018-05-19T07:00:00-05:00",
15
+ "extends_before": true,
16
+ "extends_after": false
17
+ },
18
+ {
19
+ "member_id": 53,
20
+ "schedule_id": 16,
21
+ "position_id": 51,
22
+ "position_qualification_id": 1,
23
+ "time_type_id": 1,
24
+ "time_type": "Regular",
25
+ "start_datetime": "2018-05-18T07:00:00-05:00",
26
+ "stop_datetime": "2018-05-19T07:00:00-05:00",
27
+ "extends_before": false,
28
+ "extends_after": false
29
+ }
30
+ ]
14
31
  },
15
32
  {
16
- "member_id" : 53,
17
- "schedule_id" : 16,
18
- "position_id" : 51,
19
- "time_type": "Regular",
20
- "start_datetime" : "2018-05-18T07:00",
21
- "start_timestamp" : 1526644800,
22
- "stop_datetime" : "2018-05-19T07:00",
23
- "stop_timestamp" : 1526731200,
24
- "extends_before": false,
25
- "extends_after": false
33
+ "daily_split_date": "2018-05-19",
34
+ "time_records": [
35
+ {
36
+ "member_id": 52,
37
+ "schedule_id": 16,
38
+ "position_id": 50,
39
+ "position_qualification_id": 1,
40
+ "time_type_id": 1,
41
+ "time_type": "Regular",
42
+ "start_datetime": "2018-05-19T09:00:00-05:00",
43
+ "stop_datetime": "2018-05-19T17:00:00-05:00",
44
+ "extends_before": false,
45
+ "extends_after": true
46
+ },
47
+ {
48
+ "member_id": 96,
49
+ "schedule_id": 16,
50
+ "position_id": 53,
51
+ "position_qualification_id": 1,
52
+ "time_type_id": 1,
53
+ "time_type": "Regular",
54
+ "start_datetime": "2018-05-19T09:00:00-05:00",
55
+ "stop_datetime": "2018-05-19T17:00:00-05:00",
56
+ "extends_before": false,
57
+ "extends_after": false
58
+ }
59
+ ]
26
60
  }
27
61
  ],
28
- "2018-05-19" : [
29
- {
30
- "member_id" : 52,
31
- "schedule_id" : 16,
32
- "position_id" : 50,
33
- "time_type": "Regular",
34
- "start_datetime" : "2018-05-19T09:00",
35
- "start_timestamp" : 1526738400,
36
- "stop_datetime" : "2018-05-19T17:00",
37
- "stop_timestamp" : 1526767200,
38
- "extends_before": false,
39
- "extends_after": false
40
- },
41
- {
42
- "member_id" : 96,
43
- "schedule_id" : 16,
44
- "position_id" : 53,
45
- "time_type": "Regular",
46
- "start_datetime" : "2018-05-19T09:00",
47
- "start_timestamp" : 1526738400,
48
- "stop_datetime" : "2018-05-19T17:00",
49
- "stop_timestamp" : 1526767200,
50
- "extends_before": false,
51
- "extends_after": false
52
- }
53
- ]
62
+ "meta": {
63
+ "generated_at_datetime": "2022-01-01T07:42:33-06:00"
64
+ }
54
65
  }
@@ -1,24 +1,29 @@
1
- [
2
- {
3
- "schedule_id": 1,
4
- "positions": [
5
- {
6
- "position_id": 1,
7
- "member_id": 42
8
- }
9
- ]
10
- },
11
- {
12
- "schedule_id": 2,
13
- "positions": [
14
- {
15
- "position_id": 3,
16
- "member_id": 27
17
- },
18
- {
19
- "position_id": 4,
20
- "member_id": 22
21
- }
22
- ]
1
+ {
2
+ "data": [
3
+ {
4
+ "schedule_id": 1,
5
+ "positions": [
6
+ {
7
+ "position_id": 1,
8
+ "member_id": 42
9
+ }
10
+ ]
11
+ },
12
+ {
13
+ "schedule_id": 2,
14
+ "positions": [
15
+ {
16
+ "position_id": 3,
17
+ "member_id": 27
18
+ },
19
+ {
20
+ "position_id": 4,
21
+ "member_id": 22
22
+ }
23
+ ]
24
+ }
25
+ ],
26
+ "meta": {
27
+ "generated_at_datetime": "2022-01-01T07:42:33-06:00"
23
28
  }
24
- ]
29
+ }
@@ -1,32 +1,47 @@
1
- [
2
- {
3
- "schedule_id": 1,
4
- "name": "Ambulance 1",
5
- "is_archived": false,
6
- "positions": [
7
- {
8
- "position_id": 1,
9
- "label": "Driver"
10
- },
11
- {
12
- "position_id": 2,
13
- "label": "Firefighter"
14
- }
15
- ]
16
- },
17
- {
18
- "schedule_id": 2,
19
- "name": "Fire Crew 1",
20
- "is_archived": false,
21
- "positions": [
22
- {
23
- "position_id": 3,
24
- "label": "Slot 1"
25
- },
26
- {
27
- "position_id": 4,
28
- "label": "Slot 2"
29
- }
30
- ]
1
+ {
2
+ "data": [
3
+ {
4
+ "schedule_id": 1,
5
+ "name": "Ambulance 1",
6
+ "is_archived": false,
7
+ "order": "1,",
8
+ "positions": [
9
+ {
10
+ "position_id": 1,
11
+ "position_qualification_id": 1,
12
+ "label": "Driver",
13
+ "order": 1
14
+ },
15
+ {
16
+ "position_id": 2,
17
+ "position_qualification_id": 3,
18
+ "label": "EMT",
19
+ "order": 2
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "schedule_id": 2,
25
+ "name": "Fire Crew 1",
26
+ "is_archived": false,
27
+ "order": 2,
28
+ "positions": [
29
+ {
30
+ "position_id": 3,
31
+ "position_qualification_id": 2,
32
+ "label": "Firefighter",
33
+ "order": 1
34
+ },
35
+ {
36
+ "position_id": 4,
37
+ "position_qualification_id": 2,
38
+ "label": "Firefighter",
39
+ "order": 2
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "meta": {
45
+ "generated_at_datetime": "2022-01-01T07:42:33-06:00"
31
46
  }
32
- ]
47
+ }
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aladtec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 1.0.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Dahlke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-06 00:00:00.000000000 Z
11
+ date: 2024-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -84,22 +84,16 @@ dependencies:
84
84
  name: dry-configurable
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.11'
90
87
  - - ">="
91
88
  - !ruby/object:Gem::Version
92
- version: 0.11.4
89
+ version: 1.0.0
93
90
  type: :runtime
94
91
  prerelease: false
95
92
  version_requirements: !ruby/object:Gem::Requirement
96
93
  requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: '0.11'
100
94
  - - ">="
101
95
  - !ruby/object:Gem::Version
102
- version: 0.11.4
96
+ version: 1.0.0
103
97
  - !ruby/object:Gem::Dependency
104
98
  name: dry-initializer
105
99
  requirement: !ruby/object:Gem::Requirement
@@ -181,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
175
  - !ruby/object:Gem::Version
182
176
  version: '0'
183
177
  requirements: []
184
- rubygems_version: 3.3.14
178
+ rubygems_version: 3.5.3
185
179
  signing_key:
186
180
  specification_version: 4
187
181
  summary: Client library for the Aladtec API