Class: Calendlyr::OrganizationsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/calendlyr/resources/organizations.rb

Constant Summary

Constants inherited from Resource

Resource::ERROR_CODES

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Calendlyr::Resource

Instance Method Details

#activity_log(organization: nil, **params) ⇒ Object



3
4
5
6
# File 'lib/calendlyr/resources/organizations.rb', line 3

def activity_log(organization: nil, **params)
  response = get_request("activity_log_entries", params: {organization: organization}.merge(params).compact)
  Collection.from_response(response, type: ActivityLog, client: client)
end

#invite(organization_uuid:, email:) ⇒ Object



32
33
34
# File 'lib/calendlyr/resources/organizations.rb', line 32

def invite(organization_uuid:, email:)
  Organizations::Invitation.new post_request("organizations/#{organization_uuid}/invitations", body: {email: email}).dig("resource").merge(client: client)
end

#list_invitations(uuid:, **params) ⇒ Object

Invitations



23
24
25
26
# File 'lib/calendlyr/resources/organizations.rb', line 23

def list_invitations(uuid:, **params)
  response = get_request("organizations/#{uuid}/invitations", params: params)
  Collection.from_response(response, type: Organizations::Invitation, client: client)
end

#list_memberships(**params) ⇒ Object

Memberships



9
10
11
12
# File 'lib/calendlyr/resources/organizations.rb', line 9

def list_memberships(**params)
  response = get_request("organization_memberships", params: params)
  Collection.from_response(response, type: Organizations::Membership, client: client)
end

#remove_user(uuid:) ⇒ Object



18
19
20
# File 'lib/calendlyr/resources/organizations.rb', line 18

def remove_user(uuid:)
  delete_request("organization_memberships/#{uuid}")
end

#retrieve_invitation(org_uuid:, uuid:) ⇒ Object



28
29
30
# File 'lib/calendlyr/resources/organizations.rb', line 28

def retrieve_invitation(org_uuid:, uuid:)
  Organizations::Invitation.new get_request("organizations/#{org_uuid}/invitations/#{uuid}").dig("resource").merge(client: client)
end

#retrieve_membership(uuid:) ⇒ Object



14
15
16
# File 'lib/calendlyr/resources/organizations.rb', line 14

def retrieve_membership(uuid:)
  Organizations::Membership.new(get_request("organization_memberships/#{uuid}").dig("resource").merge(client: client))
end

#revoke_invitation(org_uuid:, uuid:) ⇒ Object



36
37
38
# File 'lib/calendlyr/resources/organizations.rb', line 36

def revoke_invitation(org_uuid:, uuid:)
  delete_request("organizations/#{org_uuid}/invitations/#{uuid}")
end