Class: Telnyx::Resources::Rooms::Actions

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

Overview

Rooms Client Tokens operations.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Actions

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 Actions.

Parameters:



73
74
75
# File 'lib/telnyx/resources/rooms/actions.rb', line 73

def initialize(client:)
  @client = client
end

Instance Method Details

#generate_join_client_token(room_id, refresh_token_ttl_secs: nil, token_ttl_secs: nil, request_options: {}) ⇒ Telnyx::Models::Rooms::ActionGenerateJoinClientTokenResponse

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

Synchronously create an Client Token to join a Room. Client Token is necessary to join a Telnyx Room. Client Token will expire after ‘token_ttl_secs`, a Refresh Token is also provided to refresh a Client Token, the Refresh Token expires after `refresh_token_ttl_secs`.

Parameters:

  • room_id (String)

    The unique identifier of a room.

  • refresh_token_ttl_secs (Integer)

    The time to live in seconds of the Refresh Token, after that time the Refresh To

  • token_ttl_secs (Integer)

    The time to live in seconds of the Client Token, after that time the Client Toke

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

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/telnyx/resources/rooms/actions.rb', line 29

def generate_join_client_token(room_id, params = {})
  parsed, options = Telnyx::Rooms::ActionGenerateJoinClientTokenParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["rooms/%1$s/actions/generate_join_client_token", room_id],
    body: parsed,
    model: Telnyx::Models::Rooms::ActionGenerateJoinClientTokenResponse,
    options: options
  )
end

#refresh_client_token(room_id, refresh_token:, token_ttl_secs: nil, request_options: {}) ⇒ Telnyx::Models::Rooms::ActionRefreshClientTokenResponse

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

Synchronously refresh an Client Token to join a Room. Client Token is necessary to join a Telnyx Room. Client Token will expire after ‘token_ttl_secs`.

Parameters:

  • room_id (String)

    The unique identifier of a room.

  • refresh_token (String)
  • token_ttl_secs (Integer)

    The time to live in seconds of the Client Token, after that time the Client Toke

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

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
# File 'lib/telnyx/resources/rooms/actions.rb', line 59

def refresh_client_token(room_id, params)
  parsed, options = Telnyx::Rooms::ActionRefreshClientTokenParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["rooms/%1$s/actions/refresh_client_token", room_id],
    body: parsed,
    model: Telnyx::Models::Rooms::ActionRefreshClientTokenResponse,
    options: options
  )
end