Click or drag to resize

IWsEndUserGetScheduleOccurrences Method

The aim of the method is to output a list of date occurrences of active scheduled operations of an user between a startdate and enddate . An optional scheduleoperationID can be specified in input.

Namespace:  Aruba.Cloud.WsEndUser
Assembly:  Aruba.Cloud.WsEndUser (in Aruba.Cloud.WsEndUser.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<List<ScheduledOperationOccurrence>> GetScheduleOccurrences(
	GetScheduleOccurrencesRequest operationRequest
)

Parameters

operationRequest
Type: Aruba.Cloud.Provisioning.EntitiesGetScheduleOccurrencesRequest

Return Value

Type: WsResultListScheduledOperationOccurrence
Examples
        public static string GetScheduleOccurrences(WsEndUserClient client,
    DateTime dateStart, DateTime dateEnd)
{
    //specify the account login details 
    client.ClientCredentials.UserName.UserName = "ARU-0000";
    client.ClientCredentials.UserName.Password = "0123456789";

    StringBuilder stringBuilder = new StringBuilder();

    try
    {
        // create the object GetScheduleOccurrencesRequest  for the request 
        // with data to process
        GetScheduleOccurrencesRequest request = new GetScheduleOccurrencesRequest();
        request.ScheduleStartDate = dateStart;
        request.ScheduleEndDate = dateEnd;

        // call method GetScheduleOccurrences, 
        // obtaining a WsResultOfArrayOfScheduledOperationOccurrence item               
        WsResultOfArrayOfScheduledOperationOccurrence result =
                client.GetScheduleOccurrences(request);

        //if the call is Success print history values
        if (result.Success)
        {
            // get Value returned from server
            ScheduledOperationOccurrence[] scheduledOperations = result.Value;

            foreach (ScheduledOperationOccurrence operation in scheduledOperations)
            {
                stringBuilder.Append(" ---- Scheduled Operation ---- ");
                stringBuilder.Append(" Type: ");
                stringBuilder.Append(operation.OperationType);
                stringBuilder.Append(" ID: ");
                stringBuilder.Append(operation.ScheduleOperationID);
                stringBuilder.Append(" Server Date Time: ");
                stringBuilder.Append(operation.ScheduleDateTime);
            }
        }
        else
        {
            throw new ApplicationException(result.ResultMessage);
        }
    }
    catch (Exception ex)
    {
        // re-run the error
        throw new ApplicationException(ex.Message);
    }

    return stringBuilder.ToString();
}
See Also