listPermissionAssociations method

Future<ListPermissionAssociationsResponse> listPermissionAssociations({
  1. ResourceShareAssociationStatus? associationStatus,
  2. bool? defaultVersion,
  3. PermissionFeatureSet? featureSet,
  4. int? maxResults,
  5. String? nextToken,
  6. String? permissionArn,
  7. int? permissionVersion,
  8. String? resourceType,
})

Lists information about the managed permission and its associations to any resource shares that use this managed permission. This lets you see which resource shares use which versions of the specified managed permission.

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

Parameter associationStatus : Specifies that you want to list only those associations with resource shares that match this status.

Parameter defaultVersion : When true, specifies that you want to list only those associations with resource shares that use the default version of the specified managed permission.

When false (the default value), lists associations with resource shares that use any version of the specified managed permission.

Parameter featureSet : Specifies that you want to list only those associations with resource shares that have a featureSet with this value.

Parameter maxResults : Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

Parameter nextToken : Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call's NextToken response to request the next page of results.

Parameter permissionArn : Specifies the Amazon Resource Name (ARN) of the managed permission.

Parameter permissionVersion : Specifies that you want to list only those associations with resource shares that use this version of the managed permission. If you don't provide a value for this parameter, then the operation returns information about associations with resource shares that use any version of the managed permission.

Parameter resourceType : Specifies that you want to list only those associations with resource shares that include at least one resource of this resource type.

Implementation

Future<ListPermissionAssociationsResponse> listPermissionAssociations({
  ResourceShareAssociationStatus? associationStatus,
  bool? defaultVersion,
  PermissionFeatureSet? featureSet,
  int? maxResults,
  String? nextToken,
  String? permissionArn,
  int? permissionVersion,
  String? resourceType,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $payload = <String, dynamic>{
    if (associationStatus != null)
      'associationStatus': associationStatus.value,
    if (defaultVersion != null) 'defaultVersion': defaultVersion,
    if (featureSet != null) 'featureSet': featureSet.value,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (permissionArn != null) 'permissionArn': permissionArn,
    if (permissionVersion != null) 'permissionVersion': permissionVersion,
    if (resourceType != null) 'resourceType': resourceType,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listpermissionassociations',
    exceptionFnMap: _exceptionFns,
  );
  return ListPermissionAssociationsResponse.fromJson(response);
}