Class: Telnyx::Resources::Rooms

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/rooms.rb,
lib/telnyx/resources/rooms/actions.rb,
lib/telnyx/resources/rooms/sessions.rb,
lib/telnyx/resources/rooms/sessions/actions.rb

Overview

Rooms operations.

Defined Under Namespace

Classes: Actions, Sessions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Rooms

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Rooms.

Parameters:



169
170
171
172
173
# File 'lib/telnyx/resources/rooms.rb', line 169

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::Rooms::Actions.new(client: client)
  @sessions = Telnyx::Resources::Rooms::Sessions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Rooms::Actions (readonly)

Rooms Client Tokens operations.



9
10
11
# File 'lib/telnyx/resources/rooms.rb', line 9

def actions
  @actions
end

#sessionsTelnyx::Resources::Rooms::Sessions (readonly)



12
13
14
# File 'lib/telnyx/resources/rooms.rb', line 12

def sessions
  @sessions
end

Instance Method Details

#create(enable_recording: nil, max_participants: nil, unique_name: nil, webhook_event_failover_url: nil, webhook_event_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::RoomCreateResponse

Some parameter documentations has been truncated, see Models::RoomCreateParams for more details.

Synchronously create a Room.

Parameters:

  • enable_recording (Boolean)

    Enable or disable recording for that room.

  • max_participants (Integer)

    The maximum amount of participants allowed in a room. If new participants try to

  • unique_name (String)

    The unique (within the Telnyx account scope) name of the room.

  • webhook_event_failover_url (String)

    The failover URL where webhooks related to this room will be sent if sending to

  • webhook_event_url (String)

    The URL where webhooks related to this room will be sent. Must include a scheme,

  • webhook_timeout_secs (Integer)

    Specifies how many seconds to wait before timing out a webhook.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



38
39
40
41
42
43
44
45
46
47
# File 'lib/telnyx/resources/rooms.rb', line 38

def create(params = {})
  parsed, options = Telnyx::RoomCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "rooms",
    body: parsed,
    model: Telnyx::Models::RoomCreateResponse,
    options: options
  )
end

#delete(room_id, request_options: {}) ⇒ nil

Synchronously delete a Room. Participants from that room will be kicked out, they won’t be able to join that room anymore, and you won’t be charged anymore for that room.

Parameters:

  • room_id (String)

    The unique identifier of a room.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



157
158
159
160
161
162
163
164
# File 'lib/telnyx/resources/rooms.rb', line 157

def delete(room_id, params = {})
  @client.request(
    method: :delete,
    path: ["rooms/%1$s", room_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#list(filter: nil, include_sessions: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Room>

Some parameter documentations has been truncated, see Models::RoomListParams for more details.

View a list of rooms.

Parameters:

  • filter (Telnyx::Models::RoomListParams::Filter)

    Consolidated filter parameter (deepObject style). Originally: filter[date_create

  • include_sessions (Boolean)

    To decide if room sessions should be included in the response.

  • page_number (Integer)
  • page_size (Integer)
  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/telnyx/resources/rooms.rb', line 131

def list(params = {})
  parsed, options = Telnyx::RoomListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "rooms",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Room,
    options: options
  )
end

#retrieve(room_id, include_sessions: nil, request_options: {}) ⇒ Telnyx::Models::RoomRetrieveResponse

View a room.

Parameters:

  • room_id (String)

    The unique identifier of a room.

  • include_sessions (Boolean)

    To decide if room sessions should be included in the response.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/telnyx/resources/rooms.rb', line 62

def retrieve(room_id, params = {})
  parsed, options = Telnyx::RoomRetrieveParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["rooms/%1$s", room_id],
    query: query,
    model: Telnyx::Models::RoomRetrieveResponse,
    options: options
  )
end

#update(room_id, enable_recording: nil, max_participants: nil, unique_name: nil, webhook_event_failover_url: nil, webhook_event_url: nil, webhook_timeout_secs: nil, request_options: {}) ⇒ Telnyx::Models::RoomUpdateResponse

Some parameter documentations has been truncated, see Models::RoomUpdateParams for more details.

Synchronously update a Room.

Parameters:

  • room_id (String)

    The unique identifier of a room.

  • enable_recording (Boolean)

    Enable or disable recording for that room.

  • max_participants (Integer)

    The maximum amount of participants allowed in a room. If new participants try to

  • unique_name (String)

    The unique (within the Telnyx account scope) name of the room.

  • webhook_event_failover_url (String)

    The failover URL where webhooks related to this room will be sent if sending to

  • webhook_event_url (String)

    The URL where webhooks related to this room will be sent. Must include a scheme,

  • webhook_timeout_secs (Integer)

    Specifies how many seconds to wait before timing out a webhook.

  • request_options (Telnyx::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



100
101
102
103
104
105
106
107
108
109
# File 'lib/telnyx/resources/rooms.rb', line 100

def update(room_id, params = {})
  parsed, options = Telnyx::RoomUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["rooms/%1$s", room_id],
    body: parsed,
    model: Telnyx::Models::RoomUpdateResponse,
    options: options
  )
end