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.
176 177 178 |
# File 'lib/chime_sdk/controller/meetings.rb', line 176 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.
185 186 187 |
# File 'lib/chime_sdk/controller/meetings.rb', line 185 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.
167 168 169 |
# File 'lib/chime_sdk/controller/meetings.rb', line 167 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.
102 103 104 |
# File 'lib/chime_sdk/controller/meetings.rb', line 102 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.
142 143 144 |
# File 'lib/chime_sdk/controller/meetings.rb', line 142 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.
131 132 133 |
# File 'lib/chime_sdk/controller/meetings.rb', line 131 def attendee_resources_path(meeting_id, params = {}) attendees_path(meeting_id, params) end |
#create(params) ⇒ Object
POST /meetings POST /meetings.json
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/chime_sdk/controller/meetings.rb', line 54 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
68 69 70 71 72 73 74 |
# File 'lib/chime_sdk/controller/meetings.rb', line 68 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 31 |
# 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 @meeting_request_id = ChimeSdk.config.prefix + meeting_request_id @attendee_request_id = ChimeSdk.config.prefix + attendee_request_id respond_to do |format| format.html format.json { render json: { meeting_request_id: @meeting_request_id, attendee_request_id: @attendee_request_id } } 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.
84 85 86 |
# File 'lib/chime_sdk/controller/meetings.rb', line 84 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.
93 94 95 |
# File 'lib/chime_sdk/controller/meetings.rb', line 93 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.
121 122 123 |
# File 'lib/chime_sdk/controller/meetings.rb', line 121 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.
111 112 113 |
# File 'lib/chime_sdk/controller/meetings.rb', line 111 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.
158 159 160 |
# File 'lib/chime_sdk/controller/meetings.rb', line 158 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.
150 151 152 |
# File 'lib/chime_sdk/controller/meetings.rb', line 150 def [] end |
#show(params) ⇒ Object
GET /meetings/:meeting_id GET /meetings/:meeting_id.json
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/chime_sdk/controller/meetings.rb', line 38 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 |