describePortfolioShares method
Returns a summary of each of the portfolio shares that were created for the specified portfolio.
You can use this API to determine which accounts or organizational nodes this portfolio have been shared, whether the recipient entity has imported the share, and whether TagOptions are included with the share.
The PortfolioId
and Type
parameters are both
required.
May throw ResourceNotFoundException. May throw InvalidParametersException.
Parameter portfolioId
:
The unique identifier of the portfolio for which shares will be retrieved.
Parameter type
:
The type of portfolio share to summarize. This field acts as a filter on
the type of portfolio share, which can be one of the following:
-
ACCOUNT
- Represents an external account to account share. -
ORGANIZATION
- Represents a share to an organization. This share is available to every account in the organization. -
ORGANIZATIONAL_UNIT
- Represents a share to an organizational unit. -
ORGANIZATION_MEMBER_ACCOUNT
- Represents a share to an account in the organization.
Parameter pageSize
:
The maximum number of items to return with this call.
Parameter pageToken
:
The page token for the next set of results. To retrieve the first set of
results, use null.
Implementation
Future<DescribePortfolioSharesOutput> describePortfolioShares({
required String portfolioId,
required DescribePortfolioShareType type,
int? pageSize,
String? pageToken,
}) async {
ArgumentError.checkNotNull(portfolioId, 'portfolioId');
_s.validateStringLength(
'portfolioId',
portfolioId,
1,
100,
isRequired: true,
);
ArgumentError.checkNotNull(type, 'type');
_s.validateNumRange(
'pageSize',
pageSize,
0,
100,
);
_s.validateStringLength(
'pageToken',
pageToken,
0,
2024,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWS242ServiceCatalogService.DescribePortfolioShares'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PortfolioId': portfolioId,
'Type': type.toValue(),
if (pageSize != null) 'PageSize': pageSize,
if (pageToken != null) 'PageToken': pageToken,
},
);
return DescribePortfolioSharesOutput.fromJson(jsonResponse.body);
}