listProgramManagementAccounts method
Lists program management accounts based on specified criteria.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter catalog :
The catalog identifier to filter accounts.
Parameter accountIds :
Filter by AWS account IDs.
Parameter displayNames :
Filter by display names.
Parameter maxResults :
The maximum number of results to return in a single call.
Parameter nextToken :
Token for retrieving the next page of results.
Parameter programs :
Filter by program types.
Parameter sort :
Sorting options for the results.
Parameter statuses :
Filter by program management account statuses.
Implementation
Future<ListProgramManagementAccountsResponse> listProgramManagementAccounts({
required String catalog,
List<String>? accountIds,
List<String>? displayNames,
int? maxResults,
String? nextToken,
List<Program>? programs,
ListProgramManagementAccountsSortBase? sort,
List<ProgramManagementAccountStatus>? statuses,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'PartnerCentralChannel.ListProgramManagementAccounts'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'catalog': catalog,
if (accountIds != null) 'accountIds': accountIds,
if (displayNames != null) 'displayNames': displayNames,
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
if (programs != null) 'programs': programs.map((e) => e.value).toList(),
if (sort != null) 'sort': sort,
if (statuses != null) 'statuses': statuses.map((e) => e.value).toList(),
},
);
return ListProgramManagementAccountsResponse.fromJson(jsonResponse.body);
}