public ModifyInstanceAttributeResponse modifyInstanceAttribute(ModifyInstanceAttribute modifyInstanceAttribute) {
EC2ModifyInstanceAttribute request = new EC2ModifyInstanceAttribute();
ModifyInstanceAttributeType modifyInstanceAttribute2 = modifyInstanceAttribute.getModifyInstanceAttribute();
ModifyInstanceAttributeTypeChoice_type0 mia = modifyInstanceAttribute2.getModifyInstanceAttributeTypeChoice_type0();
request.setInstanceId(modifyInstanceAttribute2.getInstanceId());
// we only support instanceType and userData
if (mia.getInstanceType() != null) {
request.setInstanceType(mia.getInstanceType().getValue());
} else if (mia.getUserData() != null) {
request.setUserData(mia.getUserData().getValue());
} else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - InstanceType/UserData should be provided");
}
return toModifyInstanceAttributeResponse(engine.modifyInstanceAttribute(request));
}