IWsBackupGetAccountsCost Method
|
Returns the list of accounts costs
Namespace:
Aruba.Cloud.WsBackup
Assembly:
Aruba.Cloud.WsBackup (in Aruba.Cloud.WsBackup.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax [OperationContractAttribute]
WsResult<List<ServiceAccountCost>> GetAccountsCost()
<OperationContractAttribute>
Function GetAccountsCost As WsResult(Of List(Of ServiceAccountCost))
[OperationContractAttribute]
WsResult<List<ServiceAccountCost^>^>^ GetAccountsCost()
[<OperationContractAttribute>]
abstract GetAccountsCost : unit -> WsResult<List<ServiceAccountCost>>
function GetAccountsCost() : WsResult<List<ServiceAccountCost>>
Return Value
Type:
WsResultListServiceAccountCost
The method returns an object containing information on the outcome WsResultOfArrayOfServiceAccountCost.
The Value property for instance returns a List<ServiceAccountCost>.
Examples
The following example describes a method, called GetCosts(), which means a call to GetAccountsCost() to Aruba WsBackup,
get a list of objects of class ServiceAccountCost. The list thus obtained is cycled so as to extract the information about
user's costs for each Backup Services.
private String GetCosts()
{
StringBuilder sb = new StringBuilder();
using (var client = this.WsBackupClient)
{
var result = client.GetAccountsCost();
if (result.Success)
{
foreach(var ac in result.Value)
{
sb.Append(string.Format("Account type: {0}, Monthly Cost: {1}", ac.AccountType.ToString(), ac.MonthlyCost.ToString()));
}
}
else
{
throw new ApplicationException(String.Format("An error has occurred while invoking GetAccountsCost(). This is the inner exception: {0}", result.ResultMessage));
}
}
return sb.ToString();
}
See Also