sendAlexaOfferToMaster method

Future<SendAlexaOfferToMasterResponse> sendAlexaOfferToMaster({
  1. required String channelARN,
  2. required String messagePayload,
  3. required String senderClientId,
})

This API allows you to connect WebRTC-enabled devices with Alexa display devices. When invoked, it sends the Alexa Session Description Protocol (SDP) offer to the master peer. The offer is delivered as soon as the master is connected to the specified signaling channel. This API returns the SDP answer from the connected master. If the master is not connected to the signaling channel, redelivery requests are made until the message expires.

May throw ClientLimitExceededException. May throw ResourceNotFoundException. May throw InvalidArgumentException. May throw NotAuthorizedException.

Parameter channelARN : The ARN of the signaling channel by which Alexa and the master peer communicate.

Parameter messagePayload : The base64-encoded SDP offer content.

Parameter senderClientId : The unique identifier for the sender client.

Implementation

Future<SendAlexaOfferToMasterResponse> sendAlexaOfferToMaster({
  required String channelARN,
  required String messagePayload,
  required String senderClientId,
}) async {
  ArgumentError.checkNotNull(channelARN, 'channelARN');
  _s.validateStringLength(
    'channelARN',
    channelARN,
    1,
    1024,
    isRequired: true,
  );
  ArgumentError.checkNotNull(messagePayload, 'messagePayload');
  _s.validateStringLength(
    'messagePayload',
    messagePayload,
    1,
    10000,
    isRequired: true,
  );
  ArgumentError.checkNotNull(senderClientId, 'senderClientId');
  _s.validateStringLength(
    'senderClientId',
    senderClientId,
    1,
    256,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'ChannelARN': channelARN,
    'MessagePayload': messagePayload,
    'SenderClientId': senderClientId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/send-alexa-offer-to-master',
    exceptionFnMap: _exceptionFns,
  );
  return SendAlexaOfferToMasterResponse.fromJson(response);
}