getInvoiceUnit method
This retrieves the invoice unit definition.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter invoiceUnitArn :
The ARN to identify an invoice unit. This information can't be modified or
deleted.
Parameter asOf :
The state of an invoice unit at a specified time. You can see legacy
invoice units that are currently deleted if the AsOf time is
set to before it was deleted. If an AsOf is not provided, the
default value is the current time.
Implementation
Future<GetInvoiceUnitResponse> getInvoiceUnit({
required String invoiceUnitArn,
DateTime? asOf,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'Invoicing.GetInvoiceUnit'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InvoiceUnitArn': invoiceUnitArn,
if (asOf != null) 'AsOf': unixTimestampToJson(asOf),
},
);
return GetInvoiceUnitResponse.fromJson(jsonResponse.body);
}