getAttributeValues method
Returns a list of attribute values. Attibutes are similar to the details in a Price List API offer file. For a list of available attributes, see Offer File Definitions in the AWS Billing and Cost Management User Guide.
May throw InternalErrorException. May throw InvalidParameterException. May throw NotFoundException. May throw InvalidNextTokenException. May throw ExpiredNextTokenException.
Parameter attributeName :
The name of the attribute that you want to retrieve the values for, such
as volumeType.
Parameter serviceCode :
The service code for the service whose attributes you want to retrieve.
For example, if you want the retrieve an EC2 attribute, use
AmazonEC2.
Parameter maxResults :
The maximum number of results to return in response.
Parameter nextToken :
The pagination token that indicates the next set of results that you want
to retrieve.
Implementation
Future<GetAttributeValuesResponse> getAttributeValues({
required String attributeName,
required String serviceCode,
int? maxResults,
String? nextToken,
}) async {
ArgumentError.checkNotNull(attributeName, 'attributeName');
ArgumentError.checkNotNull(serviceCode, 'serviceCode');
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSPriceListService.GetAttributeValues'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AttributeName': attributeName,
'ServiceCode': serviceCode,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return GetAttributeValuesResponse.fromJson(jsonResponse.body);
}