oksky-chat-api 0.2.2 → 0.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d09d771c9bb88562002a3704303926392bce495
|
4
|
+
data.tar.gz: 2b0da590357b81261c79e27985ada49ead18733a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95fba99e57266cf8f224b9444c209f9eee23434600d9818172d7b5d60769536c38176df579fdb36746dafba1421287ef17baafdcb72cedb9b8982c0c01b86109
|
7
|
+
data.tar.gz: '078733a4506cb901d7b87540fceb8935e77f496c096ce42105c5fd141caf2fff917f8747c47758fad4db1442bb62600296657a02e35924c4a2ddbcbdd2c3d392'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Oksky
|
2
|
+
module Chat
|
3
|
+
module Object
|
4
|
+
class ClientsResource < Base
|
5
|
+
|
6
|
+
def injectable_code
|
7
|
+
content_value("injectable_code")
|
8
|
+
end
|
9
|
+
|
10
|
+
def settings
|
11
|
+
content_value("settings")
|
12
|
+
end
|
13
|
+
|
14
|
+
def title
|
15
|
+
content_value("title")
|
16
|
+
end
|
17
|
+
|
18
|
+
def code
|
19
|
+
content_value("code")
|
20
|
+
end
|
21
|
+
|
22
|
+
def default_embedded_css
|
23
|
+
content_value("default_embedded_css")
|
24
|
+
end
|
25
|
+
|
26
|
+
def default_guest_css
|
27
|
+
content_value("default_guest_css")
|
28
|
+
end
|
29
|
+
|
30
|
+
def default_embedded_html
|
31
|
+
content_value("default_embedded_html")
|
32
|
+
end
|
33
|
+
|
34
|
+
def client
|
35
|
+
if @src.has_key?('attributes')
|
36
|
+
@src['attributes']
|
37
|
+
else
|
38
|
+
@src
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def relationships
|
43
|
+
if exist_relationships?
|
44
|
+
return @src['relationships']
|
45
|
+
else
|
46
|
+
{}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
def exist_attributes?
|
52
|
+
!@src.empty? && @src.has_key?('attributes') && !@src['attributes'].empty?
|
53
|
+
end
|
54
|
+
|
55
|
+
def exist_relationships?
|
56
|
+
!@src.empty? && @src.has_key?('relationships') && !@src['relationships'].empty?
|
57
|
+
end
|
58
|
+
|
59
|
+
def content_value(key)
|
60
|
+
if exist_attributes? && @src['attributes'].has_key?("#{key}") && !@src['attributes']["#{key}"].empty?
|
61
|
+
return @src['attributes']["#{key}"]
|
62
|
+
elsif @src.has_key?("#{key}") && !@src["#{key}"].empty?
|
63
|
+
return @src["#{key}"]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -83,6 +83,38 @@ module Oksky
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
def support_group_id
|
87
|
+
if exist_relationships? && @src['relationships'].has_key?("support_group") && !@src['relationships']["support_group"].empty? && @src['relationships']["support_group"].has_key?("data") && !@src['relationships']["support_group"]["data"].empty? && @src['relationships']["support_group"]["data"].has_key?("id") && !@src['relationships']["support_group"]["data"]["id"].empty?
|
88
|
+
return @src['relationships']["relationships"]["data"]["id"]
|
89
|
+
else
|
90
|
+
return nil
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def create_user_id
|
95
|
+
if exist_relationships? && @src['relationships'].has_key?("create_user") && !@src['relationships']["create_user"].empty? && @src['relationships']["create_user"].has_key?("data") && !@src['relationships']["create_user"]["data"].empty? && @src['relationships']["create_user"]["data"].has_key?("id") && !@src['relationships']["create_user"]["data"]["id"].empty?
|
96
|
+
return @src['relationships']["create_user"]["data"]["id"]
|
97
|
+
else
|
98
|
+
return nil
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def client_id
|
103
|
+
if exist_relationships? && @src['relationships'].has_key?("client") && !@src['relationships']["client"].empty? && @src['relationships']["client"].has_key?("data") && !@src['relationships']["client"]["data"].empty? && @src['relationships']["client"]["data"].has_key?("id") && !@src['relationships']["client"]["data"]["id"].empty?
|
104
|
+
return @src['relationships']["client"]["data"]["id"]
|
105
|
+
else
|
106
|
+
return nil
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def helped_room_id
|
111
|
+
if exist_relationships? && @src['relationships'].has_key?("helped_room") && !@src['relationships']["helped_room"].empty? && @src['relationships']["helped_room"].has_key?("data") && !@src['relationships']["helped_room"]["data"].empty? && @src['relationships']["helped_room"]["data"].has_key?("id") && !@src['relationships']["helped_room"]["data"]["id"].empty?
|
112
|
+
return @src['relationships']["helped_room"]["data"]["id"]
|
113
|
+
else
|
114
|
+
return nil
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
86
118
|
def relationships
|
87
119
|
if exist_relationships?
|
88
120
|
return @src['relationships']
|
@@ -96,6 +128,10 @@ module Oksky
|
|
96
128
|
!@src.empty? && @src.has_key?('attributes') && !@src['attributes'].empty?
|
97
129
|
end
|
98
130
|
|
131
|
+
def exist_relationships?
|
132
|
+
!@src.empty? && @src.has_key?('relationships') && !@src['relationships'].empty?
|
133
|
+
end
|
134
|
+
|
99
135
|
def content_value(key)
|
100
136
|
if exist_attributes? && @src['attributes'].has_key?("#{key}") && !@src['attributes']["#{key}"].empty?
|
101
137
|
return @src['attributes']["#{key}"]
|
data/lib/oksky/chat/object.rb
CHANGED
@@ -3,4 +3,5 @@ require 'oksky/chat/object/messages_resource'
|
|
3
3
|
require 'oksky/chat/object/rooms_resource'
|
4
4
|
require 'oksky/chat/object/supports_resource'
|
5
5
|
require 'oksky/chat/object/unsupport_resource'
|
6
|
-
require 'oksky/chat/object/provider_rooms_resource'
|
6
|
+
require 'oksky/chat/object/provider_rooms_resource'
|
7
|
+
require 'oksky/chat/object/clients_resource'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oksky-chat-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SOLAIRO, INC.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/oksky/chat/httpclient.rb
|
112
112
|
- lib/oksky/chat/object.rb
|
113
113
|
- lib/oksky/chat/object/base.rb
|
114
|
+
- lib/oksky/chat/object/clients_resource.rb
|
114
115
|
- lib/oksky/chat/object/messages_resource.rb
|
115
116
|
- lib/oksky/chat/object/provider_rooms_resource.rb
|
116
117
|
- lib/oksky/chat/object/rooms_resource.rb
|