five9 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +1 -1
- data/lib/five9.rb +1 -0
- data/lib/five9/general_user.rb +84 -0
- data/lib/five9/user_management.rb +3 -3
- data/lib/five9/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWM0MjE5ZTQ1ZTU5YWYzNTc5ZTAxMjIzNDgwNGU5YTMzYmYxMTgwZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2NkZjRhMWU4YzJjOWY4ZTA0MmU2ZDZlZTk2YjUzNDA5YTZkYWQ1Yw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjI2OWZmYjEzOTk0YTlmNDhhM2JkMzcyNTk5ZTdjYjJkZjRjMDljMDc5OWNi
|
10
|
+
OWFhYzQ4MjQzZjFmN2RhNGExYWQ4Njc0N2ZjYmE4ZTI5OGEwYmI4NmM5OTYw
|
11
|
+
YTI2NzMzNjAyOGQ5MTdlYmE1MjJjODk2NGQ5OTUwYzRjNzBjOGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTQ2YjFkZTUxNWZiZGI2ZWY1NTA1NmI2Y2ZlNTk4MWI2MzUyZjc1ZTcxZmYx
|
14
|
+
NzkxM2NlOWNiZmQ4ODMzNmU1NDlmMTllNzRiZWRiZDhiMWVhYzlhZmYzODIz
|
15
|
+
ODVhOWYxZDFkNTAxNDA5NDk0NzhlOWQyZWI1NjQwODA2YmMwNTQ=
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Five9
|
2
2
|
|
3
|
-
This RubyGem is a ruby integration for the five9 API. Currently, it is only partly integrated with the statistics API. The end goal is to have a full integration.
|
3
|
+
This RubyGem is a ruby integration for the five9 API. Currently, it is only partly integrated with the statistics and user management API. The end goal is to have a full integration.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/lib/five9.rb
CHANGED
@@ -0,0 +1,84 @@
|
|
1
|
+
module Five9
|
2
|
+
class GeneralUser
|
3
|
+
def initialize(args)
|
4
|
+
@user_general_info = args.make_accessible
|
5
|
+
end
|
6
|
+
|
7
|
+
def to_h
|
8
|
+
@user_general_info
|
9
|
+
end
|
10
|
+
|
11
|
+
def save!
|
12
|
+
if GeneralUser.exist? user_name
|
13
|
+
UserManagement.modify_user(build_sendable_hash)[:general_info]
|
14
|
+
else
|
15
|
+
UserManagement.create! @user_general_info
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def delete!
|
20
|
+
UserManagement.delete_user user_name
|
21
|
+
@user_general_info
|
22
|
+
end
|
23
|
+
|
24
|
+
def update(args)
|
25
|
+
merge! args
|
26
|
+
end
|
27
|
+
|
28
|
+
def update!(args)
|
29
|
+
update(args)
|
30
|
+
save!
|
31
|
+
end
|
32
|
+
|
33
|
+
def method_missing(method_name, *args)
|
34
|
+
@user_general_info.send(method_name, *args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.all
|
38
|
+
UserManagement.get_users_general_info.map do |user_general_info|
|
39
|
+
new(user_general_info)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.create!(args)
|
44
|
+
new(UserManagement.create_user(build_sendable_hash(args))[:general_info])
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.exist?(username)
|
48
|
+
not find(username).nil?
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.find(username)
|
52
|
+
general_user = new(UserManagement.get_users_general_info(username))
|
53
|
+
if general_user[:user_name]
|
54
|
+
general_user
|
55
|
+
else
|
56
|
+
nil
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.where(args)
|
61
|
+
all.keep_if do |general_user|
|
62
|
+
general_user.merge(args).to_hash == general_user.to_hash
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
def build_sendable_hash
|
68
|
+
result = {}
|
69
|
+
result[:userGeneralInfo] = @user_general_info
|
70
|
+
result[:userGeneralInfo]["EMail"] =
|
71
|
+
@user_general_info[:e_mail] || @user_general_info["EMail"]
|
72
|
+
result
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.build_sendable_hash(user_general_info)
|
76
|
+
result = {}
|
77
|
+
user_general_info["EMail"] ||= user_general_info[:e_mail]
|
78
|
+
user_general_info[:can_change_password] = true
|
79
|
+
result[:generalInfo] = user_general_info
|
80
|
+
result[:roles] = {agent: {}}
|
81
|
+
result
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/lib/five9/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: five9
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Hahn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/five9/acd_status.rb
|
57
57
|
- lib/five9/agent_stats.rb
|
58
58
|
- lib/five9/base.rb
|
59
|
+
- lib/five9/general_user.rb
|
59
60
|
- lib/five9/inbound_campaign_stats.rb
|
60
61
|
- lib/five9/statistics.rb
|
61
62
|
- lib/five9/user.rb
|