getDevice method

Future<GetDeviceResponse> getDevice({
  1. String? deviceArn,
})

Gets the details of a device by device ARN.

May throw NotFoundException.

Parameter deviceArn : The ARN of the device for which to request details. Required.

Implementation

Future<GetDeviceResponse> getDevice({
  String? deviceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AlexaForBusiness.GetDevice'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (deviceArn != null) 'DeviceArn': deviceArn,
    },
  );

  return GetDeviceResponse.fromJson(jsonResponse.body);
}