updateLink method

Future<UpdateLinkResponse> updateLink({
  1. required String globalNetworkId,
  2. required String linkId,
  3. Bandwidth? bandwidth,
  4. String? description,
  5. String? provider,
  6. String? type,
})

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

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

Parameter globalNetworkId : The ID of the global network.

Parameter linkId : The ID of the link.

Parameter bandwidth : The upload and download speed in Mbps.

Parameter description : A description of the link.

Length Constraints: Maximum length of 256 characters.

Parameter provider : The provider of the link.

Length Constraints: Maximum length of 128 characters.

Parameter type : The type of the link.

Length Constraints: Maximum length of 128 characters.

Implementation

Future<UpdateLinkResponse> updateLink({
  required String globalNetworkId,
  required String linkId,
  Bandwidth? bandwidth,
  String? description,
  String? provider,
  String? type,
}) async {
  ArgumentError.checkNotNull(globalNetworkId, 'globalNetworkId');
  ArgumentError.checkNotNull(linkId, 'linkId');
  final $payload = <String, dynamic>{
    if (bandwidth != null) 'Bandwidth': bandwidth,
    if (description != null) 'Description': description,
    if (provider != null) 'Provider': provider,
    if (type != null) 'Type': type,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/global-networks/${Uri.encodeComponent(globalNetworkId)}/links/${Uri.encodeComponent(linkId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateLinkResponse.fromJson(response);
}