IWsCommonGetPurchasedCustomProductDetails Method |
Namespace: Aruba.Cloud.WsCommon
[RBACAttribute("get", "Aruba.VirtualPrivateCloud", "customProducts/{customProductID}")] [OperationContractAttribute] WsResult<CustomProductDetails> GetPurchasedCustomProductDetails( int customProductID )
/// IWsCommon.GetPurchasedCustomProductDetails Method (c# .NET) public static string GetPurchasedCustomProductDetails(WsCommonClient client, int customProductId) { //specify the account login details client.ClientCredentials.UserName.UserName = "ARU-0000"; client.ClientCredentials.UserName.Password = "0123456789"; StringBuilder stringBuilder = new StringBuilder(); try { // call method WsResultOfCustomProductDetails // obtaining a GetPurchasedCustomProductDetails item WsResultOfCustomProductDetails result = client.GetPurchasedCustomProductDetails(customProductId); // if the call is Success print returned values if (result.Success) { stringBuilder.Append("Operation ends successfully\n"); // get Value returned from server CustomProduct item = result.Value; if (item != null) { stringBuilder.Append("Custom Product detail\n"); stringBuilder.Append("\nProductID: "); stringBuilder.Append(item.ProductID); stringBuilder.Append("\nCustomProductID: "); stringBuilder.Append(item.CustomProductID); stringBuilder.Append("\nName: "); stringBuilder.Append(item.ProductName); stringBuilder.Append("\nQuantity: "); stringBuilder.Append(item.Quantity); stringBuilder.Append("\nDescription: "); stringBuilder.Append(item.ProductDescription); stringBuilder.Append("\nBillingType: "); stringBuilder.Append(item.BillingType); stringBuilder.Append("\nExpiryDate: "); stringBuilder.Append(item.ExpiryDate); stringBuilder.Append("\nPrice: "); stringBuilder.Append(item.Price); } } else { throw new ApplicationException(result.ResultMessage); } } catch (Exception ex) { // re-run the error throw new ApplicationException(ex.Message); } return stringBuilder.ToString(); }