disassociatePrincipalFromPortfolio method

Future<void> disassociatePrincipalFromPortfolio({
  1. required String portfolioId,
  2. required String principalARN,
  3. String? acceptLanguage,
  4. PrincipalType? principalType,
})

Disassociates a previously associated principal ARN from a specified portfolio.

The PrincipalType and PrincipalARN must match the AssociatePrincipalWithPortfolio call request details. For example, to disassociate an association created with a PrincipalARN of PrincipalType IAM you must use the PrincipalType IAM when calling DisassociatePrincipalFromPortfolio.

For portfolios that have been shared with principal name sharing enabled: after disassociating a principal, share recipient accounts will no longer be able to provision products in this portfolio using a role matching the name of the associated principal.

For more information, review associate-principal-with-portfolio in the Amazon Web Services CLI Command Reference.

May throw InvalidParametersException. May throw ResourceNotFoundException.

Parameter portfolioId : The portfolio identifier.

Parameter principalARN : The ARN of the principal (user, role, or group). This field allows an ARN with no accountID with or without wildcard characters if PrincipalType is IAM_PATTERN.

Parameter acceptLanguage : The language code.

  • jp - Japanese
  • zh - Chinese

Parameter principalType : The supported value is IAM if you use a fully defined ARN, or IAM_PATTERN if you specify an IAM ARN with no AccountId, with or without wildcard characters.

Implementation

Future<void> disassociatePrincipalFromPortfolio({
  required String portfolioId,
  required String principalARN,
  String? acceptLanguage,
  PrincipalType? principalType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWS242ServiceCatalogService.DisassociatePrincipalFromPortfolio'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PortfolioId': portfolioId,
      'PrincipalARN': principalARN,
      if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
      if (principalType != null) 'PrincipalType': principalType.value,
    },
  );
}