updatePortfolioShare method
Updates the specified portfolio share. You can use this API to enable or
disable TagOptions sharing or Principal sharing for an
existing portfolio share.
The portfolio share cannot be updated if the
CreatePortfolioShare operation is IN_PROGRESS,
as the share is not available to recipient entities. In this case, you
must wait for the portfolio share to be completed.
You must provide the accountId or organization node in the
input, but not both.
If the portfolio is shared to both an external account and an organization
node, and both shares need to be updated, you must invoke
UpdatePortfolioShare separately for each share type.
This API cannot be used for removing the portfolio share. You must use
DeletePortfolioShare API for that action.
May throw InvalidParametersException.
May throw InvalidStateException.
May throw OperationNotSupportedException.
May throw ResourceNotFoundException.
Parameter portfolioId :
The unique identifier of the portfolio for which the share will be
updated.
Parameter acceptLanguage :
The language code.
-
jp- Japanese -
zh- Chinese
Parameter accountId :
The Amazon Web Services account Id of the recipient account. This field is
required when updating an external account to account type share.
Parameter sharePrincipals :
A flag to enables or disables Principals sharing in the
portfolio. If this field is not provided, the current state of the
Principals sharing on the portfolio share will not be
modified.
Parameter shareTagOptions :
Enables or disables TagOptions sharing for the portfolio
share. If this field is not provided, the current state of TagOptions
sharing on the portfolio share will not be modified.
Implementation
Future<UpdatePortfolioShareOutput> updatePortfolioShare({
required String portfolioId,
String? acceptLanguage,
String? accountId,
OrganizationNode? organizationNode,
bool? sharePrincipals,
bool? shareTagOptions,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWS242ServiceCatalogService.UpdatePortfolioShare'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'PortfolioId': portfolioId,
if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
if (accountId != null) 'AccountId': accountId,
if (organizationNode != null) 'OrganizationNode': organizationNode,
if (sharePrincipals != null) 'SharePrincipals': sharePrincipals,
if (shareTagOptions != null) 'ShareTagOptions': shareTagOptions,
},
);
return UpdatePortfolioShareOutput.fromJson(jsonResponse.body);
}