/// <summary> /// Deserialize the object /// </summary> public virtual void DeserializeJson(JToken inputObject) { if (inputObject != null && inputObject.Type != JTokenType.Null) { JToken attributesValue = inputObject["Attributes"]; if (attributesValue != null && attributesValue.Type != JTokenType.Null) { ResourceAttributes resourceAttributes = new ResourceAttributes(); resourceAttributes.DeserializeJson(attributesValue); this.Attributes = resourceAttributes; } //JToken billingProviderValue = inputObject["BillingProvider"]; //if (billingProviderValue != null && billingProviderValue.Type != JTokenType.Null) //{ // this.BillingProvider = ((int)billingProviderValue); //} JToken chargeEndDateValue = inputObject["ChargeEndDate"]; if (chargeEndDateValue != null && chargeEndDateValue.Type != JTokenType.Null) { this.ChargeEndDate = ((DateTimeOffset)chargeEndDateValue); } JToken chargeStartDateValue = inputObject["ChargeStartDate"]; if (chargeStartDateValue != null && chargeStartDateValue.Type != JTokenType.Null) { this.ChargeStartDate = ((DateTimeOffset)chargeStartDateValue); } JToken chargeTypeValue = inputObject["ChargeType"]; if (chargeTypeValue != null && chargeTypeValue.Type != JTokenType.Null) { this.ChargeType = ((string)chargeTypeValue); } JToken consumedQuantityValue = inputObject["ConsumedQuantity"]; if (consumedQuantityValue != null && consumedQuantityValue.Type != JTokenType.Null) { this.ConsumedQuantity = ((double)consumedQuantityValue); } JToken consumptionDiscountValue = inputObject["ConsumptionDiscount"]; if (consumptionDiscountValue != null && consumptionDiscountValue.Type != JTokenType.Null) { this.ConsumptionDiscount = ((double)consumptionDiscountValue); } JToken consumptionPriceValue = inputObject["ConsumptionPrice"]; if (consumptionPriceValue != null && consumptionPriceValue.Type != JTokenType.Null) { this.ConsumptionPrice = ((double)consumptionPriceValue); } JToken currencyValue = inputObject["Currency"]; if (currencyValue != null && currencyValue.Type != JTokenType.Null) { this.Currency = ((string)currencyValue); } JToken customerCompanyNameValue = inputObject["CustomerCompanyName"]; if (customerCompanyNameValue != null && customerCompanyNameValue.Type != JTokenType.Null) { this.CustomerCompanyName = ((string)customerCompanyNameValue); } JToken detailLineItemIdValue = inputObject["DetailLineItemId"]; if (detailLineItemIdValue != null && detailLineItemIdValue.Type != JTokenType.Null) { this.DetailLineItemId = ((int)detailLineItemIdValue); } JToken includedQuantityValue = inputObject["IncludedQuantity"]; if (includedQuantityValue != null && includedQuantityValue.Type != JTokenType.Null) { this.IncludedQuantity = ((double)includedQuantityValue); } JToken invoiceLineItemTypeValue = inputObject["InvoiceLineItemType"]; //if (invoiceLineItemTypeValue != null && invoiceLineItemTypeValue.Type != JTokenType.Null) //{ // this.InvoiceLineItemType = ((int)invoiceLineItemTypeValue); //} JToken invoiceNumberValue = inputObject["InvoiceNumber"]; if (invoiceNumberValue != null && invoiceNumberValue.Type != JTokenType.Null) { this.InvoiceNumber = ((string)invoiceNumberValue); } JToken listPriceValue = inputObject["ListPrice"]; if (listPriceValue != null && listPriceValue.Type != JTokenType.Null) { this.ListPrice = ((double)listPriceValue); } JToken mpnIdValue = inputObject["MpnId"]; if (mpnIdValue != null && mpnIdValue.Type != JTokenType.Null) { this.MpnId = ((int)mpnIdValue); } JToken orderIdValue = inputObject["OrderId"]; if (orderIdValue != null && orderIdValue.Type != JTokenType.Null) { this.OrderId = ((string)orderIdValue); } JToken overageQuantityValue = inputObject["OverageQuantity"]; if (overageQuantityValue != null && overageQuantityValue.Type != JTokenType.Null) { this.OverageQuantity = ((double)overageQuantityValue); } JToken partnerBillableAccountIdValue = inputObject["PartnerBillableAccountId"]; if (partnerBillableAccountIdValue != null && partnerBillableAccountIdValue.Type != JTokenType.Null) { this.PartnerBillableAccountId = ((string)partnerBillableAccountIdValue); } JToken partnerIdValue = inputObject["PartnerId"]; if (partnerIdValue != null && partnerIdValue.Type != JTokenType.Null) { this.PartnerId = ((string)partnerIdValue); } JToken partnerNameValue = inputObject["PartnerName"]; if (partnerNameValue != null && partnerNameValue.Type != JTokenType.Null) { this.PartnerName = ((string)partnerNameValue); } JToken postTaxEffectiveRateValue = inputObject["PostTaxEffectiveRate"]; if (postTaxEffectiveRateValue != null && postTaxEffectiveRateValue.Type != JTokenType.Null) { this.PostTaxEffectiveRate = ((double)postTaxEffectiveRateValue); } JToken postTaxTotalValue = inputObject["PostTaxTotal"]; if (postTaxTotalValue != null && postTaxTotalValue.Type != JTokenType.Null) { this.PostTaxTotal = ((double)postTaxTotalValue); } JToken pretaxChargesValue = inputObject["PretaxCharges"]; if (pretaxChargesValue != null && pretaxChargesValue.Type != JTokenType.Null) { this.PretaxCharges = ((double)pretaxChargesValue); } JToken pretaxEffectiveRateValue = inputObject["PretaxEffectiveRate"]; if (pretaxEffectiveRateValue != null && pretaxEffectiveRateValue.Type != JTokenType.Null) { this.PretaxEffectiveRate = ((double)pretaxEffectiveRateValue); } JToken regionValue = inputObject["Region"]; if (regionValue != null && regionValue.Type != JTokenType.Null) { this.Region = ((string)regionValue); } JToken resourceGuidValue = inputObject["ResourceGuid"]; if (resourceGuidValue != null && resourceGuidValue.Type != JTokenType.Null) { this.ResourceGuid = ((string)resourceGuidValue); } JToken resourceNameValue = inputObject["ResourceName"]; if (resourceNameValue != null && resourceNameValue.Type != JTokenType.Null) { this.ResourceName = ((string)resourceNameValue); } JToken serviceNameValue = inputObject["ServiceName"]; if (serviceNameValue != null && serviceNameValue.Type != JTokenType.Null) { this.ServiceName = ((string)serviceNameValue); } JToken serviceTypeValue = inputObject["ServiceType"]; if (serviceTypeValue != null && serviceTypeValue.Type != JTokenType.Null) { this.ServiceType = ((string)serviceTypeValue); } JToken skuValue = inputObject["Sku"]; if (skuValue != null && skuValue.Type != JTokenType.Null) { this.Sku = ((string)skuValue); } JToken subscriptionDescriptionValue = inputObject["SubscriptionDescription"]; if (subscriptionDescriptionValue != null && subscriptionDescriptionValue.Type != JTokenType.Null) { this.SubscriptionDescription = ((string)subscriptionDescriptionValue); } JToken subscriptionIdValue = inputObject["SubscriptionId"]; if (subscriptionIdValue != null && subscriptionIdValue.Type != JTokenType.Null) { this.SubscriptionId = ((string)subscriptionIdValue); } JToken subscriptionNameValue = inputObject["SubscriptionName"]; if (subscriptionNameValue != null && subscriptionNameValue.Type != JTokenType.Null) { this.SubscriptionName = ((string)subscriptionNameValue); } JToken taxAmountValue = inputObject["TaxAmount"]; if (taxAmountValue != null && taxAmountValue.Type != JTokenType.Null) { this.TaxAmount = ((double)taxAmountValue); } JToken tier2MpnIdValue = inputObject["Tier2MpnId"]; if (tier2MpnIdValue != null && tier2MpnIdValue.Type != JTokenType.Null) { this.Tier2MpnId = ((int)tier2MpnIdValue); } } }