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 +4 -4
- data/aladtec.gemspec +2 -2
- data/lib/aladtec/client.rb +64 -18
- data/lib/aladtec/member.rb +7 -2
- data/lib/aladtec/version.rb +1 -1
- data/lib/aladtec.rb +1 -1
- data/spec/aladtec/aladtec_spec.rb +1 -1
- data/spec/aladtec/client_spec.rb +20 -19
- data/spec/fixtures/events.json +50 -48
- data/spec/fixtures/members.json +42 -38
- data/spec/fixtures/scheduled_time.json +58 -47
- data/spec/fixtures/scheduled_time_now.json +28 -23
- data/spec/fixtures/schedules.json +46 -31
- metadata +9 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bb6e0cb78ea7cc6446e1a62611ff179318d2ee0de1e94cbc1d29be51b3390d8
|
4
|
+
data.tar.gz: 719e483534d65051256f493bad7eb74632b735de7e2bb4985848ba1963fedc3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
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', '
|
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
|
data/lib/aladtec/client.rb
CHANGED
@@ -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.
|
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('
|
34
|
-
@auth_expiration = Time.
|
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',
|
51
|
-
|
52
|
-
events.
|
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
|
-
|
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',
|
88
|
-
|
89
|
-
scheduled_time.
|
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%
|
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
|
data/lib/aladtec/member.rb
CHANGED
@@ -8,9 +8,10 @@ module Aladtec
|
|
8
8
|
extend Dry::Initializer
|
9
9
|
|
10
10
|
option :member_id, as: :id
|
11
|
-
option :
|
11
|
+
option :first_name
|
12
|
+
option :last_name
|
12
13
|
option :is_active
|
13
|
-
option :
|
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
|
data/lib/aladtec/version.rb
CHANGED
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
|
data/spec/aladtec/client_spec.rb
CHANGED
@@ -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%
|
7
|
-
let(:end_time) { (Time.now + 60 * 60 * 24).strftime('%FT%
|
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, '
|
17
|
-
.to_return(body: {
|
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, '
|
25
|
-
.with(query: {
|
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(
|
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('
|
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(
|
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, '
|
46
|
-
.with(query: {
|
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('
|
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, '
|
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, '
|
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, '
|
125
|
-
.with(query: {
|
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|
|
data/spec/fixtures/events.json
CHANGED
@@ -1,55 +1,57 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"data": [
|
3
3
|
{
|
4
|
-
"
|
5
|
-
"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
"
|
22
|
-
"
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
-
"
|
38
|
-
|
39
|
-
|
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
|
}
|
data/spec/fixtures/members.json
CHANGED
@@ -1,39 +1,43 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
"
|
2
|
+
"data": [
|
3
3
|
{
|
4
|
-
"
|
5
|
-
"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
-
"
|
17
|
-
"
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
"
|
29
|
-
|
30
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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.
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
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
|
178
|
+
rubygems_version: 3.5.3
|
185
179
|
signing_key:
|
186
180
|
specification_version: 4
|
187
181
|
summary: Client library for the Aladtec API
|