Computing > 10 - Requests for Assistance > Get user assistance requests

10.1 Get user assistance requests

The method GetUserAssistanceRequests provide a list of the assistance requests inserted by the user. Data can be filtered by date interval and request status.

Parameters
dateStart
Type: DateTime
Value of type DateTime which is the start date of interval

dateEnd
Type: DateTime
Value of type DateTime which is the start date of interval

status
Type: AssistanceRequestStatus
Value of type AssistanceRequestStatus which is the requests status filter
 
/// IWsEndUser.GetUserAssistanceRequests Method (c# .NET)
public static string GetUserAssistanceRequests(WsEndUserClient client,
    DateTime dateStart, DateTime dateEnd, AssistanceRequestStatus status)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // call method GetUserAssistanceRequests, 
        // obtaining a WsResultOfArrayOfAssistanceRequest item
        WsResultOfArrayOfAssistanceRequest result =
            client.GetUserAssistanceRequests(dateStart, dateEnd, status);

        //if the call is not successful, re-run the error indicating the message
        if (result.Success)
        {
            AssistanceRequest[] arrayOfAssistanceRequest = result.Value;

            //browse the list and print the values
            foreach (AssistanceRequest assistanceRequest in arrayOfAssistanceRequest)
            {
                stringBuilder.Append(" ---- Request ---- ");
                stringBuilder.Append("AssistanceQuotation: ");
                stringBuilder.Append(assistanceRequest.AssistanceQuotation);
                stringBuilder.Append("AssistanceRequestBody: ");
                stringBuilder.Append(assistanceRequest.AssistanceRequestBody);
                stringBuilder.Append("AssistanceRequestCurrency: ");
                stringBuilder.Append(assistanceRequest.AssistanceRequestCurrency);
                stringBuilder.Append("AssistanceRequestID: ");
                stringBuilder.Append(assistanceRequest.AssistanceRequestID);
                stringBuilder.Append("AssistanceRequestStatus: ");
                stringBuilder.Append(assistanceRequest.AssistanceRequestStatus);
                stringBuilder.Append("AssistanceRequestSubject: ");
                stringBuilder.Append(assistanceRequest.AssistanceRequestSubject);
                stringBuilder.Append("CompanyID: ");
                stringBuilder.Append(assistanceRequest.CompanyID);
                stringBuilder.Append("CompanyName: ");
                stringBuilder.Append(assistanceRequest.CompanyName);
                stringBuilder.Append("CustomerFullName: ");
                stringBuilder.Append(assistanceRequest.CustomerFullName);
                stringBuilder.Append("CustomerMail: ");
                stringBuilder.Append(assistanceRequest.CustomerMail);
                stringBuilder.Append("CustomerPhoneNumber: ");
                stringBuilder.Append(assistanceRequest.CustomerPhoneNumber);
                stringBuilder.Append("DataCenterID: ");
                stringBuilder.Append(assistanceRequest.DataCenterID);
                stringBuilder.Append("Language: ");
                stringBuilder.Append(assistanceRequest.Language);
                stringBuilder.Append("LastModifiedDate: ");
                stringBuilder.Append(assistanceRequest.LastModifiedDate);
                stringBuilder.Append("ResourceID: ");
                stringBuilder.Append(assistanceRequest.ResourceID);
                stringBuilder.Append("UnitPrice: ");
                stringBuilder.Append(assistanceRequest.UnitPrice);
                stringBuilder.Append("UserID: ");
                stringBuilder.Append(assistanceRequest.UserID);
                stringBuilder.Append("VirtualMachineID: ");
                stringBuilder.Append(assistanceRequest.VirtualMachineID);
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
/// IWsEndUser.GetUserAssistanceRequests Method (JAVA)
private static String getUserAssistanceRequests(IWsEndUser client,
    XMLGregorianCalendar dateStart, XMLGregorianCalendar dateEnd, 
    AssistanceRequestStatus status)
{
    //specify the account login details 
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.USERNAME_PROPERTY, "ARU-0000");
    ((BindingProvider) client).getRequestContext()
            .put(BindingProvider.PASSWORD_PROPERTY, "0123456789");

    StringBuilder StringBuilder = new StringBuilder();

    try
    {
        // call method GetUserAssistanceRequests, 
        // obtaining a WsResultOfArrayOfAssistanceRequest item
        WsResultOfArrayOfAssistanceRequest result =
            client.getUserAssistanceRequests(dateStart, dateEnd, status);

        //if the call is not successful, re-run the error indicating the message
        if (result.isSuccess())
        {
            ArrayOfAssistanceRequest arrayOfAssistanceRequest = result.getValue();
            List<AssistanceRequest> listOfAssistanceRequest = 
                arrayOfAssistanceRequest.getAssistanceRequest();
            
            //browse the list and print the values
            for (Iterator<AssistanceRequest> it = 
                listOfAssistanceRequest.iterator(); it.hasNext();) 
            {
                AssistanceRequest assistanceRequest = it.next();
                StringBuilder.append(" ---- Request ---- ");
                StringBuilder.append("AssistanceQuotation: ");
                StringBuilder.append(assistanceRequest.getAssistanceQuotation());
                StringBuilder.append("AssistanceRequestBody: ");
                StringBuilder.append(assistanceRequest.getAssistanceRequestBody());
                StringBuilder.append("AssistanceRequestCurrency: ");
                StringBuilder.append(
                    assistanceRequest.getAssistanceRequestCurrency());
                StringBuilder.append("AssistanceRequestID: ");
                StringBuilder.append(assistanceRequest.getAssistanceRequestID());
                StringBuilder.append("AssistanceRequestStatus: ");
                StringBuilder.append(
                    assistanceRequest.getAssistanceRequestStatus());
                StringBuilder.append("AssistanceRequestSubject: ");
                StringBuilder.append(
                    assistanceRequest.getAssistanceRequestSubject());
                StringBuilder.append("CompanyID: ");
                StringBuilder.append(assistanceRequest.getCompanyID());
                StringBuilder.append("CompanyName: ");
                StringBuilder.append(assistanceRequest.getCompanyName());
                StringBuilder.append("CustomerFullName: ");
                StringBuilder.append(assistanceRequest.getCustomerFullName());
                StringBuilder.append("CustomerMail: ");
                StringBuilder.append(assistanceRequest.getCustomerMail());
                StringBuilder.append("CustomerPhoneNumber: ");
                StringBuilder.append(assistanceRequest.getCustomerPhoneNumber());
                StringBuilder.append("DataCenterID: ");
                StringBuilder.append(assistanceRequest.getDataCenterID());
                StringBuilder.append("Language: ");
                StringBuilder.append(assistanceRequest.getLanguage());
                StringBuilder.append("LastModifiedDate: ");
                StringBuilder.append(assistanceRequest.getLastModifiedDate());
                StringBuilder.append("ResourceID: ");
                StringBuilder.append(assistanceRequest.getResourceID());
                StringBuilder.append("UnitPrice: ");
                StringBuilder.append(assistanceRequest.getUnitPrice());
                StringBuilder.append("UserID: ");
                StringBuilder.append(assistanceRequest.getUserID());
                StringBuilder.append("VirtualMachineID: ");
                StringBuilder.append(assistanceRequest.getVirtualMachineID());
            }
        }
        else
        {
            throw new Exception(result.getResultMessage());
        }
    }
    catch (Exception ex)
    {
        // show the error
        System.out.println(ex);
    }

    System.out.println("StringBuilder: "+StringBuilder);
    return StringBuilder.toString();
}
Versione
API: v2.8 URL: https://api.dc1.computing.cloud.it/WsEndUser/v2.8/WsEndUser.svc?wsdl