getSignalingChannelEndpoint method

Future<GetSignalingChannelEndpointOutput> getSignalingChannelEndpoint({
  1. required String channelARN,
  2. SingleMasterChannelEndpointConfiguration? singleMasterChannelEndpointConfiguration,
})

Provides an endpoint for the specified signaling channel to send and receive messages. This API uses the SingleMasterChannelEndpointConfiguration input parameter, which consists of the Protocols and Role properties.

Protocols is used to determine the communication mechanism. For example, if you specify WSS as the protocol, this API produces a secure websocket endpoint. If you specify HTTPS as the protocol, this API generates an HTTPS endpoint.

Role determines the messaging permissions. A MASTER role results in this API generating an endpoint that a client can use to communicate with any of the viewers on the channel. A VIEWER role results in this API generating an endpoint that a client can use to communicate only with a MASTER.

May throw InvalidArgumentException. May throw ClientLimitExceededException. May throw ResourceNotFoundException. May throw ResourceInUseException. May throw AccessDeniedException.

Parameter channelARN : The Amazon Resource Name (ARN) of the signalling channel for which you want to get an endpoint.

Parameter singleMasterChannelEndpointConfiguration : A structure containing the endpoint configuration for the SINGLE_MASTER channel type.

Implementation

Future<GetSignalingChannelEndpointOutput> getSignalingChannelEndpoint({
  required String channelARN,
  SingleMasterChannelEndpointConfiguration?
      singleMasterChannelEndpointConfiguration,
}) async {
  ArgumentError.checkNotNull(channelARN, 'channelARN');
  _s.validateStringLength(
    'channelARN',
    channelARN,
    1,
    1024,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'ChannelARN': channelARN,
    if (singleMasterChannelEndpointConfiguration != null)
      'SingleMasterChannelEndpointConfiguration':
          singleMasterChannelEndpointConfiguration,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/getSignalingChannelEndpoint',
    exceptionFnMap: _exceptionFns,
  );
  return GetSignalingChannelEndpointOutput.fromJson(response);
}