updateConnection method

Future<UpdateConnectionResponse> updateConnection({
  1. required String connectionId,
  2. required String globalNetworkId,
  3. String? connectedLinkId,
  4. String? description,
  5. String? linkId,
})

Updates the information for an existing connection. To remove information for any of the parameters, specify an empty string.

May throw ValidationException. May throw AccessDeniedException. May throw ResourceNotFoundException. May throw ConflictException. May throw ThrottlingException. May throw InternalServerException.

Parameter connectionId : The ID of the connection.

Parameter globalNetworkId : The ID of the global network.

Parameter connectedLinkId : The ID of the link for the second device in the connection.

Parameter description : A description of the connection.

Length Constraints: Maximum length of 256 characters.

Parameter linkId : The ID of the link for the first device in the connection.

Implementation

Future<UpdateConnectionResponse> updateConnection({
  required String connectionId,
  required String globalNetworkId,
  String? connectedLinkId,
  String? description,
  String? linkId,
}) async {
  ArgumentError.checkNotNull(connectionId, 'connectionId');
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  final $payload = <String, dynamic>{
    if (connectedLinkId != null) 'ConnectedLinkId': connectedLinkId,
    if (description != null) 'Description': description,
    if (linkId != null) 'LinkId': linkId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/connections/${Uri.encodeComponent(connectionId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateConnectionResponse.fromJson(response);
}