createLink method
Creates a new link between gateways.
Establishes a connection that allows gateways to communicate and exchange bid requests and responses.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter gatewayId :
The unique identifier of the gateway.
Parameter logSettings :
Settings for the application logs.
Parameter peerGatewayId :
The unique identifier of the peer gateway.
Parameter attributes :
Attributes of the link.
Parameter httpResponderAllowed :
Boolean to specify if an HTTP responder is allowed.
Parameter tags :
A map of the key-value pairs of the tag or tags to assign to the resource.
Parameter timeoutInMillis :
The timeout value in milliseconds.
Implementation
Future<CreateLinkResponse> createLink({
required String gatewayId,
required LinkLogSettings logSettings,
required String peerGatewayId,
LinkAttributes? attributes,
bool? httpResponderAllowed,
Map<String, String>? tags,
int? timeoutInMillis,
}) async {
_s.validateNumRange(
'timeoutInMillis',
timeoutInMillis,
100,
5000,
);
final $payload = <String, dynamic>{
'logSettings': logSettings,
'peerGatewayId': peerGatewayId,
if (attributes != null) 'attributes': attributes,
if (httpResponderAllowed != null)
'httpResponderAllowed': httpResponderAllowed,
if (tags != null) 'tags': tags,
if (timeoutInMillis != null) 'timeoutInMillis': timeoutInMillis,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/gateway/${Uri.encodeComponent(gatewayId)}/create-link',
exceptionFnMap: _exceptionFns,
);
return CreateLinkResponse.fromJson(response);
}