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. String? supportDescription,
  10. String? supportEmail,
  11. String? supportUrl,
})

Updates the specified product.

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

Parameter id : The product identifier.

Parameter acceptLanguage : The language code.

  • en - English (default)
  • 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 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,
  String? supportDescription,
  String? supportEmail,
  String? supportUrl,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    1,
    100,
    isRequired: true,
  );
  _s.validateStringLength(
    'acceptLanguage',
    acceptLanguage,
    0,
    100,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    8191,
  );
  _s.validateStringLength(
    'distributor',
    distributor,
    0,
    8191,
  );
  _s.validateStringLength(
    'name',
    name,
    0,
    8191,
  );
  _s.validateStringLength(
    'owner',
    owner,
    0,
    8191,
  );
  _s.validateStringLength(
    'supportDescription',
    supportDescription,
    0,
    8191,
  );
  _s.validateStringLength(
    'supportEmail',
    supportEmail,
    0,
    254,
  );
  _s.validateStringLength(
    'supportUrl',
    supportUrl,
    0,
    2083,
  );
  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 (supportDescription != null)
        'SupportDescription': supportDescription,
      if (supportEmail != null) 'SupportEmail': supportEmail,
      if (supportUrl != null) 'SupportUrl': supportUrl,
    },
  );

  return UpdateProductOutput.fromJson(jsonResponse.body);
}