Module: Zanshin::SDK::Organizations
- Included in:
- Client
- Defined in:
- lib/zanshin/organizations.rb
Overview
Zanshin SDK Organization
Instance Method Summary collapse
-
#get_organization(organization_id) ⇒ Object
Gets an organization given its ID [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationById).
-
#iter_organizations ⇒ Object
Organizations Enumerator of current logged user [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizations).
-
#update_organization(organization_id, name: nil, picture: nil, email: nil) ⇒ Object
Gets an organization given its ID [#reference](api.zanshin.tenchisecurity.com/#operation/editOrganizationById).
Instance Method Details
#get_organization(organization_id) ⇒ Object
Gets an organization given its ID [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationById)
29 30 31 |
# File 'lib/zanshin/organizations.rb', line 29 def get_organization(organization_id) @http.request('GET', "/organizations/#{validate_uuid(organization_id)}") end |
#iter_organizations ⇒ Object
Organizations Enumerator of current logged user [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizations)
15 16 17 18 19 20 21 |
# File 'lib/zanshin/organizations.rb', line 15 def iter_organizations Enumerator.new do |yielder| @http.request('GET', '/organizations').each do |e| yielder.yield e end end end |
#update_organization(organization_id, name: nil, picture: nil, email: nil) ⇒ Object
Gets an organization given its ID [#reference](api.zanshin.tenchisecurity.com/#operation/editOrganizationById)
42 43 44 45 46 47 48 49 |
# File 'lib/zanshin/organizations.rb', line 42 def update_organization(organization_id, name: nil, picture: nil, email: nil) body = { 'name' => name, 'picture' => picture, 'email' => email } @http.request('PUT', "/organizations/#{validate_uuid(organization_id)}", body) end |