getEnrollmentStatusesForOrganization method

Future<GetEnrollmentStatusesForOrganizationResponse> getEnrollmentStatusesForOrganization({
  1. List<EnrollmentFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Returns the Compute Optimizer enrollment (opt-in) status of organization member accounts, if your account is an organization management account.

To get the enrollment status of standalone accounts, use the GetEnrollmentStatus action.

May throw AccessDeniedException. May throw InternalServerException. May throw InvalidParameterValueException. May throw MissingAuthenticationToken. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter filters : An array of objects to specify a filter that returns a more specific list of account enrollment statuses.

Parameter maxResults : The maximum number of account enrollment statuses to return with a single request. You can specify up to 100 statuses to return with each request.

To retrieve the remaining results, make another request with the returned nextToken value.

Parameter nextToken : The token to advance to the next page of account enrollment statuses.

Implementation

Future<GetEnrollmentStatusesForOrganizationResponse>
    getEnrollmentStatusesForOrganization({
  List<EnrollmentFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'ComputeOptimizerService.GetEnrollmentStatusesForOrganization'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'filters': filters,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetEnrollmentStatusesForOrganizationResponse.fromJson(
      jsonResponse.body);
}