icws 0.0.3 → 1.0.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.
data/lib/status/status.rb DELETED
@@ -1,35 +0,0 @@
1
- require '..\lib\status\statusmessage.rb'
2
- require '..\lib\status\userstatus.rb'
3
-
4
- class ICWS
5
- class ICWS::Status
6
-
7
- def initialize(connection)
8
- @client = ICWS::Client.new connection
9
- end
10
-
11
- def all_system_statuses
12
- status_list = @client.get '/status/status-messages'
13
- statuses = []
14
- status_list['statusMessageList'].each {|s| statuses.push ICWS::StatusMessage.new(s)}
15
- return statuses
16
- end
17
-
18
- def allowable_statuses (user_id)
19
- status = @client.get '/status/status-messages-user-access/' + user_id
20
- status['statusMessages']
21
- end
22
-
23
- def get_user_status(user_id)
24
- status = @client.get '/status/user-statuses/' + user_id
25
- ICWS::Status::UserStatus.new(status )
26
- end
27
-
28
- def set_user_status(user_id, status_id)
29
- status_data = {}
30
- status_data[:statusId] = status_id
31
-
32
- @client.put '/status/user-statuses/' + user_id, status_data
33
- end
34
- end
35
- end
@@ -1,41 +0,0 @@
1
- class ICWS
2
- class StatusMessage
3
- attr_reader :status_id
4
- attr_reader :message_text
5
- attr_reader :icon_uri
6
- attr_reader :group_tag
7
- attr_reader :can_have_date
8
- attr_reader :can_have_time
9
- attr_reader :is_do_not_disturb_status
10
- attr_reader :is_selectable_status
11
- attr_reader :is_persistent_status
12
- attr_reader :is_forward_status
13
- attr_reader :is_after_call_work_status
14
- attr_reader :is_acd_status
15
- attr_reader :is_allow_follow_up_status
16
- attr_reader :system_id
17
-
18
- def initialize(property_map)
19
- @status_id = property_map['statusId']
20
- @message_text = property_map['messageText']
21
- @icon_uri = property_map['iconUri']
22
- @group_tag = property_map['groupTag']
23
- @can_have_date = property_map['canHaveDate']
24
- @can_have_time = property_map['canHaveTime']
25
- @is_do_not_disturb_status = property_map['isDoNotDisturbStatus']
26
- @is_selectable_status = property_map['isSelectableStatus']
27
- @is_fersistent_status = property_map['isPersistentStatus']
28
- @is_forward_status = property_map['isForwardStatus']
29
- @is_after_call_work_status = property_map['isAfterCallWorkStatus']
30
- @is_acd_status = property_map['isAcdStatus']
31
- @is_allow_follow_up_status = property_map['isAllowFollowUpStatus']
32
- @system_id = property_map['systemId']
33
- end
34
-
35
- def to_s
36
- status_id + ', ' + message_text + ',' + icon_uri
37
- end
38
- end
39
- end
40
-
41
-
@@ -1,33 +0,0 @@
1
- require 'Date'
2
-
3
- class ICWS
4
- class Status
5
- class UserStatus
6
- attr_reader :user_id
7
- attr_reader :status_id
8
- attr_reader :status_changed #"=>"20130808T211625Z",
9
- attr_reader :notes
10
- attr_reader :ic_servers
11
- attr_reader :stations
12
- attr_reader :logged_in
13
- attr_reader :on_phone
14
- attr_reader :on_phone_changed
15
-
16
- def initialize(property_map)
17
- @status_id = property_map['statusId']
18
- @user_id = property_map['userId']
19
- @notes = property_map['notes']
20
- @ic_servers = property_map['icServers']
21
- @stations = property_map['stations']
22
- @logged_in = property_map['loggedIn']
23
- @on_phone = property_map['onPhone']
24
- @status_changed = DateTime.parse property_map['statusChanged']
25
- @system_id = DateTime.parse property_map['onPhoneChanged']
26
- end
27
-
28
- def to_s
29
- @user_id + ' - ' + @status_id
30
- end
31
- end
32
- end
33
- end