sirportly 1.1.4 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
data/lib/sirportly.rb
CHANGED
@@ -14,8 +14,10 @@ require 'sirportly/data_objects/customer'
|
|
14
14
|
require 'sirportly/data_objects/customer_contact_method'
|
15
15
|
require 'sirportly/data_objects/department'
|
16
16
|
require 'sirportly/data_objects/escalation_path'
|
17
|
-
require 'sirportly/data_objects/priority'
|
18
17
|
require 'sirportly/data_objects/filter'
|
18
|
+
require 'sirportly/data_objects/knowledge_base'
|
19
|
+
require 'sirportly/data_objects/page'
|
20
|
+
require 'sirportly/data_objects/priority'
|
19
21
|
require 'sirportly/data_objects/sla'
|
20
22
|
require 'sirportly/data_objects/status'
|
21
23
|
require 'sirportly/data_objects/team'
|
@@ -24,7 +26,7 @@ require 'sirportly/data_objects/ticket_update'
|
|
24
26
|
require 'sirportly/data_objects/user'
|
25
27
|
|
26
28
|
module Sirportly
|
27
|
-
VERSION = '1.1.
|
29
|
+
VERSION = '1.1.7'
|
28
30
|
|
29
31
|
class << self
|
30
32
|
|
data/lib/sirportly/client.rb
CHANGED
@@ -47,6 +47,16 @@ module Sirportly
|
|
47
47
|
Filter.all(self)
|
48
48
|
end
|
49
49
|
|
50
|
+
## Return all knowledge bases
|
51
|
+
def knowledge_bases
|
52
|
+
KnowledgeBase.all(self)
|
53
|
+
end
|
54
|
+
|
55
|
+
## Return a specific knowledge base
|
56
|
+
def knowledge_base(q)
|
57
|
+
KnowledgeBase.find(self, q)
|
58
|
+
end
|
59
|
+
|
50
60
|
## Return all priorities
|
51
61
|
def priorities
|
52
62
|
Priority.all(self)
|
@@ -97,5 +107,10 @@ module Sirportly
|
|
97
107
|
User.find(self, q)
|
98
108
|
end
|
99
109
|
|
110
|
+
## Create a user
|
111
|
+
def create_user(params = {})
|
112
|
+
User.create(self, params)
|
113
|
+
end
|
114
|
+
|
100
115
|
end
|
101
116
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Sirportly
|
2
|
+
class KnowledgeBase < DataObject
|
3
|
+
self.collection_path = 'knowledge/list'
|
4
|
+
self.member = {:path => 'knowledge/tree', :param => :kb}
|
5
|
+
self.maps = {'children' => 'Page'}
|
6
|
+
|
7
|
+
## Workaround for a Sirportly bug
|
8
|
+
## Currently SP wraps the result in an array
|
9
|
+
def self.find(client, query)
|
10
|
+
raise Sirportly::Error, "This object does not support finding objects" unless member.is_a?(Hash)
|
11
|
+
result = client.request(member[:path], {member[:param] => query})
|
12
|
+
## Notice .first here
|
13
|
+
self.new(client, result.first)
|
14
|
+
end
|
15
|
+
|
16
|
+
def pages
|
17
|
+
self.children
|
18
|
+
end
|
19
|
+
|
20
|
+
## Creates a new page associated with this knowledge base
|
21
|
+
## Returns a Page object
|
22
|
+
def create_page(params = {})
|
23
|
+
params.merge!({:kb => self.attributes['id']})
|
24
|
+
if req = @client.request('knowledge/add_page', params)
|
25
|
+
Page.new @client, req
|
26
|
+
else
|
27
|
+
false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -3,5 +3,14 @@ module Sirportly
|
|
3
3
|
self.collection_path = 'users/all'
|
4
4
|
self.member = {:path => 'users/info', :param => 'user'}
|
5
5
|
self.maps = {'teams' => 'Team'}
|
6
|
+
|
7
|
+
# Creates a new user and returns a user object
|
8
|
+
def self.create(client, params = {})
|
9
|
+
if req = client.request('users/create', params)
|
10
|
+
self.new(client, req)
|
11
|
+
else
|
12
|
+
false
|
13
|
+
end
|
14
|
+
end
|
6
15
|
end
|
7
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sirportly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,9 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-14 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: A Ruby library for interacting with the Sirportly API.
|
15
15
|
email: adam@atechmedia.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
@@ -26,6 +26,8 @@ files:
|
|
26
26
|
- lib/sirportly/data_objects/department.rb
|
27
27
|
- lib/sirportly/data_objects/escalation_path.rb
|
28
28
|
- lib/sirportly/data_objects/filter.rb
|
29
|
+
- lib/sirportly/data_objects/knowledge_base.rb
|
30
|
+
- lib/sirportly/data_objects/page.rb
|
29
31
|
- lib/sirportly/data_objects/priority.rb
|
30
32
|
- lib/sirportly/data_objects/sla.rb
|
31
33
|
- lib/sirportly/data_objects/status.rb
|
@@ -59,5 +61,5 @@ rubyforge_project:
|
|
59
61
|
rubygems_version: 1.8.10
|
60
62
|
signing_key:
|
61
63
|
specification_version: 3
|
62
|
-
summary: Easy to use client library for Sirportly
|
64
|
+
summary: Easy to use client library for Sirportly.
|
63
65
|
test_files: []
|