listBudgetsForResource method
Lists all the budgets associated to the specified resource.
May throw ResourceNotFoundException. May throw InvalidParametersException.
Parameter resourceId
:
The resource identifier.
Parameter acceptLanguage
:
The language code.
-
en
- English (default) -
jp
- Japanese -
zh
- Chinese
Parameter pageSize
:
The maximum number of items to return with this call.
Parameter pageToken
:
The page token for the next set of results. To retrieve the first set of
results, use null.
Implementation
Future<ListBudgetsForResourceOutput> listBudgetsForResource({
required String resourceId,
String? acceptLanguage,
int? pageSize,
String? pageToken,
}) async {
ArgumentError.checkNotNull(resourceId, 'resourceId');
_s.validateStringLength(
'resourceId',
resourceId,
1,
100,
isRequired: true,
);
_s.validateStringLength(
'acceptLanguage',
acceptLanguage,
0,
100,
);
_s.validateNumRange(
'pageSize',
pageSize,
0,
20,
);
_s.validateStringLength(
'pageToken',
pageToken,
0,
2024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWS242ServiceCatalogService.ListBudgetsForResource'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceId': resourceId,
if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
if (pageSize != null) 'PageSize': pageSize,
if (pageToken != null) 'PageToken': pageToken,
},
);
return ListBudgetsForResourceOutput.fromJson(jsonResponse.body);
}