updatePortfolio method

Future<UpdatePortfolioOutput> updatePortfolio({
  1. required String id,
  2. String? acceptLanguage,
  3. List<Tag>? addTags,
  4. String? description,
  5. String? displayName,
  6. String? providerName,
  7. List<String>? removeTags,
})

Updates the specified portfolio.

You cannot update a product that was shared with you.

May throw InvalidParametersException. May throw ResourceNotFoundException. May throw LimitExceededException. May throw TagOptionNotMigratedException.

Parameter id : The portfolio identifier.

Parameter acceptLanguage : The language code.

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

Parameter addTags : The tags to add.

Parameter description : The updated description of the portfolio.

Parameter displayName : The name to use for display purposes.

Parameter providerName : The updated name of the portfolio provider.

Parameter removeTags : The tags to remove.

Implementation

Future<UpdatePortfolioOutput> updatePortfolio({
  required String id,
  String? acceptLanguage,
  List<Tag>? addTags,
  String? description,
  String? displayName,
  String? providerName,
  List<String>? removeTags,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    2000,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    1,
    100,
  );
  _s.validateStringLength(
    'providerName',
    providerName,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.UpdatePortfolio'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Id': id,
      if (acceptLanguage != null) 'AcceptLanguage': acceptLanguage,
      if (addTags != null) 'AddTags': addTags,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
      if (providerName != null) 'ProviderName': providerName,
      if (removeTags != null) 'RemoveTags': removeTags,
    },
  );

  return UpdatePortfolioOutput.fromJson(jsonResponse.body);
}