Class: Calendly::Organization

Inherits:
Object
  • Object
show all
Includes:
ModelUtils
Defined in:
lib/calendly/models/organization.rb

Overview

Calendly’s organization model.

Constant Summary collapse

UUID_RE =
%r{\A#{Client::API_HOST}/organizations/(\w+)\z}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ModelUtils

#client, #id, included, #initialize, #inspect

Instance Attribute Details

#uriString

Canonical resource reference.

Returns:

  • (String)


14
15
16
# File 'lib/calendly/models/organization.rb', line 14

def uri
  @uri
end

#uuidString

unique id of the Organization object.

Returns:

  • (String)


11
12
13
# File 'lib/calendly/models/organization.rb', line 11

def uuid
  @uuid
end

Instance Method Details

#create_invitation(email) ⇒ Calendly::OrganizationInvitation

Invite a person to an Organization.

Parameters:

  • email (String)

    Email of the person being invited.

Returns:

Raises:

Since:

  • 0.1.0



60
61
62
# File 'lib/calendly/models/organization.rb', line 60

def create_invitation(email)
  client.create_invitation uuid, email
end

#invitations(opts = {}) ⇒ Array<Calendly::OrganizationInvitation>

Get Organization Invitations.

Accepts comma-separated list of field:direction values.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional request parameters.

Options Hash (opts):

  • :count (Integer)

    Number of rows to return.

  • :email (String)

    Filter by email.

  • :page_token (String)

    Pass this to get the next portion of collection.

  • :sort (String)

    Order results by the specified field and directin.

  • :status (String)

    Filter by status.

Returns:

Raises:

Since:

  • 0.1.0



46
47
48
49
# File 'lib/calendly/models/organization.rb', line 46

def invitations(opts = {})
  request_proc = proc { |options| client.invitations uuid, options }
  auto_pagination request_proc, opts
end

#memberships(opts = {}) ⇒ Array<Calendly::OrganizationMembership>

Get List memberships of all users belonging to self.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional request parameters.

Options Hash (opts):

  • :count (Integer)

    Number of rows to return.

  • :email (String)

    Filter by email.

  • :page_token (String)

    Pass this to get the next portion of collection.

Returns:

Raises:

Since:

  • 0.1.0



27
28
29
30
# File 'lib/calendly/models/organization.rb', line 27

def memberships(opts = {})
  request_proc = proc { |options| client.memberships uri, options }
  auto_pagination request_proc, opts
end