listHosts method
Lists the hosts associated with your account.
Parameter maxResults
:
The maximum number of results to return in a single call. To retrieve the
remaining results, make another call with the returned
nextToken
value.
Parameter nextToken
:
The token that was returned from the previous ListHosts
call,
which can be used to return the next set of hosts in the list.
Implementation
Future<ListHostsOutput> listHosts({
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
0,
100,
);
_s.validateStringLength(
'nextToken',
nextToken,
1,
1024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'com.amazonaws.codestar.connections.CodeStar_connections_20191201.ListHosts'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListHostsOutput.fromJson(jsonResponse.body);
}