return response;
}
public static TerminateInstancesResponse toTermInstancesResponse(EC2StopInstancesResponse engineResponse) {
TerminateInstancesResponse response = new TerminateInstancesResponse();
TerminateInstancesResponseType param1 = new TerminateInstancesResponseType();
InstanceStateChangeSetType param2 = new InstanceStateChangeSetType();
EC2Instance[] instances = engineResponse.getInstanceSet();
for (int i = 0; i < instances.length; i++) {
InstanceStateChangeType param3 = new InstanceStateChangeType();
param3.setInstanceId(instances[i].getId());
InstanceStateType param4 = new InstanceStateType();
param4.setCode(toAmazonCode(instances[i].getState()));
param4.setName(toAmazonStateName(instances[i].getState()));
param3.setCurrentState(param4);
InstanceStateType param5 = new InstanceStateType();
param5.setCode(toAmazonCode(instances[i].getPreviousState()));
param5.setName(toAmazonStateName(instances[i].getPreviousState()));
param3.setPreviousState(param5);
param2.addItem(param3);
}
param1.setRequestId(UUID.randomUUID().toString());
param1.setInstancesSet(param2);
response.setTerminateInstancesResponse(param1);
return response;
}