listConstraintsForPortfolio method

Future<ListConstraintsForPortfolioOutput> listConstraintsForPortfolio({
  1. required String portfolioId,
  2. String? acceptLanguage,
  3. int? pageSize,
  4. String? pageToken,
  5. String? productId,
})

Lists the constraints for the specified portfolio and product.

May throw InvalidParametersException. May throw ResourceNotFoundException.

Parameter portfolioId : The portfolio identifier.

Parameter acceptLanguage : The language code.

  • jp - Japanese
  • zh - Chinese

Parameter pageSize : The maximum number of items to return with this call.

Parameter pageToken : The page token for the next set of results. To retrieve the first set of results, use null.

Parameter productId : The product identifier.

Implementation

Future<ListConstraintsForPortfolioOutput> listConstraintsForPortfolio({
  required String portfolioId,
  String? acceptLanguage,
  int? pageSize,
  String? pageToken,
  String? productId,
}) async {
  _s.validateNumRange(
    'pageSize',
    pageSize,
    0,
    20,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.ListConstraintsForPortfolio'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'PortfolioId': portfolioId,
      if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
      if (pageSize != null) 'PageSize': pageSize,
      if (pageToken != null) 'PageToken': pageToken,
      if (productId != null) 'ProductId': productId,
    },
  );

  return ListConstraintsForPortfolioOutput.fromJson(jsonResponse.body);
}