Module: ChimeSdk::Controller::Meetings::Mixin
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/chime_sdk/controller/meetings.rb
Overview
Controller implementation to be included in custom meetings controllers.
Instance Method Summary collapse
-
#application_attendee_metadata(attendee) ⇒ Hash
protected
Appication metadata that attendees API returns as JSON response included in attendee resource.
-
#application_attendee_name(attendee) ⇒ String
protected
Application attendee name to resolve from attendee object in your view.
-
#application_meeting_metadata(meeting) ⇒ Hash
protected
Appication metadata that meetings API returns as JSON response included in meeting resource.
-
#attendee_request_id ⇒ String
protected
Unique attendee request id to identify attendee by Amazon Chime.
-
#attendee_resource_path(meeting_id, attendee_id, params = {}) ⇒ String
protected
Path for attendees#show action such as attendee_path(meeting_id, attendee_id).
-
#attendee_resources_path(meeting_id, params = {}) ⇒ String
protected
Path for attendees#index action such as attendees_path(meeting_id).
-
#create(params) ⇒ Object
POST /meetings POST /meetings.json.
-
#destroy ⇒ Object
DELETE /meetings/:meeting_id DELETE /meetings/:meeting_id.json.
-
#index(params) ⇒ Object
GET /meetings GET /meetings.json.
-
#meeting_id_param ⇒ String, Integer
protected
Request parameter representing meeting id such as params[:id].
-
#meeting_request_id ⇒ String
protected
Unique meeting request id to identify meeting by Amazon Chime.
-
#meeting_resource_path(meeting_id, params = {}) ⇒ String
protected
Path for meetings#show action such as meeting_path(meeting_id).
-
#meeting_resources_path(params = {}) ⇒ String
protected
Path for meetings#index action such as meetings_path.
-
#optional_attendee_tags ⇒ Array<Hash>
protected
Optional attendee tags to pass to Amazon Chime.
-
#optional_meeting_tags ⇒ Array<Hash>
protected
Optional meeting tags to pass to Amazon Chime.
-
#show(params) ⇒ Object
GET /meetings/:meeting_id GET /meetings/:meeting_id.json.
Instance Method Details
#application_attendee_metadata(attendee) ⇒ Hash (protected)
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.
175 176 177 |
# File 'lib/chime_sdk/controller/meetings.rb', line 175 def (attendee) {} end |
#application_attendee_name(attendee) ⇒ String (protected)
Application attendee name to resolve from attendee object in your view. This is an optional parameter and configure it depending on your application.
184 185 186 |
# File 'lib/chime_sdk/controller/meetings.rb', line 184 def application_attendee_name(attendee) attendee[:Attendee][:AttendeeId] end |
#application_meeting_metadata(meeting) ⇒ Hash (protected)
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.
166 167 168 |
# File 'lib/chime_sdk/controller/meetings.rb', line 166 def (meeting) {} end |
#attendee_request_id ⇒ String (protected)
Unique attendee request id to identify attendee by Amazon Chime. Configure it depending on your application resources to identify attendee. For example, set "User-#ChimeSdk::Controller::Meetings::Mixin.current_usercurrent_user.id" by User model.
101 102 103 |
# File 'lib/chime_sdk/controller/meetings.rb', line 101 def attendee_request_id "default" end |
#attendee_resource_path(meeting_id, attendee_id, params = {}) ⇒ String (protected)
Path for attendees#show action such as attendee_path(meeting_id, attendee_id). Configure it depending on your application routes.
141 142 143 |
# 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 = {}) ⇒ String (protected)
Path for attendees#index action such as attendees_path(meeting_id). Configure it depending on your application routes.
130 131 132 |
# File 'lib/chime_sdk/controller/meetings.rb', line 130 def attendee_resources_path(meeting_id, params = {}) attendees_path(meeting_id, params) end |
#create(params) ⇒ Object
POST /meetings POST /meetings.json
53 54 55 56 57 58 59 60 61 62 63 |
# 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 && params[:create_meeting_with_attendee].to_s.to_boolean(true) 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 ⇒ Object
DELETE /meetings/:meeting_id DELETE /meetings/:meeting_id.json
67 68 69 70 71 72 73 |
# 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(params) ⇒ Object
GET /meetings GET /meetings.json
20 21 22 23 24 25 26 27 28 29 30 |
# 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 && params[:create_meeting].to_s.to_boolean(true) create else list_meetings respond_to do |format| format.html format.json { render json: { meetings: @meetings } } end end end |
#meeting_id_param ⇒ String, Integer (protected)
Request parameter representing meeting id such as params[:id]. Configure it depending on your application routes.
83 84 85 |
# File 'lib/chime_sdk/controller/meetings.rb', line 83 def meeting_id_param params[:id] end |
#meeting_request_id ⇒ String (protected)
Unique meeting request id to identify meeting by Amazon Chime. Configure it depending on your application resources to identify meeting. For example, set "PrivateRoom-#ChimeSdk::Controller::Meetings::Mixin.@[email protected]" by Room model.
92 93 94 |
# File 'lib/chime_sdk/controller/meetings.rb', line 92 def meeting_request_id "default" end |
#meeting_resource_path(meeting_id, params = {}) ⇒ String (protected)
Path for meetings#show action such as meeting_path(meeting_id). Configure it depending on your application routes.
120 121 122 |
# 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 = {}) ⇒ String (protected)
Path for meetings#index action such as meetings_path. Configure it depending on your application routes.
110 111 112 |
# File 'lib/chime_sdk/controller/meetings.rb', line 110 def meeting_resources_path(params = {}) meetings_path(params) end |
#optional_attendee_tags ⇒ Array<Hash> (protected)
Optional attendee tags to pass to Amazon Chime. This is an optional parameter and configure it depending on your application.
157 158 159 |
# File 'lib/chime_sdk/controller/meetings.rb', line 157 def [] end |
#optional_meeting_tags ⇒ Array<Hash> (protected)
Optional meeting tags to pass to Amazon Chime. This is an optional parameter and configure it depending on your application.
149 150 151 |
# File 'lib/chime_sdk/controller/meetings.rb', line 149 def [] end |
#show(params) ⇒ Object
GET /meetings/:meeting_id GET /meetings/:meeting_id.json
37 38 39 40 41 42 43 44 45 46 |
# 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 && params[:create_attendee_from_meeting].to_s.to_boolean(true) create_attendee_from_meeting end respond_to do |format| format.html format.json { render json: @meeting } end end |