Class: Pike13::API::V2::Desk::Person
- Defined in:
- lib/pike13/api/v2/desk/person.rb
Class Method Summary collapse
-
.all(**params) ⇒ Object
GET /desk/people.
-
.create(attributes) ⇒ Object
POST /desk/people.
-
.destroy(id) ⇒ Object
DELETE /desk/people/:id.
-
.find(id) ⇒ Object
GET /desk/people/:id.
-
.me ⇒ Object
GET /desk/people/me.
-
.search(query, fields: nil) ⇒ Object
GET /desk/people/search?q=query&fields=fields.
-
.update(id, attributes) ⇒ Object
PUT /desk/people/:id.
Methods inherited from Base
Class Method Details
.all(**params) ⇒ Object
GET /desk/people
10 11 12 |
# File 'lib/pike13/api/v2/desk/person.rb', line 10 def all(**params) client.get("desk/people", params) end |
.create(attributes) ⇒ Object
POST /desk/people
32 33 34 |
# File 'lib/pike13/api/v2/desk/person.rb', line 32 def create(attributes) client.post("desk/people", { person: attributes }) end |
.destroy(id) ⇒ Object
DELETE /desk/people/:id
42 43 44 |
# File 'lib/pike13/api/v2/desk/person.rb', line 42 def destroy(id) client.delete("desk/people/#{id}") end |
.find(id) ⇒ Object
GET /desk/people/:id
15 16 17 |
# File 'lib/pike13/api/v2/desk/person.rb', line 15 def find(id) client.get("desk/people/#{id}") end |
.me ⇒ Object
GET /desk/people/me
20 21 22 |
# File 'lib/pike13/api/v2/desk/person.rb', line 20 def me find(:me) end |
.search(query, fields: nil) ⇒ Object
GET /desk/people/search?q=query&fields=fields
25 26 27 28 29 |
# File 'lib/pike13/api/v2/desk/person.rb', line 25 def search(query, fields: nil) params = { q: query } params[:fields] = fields if fields client.get("desk/people/search", params) end |
.update(id, attributes) ⇒ Object
PUT /desk/people/:id
37 38 39 |
# File 'lib/pike13/api/v2/desk/person.rb', line 37 def update(id, attributes) client.put("desk/people/#{id}", { person: attributes }) end |