module ChimeSdk::Controller::Meetings::Mixin
Controller
implementation to be included in custom meetings controllers.
Public Instance Methods
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
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
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
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
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 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
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
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
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
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
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
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
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
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