func newAssociationResponse(taskARN, associationType, associationName string, state dockerstate.TaskEngineState) (string, error) {
	task, ok := state.TaskByArn(taskARN)
	if !ok {
		return "", errors.Errorf("unable to get task from task arn: %s", taskARN)
	}

	association, ok := task.AssociationByTypeAndName(associationType, associationName)

	if !ok {
		return "", errors.Errorf("unable to get association from association type %s and association name %s", associationType, associationName)
	}

	return association.Content.Value, nil
}
func newAssociationResponse(taskARN, associationType, associationName string, state dockerstate.TaskEngineState) (string, error) {
	task, ok := state.TaskByArn(taskARN)
	if !ok {
		return "", errors.Errorf("unable to get task from task arn: %s", taskARN)
	}

	association, ok := task.AssociationByTypeAndName(associationType, associationName)

	if !ok {
		return "", errors.Errorf("unable to get association from association type %s and association name %s", associationType, associationName)
	}

	return association.Content.Value, nil
}
// Association response is a string that's assumed to be in valid JSON format, which will be exactly the same as
// the value of Association.Content.Value (cp is responsible to validate it and deal with it if it's not valid). We
// don't do any decoding base on the encoding, because the only encoding that cp currently sends us is 'identity';
// we don't explicitly model the value field as a struct because we don't want to let agent's implementation depends
// on the payload format of the association (i.e. eia device for now)