// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT.

package armbilling_test

import (
	"context"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling/v2"
	"log"
	"time"
)

// Generated from example definition: 2024-04-01/transactionSummaryGetByInvoice.json
func ExampleTransactionsClient_GetTransactionSummaryByInvoice() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTransactionsClient().GetTransactionSummaryByInvoice(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res = armbilling.TransactionsClientGetTransactionSummaryByInvoiceResponse{
	// 	TransactionSummary: armbilling.TransactionSummary{
	// 		AzureCreditApplied: to.Ptr[float32](100),
	// 		BillingCurrency: to.Ptr("USD"),
	// 		ConsumptionCommitmentDecremented: to.Ptr[float32](1000),
	// 		SubTotal: to.Ptr[float32](1000),
	// 		Tax: to.Ptr[float32](500),
	// 		Total: to.Ptr[float32](5400),
	// 	},
	// }
}

// Generated from example definition: 2024-04-01/transactionsListByBillingProfile.json
func ExampleTransactionsClient_NewListByBillingProfilePager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTransactionsClient().NewListByBillingProfilePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", func() time.Time { t, _ := time.Parse(time.DateOnly, "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse(time.DateOnly, "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByBillingProfileOptions{
		Filter: to.Ptr("properties/date gt '2020-10-01'"),
		Search: to.Ptr("storage")})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armbilling.TransactionsClientListByBillingProfileResponse{
		// 	TransactionListResult: armbilling.TransactionListResult{
		// 		Value: []*armbilling.Transaction{
		// 			{
		// 				Name: to.Ptr("41000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](2000),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](100),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("G123456789"),
		// 					InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0001"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard D1, US West 3"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](4500),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](500),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5000),
		// 					},
		// 					TransactionType: to.Ptr("Purchase"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](11.25),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("51000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("pending"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0002"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard Support"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](45),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					TransactionType: to.Ptr("Cancel"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](1.25),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-04-01/transactionsListByCustomer.json
func ExampleTransactionsClient_NewListByCustomerPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTransactionsClient().NewListByCustomerPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "22000000-0000-0000-0000-000000000000", func() time.Time { t, _ := time.Parse(time.DateOnly, "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse(time.DateOnly, "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByCustomerOptions{
		Filter: to.Ptr("properties/date gt '2020-10-01'"),
		Search: to.Ptr("storage")})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armbilling.TransactionsClientListByCustomerResponse{
		// 	TransactionListResult: armbilling.TransactionListResult{
		// 		Value: []*armbilling.Transaction{
		// 			{
		// 				Name: to.Ptr("41000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](2000),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](100),
		// 					},
		// 					CustomerDisplayName: to.Ptr("Contoso operations customer"),
		// 					CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22000000-0000-0000-0000-000000000000"),
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("G123456789"),
		// 					InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0001"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard D1, US West 3"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](4500),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](500),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5000),
		// 					},
		// 					TransactionType: to.Ptr("Purchase"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](11.25),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("51000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					CustomerDisplayName: to.Ptr("Contoso operations customer"),
		// 					CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/customers/22000000-0000-0000-0000-000000000000"),
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("pending"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0002"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard Support"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](45),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					TransactionType: to.Ptr("Cancel"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](1.25),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-04-01/transactionsListByInvoice.json
func ExampleTransactionsClient_NewListByInvoicePager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTransactionsClient().NewListByInvoicePager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armbilling.TransactionsClientListByInvoiceResponse{
		// 	TransactionListResult: armbilling.TransactionListResult{
		// 		Value: []*armbilling.Transaction{
		// 			{
		// 				Name: to.Ptr("41000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](2000),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](100),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("G123456789"),
		// 					InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0001"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard D1, US West 3"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](4500),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](500),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5000),
		// 					},
		// 					TransactionType: to.Ptr("Purchase"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](11.25),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("51000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("pending"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0002"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard Support"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](45),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					TransactionType: to.Ptr("Cancel"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](1.25),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-04-01/transactionsListByInvoiceSection.json
func ExampleTransactionsClient_NewListByInvoiceSectionPager() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTransactionsClient().NewListByInvoiceSectionPager("00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "xxxx-xxxx-xxx-xxx", "22000000-0000-0000-0000-000000000000", func() time.Time { t, _ := time.Parse(time.DateOnly, "2024-04-01"); return t }(), func() time.Time { t, _ := time.Parse(time.DateOnly, "2023-05-30"); return t }(), armbilling.TransactionTypeBilled, &armbilling.TransactionsClientListByInvoiceSectionOptions{
		Filter: to.Ptr("properties/date gt '2020-10-01'"),
		Search: to.Ptr("storage")})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page = armbilling.TransactionsClientListByInvoiceSectionResponse{
		// 	TransactionListResult: armbilling.TransactionListResult{
		// 		Value: []*armbilling.Transaction{
		// 			{
		// 				Name: to.Ptr("41000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/41000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](2000),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](100),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("G123456789"),
		// 					InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/invoices/G123456789"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0001"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard D1, US West 3"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](4500),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](500),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5000),
		// 					},
		// 					TransactionType: to.Ptr("Purchase"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](11.25),
		// 				},
		// 			},
		// 			{
		// 				Name: to.Ptr("51000000-0000-0000-0000-000000000000"),
		// 				Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/transactions"),
		// 				ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/BillingProfiles/xxxx-xxxx-xxx-xxx/transactions/51000000-0000-0000-0000-000000000000"),
		// 				Properties: &armbilling.TransactionProperties{
		// 					AzureCreditApplied: &armbilling.TransactionPropertiesAzureCreditApplied{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					BillingCurrency: to.Ptr("USD"),
		// 					BillingProfileDisplayName: "Contoso operations billing",
		// 					BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx"),
		// 					ConsumptionCommitmentDecremented: &armbilling.TransactionPropertiesConsumptionCommitmentDecremented{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-01T00:00:00Z"); return t}()),
		// 					Discount: to.Ptr[float32](0.1),
		// 					EffectivePrice: &armbilling.TransactionPropertiesEffectivePrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](10),
		// 					},
		// 					ExchangeRate: to.Ptr[float32](1),
		// 					Invoice: to.Ptr("pending"),
		// 					InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"),
		// 					InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31/billingProfiles/xxxx-xxxx-xxx-xxx/invoiceSections/22000000-0000-0000-0000-000000000000"),
		// 					MarketPrice: &armbilling.TransactionPropertiesMarketPrice{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](20),
		// 					},
		// 					PartNumber: to.Ptr("0002"),
		// 					PricingCurrency: to.Ptr("USD"),
		// 					ProductDescription: to.Ptr("Standard Support"),
		// 					ProductFamily: to.Ptr("Storage"),
		// 					ProductType: to.Ptr("VM Instance"),
		// 					ProductTypeID: to.Ptr("A12345"),
		// 					Quantity: to.Ptr[int32](1),
		// 					ServicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-30T00:00:00Z"); return t}()),
		// 					ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-01T00:00:00Z"); return t}()),
		// 					SubTotal: &armbilling.TransactionPropertiesSubTotal{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](45),
		// 					},
		// 					Tax: &armbilling.TransactionPropertiesTax{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](5),
		// 					},
		// 					TransactionAmount: &armbilling.TransactionPropertiesTransactionAmount{
		// 						Currency: to.Ptr("USD"),
		// 						Value: to.Ptr[float32](50),
		// 					},
		// 					TransactionType: to.Ptr("Cancel"),
		// 					UnitOfMeasure: to.Ptr("1 Minute"),
		// 					UnitType: to.Ptr("1 Runtime Minute"),
		// 					Units: to.Ptr[float32](1.25),
		// 				},
		// 			},
		// 		},
		// 	},
		// }
	}
}

// Generated from example definition: 2024-04-01/transactionsDownloadByInvoice.json
func ExampleTransactionsClient_BeginTransactionsDownloadByInvoice() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTransactionsClient().BeginTransactionsDownloadByInvoice(ctx, "00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000_2019-05-31", "G123456789", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to poll the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res = armbilling.TransactionsClientTransactionsDownloadByInvoiceResponse{
	// 	DocumentDownloadResult: armbilling.DocumentDownloadResult{
	// 		ExpiryTime: to.Ptr("2023-02-16T17:32:28Z"),
	// 		URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724_invoice.csv?sv=2019-02-02&sr=b&sp=r"),
	// 	},
	// }
}
