updateProduct method

Future<UpdateProductOutput> updateProduct({
  1. required String id,
  2. String? acceptLanguage,
  3. List<Tag>? addTags,
  4. String? description,
  5. String? distributor,
  6. String? name,
  7. String? owner,
  8. List<String>? removeTags,
  9. SourceConnection? sourceConnection,
  10. String? supportDescription,
  11. String? supportEmail,
  12. String? supportUrl,
})

Updates the specified product.

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

Parameter id : The product identifier.

Parameter acceptLanguage : The language code.

  • jp - Japanese
  • zh - Chinese

Parameter addTags : The tags to add to the product.

Parameter description : The updated description of the product.

Parameter distributor : The updated distributor of the product.

Parameter name : The updated product name.

Parameter owner : The updated owner of the product.

Parameter removeTags : The tags to remove from the product.

Parameter sourceConnection : Specifies connection details for the updated product and syncs the product to the connection source artifact. This automatically manages the product's artifacts based on changes to the source. The SourceConnection parameter consists of the following sub-fields.

  • Type
  • ConnectionParamters

Parameter supportDescription : The updated support description for the product.

Parameter supportEmail : The updated support email for the product.

Parameter supportUrl : The updated support URL for the product.

Implementation

Future<UpdateProductOutput> updateProduct({
  required String id,
  String? acceptLanguage,
  List<Tag>? addTags,
  String? description,
  String? distributor,
  String? name,
  String? owner,
  List<String>? removeTags,
  SourceConnection? sourceConnection,
  String? supportDescription,
  String? supportEmail,
  String? supportUrl,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWS242ServiceCatalogService.UpdateProduct'
  };
  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 (distributor != null) 'Distributor': distributor,
      if (name != null) 'Name': name,
      if (owner != null) 'Owner': owner,
      if (removeTags != null) 'RemoveTags': removeTags,
      if (sourceConnection != null) 'SourceConnection': sourceConnection,
      if (supportDescription != null)
        'SupportDescription': supportDescription,
      if (supportEmail != null) 'SupportEmail': supportEmail,
      if (supportUrl != null) 'SupportUrl': supportUrl,
    },
  );

  return UpdateProductOutput.fromJson(jsonResponse.body);
}