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/(#{UUID_FORMAT})\z}.freeze

Constants included from ModelUtils

ModelUtils::UUID_FORMAT

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)


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

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

#activity_log_entries(options: nil) ⇒ Array<Array<Calendly::ActivityLogEntry>, Hash, Hash>

Returns a list of activity log entries.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :action (Array<String>)

    The action(s) associated with the entries.

  • :actor (Array<String>)

    Return entries from the user(s) associated with the provided URIs.

  • :count (Integer)

    The number of rows to return.

  • :max_occurred_at (String)

    include entries that occurred prior to this time.

  • :min_occurred_at (String)

    Include entries that occurred after this time.

  • :namespace (Array<String>)

    The categories of the entries.

  • :page_token (String)

    The token to pass to get the next portion of the collection.

  • :search_term (String)

    Filters entries based on the search term.

  • :sort (Array<String>)

    Order results by the specified field and direction. List of field:direction values.

Returns:

  • (Array<Array<Calendly::ActivityLogEntry>, Hash, Hash>)
    • Array<Calendly::ActivityLogEntry>

      log_entries

    • Hash

      next_params the parameters to get next data. if thre is no next it returns nil.

    • Hash

      raw_response

Raises:

Since:

  • 0.14.0



217
218
219
# File 'lib/calendly/models/organization.rb', line 217

def activity_log_entries(options: nil)
  client.activity_log_entries uri, options: options
end

#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



76
77
78
# File 'lib/calendly/models/organization.rb', line 76

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

#create_webhook(url, events, signing_key: nil) ⇒ Calendly::WebhookSubscription

Create a user scope webhook associated with self.

Parameters:

  • url (String)

    Canonical reference (unique identifier) for the resource.

  • events (Array<String>)

    List of user events to subscribe to. options: invitee.created or invitee.canceled

  • signing_key (String) (defaults to: nil)

    secret key shared between your application and Calendly. Optional.

Returns:

Raises:

Since:

  • 0.1.3



169
170
171
# File 'lib/calendly/models/organization.rb', line 169

def create_webhook(url, events, signing_key: nil)
  client.create_webhook url, events, uri, signing_key: signing_key
end

#event_types(options: nil) ⇒ Array<Calendly::EventType>

Returns all Event Types associated with self.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :active (Boolean)

    Return only active event types if true, only inactive if false, or all event types if this parameter is omitted.

  • :count (Integer)

    Number of rows to return.

  • :page_token (String)

    Pass this to get the next portion of collection.

  • :sort (String)

    Order results by the specified field and direction. Accepts comma-separated list of field:direction values.

Returns:

Raises:

Since:

  • 0.6.0



92
93
94
95
96
97
# File 'lib/calendly/models/organization.rb', line 92

def event_types(options: nil)
  return @cached_event_types if defined?(@cached_event_types) && @cached_event_types

  request_proc = proc { |opts| client.event_types uri, options: opts }
  @cached_event_types = auto_pagination request_proc, options
end

#event_types!(options: nil) ⇒ Object

Since:

  • 0.6.0



100
101
102
103
# File 'lib/calendly/models/organization.rb', line 100

def event_types!(options: nil)
  @cached_event_types = nil
  event_types options: options
end

#invitations(options: nil) ⇒ Array<Calendly::OrganizationInvitation>

Get Organization Invitations.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :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. Accepts comma-separated list of field:direction values.

  • :status (String)

    Filter by status.

Returns:

Raises:

Since:

  • 0.1.0



54
55
56
57
58
59
# File 'lib/calendly/models/organization.rb', line 54

def invitations(options: nil)
  return @cached_invitations if defined?(@cached_invitations) && @cached_invitations

  request_proc = proc { |opts| client.invitations uuid, options: opts }
  @cached_invitations = auto_pagination request_proc, options
end

#invitations!(options: nil) ⇒ Object

Since:

  • 0.2.0



62
63
64
65
# File 'lib/calendly/models/organization.rb', line 62

def invitations!(options: nil)
  @cached_invitations = nil
  invitations options: options
end

#memberships(options: nil) ⇒ Array<Calendly::OrganizationMembership>

Get List memberships of all users belonging to self.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :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



28
29
30
31
32
33
# File 'lib/calendly/models/organization.rb', line 28

def memberships(options: nil)
  return @cached_memberships if defined?(@cached_memberships) && @cached_memberships

  request_proc = proc { |opts| client.memberships uri, options: opts }
  @cached_memberships = auto_pagination request_proc, options
end

#memberships!(options: nil) ⇒ Object

Since:

  • 0.2.0



36
37
38
39
# File 'lib/calendly/models/organization.rb', line 36

def memberships!(options: nil)
  @cached_memberships = nil
  memberships options: options
end

#routing_forms(options: nil) ⇒ Array<Calendly::RoutingForm>

Returns all Routing Forms associated with self.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :count (Integer)

    Number of rows to return.

  • :page_token (String)

    Pass this to get the next portion of collection.

  • :sort (String)

    Order results by the specified field and directin. Accepts comma-separated list of field:direction values.

Returns:

Raises:

Since:

  • 0.12.0



184
185
186
187
188
189
# File 'lib/calendly/models/organization.rb', line 184

def routing_forms(options: nil)
  return @cached_routing_forms if defined?(@cached_routing_forms) && @cached_routing_forms

  request_proc = proc { |opts| client.routing_forms uri, options: opts }
  @cached_routing_forms = auto_pagination request_proc, options
end

#routing_forms!(options: nil) ⇒ Object

Since:

  • 0.12.0



192
193
194
195
# File 'lib/calendly/models/organization.rb', line 192

def routing_forms!(options: nil)
  @cached_routing_forms = nil
  routing_forms options: options
end

#scheduled_events(options: nil) ⇒ Array<Calendly::Event>

Returns all Scheduled Events associated with self.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :count (Integer)

    Number of rows to return.

  • :invitee_email (String)

    Return events scheduled with the specified invitee email

  • :max_start_timeUpper (String)

    bound (inclusive) for an event’s start time to filter by.

  • :min_start_time (String)

    Lower bound (inclusive) for an event’s start time to filter by.

  • :page_token (String)

    Pass this to get the next portion of collection.

  • :sort (String)

    Order results by the specified field and directin. Accepts comma-separated list of field:direction values.

  • :status (String)

    Whether the scheduled event is active or canceled

Returns:

Raises:

Since:

  • 0.5.0



120
121
122
123
124
125
# File 'lib/calendly/models/organization.rb', line 120

def scheduled_events(options: nil)
  return @cached_scheduled_events if defined?(@cached_scheduled_events) && @cached_scheduled_events

  request_proc = proc { |opts| client.scheduled_events uri, options: opts }
  @cached_scheduled_events = auto_pagination request_proc, options
end

#scheduled_events!(options: nil) ⇒ Object

Since:

  • 0.5.0



128
129
130
131
# File 'lib/calendly/models/organization.rb', line 128

def scheduled_events!(options: nil)
  @cached_scheduled_events = nil
  scheduled_events options: options
end

#webhooks(options: nil) ⇒ Array<Calendly::WebhookSubscription>

Get List of organization scope Webhooks associated with self.

Parameters:

  • options (Hash) (defaults to: nil)

    the optional request parameters. Optional.

Options Hash (options:):

  • :count (Integer)

    Number of rows to return.

  • :page_token (String)

    Pass this to get the next portion of collection.

  • :sort (String)

    Order results by the specified field and directin. Accepts comma-separated list of field:direction values.

Returns:

Raises:

Since:

  • 0.1.3



144
145
146
147
148
149
# File 'lib/calendly/models/organization.rb', line 144

def webhooks(options: nil)
  return @cached_webhooks if defined?(@cached_webhooks) && @cached_webhooks

  request_proc = proc { |opts| client.webhooks uri, options: opts }
  @cached_webhooks = auto_pagination request_proc, options
end

#webhooks!(options: nil) ⇒ Object

Since:

  • 0.2.0



152
153
154
155
# File 'lib/calendly/models/organization.rb', line 152

def webhooks!(options: nil)
  @cached_webhooks = nil
  webhooks options: options
end