Module: Zanshin::SDK::OrganizationMembers
- Included in:
- Client
- Defined in:
- lib/zanshin/organization_members.rb
Overview
Zanshin SDK Organization Members
Instance Method Summary collapse
-
#create_organization_members_invite(organization_id, email, roles = nil) ⇒ Object
Create organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/createOrgamizationInvite).
-
#delete_organization_member(organization_id, member_id) ⇒ Object
Delete organization member [#reference](api.zanshin.tenchisecurity.com/#operation/removeOrganizationMemberById).
-
#delete_organization_member_invite(organization_id, email) ⇒ Object
Delete organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/deleteOrganizationInviteByEmail).
-
#get_organization_member(organization_id, member_id) ⇒ Object
Get details on a user’s organization membership [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationMemberById).
-
#get_organization_member_invite(organization_id, email) ⇒ Object
Get organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationInviteByEmail).
-
#iter_organization_members(organization_id) ⇒ Object
Organization Members Enumerator of the users which are members of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationMembers).
-
#iter_organization_members_invites(organization_id) ⇒ Object
Organization Members Invites Enumerator of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrgamizationInvites).
-
#resend_organization_member_invite(organization_id, email) ⇒ Object
Resend organization member invitation [#reference](api.zanshin.tenchisecurity.com/#operation/resendOrganizationInviteByEmail).
-
#reset_organization_member_mfa(organization_id, member_id) ⇒ Object
Reset organization member MFA [#reference](api.zanshin.tenchisecurity.com/#operation/resetOrganizationMemberMfaById).
-
#reset_organization_member_password(organization_id, member_id) ⇒ Object
Reset organization member Password [#reference](api.zanshin.tenchisecurity.com/#operation/resetOrganizationMemberPasswordById).
-
#update_organization_member(organization_id, member_id, roles = nil) ⇒ Object
Update organization member [#reference](api.zanshin.tenchisecurity.com/#operation/editOrganizationMembersById).
Instance Method Details
#create_organization_members_invite(organization_id, email, roles = nil) ⇒ Object
Create organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/createOrgamizationInvite)
120 121 122 123 124 125 126 127 128 |
# File 'lib/zanshin/organization_members.rb', line 120 def create_organization_members_invite(organization_id, email, roles = nil) body = { 'email' => email, 'roles' => [roles].compact } @http.request('POST', "/organizations/#{validate_uuid(organization_id)}/invites", body) end |
#delete_organization_member(organization_id, member_id) ⇒ Object
Delete organization member [#reference](api.zanshin.tenchisecurity.com/#operation/removeOrganizationMemberById)
61 62 63 64 |
# File 'lib/zanshin/organization_members.rb', line 61 def delete_organization_member(organization_id, member_id) @http.request('DELETE', "/organizations/#{validate_uuid(organization_id)}/members/#{validate_uuid(member_id)}") end |
#delete_organization_member_invite(organization_id, email) ⇒ Object
Delete organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/deleteOrganizationInviteByEmail)
149 150 151 152 |
# File 'lib/zanshin/organization_members.rb', line 149 def delete_organization_member_invite(organization_id, email) @http.request('DELETE', "/organizations/#{validate_uuid(organization_id)}/invites/#{email}") end |
#get_organization_member(organization_id, member_id) ⇒ Object
Get details on a user’s organization membership [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationMemberById)
32 33 34 35 |
# File 'lib/zanshin/organization_members.rb', line 32 def get_organization_member(organization_id, member_id) @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/members/#{validate_uuid(member_id)}") end |
#get_organization_member_invite(organization_id, email) ⇒ Object
Get organization member invite [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationInviteByEmail)
137 138 139 140 |
# File 'lib/zanshin/organization_members.rb', line 137 def get_organization_member_invite(organization_id, email) @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/invites/#{email}") end |
#iter_organization_members(organization_id) ⇒ Object
Organization Members Enumerator of the users which are members of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrganizationMembers)
17 18 19 20 21 22 23 |
# File 'lib/zanshin/organization_members.rb', line 17 def iter_organization_members(organization_id) Enumerator.new do |yielder| @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/members").each do |e| yielder.yield e end end end |
#iter_organization_members_invites(organization_id) ⇒ Object
Organization Members Invites Enumerator of an organization [#reference](api.zanshin.tenchisecurity.com/#operation/getOrgamizationInvites)
104 105 106 107 108 109 110 |
# File 'lib/zanshin/organization_members.rb', line 104 def iter_organization_members_invites(organization_id) Enumerator.new do |yielder| @http.request('GET', "/organizations/#{validate_uuid(organization_id)}/invites").each do |e| yielder.yield e end end end |
#resend_organization_member_invite(organization_id, email) ⇒ Object
Resend organization member invitation [#reference](api.zanshin.tenchisecurity.com/#operation/resendOrganizationInviteByEmail)
161 162 163 164 |
# File 'lib/zanshin/organization_members.rb', line 161 def resend_organization_member_invite(organization_id, email) @http.request('POST', "/organizations/#{validate_uuid(organization_id)}/invites/#{email}/resend") end |
#reset_organization_member_mfa(organization_id, member_id) ⇒ Object
Reset organization member MFA [#reference](api.zanshin.tenchisecurity.com/#operation/resetOrganizationMemberMfaById)
73 74 75 76 77 78 |
# File 'lib/zanshin/organization_members.rb', line 73 def reset_organization_member_mfa(organization_id, member_id) @http.request( 'POST', "/organizations/#{validate_uuid(organization_id)}/members/#{validate_uuid(member_id)}/mfa/reset" ) end |
#reset_organization_member_password(organization_id, member_id) ⇒ Object
Reset organization member Password [#reference](api.zanshin.tenchisecurity.com/#operation/resetOrganizationMemberPasswordById)
87 88 89 90 91 92 |
# File 'lib/zanshin/organization_members.rb', line 87 def reset_organization_member_password(organization_id, member_id) @http.request( 'POST', "/organizations/#{validate_uuid(organization_id)}/members/#{validate_uuid(member_id)}/password/reset" ) end |
#update_organization_member(organization_id, member_id, roles = nil) ⇒ Object
Update organization member [#reference](api.zanshin.tenchisecurity.com/#operation/editOrganizationMembersById)
45 46 47 48 49 50 51 52 |
# File 'lib/zanshin/organization_members.rb', line 45 def update_organization_member(organization_id, member_id, roles = nil) body = { 'roles' => [roles].compact } @http.request('PUT', "/organizations/#{validate_uuid(organization_id)}/members/#{validate_uuid(member_id)}", body) end |