disassociatePrincipalFromPortfolio method

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

Disassociates a previously associated principal ARN from a specified portfolio.

May throw InvalidParametersException. May throw ResourceNotFoundException.

Parameter portfolioId : The portfolio identifier.

Parameter principalARN : The ARN of the principal (IAM user, role, or group).

Parameter acceptLanguage : The language code.

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

Implementation

Future<void> disassociatePrincipalFromPortfolio({
  required String portfolioId,
  required String principalARN,
  String? acceptLanguage,
}) async {
  ArgumentError.checkNotNull(portfolioId, 'portfolioId');
  _s.validateStringLength(
    'portfolioId',
    portfolioId,
    1,
    100,
    isRequired: true,
  );
  ArgumentError.checkNotNull(principalARN, 'principalARN');
  _s.validateStringLength(
    'principalARN',
    principalARN,
    1,
    1000,
    isRequired: true,
  );
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  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,
    },
  );
}