Module: ChimeSdk::Controller::Attendees::Mixin

Extended by:
ActiveSupport::Concern
Defined in:
lib/chime_sdk/controller/attendees.rb

Overview

Controller implementation to be included in custom attendees controllers.

Instance Method Summary collapse

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.

Parameters:

  • attendee (Hash)

    Attendee JSON object as hash

Returns:

  • (Hash)

    Appication metadata for attendees



120
121
122
# File 'lib/chime_sdk/controller/attendees.rb', line 120

def (attendee)
  {}
end

#attendee_id_paramString, Integer (protected)

Request parameter representing attendee id such as params[:id]. Configure it depending on your application routes.

Returns:

  • (String, Integer)

    Attendee id from request parameter



54
55
56
# File 'lib/chime_sdk/controller/attendees.rb', line 54

def attendee_id_param
  params[:id]
end

#attendee_request_idString (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::Attendees::Mixin.current_usercurrent_user.id" by User model.

Returns:

  • (String)

    Unique attendee request id to identify attendee by Amazon Chime



63
64
65
# File 'lib/chime_sdk/controller/attendees.rb', line 63

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.

Parameters:

  • meeting_id (String)

    Meeting id

  • attendee_id (String)

    Attendee id

  • params (Hash) (defaults to: {})

    Request parameters for path method

Returns:

  • (String)

    Path for attendees#index action such as attendees_path(meeting_id)



103
104
105
# File 'lib/chime_sdk/controller/attendees.rb', line 103

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.

Parameters:

  • meeting_id (String)

    Meeting id

  • params (Hash) (defaults to: {})

    Request parameters for path method

Returns:

  • (String)

    Path for attendees#index action such as attendees_path(meeting_id)



92
93
94
# File 'lib/chime_sdk/controller/attendees.rb', line 92

def attendee_resources_path(meeting_id, params = {})
  attendees_path(meeting_id, params)
end

#createObject

POST /meetings/:meeting_id/attendees



27
28
29
30
# File 'lib/chime_sdk/controller/attendees.rb', line 27

def create
  create_attendee
  render status: 201, json: @attendee
end

#destroyObject

DELETE /meetings/:meeting_id/attendees/:attendee_id



33
34
35
36
# File 'lib/chime_sdk/controller/attendees.rb', line 33

def destroy
  delete_attendee
  head 204
end

#indexObject

GET /meetings/:meeting_id/attendees



15
16
17
18
# File 'lib/chime_sdk/controller/attendees.rb', line 15

def index
  list_attendees
  render json: { attendees: @attendees }
end

#meeting_id_paramString, Integer (protected)

Request parameter representing meeting id such as params[:meeting_id]. Configure it depending on your application routes.

Returns:

  • (String, Integer)

    Meeting id from request parameter



46
47
48
# File 'lib/chime_sdk/controller/attendees.rb', line 46

def meeting_id_param
  params[:meeting_id]
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.

Parameters:

  • meeting_id (String)

    Meeting id

  • params (Hash) (defaults to: {})

    Request parameters for path method

Returns:

  • (String)

    Path for meetings#show action such as meeting_path(meeting_id)



82
83
84
# File 'lib/chime_sdk/controller/attendees.rb', line 82

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.

Parameters:

  • params (Hash) (defaults to: {})

    Request parameters for path method

Returns:

  • (String)

    Path for meetings#index action such as meetings_path



72
73
74
# File 'lib/chime_sdk/controller/attendees.rb', line 72

def meeting_resources_path(params = {})
  meetings_path(params)
end

#optional_attendee_tagsArray<Hash> (protected)

Optional attendee tags to pass to Amazon Chime. This is an optional parameter and configure it depending on your application.

Returns:

  • (Array<Hash>)

    Optional tags for attendees



111
112
113
# File 'lib/chime_sdk/controller/attendees.rb', line 111

def optional_attendee_tags
  []
end

#showObject

GET /meetings/:meeting_id/attendees/:attendee_id



21
22
23
24
# File 'lib/chime_sdk/controller/attendees.rb', line 21

def show
  get_attendee
  render json: @attendee
end