deletePortfolioShare method

Future<DeletePortfolioShareOutput> deletePortfolioShare({
  1. required String portfolioId,
  2. String? acceptLanguage,
  3. String? accountId,
  4. OrganizationNode? organizationNode,
})

Stops sharing the specified portfolio with the specified account or organization node. Shares to an organization node can only be deleted by the management account of an organization or by a delegated administrator.

Note that if a delegated admin is de-registered, portfolio shares created from that account are removed.

May throw ResourceNotFoundException. May throw InvalidParametersException. May throw OperationNotSupportedException. May throw InvalidStateException.

Parameter portfolioId : The portfolio identifier.

Parameter acceptLanguage : The language code.

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

Parameter accountId : The AWS account ID.

Parameter organizationNode : The organization node to whom you are going to stop sharing.

Implementation

Future<DeletePortfolioShareOutput> deletePortfolioShare({
  required String portfolioId,
  String? acceptLanguage,
  String? accountId,
  OrganizationNode? organizationNode,
}) 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.DeletePortfolioShare'
  };
  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,
    },
  );

  return DeletePortfolioShareOutput.fromJson(jsonResponse.body);
}