acceptLink method
Accepts a link request between gateways.
When a requester gateway requests to link with a responder gateway, the responder can use this operation to accept the link request and establish the connection.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter gatewayId :
The unique identifier of the gateway.
Parameter linkId :
The unique identifier of the link.
Parameter logSettings :
Settings for the application logs.
Parameter attributes :
Attributes of the link.
Parameter timeoutInMillis :
The timeout value in milliseconds.
Implementation
Future<AcceptLinkResponse> acceptLink({
required String gatewayId,
required String linkId,
required LinkLogSettings logSettings,
LinkAttributes? attributes,
int? timeoutInMillis,
}) async {
_s.validateNumRange(
'timeoutInMillis',
timeoutInMillis,
100,
5000,
);
final $payload = <String, dynamic>{
'logSettings': logSettings,
if (attributes != null) 'attributes': attributes,
if (timeoutInMillis != null) 'timeoutInMillis': timeoutInMillis,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/gateway/${Uri.encodeComponent(gatewayId)}/link/${Uri.encodeComponent(linkId)}/accept',
exceptionFnMap: _exceptionFns,
);
return AcceptLinkResponse.fromJson(response);
}