updateRelay method

Future<void> updateRelay({
  1. required String relayId,
  2. RelayAuthentication? authentication,
  3. String? relayName,
  4. String? serverName,
  5. int? serverPort,
})

Updates the attributes of an existing relay resource.

May throw ConflictException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter relayId : The unique relay identifier.

Parameter authentication : Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.

Parameter relayName : The name of the relay resource.

Parameter serverName : The destination relay server address.

Parameter serverPort : The destination relay server port.

Implementation

Future<void> updateRelay({
  required String relayId,
  RelayAuthentication? authentication,
  String? relayName,
  String? serverName,
  int? serverPort,
}) async {
  _s.validateNumRange(
    'serverPort',
    serverPort,
    1,
    65535,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'MailManagerSvc.UpdateRelay'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'RelayId': relayId,
      if (authentication != null) 'Authentication': authentication,
      if (relayName != null) 'RelayName': relayName,
      if (serverName != null) 'ServerName': serverName,
      if (serverPort != null) 'ServerPort': serverPort,
    },
  );
}