updateGateway method

Future<void> updateGateway({
  1. required String gatewayArn,
  2. String? description,
  3. String? name,
  4. String? softwareVersion,
})

Updates the details of a gateway. If any optional field is not provided, the existing corresponding value is left unmodified.

May throw NotFoundException. May throw NameInUseException.

Parameter gatewayArn : The ARN of the gateway to update.

Parameter description : The updated description of the gateway.

Parameter name : The updated name of the gateway.

Parameter softwareVersion : The updated software version of the gateway. The gateway automatically updates its software version during normal operation.

Implementation

Future<void> updateGateway({
  required String gatewayArn,
  String? description,
  String? name,
  String? softwareVersion,
}) async {
  ArgumentError.checkNotNull(gatewayArn, 'gatewayArn');
  _s.validateStringLength(
    'description',
    description,
    0,
    200,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    253,
  );
  _s.validateStringLength(
    'softwareVersion',
    softwareVersion,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.UpdateGateway'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GatewayArn': gatewayArn,
      if (description != null) 'Description': description,
      if (name != null) 'Name': name,
      if (softwareVersion != null) 'SoftwareVersion': softwareVersion,
    },
  );
}