Class: Sirportly::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/sirportly/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#secretObject (readonly)

Returns the value of attribute secret.



4
5
6
# File 'lib/sirportly/client.rb', line 4

def secret
  @secret
end

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/sirportly/client.rb', line 4

def token
  @token
end

Instance Method Details

#brandsObject

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

#departmentsObject

Return all departments



36
37
38
# File 'lib/sirportly/client.rb', line 36

def departments
  Department.all(self)
end

#escalation_pathsObject

Return all escalation paths



41
42
43
# File 'lib/sirportly/client.rb', line 41

def escalation_paths
  EscalationPath.all(self)
end

#filtersObject

Return all filters



46
47
48
# File 'lib/sirportly/client.rb', line 46

def filters
  Filter.all(self)
end

#prioritiesObject

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

#slasObject

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

#statusesObject

Return all statuses



66
67
68
# File 'lib/sirportly/client.rb', line 66

def statuses
  Status.all(self)
end

#teamsObject

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

#ticketsObject

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