module ChimeSdk::Controller::Meetings::Mixin

Controller implementation to be included in custom meetings controllers.

Public Instance Methods

create() click to toggle source

POST /meetings POST /meetings.json @overload create(params)

@param [Hash] params Request parameter options
@option params [String] :create_meeting_with_attendee (ChimeSdk.config.create_meeting_with_attendee) Whether the application creates meeting with attendee in this meetings#create action
# File lib/chime_sdk/controller/meetings.rb, line 53
def create
  if params[:create_meeting_with_attendee].to_s.to_boolean(false) || ChimeSdk.config.create_meeting_with_attendee
    create_meeting_with_attendee
  else
    create_meeting
  end
  respond_to do |format|
    format.html { redirect_to meeting_resource_path(meeting_id), notice: "Meeting <#{meeting_id}> was successfully created." }
    format.json { render status: 201, json: @meeting.merge(@attendee || {}) }
  end
end
destroy() click to toggle source

DELETE /meetings/:meeting_id DELETE /meetings/:meeting_id.json

# File lib/chime_sdk/controller/meetings.rb, line 67
def destroy
  delete_meeting
  respond_to do |format|
    format.html { redirect_to meeting_resources_path, notice: "Meeting <#{meeting_id}> was successfully destroyed." }
    format.json { head 204 }
  end
end
index() click to toggle source

GET /meetings GET /meetings.json @overload index(params)

@param [Hash] params Request parameter options
@option params [String] :create_meeting (ChimeSdk.config.create_meeting_by_get_request) Whether the application creates meeting in this meetings#index action by HTTP GET request
# File lib/chime_sdk/controller/meetings.rb, line 20
def index
  if params[:create_meeting].to_s.to_boolean(false) || ChimeSdk.config.create_meeting_by_get_request
    create
  else
    list_meetings
    respond_to do |format|
      format.html
      format.json { render json: { meetings: @meetings } }
    end
  end
end
show() click to toggle source

GET /meetings/:meeting_id GET /meetings/:meeting_id.json @overload show(params)

@param [Hash] params Request parameter options
@option params [String] :create_attendee_from_meeting (ChimeSdk.config.create_attendee_from_meeting) Whether the application creates attendee from meeting in meetings#show action
# File lib/chime_sdk/controller/meetings.rb, line 37
def show
  get_meeting
  if params[:create_attendee_from_meeting].to_s.to_boolean(false) || ChimeSdk.config.create_attendee_from_meeting
    create_attendee_from_meeting
  end
  respond_to do |format|
    format.html
    format.json { render json: @meeting }
  end
end

Protected Instance Methods

application_attendee_metadata(attendee) click to toggle source

Appication metadata that attendees API returns as JSON response included in attendee resource. This is an optional parameter and configure it depending on your application. @api protected @param [Hash] attendee Attendee JSON object as hash @return [Hash] Appication metadata for attendees

# File lib/chime_sdk/controller/meetings.rb, line 175
def application_attendee_metadata(attendee)
  {}
end
application_attendee_name(attendee) click to toggle source

Application attendee name to resolve from attendee object in your view. This is an optional parameter and configure it depending on your application. @api protected @param [Hash] attendee Attendee JSON object as hash @return [String] Appication attendee name to resolve from attendee object in your view

# File lib/chime_sdk/controller/meetings.rb, line 184
def application_attendee_name(attendee)
  attendee[:Attendee][:AttendeeId]
end
application_meeting_metadata(meeting) click to toggle source

Appication metadata that meetings API returns as JSON response included in meeting resource. This is an optional parameter and configure it depending on your application. @api protected @param [Hash] meeting Meeting JSON object as hash @return [Hash] Appication metadata for meetings

# File lib/chime_sdk/controller/meetings.rb, line 166
def application_meeting_metadata(meeting)
  {}
end
attendee_request_id() click to toggle source

Unique attendee request id to identify attendee by Amazon Chime. Configure it depending on your application resources to identify attendee. For example, set “User-#{current_user.id}” by User model. @api protected @return [String] Unique attendee request id to identify attendee by Amazon Chime

# File lib/chime_sdk/controller/meetings.rb, line 101
def attendee_request_id
  "default"
end
attendee_resource_path(meeting_id, attendee_id, params = {}) click to toggle source

Path for attendees#show action such as attendee_path(meeting_id, attendee_id). Configure it depending on your application routes. @api protected @param [String] meeting_id Meeting id @param [String] attendee_id Attendee id @param [Hash] params Request parameters for path method @return [String] Path for attendees#index action such as attendees_path(meeting_id)

# File lib/chime_sdk/controller/meetings.rb, line 141
def attendee_resource_path(meeting_id, attendee_id, params = {})
  attendee_path(meeting_id, attendee_id, params)
end
attendee_resources_path(meeting_id, params = {}) click to toggle source

Path for attendees#index action such as attendees_path(meeting_id). Configure it depending on your application routes. @api protected @param [String] meeting_id Meeting id @param [Hash] params Request parameters for path method @return [String] Path for attendees#index action such as attendees_path(meeting_id)

# File lib/chime_sdk/controller/meetings.rb, line 130
def attendee_resources_path(meeting_id, params = {})
  attendees_path(meeting_id, params)
end
meeting_id_param() click to toggle source

Request parameter representing meeting id such as params. Configure it depending on your application routes. @api protected @return [String, Integer] Meeting id from request parameter

# File lib/chime_sdk/controller/meetings.rb, line 83
def meeting_id_param
  params[:id]
end
meeting_request_id() click to toggle source

Unique meeting request id to identify meeting by Amazon Chime. Configure it depending on your application resources to identify meeting. For example, set “PrivateRoom-#{@room.id}” by Room model. @api protected @return [String] Unique meeting request id to identify meeting by Amazon Chime

# File lib/chime_sdk/controller/meetings.rb, line 92
def meeting_request_id
  "default"
end
meeting_resource_path(meeting_id, params = {}) click to toggle source

Path for meetings#show action such as meeting_path(meeting_id). Configure it depending on your application routes. @api protected @param [String] meeting_id Meeting id @param [Hash] params Request parameters for path method @return [String] Path for meetings#show action such as meeting_path(meeting_id)

# File lib/chime_sdk/controller/meetings.rb, line 120
def meeting_resource_path(meeting_id, params = {})
  meeting_path(meeting_id, params)
end
meeting_resources_path(params = {}) click to toggle source

Path for meetings#index action such as meetings_path. Configure it depending on your application routes. @api protected @param [Hash] params Request parameters for path method @return [String] Path for meetings#index action such as meetings_path

# File lib/chime_sdk/controller/meetings.rb, line 110
def meeting_resources_path(params = {})
  meetings_path(params)
end
optional_attendee_tags() click to toggle source

Optional attendee tags to pass to Amazon Chime. This is an optional parameter and configure it depending on your application. @api protected @return [Array<Hash>] Optional tags for attendees

# File lib/chime_sdk/controller/meetings.rb, line 157
def optional_attendee_tags
  []
end
optional_meeting_tags() click to toggle source

Optional meeting tags to pass to Amazon Chime. This is an optional parameter and configure it depending on your application. @api protected @return [Array<Hash>] Optional tags for meetings

# File lib/chime_sdk/controller/meetings.rb, line 149
def optional_meeting_tags
  []
end