describeImagePermissions method

Future<DescribeImagePermissionsResult> describeImagePermissions({
  1. required String name,
  2. int? maxResults,
  3. String? nextToken,
  4. List<String>? sharedAwsAccountIds,
})

Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.

May throw ResourceNotFoundException.

Parameter name : The name of the private image for which to describe permissions. The image must be one that you own.

Parameter maxResults : The maximum size of each page of results.

Parameter nextToken : The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Parameter sharedAwsAccountIds : The 12-digit identifier of one or more AWS accounts with which the image is shared.

Implementation

Future<DescribeImagePermissionsResult> describeImagePermissions({
  required String name,
  int? maxResults,
  String? nextToken,
  List<String>? sharedAwsAccountIds,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    500,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.DescribeImagePermissions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (sharedAwsAccountIds != null)
        'SharedAwsAccountIds': sharedAwsAccountIds,
    },
  );

  return DescribeImagePermissionsResult.fromJson(jsonResponse.body);
}