listPrincipals method

Future<ListPrincipalsResponse> listPrincipals({
  1. required ResourceOwner resourceOwner,
  2. int? maxResults,
  3. String? nextToken,
  4. List<String>? principals,
  5. String? resourceArn,
  6. List<String>? resourceShareArns,
  7. String? resourceType,
})

Lists the principals that you have shared resources with or that have shared resources with you.

May throw MalformedArnException. May throw UnknownResourceException. May throw InvalidNextTokenException. May throw InvalidParameterException. May throw ServerInternalException. May throw ServiceUnavailableException.

Parameter resourceOwner : The type of owner.

Parameter maxResults : The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

Parameter nextToken : The token for the next page of results.

Parameter principals : The principals.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource.

Parameter resourceShareArns : The Amazon Resource Names (ARN) of the resource shares.

Parameter resourceType : The resource type.

Valid values: codebuild:Project | codebuild:ReportGroup | ec2:CapacityReservation | ec2:DedicatedHost | ec2:Subnet | ec2:TrafficMirrorTarget | ec2:TransitGateway | imagebuilder:Component | imagebuilder:Image | imagebuilder:ImageRecipe | license-manager:LicenseConfiguration I resource-groups:Group | rds:Cluster | route53resolver:ResolverRule

Implementation

Future<ListPrincipalsResponse> listPrincipals({
  required ResourceOwner resourceOwner,
  int? maxResults,
  String? nextToken,
  List<String>? principals,
  String? resourceArn,
  List<String>? resourceShareArns,
  String? resourceType,
}) async {
  ArgumentError.checkNotNull(resourceOwner, 'resourceOwner');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $payload = <String, dynamic>{
    'resourceOwner': resourceOwner.toValue(),
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (principals != null) 'principals': principals,
    if (resourceArn != null) 'resourceArn': resourceArn,
    if (resourceShareArns != null) 'resourceShareArns': resourceShareArns,
    if (resourceType != null) 'resourceType': resourceType,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listprincipals',
    exceptionFnMap: _exceptionFns,
  );
  return ListPrincipalsResponse.fromJson(response);
}