/// <summary> /// Initializes a new instance of the AzureUtilizationRecord class. /// </summary> public AzureUtilizationRecord(DateTime?usageStartTime = default(DateTime?), DateTime?usageEndTime = default(DateTime?), AzureResource resource = default(AzureResource), double?quantity = default(double?), string unit = default(string), IDictionary <string, string> infoFields = default(IDictionary <string, string>), AzureInstanceData instanceData = default(AzureInstanceData), ResourceAttributes attributes = default(ResourceAttributes)) { UsageStartTime = usageStartTime; UsageEndTime = usageEndTime; Resource = resource; Quantity = quantity; Unit = unit; InfoFields = infoFields; InstanceData = instanceData; Attributes = attributes; }
/// <summary> /// Initializes a new instance of the UsageBasedLineItem class. /// </summary> public UsageBasedLineItem(int?detailLineItemId = default(int?), string sku = default(string), double?includedQuantity = default(double?), double?overageQuantity = default(double?), double?listPrice = default(double?), double?consumptionPrice = default(double?), double?consumptionDiscount = default(double?), string currency = default(string), double?pretaxCharges = default(double?), double?taxAmount = default(double?), double?postTaxTotal = default(double?), double?pretaxEffectiveRate = default(double?), double?postTaxEffectiveRate = default(double?), string chargeType = default(string), string invoiceLineItemType = default(string), string partnerId = default(string), string partnerName = default(string), string partnerBillableAccountId = default(string), string customerId = default(string), string customerCompanyName = default(string), int?mpnId = default(int?), int?tier2MpnId = default(int?), string invoiceNumber = default(string), string domainName = default(string), string billingCycleType = default(string), string subscriptionId = default(string), string subscriptionName = default(string), string subscriptionDescription = default(string), string orderId = default(string), string serviceName = default(string), string serviceType = default(string), string resourceGuid = default(string), string resourceName = default(string), string region = default(string), double?consumedQuantity = default(double?), DateTime?chargeStartDate = default(DateTime?), DateTime?chargeEndDate = default(DateTime?), string billingProvider = default(string), ResourceAttributes attributes = default(ResourceAttributes)) { DetailLineItemId = detailLineItemId; Sku = sku; IncludedQuantity = includedQuantity; OverageQuantity = overageQuantity; ListPrice = listPrice; ConsumptionPrice = consumptionPrice; ConsumptionDiscount = consumptionDiscount; Currency = currency; PretaxCharges = pretaxCharges; TaxAmount = taxAmount; PostTaxTotal = postTaxTotal; PretaxEffectiveRate = pretaxEffectiveRate; PostTaxEffectiveRate = postTaxEffectiveRate; ChargeType = chargeType; InvoiceLineItemType = invoiceLineItemType; PartnerId = partnerId; PartnerName = partnerName; PartnerBillableAccountId = partnerBillableAccountId; CustomerId = customerId; CustomerCompanyName = customerCompanyName; MpnId = mpnId; Tier2MpnId = tier2MpnId; InvoiceNumber = invoiceNumber; DomainName = domainName; BillingCycleType = billingCycleType; SubscriptionId = subscriptionId; SubscriptionName = subscriptionName; SubscriptionDescription = subscriptionDescription; OrderId = orderId; ServiceName = serviceName; ServiceType = serviceType; ResourceGuid = resourceGuid; ResourceName = resourceName; Region = region; ConsumedQuantity = consumedQuantity; ChargeStartDate = chargeStartDate; ChargeEndDate = chargeEndDate; BillingProvider = billingProvider; Attributes = attributes; }
/// <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); } } }