deleteAttributes method

Future<DeleteAttributesResponse> deleteAttributes({
  1. required List<Attribute> attributes,
  2. String? cluster,
})

Deletes one or more custom attributes from an Amazon ECS resource.

May throw AccessDeniedException. May throw ClientException. May throw ClusterNotFoundException. May throw InvalidParameterException. May throw ServerException. May throw TargetNotFoundException.

Parameter attributes : The attributes to delete from your resource. You can specify up to 10 attributes for each request. For custom attributes, specify the attribute name and target ID, but don't specify the value. If you specify the target ID using the short form, you must also specify the target type.

Parameter cluster : The short name or full Amazon Resource Name (ARN) of the cluster that contains the resource to delete attributes. If you do not specify a cluster, the default cluster is assumed.

Implementation

Future<DeleteAttributesResponse> deleteAttributes({
  required List<Attribute> attributes,
  String? cluster,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DeleteAttributes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'attributes': attributes,
      if (cluster != null) 'cluster': cluster,
    },
  );

  return DeleteAttributesResponse.fromJson(jsonResponse.body);
}