updatePortfolioShare method

Future<UpdatePortfolioShareOutput> updatePortfolioShare({
  1. required String portfolioId,
  2. String? acceptLanguage,
  3. String? accountId,
  4. OrganizationNode? organizationNode,
  5. bool? shareTagOptions,
})

Updates the specified portfolio share. You can use this API to enable or disable TagOptions 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 ResourceNotFoundException. May throw InvalidParametersException. May throw OperationNotSupportedException. May throw InvalidStateException.

Parameter portfolioId : The unique identifier of the portfolio for which the share will be updated.

Parameter acceptLanguage : The language code.

  • en - English (default)
  • jp - Japanese
  • zh - Chinese

Parameter accountId : The AWS Account Id of the recipient account. This field is required when updating an external account to account type share.

Parameter shareTagOptions : A flag to enable or disable 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? shareTagOptions,
}) async {
  ArgumentError.checkNotNull(portfolioId, 'portfolioId');
  _s.validateStringLength(
    'portfolioId',
    portfolioId,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  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 (shareTagOptions != null) 'ShareTagOptions': shareTagOptions,
    },
  );

  return UpdatePortfolioShareOutput.fromJson(jsonResponse.body);
}