Class: Sirportly::Client
- Inherits:
-
Object
- Object
- Sirportly::Client
- Defined in:
- lib/sirportly/client.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#brands ⇒ Object
Return all brands.
-
#create_ticket(params = {}) ⇒ Object
Creates a new ticket.
-
#customer(q) ⇒ Object
Return a specific customer.
-
#customers(opts = {}) ⇒ Object
Return all customers.
-
#departments ⇒ Object
Return all departments.
-
#escalation_paths ⇒ Object
Return all escalation paths.
-
#filters ⇒ Object
Return all filters.
-
#initialize(token, secret) ⇒ Client
constructor
A new instance of Client.
-
#priorities ⇒ Object
Return all priorities.
-
#request(*args) ⇒ Object
Make a request using this client’s authentication token and return the request.
-
#slas ⇒ Object
Return all SLAs.
-
#spql(query) ⇒ Object
Execute an SPQL query and return the SPQLQuery instance.
-
#statuses ⇒ Object
Return all statuses.
-
#teams ⇒ Object
Return all teams.
-
#ticket(q) ⇒ Object
Return a specific ticket.
-
#ticket_search(query, page = 1) ⇒ Object
Return a set of tickets for given search term.
-
#tickets ⇒ Object
Return all tickets.
-
#user(q) ⇒ Object
Return a specific user.
-
#users(opts = {}) ⇒ Object
Return all users.
Constructor Details
#initialize(token, secret) ⇒ Client
Returns a new instance of Client.
6 7 8 |
# File 'lib/sirportly/client.rb', line 6 def initialize(token, secret) @token, @secret = token, secret end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
4 5 6 |
# File 'lib/sirportly/client.rb', line 4 def secret @secret end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/sirportly/client.rb', line 4 def token @token end |
Instance Method Details
#brands ⇒ Object
Return all brands
16 17 18 |
# File 'lib/sirportly/client.rb', line 16 def brands Brand.all(self) end |
#create_ticket(params = {}) ⇒ Object
Creates a new ticket
21 22 23 |
# File 'lib/sirportly/client.rb', line 21 def create_ticket(params = {}) Ticket.create(self, params) end |
#customer(q) ⇒ Object
Return a specific customer
31 32 33 |
# File 'lib/sirportly/client.rb', line 31 def customer(q) Customer.find(self, q) end |
#customers(opts = {}) ⇒ Object
Return all customers
26 27 28 |
# File 'lib/sirportly/client.rb', line 26 def customers(opts = {}) Customer.all(self, opts) end |
#departments ⇒ Object
Return all departments
36 37 38 |
# File 'lib/sirportly/client.rb', line 36 def departments Department.all(self) end |
#escalation_paths ⇒ Object
Return all escalation paths
41 42 43 |
# File 'lib/sirportly/client.rb', line 41 def escalation_paths EscalationPath.all(self) end |
#filters ⇒ Object
Return all filters
46 47 48 |
# File 'lib/sirportly/client.rb', line 46 def filters Filter.all(self) end |
#priorities ⇒ Object
Return all priorities
51 52 53 |
# File 'lib/sirportly/client.rb', line 51 def priorities Priority.all(self) end |
#request(*args) ⇒ Object
Make a request using this client’s authentication token and return the request.
11 12 13 |
# File 'lib/sirportly/client.rb', line 11 def request(*args) Request.request(self, *args) end |
#slas ⇒ Object
Return all SLAs
56 57 58 |
# File 'lib/sirportly/client.rb', line 56 def slas SLA.all(self) end |
#spql(query) ⇒ Object
Execute an SPQL query and return the SPQLQuery instance
61 62 63 |
# File 'lib/sirportly/client.rb', line 61 def spql(query) SPQLQuery.new(self, query) end |
#statuses ⇒ Object
Return all statuses
66 67 68 |
# File 'lib/sirportly/client.rb', line 66 def statuses Status.all(self) end |
#teams ⇒ Object
Return all teams
71 72 73 |
# File 'lib/sirportly/client.rb', line 71 def teams Team.all(self) end |
#ticket(q) ⇒ Object
Return a specific ticket
81 82 83 |
# File 'lib/sirportly/client.rb', line 81 def ticket(q) Ticket.find(self, q) end |
#ticket_search(query, page = 1) ⇒ Object
Return a set of tickets for given search term
86 87 88 |
# File 'lib/sirportly/client.rb', line 86 def ticket_search(query, page = 1) Ticket.search(self, query, page) end |
#tickets ⇒ Object
Return all tickets
76 77 78 |
# File 'lib/sirportly/client.rb', line 76 def tickets Ticket.all(self) end |
#user(q) ⇒ Object
Return a specific user
96 97 98 |
# File 'lib/sirportly/client.rb', line 96 def user(q) User.find(self, q) end |
#users(opts = {}) ⇒ Object
Return all users
91 92 93 |
# File 'lib/sirportly/client.rb', line 91 def users(opts = {}) User.all(self, opts) end |