Class: Daino::Clients::Organization
- Inherits:
-
Base
- Object
- Base
- Daino::Clients::Organization
show all
- Defined in:
- lib/daino/clients/organization.rb
Instance Attribute Summary
Attributes inherited from Base
#api_endpoint, #api_key
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create(name:, description:, status: "Active") ⇒ Object
22
23
24
25
|
# File 'lib/daino/clients/organization.rb', line 22
def create(name:, description:, status: "Active")
payload = { name: name, description: description, status: status }
post("/api/organization", payload) { |json| json }
end
|
#delete_by_id(id) ⇒ Object
27
28
29
|
# File 'lib/daino/clients/organization.rb', line 27
def delete_by_id(id)
delete("/api/organization/#{id}") { |res| res }
end
|
#get_by_id(id) ⇒ Object
14
15
16
|
# File 'lib/daino/clients/organization.rb', line 14
def get_by_id(id)
get("/api/organization/#{id}") { |json| json }
end
|
#list ⇒ Object
6
7
8
|
# File 'lib/daino/clients/organization.rb', line 6
def list
get("/api/organization") { |json| json }
end
|
#search(attributes) ⇒ Object
10
11
12
|
# File 'lib/daino/clients/organization.rb', line 10
def search(attributes)
post("/api/organization/_search", query: attributes) { |json| json }
end
|
#users(id) ⇒ Object
18
19
20
|
# File 'lib/daino/clients/organization.rb', line 18
def users(id)
get("/api/organization/#{id}/user") { |json| json }
end
|