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 ClusterNotFoundException. May throw TargetNotFoundException. May throw InvalidParameterException.

Parameter attributes : The attributes to delete from your resource. You can specify up to 10 attributes per request. For custom attributes, specify the attribute name and target ID, but do not 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 {
  ArgumentError.checkNotNull(attributes, 'attributes');
  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);
}