class Calendly::Event

Calendly's event model. A meeting that has been scheduled.

Constants

ASSOCIATION
TIME_FIELDS
UUID_RE

Attributes

created_at[RW]

@return [Time] Moment when user record was first created.

end_time[RW]

@return [Time] Moment when event is (or was) scheduled to end.

event_guests[RW]

@return [Array<Guest>] Additional people added to an event by an invitee.

event_memberships[RW]

@return [Array<User>] Event membership list.

event_type[RW]

@return [EventType] Reference to Event Type associated with this event.

invitees_counter[RW]

@return [InviteesCounter] invitees counter.

location[RW]

@return [Calendly::Location] location in this event.

name[RW]

@return [String] Name of the event.

start_time[RW]

@return [Time] Moment when event is (or was) scheduled to begin.

status[RW]

@return [String] Whether the event is active or canceled.

updated_at[RW]

@return [Time] Moment when user record was last updated.

uri[RW]

@return [String] Canonical resource reference.

uuid[RW]

@return [String] unique id of the Event object.

Public Instance Methods

fetch() click to toggle source

Get Scheduled Event associated with self.

@return [Calendly::Event] @raise [Calendly::Error] if the uuid is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.0

# File lib/calendly/models/event.rb, line 83
def fetch
  client.scheduled_event uuid
end
invitees(options: nil) click to toggle source

Returns all Event Invitees associated with self.

@param [Hash] options the optional request parameters. Optional. @option options [Integer] :count Number of rows to return. @option options [String] :email Filter by email. @option options [String] :page_token Pass this to get the next portion of collection. @option opts [String] :sort Order results by the specified field and directin. Accepts comma-separated list of {field}:{direction} values. @option opts [String] :status Whether the scheduled event is active or canceled. @return [Array<Calendly::Invitee>] @raise [Calendly::Error] if the uuid is empty. @raise [Calendly::ApiError] if the api returns error code. @since 0.1.0

# File lib/calendly/models/event.rb, line 102
def invitees(options: nil)
  return @cached_invitees if defined?(@cached_invitees) && @cached_invitees

  request_proc = proc { |opts| client.event_invitees uuid, options: opts }
  @cached_invitees = auto_pagination request_proc, options
end
invitees!(options: nil) click to toggle source

@since 0.2.0

# File lib/calendly/models/event.rb, line 110
def invitees!(options: nil)
  @cached_invitees = nil
  invitees options: options
end

Private Instance Methods

after_set_attributes(attrs) click to toggle source
# File lib/calendly/models/event.rb, line 117
def after_set_attributes(attrs)
  super attrs
  if event_memberships.is_a? Array # rubocop:disable Style/GuardClause
    @event_memberships = event_memberships.map do |params|
      uri = params[:user]
      User.new({uri: uri}, @client)
    end
  end
end