listLensShares method

Future<ListLensSharesOutput> listLensShares({
  1. required String lensAlias,
  2. int? maxResults,
  3. String? nextToken,
  4. String? sharedWithPrefix,
  5. ShareStatus? status,
})

List the lens shares associated with the lens.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter maxResults : The maximum number of results to return for this request.

Parameter sharedWithPrefix : The Amazon Web Services account ID, organization ID, or organizational unit (OU) ID with which the lens is shared.

Implementation

Future<ListLensSharesOutput> listLensShares({
  required String lensAlias,
  int? maxResults,
  String? nextToken,
  String? sharedWithPrefix,
  ShareStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
    if (sharedWithPrefix != null) 'SharedWithPrefix': [sharedWithPrefix],
    if (status != null) 'Status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/lenses/${Uri.encodeComponent(lensAlias)}/shares',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListLensSharesOutput.fromJson(response);
}