From 2cf389ec08bca6e15e6a95f6967e33bed6468a90 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 12 May 2023 01:23:39 +0000 Subject: [PATCH] CodeGen from PR 23948 in Azure/azure-rest-api-specs Merge 899d1e664658a1def43f1df86fac9c94e646427d into 99dad1e94c408d931172e35eef941e76837a6d76 --- .../billing/armbilling/CHANGELOG.md | 4 + .../accounts_client_example_test.go | 883 ---------- .../armbilling/address_client_example_test.go | 101 -- .../agreements_client_example_test.go | 133 -- .../billing/armbilling/autorest.md | 6 +- .../availablebalances_client_example_test.go | 49 - .../billing/armbilling/constants.go | 2 +- .../customers_client_example_test.go | 193 --- .../enrollmentaccounts_client_example_test.go | 90 -- sdk/resourcemanager/billing/armbilling/go.mod | 14 +- sdk/resourcemanager/billing/armbilling/go.sum | 22 +- .../instructions_client_example_test.go | 135 -- .../invoices_client_example_test.go | 1424 ----------------- .../invoicesections_client_example_test.go | 167 -- .../billing/armbilling/models.go | 960 +++++------ .../armbilling/periods_client_example_test.go | 93 -- .../permissions_client_example_test.go | 217 --- .../policies_client_example_test.go | 145 -- .../products_client_example_test.go | 566 ------- .../profiles_client_example_test.go | 510 ------ .../property_client_example_test.go | 111 -- .../reservations_client_example_test.go | 188 --- .../roleassignments_client_example_test.go | 390 ----- .../roledefinitions_client_example_test.go | 508 ------ .../subscriptions_client_example_test.go | 606 ------- .../transactions_client_example_test.go | 155 -- 26 files changed, 494 insertions(+), 7178 deletions(-) delete mode 100644 sdk/resourcemanager/billing/armbilling/accounts_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/address_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/agreements_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/availablebalances_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/customers_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/enrollmentaccounts_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/instructions_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/invoices_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/invoicesections_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/periods_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/permissions_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/policies_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/products_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/profiles_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/property_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/reservations_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/roleassignments_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/roledefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/subscriptions_client_example_test.go delete mode 100644 sdk/resourcemanager/billing/armbilling/transactions_client_example_test.go diff --git a/sdk/resourcemanager/billing/armbilling/CHANGELOG.md b/sdk/resourcemanager/billing/armbilling/CHANGELOG.md index 92d136dd6aa6..1d94dbe9f2f4 100644 --- a/sdk/resourcemanager/billing/armbilling/CHANGELOG.md +++ b/sdk/resourcemanager/billing/armbilling/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.6.1 (2023-05-12) +### Other Changes + + ## 0.6.0 (2023-03-27) ### Features Added diff --git a/sdk/resourcemanager/billing/armbilling/accounts_client_example_test.go b/sdk/resourcemanager/billing/armbilling/accounts_client_example_test.go deleted file mode 100644 index 60d01afb7718..000000000000 --- a/sdk/resourcemanager/billing/armbilling/accounts_client_example_test.go +++ /dev/null @@ -1,883 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsList.json -func ExampleAccountsClient_NewListPager_billingAccountsList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: 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.AccountListResult = armbilling.AccountListResult{ - // Value: []*armbilling.Account{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // DisplayName: to.Ptr("Test Account 1"), - // HasReadAccess: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // DisplayName: to.Ptr("Test Account 2"), - // HasReadAccess: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("20000000-0000-0000-0000-000000000002_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/20000000-0000-0000-0000-000000000002_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // DisplayName: to.Ptr("Test Account 3"), - // HasReadAccess: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpand.json -func ExampleAccountsClient_NewListPager_billingAccountsListWithExpand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: to.Ptr("soldTo,billingProfiles,billingProfiles/invoiceSections")}) - 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.AccountListResult = armbilling.AccountListResult{ - // Value: []*armbilling.Account{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // BillingProfiles: &armbilling.ProfilesOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.Profile{ - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(false), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), - // }, - // }, - // { - // Name: to.Ptr("invoiceSectionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId2"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName2"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Finance"), - // "pcCode": to.Ptr("B223456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // }, - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeCSPPartner), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile2"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(false), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId11"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId11"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName11"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("Z223456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-33XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), - // Status: to.Ptr(armbilling.BillingProfileStatusActive), - // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // DisplayName: to.Ptr("Test Account 1"), - // HasReadAccess: to.Ptr(true), - // SoldTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address"), - // AddressLine2: to.Ptr("Test Address"), - // AddressLine3: to.Ptr("Test Address"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // BillingProfiles: &armbilling.ProfilesOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.Profile{ - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000004"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso Test"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectPartner), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile3"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ - // BillingAccountName: to.Ptr("20000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // BillingProfileName: to.Ptr("22000000-0000-0000-0000-000000000001"), - // DisplayName: to.Ptr("Customer1"), - // }, - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId3"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004/invoiceSections/invoiceSectionId3"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName3"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("C123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), - // SystemID: to.Ptr("9XXX-44XX-XX1-XXXX-XXX"), - // TargetCloud: to.Ptr(armbilling.TargetCloudUSNat), - // }, - // }, - // { - // Name: to.Ptr("invoiceSectionId4"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000004/invoiceSections/invoiceSectionId4"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName4"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("D123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), - // SystemID: to.Ptr("9XXX-55XX-XX1-XXXX-XXX"), - // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("3XXX-33XX-XX1-XXXX-XXX"), - // TargetClouds: []*armbilling.TargetCloud{ - // to.Ptr(armbilling.TargetCloudUSNat), - // to.Ptr(armbilling.TargetCloudUSSec)}, - // }, - // }, - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000005"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso Test"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile4"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ - // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), - // DisplayName: to.Ptr("Partner1"), - // }, - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId5"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005/invoiceSections/invoiceSectionId5"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName5"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Finance"), - // "pcCode": to.Ptr("E123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-66XX-XX1-XXXX-XXX"), - // }, - // }, - // { - // Name: to.Ptr("invoiceSectionId6"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/10000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000005/invoiceSections/invoiceSectionId6"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName6"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("O123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), - // SystemID: to.Ptr("9XXX-77XX-XX1-XXXX-XXX"), - // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("4XXX-44XX-XX1-XXXX-XXX"), - // TargetClouds: []*armbilling.TargetCloud{ - // to.Ptr(armbilling.TargetCloudUSSec)}, - // }, - // }}, - // }, - // DisplayName: to.Ptr("Test Account 2"), - // HasReadAccess: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountsListWithExpandForEnrollmentDetails.json -func ExampleAccountsClient_NewListPager_billingAccountsListWithExpandForEnrollmentDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListPager(&armbilling.AccountsClientListOptions{Expand: to.Ptr("enrollmentDetails,departments,enrollmentAccounts")}) - 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.AccountListResult = armbilling.AccountListResult{ - // Value: []*armbilling.Account{ - // { - // Name: to.Ptr("7645820"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/7645820"), - // Properties: &armbilling.AccountProperties{ - // AgreementType: to.Ptr(armbilling.AgreementTypeEnterpriseAgreement), - // Departments: []*armbilling.Department{ - // { - // Name: to.Ptr("departmentId1"), - // Type: to.Ptr("Microsoft.Billing/departments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/departmentId1"), - // Properties: &armbilling.DepartmentProperties{ - // CostCenter: to.Ptr("C1"), - // DepartmentName: to.Ptr("departmentName1"), - // Status: to.Ptr("Active"), - // }, - // }, - // { - // Name: to.Ptr("departmentId2"), - // Type: to.Ptr("Microsoft.Billing/departments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/departmentId2"), - // Properties: &armbilling.DepartmentProperties{ - // CostCenter: to.Ptr("C4"), - // DepartmentName: to.Ptr("departmentName2"), - // Status: to.Ptr("Active"), - // }, - // }}, - // EnrollmentAccounts: []*armbilling.EnrollmentAccount{ - // { - // Name: to.Ptr("accountId0"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId0"), - // Properties: &armbilling.EnrollmentAccountProperties{ - // AccountName: to.Ptr("AccountName0"), - // CostCenter: to.Ptr("C0"), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Status: to.Ptr("Active"), - // }, - // }, - // { - // Name: to.Ptr("accountId1"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId1"), - // Properties: &armbilling.EnrollmentAccountProperties{ - // AccountName: to.Ptr("AccountName1"), - // CostCenter: to.Ptr("C4"), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Status: to.Ptr("Active"), - // }, - // }, - // { - // Name: to.Ptr("accountId2"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/accountId2"), - // Properties: &armbilling.EnrollmentAccountProperties{ - // AccountName: to.Ptr("AccountName2"), - // CostCenter: to.Ptr("C4"), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Status: to.Ptr("Active"), - // }, - // }}, - // EnrollmentDetails: &armbilling.Enrollment{ - // BillingCycle: to.Ptr("Monthly"), - // Channel: to.Ptr("EaDirect"), - // CountryCode: to.Ptr("US"), - // Currency: to.Ptr("USD"), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-31T17:32:28Z"); return t}()), - // Policies: &armbilling.EnrollmentPolicies{ - // AccountOwnerViewCharges: to.Ptr(true), - // DepartmentAdminViewCharges: to.Ptr(true), - // MarketplaceEnabled: to.Ptr(true), - // ReservedInstancesEnabled: to.Ptr(true), - // }, - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Status: to.Ptr("Active"), - // Language: to.Ptr("en"), - // }, - // SoldTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address"), - // AddressLine2: to.Ptr("Test Address"), - // AddressLine3: to.Ptr("Test Address"), - // City: to.Ptr("City"), - // Country: to.Ptr("US"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountWithExpand.json -func ExampleAccountsClient_Get_billingAccountWithExpand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Get(ctx, "{billingAccountName}", &armbilling.AccountsClientGetOptions{Expand: to.Ptr("soldTo,billingProfiles,billingProfiles/invoiceSections")}) - 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.Account = armbilling.Account{ - // Name: to.Ptr("{billingAccountName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // BillingProfiles: &armbilling.ProfilesOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.Profile{ - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // }, - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile2"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ - // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), - // DisplayName: to.Ptr("Partner1"), - // }, - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(true), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId2"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName2"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("Z223456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), - // Status: to.Ptr(armbilling.BillingProfileStatusActive), - // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // DisplayName: to.Ptr("Test Account 1"), - // HasReadAccess: to.Ptr(true), - // SoldTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address"), - // AddressLine2: to.Ptr("Test Address"), - // AddressLine3: to.Ptr("Test Address"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccount.json -func ExampleAccountsClient_Get_billingAccounts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Get(ctx, "{billingAccountName}", &armbilling.AccountsClientGetOptions{Expand: 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.Account = armbilling.Account{ - // Name: to.Ptr("{billingAccountName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // DisplayName: to.Ptr("Test Account"), - // HasReadAccess: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingAccount.json -func ExampleAccountsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "{billingAccountName}", armbilling.AccountUpdateRequest{ - Properties: &armbilling.AccountProperties{ - DisplayName: to.Ptr("Test Account"), - SoldTo: &armbilling.AddressDetails{ - AddressLine1: to.Ptr("Test Address 1"), - City: to.Ptr("Redmond"), - CompanyName: to.Ptr("Contoso"), - Country: to.Ptr("US"), - FirstName: to.Ptr("Test"), - LastName: to.Ptr("User"), - PostalCode: to.Ptr("12345"), - Region: to.Ptr("WA"), - }, - }, - }, 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 pull 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.Account = armbilling.Account{ - // Name: to.Ptr("{billingAccountName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // Properties: &armbilling.AccountProperties{ - // AccountStatus: to.Ptr(armbilling.AccountStatusActive), - // AccountType: to.Ptr(armbilling.AccountTypeEnterprise), - // AgreementType: to.Ptr(armbilling.AgreementTypeMicrosoftCustomerAgreement), - // DisplayName: to.Ptr("Test Account"), - // HasReadAccess: to.Ptr(true), - // SoldTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address 1"), - // City: to.Ptr("Redmond"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PostalCode: to.Ptr("12345"), - // Region: to.Ptr("WA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListWithCreateSubPermission.json -func ExampleAccountsClient_NewListInvoiceSectionsByCreateSubscriptionPermissionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListInvoiceSectionsByCreateSubscriptionPermissionPager("{billingAccountName}", 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.InvoiceSectionListWithCreateSubPermissionResult = armbilling.InvoiceSectionListWithCreateSubPermissionResult{ - // Value: []*armbilling.InvoiceSectionWithCreateSubPermission{ - // { - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // BillingProfileSpendingLimit: to.Ptr(armbilling.SpendingLimitForBillingProfileOn), - // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), - // BillingProfileStatusReasonCode: to.Ptr(armbilling.StatusReasonCodeForBillingProfilePastDue), - // BillingProfileSystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // InvoiceSectionDisplayName: to.Ptr("invoiceSection1"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // InvoiceSectionSystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/billing/armbilling/address_client_example_test.go b/sdk/resourcemanager/billing/armbilling/address_client_example_test.go deleted file mode 100644 index daf018534c50..000000000000 --- a/sdk/resourcemanager/billing/armbilling/address_client_example_test.go +++ /dev/null @@ -1,101 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressInvalid.json -func ExampleAddressClient_Validate_addressInvalid() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddressClient().Validate(ctx, armbilling.AddressDetails{ - AddressLine1: to.Ptr("1 Test"), - City: to.Ptr("bellevue"), - Country: to.Ptr("us"), - PostalCode: to.Ptr("12345"), - Region: to.Ptr("wa"), - }, 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.ValidateAddressResponse = armbilling.ValidateAddressResponse{ - // Status: to.Ptr(armbilling.AddressValidationStatusInvalid), - // SuggestedAddresses: []*armbilling.AddressDetails{ - // { - // AddressLine1: to.Ptr("1 Test Address"), - // City: to.Ptr("Bellevue"), - // Country: to.Ptr("US"), - // PostalCode: to.Ptr("98052"), - // Region: to.Ptr("WA"), - // }, - // { - // AddressLine1: to.Ptr("1 Test Address"), - // City: to.Ptr("Bellevue"), - // Country: to.Ptr("US"), - // PostalCode: to.Ptr("12345-0000"), - // Region: to.Ptr("WA"), - // }}, - // ValidationMessage: to.Ptr("Invalid address"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AddressValid.json -func ExampleAddressClient_Validate_addressValid() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAddressClient().Validate(ctx, armbilling.AddressDetails{ - AddressLine1: to.Ptr("1 Test Address"), - City: to.Ptr("bellevue"), - Country: to.Ptr("us"), - PostalCode: to.Ptr("12345"), - Region: to.Ptr("wa"), - }, 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.ValidateAddressResponse = armbilling.ValidateAddressResponse{ - // Status: to.Ptr(armbilling.AddressValidationStatusValid), - // SuggestedAddresses: []*armbilling.AddressDetails{ - // { - // AddressLine1: to.Ptr("1 Test Address"), - // City: to.Ptr("Bellevue"), - // Country: to.Ptr("US"), - // PostalCode: to.Ptr("12345-0000"), - // Region: to.Ptr("WA"), - // }}, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/agreements_client_example_test.go b/sdk/resourcemanager/billing/armbilling/agreements_client_example_test.go deleted file mode 100644 index 412c0e075a47..000000000000 --- a/sdk/resourcemanager/billing/armbilling/agreements_client_example_test.go +++ /dev/null @@ -1,133 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementsListByBillingAccount.json -func ExampleAgreementsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAgreementsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.AgreementsClientListByBillingAccountOptions{Expand: 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.AgreementListResult = armbilling.AgreementListResult{ - // Value: []*armbilling.Agreement{ - // { - // Name: to.Ptr("Agreement1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/Agreement1"), - // Properties: &armbilling.AgreementProperties{ - // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), - // AgreementLink: to.Ptr("https://agreementuri1.com"), - // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // Participants: []*armbilling.Participants{ - // { - // Email: to.Ptr("abc@contoso.com"), - // Status: to.Ptr("Accepted"), - // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00Z"); return t}()), - // }, - // { - // Email: to.Ptr("xtz@contoso.com"), - // Status: to.Ptr("Declined"), - // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-02T00:00:00Z"); return t}()), - // }}, - // Status: to.Ptr("Published"), - // }, - // }, - // { - // Name: to.Ptr("Agreement2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/Agreement2"), - // Properties: &armbilling.AgreementProperties{ - // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeESignEmbedded), - // AgreementLink: to.Ptr("https://agreementuri2.com"), - // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // Participants: []*armbilling.Participants{ - // { - // Email: to.Ptr("abc@contoso.com"), - // Status: to.Ptr("Unknown"), - // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00Z"); return t}()), - // }}, - // Status: to.Ptr("PendingSignature"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AgreementByName.json -func ExampleAgreementsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAgreementsClient().Get(ctx, "{billingAccountName}", "{agreementName}", &armbilling.AgreementsClientGetOptions{Expand: 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.Agreement = armbilling.Agreement{ - // Name: to.Ptr("{agreementName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/agreements"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}"), - // Properties: &armbilling.AgreementProperties{ - // AcceptanceMode: to.Ptr(armbilling.AcceptanceModeClickToAccept), - // AgreementLink: to.Ptr("https://agreementuri1.com"), - // Category: to.Ptr(armbilling.CategoryMicrosoftCustomerAgreement), - // EffectiveDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-12-05T00:00:00Z"); return t}()), - // Participants: []*armbilling.Participants{ - // { - // Email: to.Ptr("abc@contoso.com"), - // Status: to.Ptr("Accepted"), - // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-01T00:00:00Z"); return t}()), - // }, - // { - // Email: to.Ptr("xyz@contoso.com"), - // Status: to.Ptr("Declined"), - // StatusDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-02T00:00:00Z"); return t}()), - // }}, - // Status: to.Ptr("Published"), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/autorest.md b/sdk/resourcemanager/billing/armbilling/autorest.md index d7b838101ef8..0d4719fce4d0 100644 --- a/sdk/resourcemanager/billing/armbilling/autorest.md +++ b/sdk/resourcemanager/billing/armbilling/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/billing/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/billing/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.6.0 +module-version: 0.6.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/billing/armbilling/availablebalances_client_example_test.go b/sdk/resourcemanager/billing/armbilling/availablebalances_client_example_test.go deleted file mode 100644 index 9ddd3339d033..000000000000 --- a/sdk/resourcemanager/billing/armbilling/availablebalances_client_example_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/AvailableBalanceByBillingProfile.json -func ExampleAvailableBalancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailableBalancesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", 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.AvailableBalance = armbilling.AvailableBalance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/availableBalance"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default"), - // Properties: &armbilling.AvailableBalanceProperties{ - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](500), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/constants.go b/sdk/resourcemanager/billing/armbilling/constants.go index a175f1eb9460..36b569ad1fe0 100644 --- a/sdk/resourcemanager/billing/armbilling/constants.go +++ b/sdk/resourcemanager/billing/armbilling/constants.go @@ -11,7 +11,7 @@ package armbilling const ( moduleName = "armbilling" - moduleVersion = "v0.6.0" + moduleVersion = "v0.6.1" ) // AcceptanceMode - The mode of acceptance for an agreement. diff --git a/sdk/resourcemanager/billing/armbilling/customers_client_example_test.go b/sdk/resourcemanager/billing/armbilling/customers_client_example_test.go deleted file mode 100644 index 48e59ccc8f25..000000000000 --- a/sdk/resourcemanager/billing/armbilling/customers_client_example_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingProfile.json -func ExampleCustomersClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomersClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.CustomersClientListByBillingProfileOptions{Search: nil, - Filter: 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.CustomerListResult = armbilling.CustomerListResult{ - // Value: []*armbilling.Customer{ - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customer1"), - // }, - // }, - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000011"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customer2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomersListByBillingAccount.json -func ExampleCustomersClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomersClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.CustomersClientListByBillingAccountOptions{Search: nil, - Filter: 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.CustomerListResult = armbilling.CustomerListResult{ - // Value: []*armbilling.Customer{ - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customer1"), - // }, - // }, - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/22000000-0000-0000-0000-000000000011"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customer2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Customer.json -func ExampleCustomersClient_Get_customer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomersClient().Get(ctx, "{billingAccountName}", "{customerName}", &armbilling.CustomersClientGetOptions{Expand: 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.Customer = armbilling.Customer{ - // Name: to.Ptr("{customerName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customer1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerWithExpand.json -func ExampleCustomersClient_Get_customerWithExpand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomersClient().Get(ctx, "{billingAccountName}", "{customerName}", &armbilling.CustomersClientGetOptions{Expand: to.Ptr("enabledAzurePlans,resellers")}) - 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.Customer = armbilling.Customer{ - // Name: to.Ptr("{customerName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // Properties: &armbilling.CustomerProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("customerName1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // Resellers: []*armbilling.Reseller{ - // { - // Description: to.Ptr("Reseller1"), - // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), - // }, - // { - // Description: to.Ptr("Reseller2"), - // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/enrollmentaccounts_client_example_test.go b/sdk/resourcemanager/billing/armbilling/enrollmentaccounts_client_example_test.go deleted file mode 100644 index beae6ecf5154..000000000000 --- a/sdk/resourcemanager/billing/armbilling/enrollmentaccounts_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsList.json -func ExampleEnrollmentAccountsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEnrollmentAccountsClient().NewListPager(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.EnrollmentAccountListResult = armbilling.EnrollmentAccountListResult{ - // Value: []*armbilling.EnrollmentAccountSummary{ - // { - // Name: to.Ptr("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), - // Properties: &armbilling.EnrollmentAccountSummaryProperties{ - // PrincipalName: to.Ptr("kathy@contoso.com"), - // }, - // }, - // { - // Name: to.Ptr("edd24053-07cd-4ed4-aa5b-326160a6680d"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/edd24053-07cd-4ed4-aa5b-326160a6680d"), - // Properties: &armbilling.EnrollmentAccountSummaryProperties{ - // PrincipalName: to.Ptr("dan@contoso.com"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/EnrollmentAccountsGet.json -func ExampleEnrollmentAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnrollmentAccountsClient().Get(ctx, "e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556", 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.EnrollmentAccountSummary = armbilling.EnrollmentAccountSummary{ - // Name: to.Ptr("e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), - // Type: to.Ptr("Microsoft.Billing/enrollmentAccounts"), - // ID: to.Ptr("/providers/Microsoft.Billing/enrollmentAccounts/e1bf1c8c-5ac6-44a0-bdcd-aa7c1cf60556"), - // Properties: &armbilling.EnrollmentAccountSummaryProperties{ - // PrincipalName: to.Ptr("kathy@contoso.com"), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/go.mod b/sdk/resourcemanager/billing/armbilling/go.mod index 7c42b196a5eb..1c877bc84021 100644 --- a/sdk/resourcemanager/billing/armbilling/go.mod +++ b/sdk/resourcemanager/billing/armbilling/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/billing/armbilling/go.sum b/sdk/resourcemanager/billing/armbilling/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/billing/armbilling/go.sum +++ b/sdk/resourcemanager/billing/armbilling/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/billing/armbilling/instructions_client_example_test.go b/sdk/resourcemanager/billing/armbilling/instructions_client_example_test.go deleted file mode 100644 index 3379974e9570..000000000000 --- a/sdk/resourcemanager/billing/armbilling/instructions_client_example_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "time" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InstructionsListByBillingProfile.json -func ExampleInstructionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInstructionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.InstructionListResult = armbilling.InstructionListResult{ - // Value: []*armbilling.Instruction{ - // { - // Name: to.Ptr("TO1:CLIN001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN001"), - // Properties: &armbilling.InstructionProperties{ - // Amount: to.Ptr[float32](5000), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("TO1:CLIN002"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/TO1:CLIN002"), - // Properties: &armbilling.InstructionProperties{ - // Amount: to.Ptr[float32](2000), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Instruction.json -func ExampleInstructionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInstructionsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{instructionName}", 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.Instruction = armbilling.Instruction{ - // Name: to.Ptr("{instructionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}"), - // Properties: &armbilling.InstructionProperties{ - // Amount: to.Ptr[float32](5000), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInstruction.json -func ExampleInstructionsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInstructionsClient().Put(ctx, "{billingAccountName}", "{billingProfileName}", "{instructionName}", armbilling.Instruction{ - Properties: &armbilling.InstructionProperties{ - Amount: to.Ptr[float32](5000), - EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t }()), - StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t }()), - }, - }, 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.Instruction = armbilling.Instruction{ - // Name: to.Ptr("{instructionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/instructions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}"), - // Properties: &armbilling.InstructionProperties{ - // Amount: to.Ptr[float32](5000), - // EndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-30T21:26:47.997Z"); return t}()), - // StartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-30T21:26:47.997Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/invoices_client_example_test.go b/sdk/resourcemanager/billing/armbilling/invoices_client_example_test.go deleted file mode 100644 index 438ccf4719fd..000000000000 --- a/sdk/resourcemanager/billing/armbilling/invoices_client_example_test.go +++ /dev/null @@ -1,1424 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesList.json -func ExampleInvoicesClient_NewListByBillingAccountPager_billingAccountInvoicesList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoicesClient().NewListByBillingAccountPager("{billingAccountName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ - // Value: []*armbilling.Invoice{ - // { - // Name: to.Ptr("1383723"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383723"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](8.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](25.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](7.53), - // }, - // }, - // }, - // { - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxreceipt.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(true), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatus("PastDue")), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountInvoicesListWithRebillDetails.json -func ExampleInvoicesClient_NewListByBillingAccountPager_billingAccountInvoicesListWithRebillDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoicesClient().NewListByBillingAccountPager("{billingAccountName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ - // Value: []*armbilling.Invoice{ - // { - // Name: to.Ptr("I000003"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000003"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](8.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](25.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // RebillDetails: map[string]*armbilling.RebillDetails{ - // "creditNoteDocumentId": &armbilling.RebillDetails{ - // }, - // "invoiceDocumentId": &armbilling.RebillDetails{ - // }, - // "rebillDetails": &armbilling.RebillDetails{ - // }, - // }, - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](7.53), - // }, - // }, - // }, - // { - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxreceipt.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(true), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatus("PastDue")), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfile.json -func ExampleInvoicesClient_NewListByBillingProfilePager_invoicesListByBillingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoicesClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ - // Value: []*armbilling.Invoice{ - // { - // Name: to.Ptr("1383723"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383723"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](8.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](25.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](7.53), - // }, - // }, - // }, - // { - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(true), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoicesListByBillingProfileWithRebillDetails.json -func ExampleInvoicesClient_NewListByBillingProfilePager_invoicesListByBillingProfileWithRebillDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoicesClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", "2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ - // Value: []*armbilling.Invoice{ - // { - // Name: to.Ptr("I000003"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000003"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](8.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](25.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // RebillDetails: map[string]*armbilling.RebillDetails{ - // "creditNoteDocumentId": &armbilling.RebillDetails{ - // }, - // "invoiceDocumentId": &armbilling.RebillDetails{ - // }, - // "rebillDetails": &armbilling.RebillDetails{ - // }, - // }, - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](7.53), - // }, - // }, - // }, - // { - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-28T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(true), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CreditNote.json -func ExampleInvoicesClient_Get_creditNote() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("{invoiceName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // CreditForDocumentID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000001"), - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeCreditNote), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusPaid), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Invoice.json -func ExampleInvoicesClient_Get_invoice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("{invoiceName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceWithRebillDetails.json -func ExampleInvoicesClient_Get_invoiceWithRebillDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("{invoiceName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // RebillDetails: map[string]*armbilling.RebillDetails{ - // "creditNoteDocumentId": &armbilling.RebillDetails{ - // }, - // "invoiceDocumentId": &armbilling.RebillDetails{ - // }, - // "rebillDetails": &armbilling.RebillDetails{ - // }, - // }, - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/VoidInvoice.json -func ExampleInvoicesClient_Get_voidInvoice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().Get(ctx, "{billingAccountName}", "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("{invoiceName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BilledDocumentID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/I000002"), - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // DocumentType: to.Ptr(armbilling.InvoiceDocumentTypeInvoice), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusVoid), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceById.json -func ExampleInvoicesClient_GetByID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().GetByID(ctx, "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("{invoiceName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // AzurePrepaymentApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](15.46), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CreditAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/invoice.pdf"), - // }, - // { - // Kind: to.Ptr(armbilling.DocumentTypeTaxReceipt), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://microsoft.com/taxDoc.pdf"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // FreeAzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // IsMonthlyInvoice: to.Ptr(false), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](33.99), - // }, - // TaxAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](0), - // }, - // TotalAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](16.53), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ModernInvoiceDownload.json -func ExampleInvoicesClient_BeginDownloadInvoice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInvoicesClient().BeginDownloadInvoice(ctx, "{billingAccountName}", "{invoiceName}", "DRS_12345", 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 pull 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.DownloadURL = armbilling.DownloadURL{ - // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleModernInvoiceDownload.json -func ExampleInvoicesClient_BeginDownloadMultipleBillingProfileInvoices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingProfileInvoices(ctx, "{billingAccountName}", []*string{ - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, 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 pull 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.DownloadURL = armbilling.DownloadURL{ - // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoicesList.json -func ExampleInvoicesClient_NewListByBillingSubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoicesClient().NewListByBillingSubscriptionPager("2018-01-01", "2018-06-30", 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.InvoiceListResult = armbilling.InvoiceListResult{ - // Value: []*armbilling.Invoice{ - // { - // Name: to.Ptr("1383723"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383723"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-16T17:32:28Z"); return t}()), - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-15T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T17:32:28Z"); return t}()), - // InvoiceType: to.Ptr(armbilling.InvoiceType("AzureServices")), - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusDue), - // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), - // }, - // }, - // { - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724/download"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-30T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureMarketplace), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusPaid), - // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoice.json -func ExampleInvoicesClient_GetBySubscriptionAndInvoiceID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoicesClient().GetBySubscriptionAndInvoiceID(ctx, "{invoiceName}", 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.Invoice = armbilling.Invoice{ - // Name: to.Ptr("1383724"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions/invoices"), - // ID: to.Ptr("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724"), - // Properties: &armbilling.InvoiceProperties{ - // AmountDue: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // BilledAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // BillingProfileDisplayName: to.Ptr("Contoso Operations Billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Documents: []*armbilling.Document{ - // { - // Kind: to.Ptr(armbilling.DocumentTypeInvoice), - // Source: to.Ptr(armbilling.DocumentSourceDRS), - // URL: to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/11000000-0000-0000-0000-000000000000/invoices/1383724/download"), - // }}, - // DueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-01T17:32:28Z"); return t}()), - // InvoiceDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoicePeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-30T17:32:28Z"); return t}()), - // InvoicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T17:32:28Z"); return t}()), - // InvoiceType: to.Ptr(armbilling.InvoiceTypeAzureMarketplace), - // Payments: []*armbilling.PaymentProperties{ - // { - // Amount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-14T17:32:28Z"); return t}()), - // PaymentMethodFamily: to.Ptr(armbilling.PaymentMethodFamilyCreditCard), - // PaymentMethodType: to.Ptr("visa"), - // PaymentType: to.Ptr("credited"), - // }}, - // PurchaseOrderNumber: to.Ptr("123456"), - // Status: to.Ptr(armbilling.InvoiceStatusPaid), - // SubscriptionID: to.Ptr("55000000-0000-0000-0000-000000000011"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionInvoiceDownload.json -func ExampleInvoicesClient_BeginDownloadBillingSubscriptionInvoice() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInvoicesClient().BeginDownloadBillingSubscriptionInvoice(ctx, "{invoiceName}", "DRS_12345", 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 pull 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.DownloadURL = armbilling.DownloadURL{ - // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sig=sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json -func ExampleInvoicesClient_BeginDownloadMultipleBillingSubscriptionInvoices() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingSubscriptionInvoices(ctx, []*string{ - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"), - to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, 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 pull 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.DownloadURL = armbilling.DownloadURL{ - // URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"), - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/invoicesections_client_example_test.go b/sdk/resourcemanager/billing/armbilling/invoicesections_client_example_test.go deleted file mode 100644 index 50568d6f3273..000000000000 --- a/sdk/resourcemanager/billing/armbilling/invoicesections_client_example_test.go +++ /dev/null @@ -1,167 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionsListByBillingProfile.json -func ExampleInvoiceSectionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInvoiceSectionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.InvoiceSectionListResult = armbilling.InvoiceSectionListResult{ - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSection1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), - // Tags: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // }, - // }, - // { - // Name: to.Ptr("22000000-0000-0000-0000-000000000011"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000011"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSection2"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("Z223456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateRestricted), - // SystemID: to.Ptr("YY1X-BBAA-XXX-ZZZ"), - // Tags: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("Z223456"), - // }, - // TargetCloud: to.Ptr(armbilling.TargetCloudUSSec), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSection.json -func ExampleInvoiceSectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInvoiceSectionsClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.InvoiceSection = armbilling.InvoiceSection{ - // Name: to.Ptr("{invoiceSectionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSection1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), - // Tags: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutInvoiceSection.json -func ExampleInvoiceSectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewInvoiceSectionsClient().BeginCreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", armbilling.InvoiceSection{ - Properties: &armbilling.InvoiceSectionProperties{ - DisplayName: to.Ptr("invoiceSection1"), - Labels: map[string]*string{ - "costCategory": to.Ptr("Support"), - "pcCode": to.Ptr("A123456"), - }, - }, - }, 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 pull 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.InvoiceSection = armbilling.InvoiceSection{ - // Name: to.Ptr("{invoiceSectionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSection1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // SystemID: to.Ptr("XX1X-XXAA-XXX-ZZZ"), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/models.go b/sdk/resourcemanager/billing/armbilling/models.go index 33b09af4f2ef..01053ed26e19 100644 --- a/sdk/resourcemanager/billing/armbilling/models.go +++ b/sdk/resourcemanager/billing/armbilling/models.go @@ -14,68 +14,68 @@ import "time" // Account - A billing account. type Account struct { // The properties of the billing account. - Properties *AccountProperties `json:"properties,omitempty"` + Properties *AccountProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AccountListResult - The list of billing accounts. type AccountListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of billing accounts. - Value []*Account `json:"value,omitempty" azure:"ro"` + Value []*Account } // AccountProperties - The properties of the billing account. type AccountProperties struct { // The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. - BillingProfiles *ProfilesOnExpand `json:"billingProfiles,omitempty"` + BillingProfiles *ProfilesOnExpand // The departments associated to the enrollment. - Departments []*Department `json:"departments,omitempty"` + Departments []*Department // The billing account name. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // The accounts associated to the enrollment. - EnrollmentAccounts []*EnrollmentAccount `json:"enrollmentAccounts,omitempty"` + EnrollmentAccounts []*EnrollmentAccount // Notification email address, only for legacy accounts - NotificationEmailAddress *string `json:"notificationEmailAddress,omitempty"` + NotificationEmailAddress *string // The address of the individual or organization that is responsible for the billing account. - SoldTo *AddressDetails `json:"soldTo,omitempty"` + SoldTo *AddressDetails // READ-ONLY; The current status of the billing account. - AccountStatus *AccountStatus `json:"accountStatus,omitempty" azure:"ro"` + AccountStatus *AccountStatus // READ-ONLY; The type of customer. - AccountType *AccountType `json:"accountType,omitempty" azure:"ro"` + AccountType *AccountType // READ-ONLY; The type of agreement. - AgreementType *AgreementType `json:"agreementType,omitempty" azure:"ro"` + AgreementType *AgreementType // READ-ONLY; The details about the associated legacy enrollment. By default this is not populated, unless it's specified // in $expand. - EnrollmentDetails *Enrollment `json:"enrollmentDetails,omitempty" azure:"ro"` + EnrollmentDetails *Enrollment // READ-ONLY; Indicates whether user has read access to the billing account. - HasReadAccess *bool `json:"hasReadAccess,omitempty" azure:"ro"` + HasReadAccess *bool } // AccountUpdateRequest - The request properties of the billing account that can be updated. type AccountUpdateRequest struct { // A billing property. - Properties *AccountProperties `json:"properties,omitempty"` + Properties *AccountProperties } // AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. @@ -110,97 +110,97 @@ type AddressClientValidateOptions struct { // AddressDetails - Address details. type AddressDetails struct { // REQUIRED; Address line 1. - AddressLine1 *string `json:"addressLine1,omitempty"` + AddressLine1 *string // REQUIRED; Country code uses ISO2, 2-digit format. - Country *string `json:"country,omitempty"` + Country *string // Address line 2. - AddressLine2 *string `json:"addressLine2,omitempty"` + AddressLine2 *string // Address line 3. - AddressLine3 *string `json:"addressLine3,omitempty"` + AddressLine3 *string // Address city. - City *string `json:"city,omitempty"` + City *string // Company name. - CompanyName *string `json:"companyName,omitempty"` + CompanyName *string // Address district. - District *string `json:"district,omitempty"` + District *string // Email address. - Email *string `json:"email,omitempty"` + Email *string // First name. - FirstName *string `json:"firstName,omitempty"` + FirstName *string // Last name. - LastName *string `json:"lastName,omitempty"` + LastName *string // Middle name. - MiddleName *string `json:"middleName,omitempty"` + MiddleName *string // Phone number. - PhoneNumber *string `json:"phoneNumber,omitempty"` + PhoneNumber *string // Postal code. - PostalCode *string `json:"postalCode,omitempty"` + PostalCode *string // Address region. - Region *string `json:"region,omitempty"` + Region *string } // Agreement - An agreement. type Agreement struct { // The properties of an agreement. - Properties *AgreementProperties `json:"properties,omitempty"` + Properties *AgreementProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AgreementListResult - Result of listing agreements. type AgreementListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of agreements. - Value []*Agreement `json:"value,omitempty" azure:"ro"` + Value []*Agreement } // AgreementProperties - The properties of an agreement. type AgreementProperties struct { // The list of participants that participates in acceptance of an agreement. - Participants []*Participants `json:"participants,omitempty"` + Participants []*Participants // READ-ONLY; The mode of acceptance for an agreement. - AcceptanceMode *AcceptanceMode `json:"acceptanceMode,omitempty" azure:"ro"` + AcceptanceMode *AcceptanceMode // READ-ONLY; The URL to download the agreement. - AgreementLink *string `json:"agreementLink,omitempty" azure:"ro"` + AgreementLink *string // READ-ONLY; The list of billing profiles associated with agreement and present only for specific agreements. - BillingProfileInfo *ProfileInfo `json:"billingProfileInfo,omitempty" azure:"ro"` + BillingProfileInfo *ProfileInfo // READ-ONLY; The category of the agreement signed by a customer. - Category *Category `json:"category,omitempty" azure:"ro"` + Category *Category // READ-ONLY; The date from which the agreement is effective. - EffectiveDate *time.Time `json:"effectiveDate,omitempty" azure:"ro"` + EffectiveDate *time.Time // READ-ONLY; The date when the agreement expires. - ExpirationDate *time.Time `json:"expirationDate,omitempty" azure:"ro"` + ExpirationDate *time.Time // READ-ONLY; The current status of the agreement. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // AgreementsClientGetOptions contains the optional parameters for the AgreementsClient.Get method. @@ -219,31 +219,31 @@ type AgreementsClientListByBillingAccountOptions struct { // Amount - The amount. type Amount struct { // Amount value. - Value *float32 `json:"value,omitempty"` + Value *float32 // READ-ONLY; The currency for the amount value. - Currency *string `json:"currency,omitempty" azure:"ro"` + Currency *string } // AvailableBalance - The latest Azure credit balance. This is the balance available for pay now. type AvailableBalance struct { // The properties of available balance. - Properties *AvailableBalanceProperties `json:"properties,omitempty"` + Properties *AvailableBalanceProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AvailableBalanceProperties - The properties of available balance. type AvailableBalanceProperties struct { // READ-ONLY; Balance amount. - Amount *Amount `json:"amount,omitempty" azure:"ro"` + Amount *Amount } // AvailableBalancesClientGetOptions contains the optional parameters for the AvailableBalancesClient.Get method. @@ -254,76 +254,76 @@ type AvailableBalancesClientGetOptions struct { // AzurePlan - Details of the Azure plan. type AzurePlan struct { // The sku id. - SKUID *string `json:"skuId,omitempty"` + SKUID *string // READ-ONLY; The sku description. - SKUDescription *string `json:"skuDescription,omitempty" azure:"ro"` + SKUDescription *string } // Customer - A partner's customer. type Customer struct { // The customer. - Properties *CustomerProperties `json:"properties,omitempty"` + Properties *CustomerProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CustomerListResult - The list of customers. type CustomerListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of customers. - Value []*Customer `json:"value,omitempty" azure:"ro"` + Value []*Customer } // CustomerPolicy - The customer's Policy. type CustomerPolicy struct { // The properties of a customer's policy. - Properties *CustomerPolicyProperties `json:"properties,omitempty"` + Properties *CustomerPolicyProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CustomerPolicyProperties - The properties of a customer's policy. type CustomerPolicyProperties struct { // The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. - ViewCharges *ViewCharges `json:"viewCharges,omitempty"` + ViewCharges *ViewCharges } // CustomerProperties - The properties of a customer. type CustomerProperties struct { // The name of the customer. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Azure plans enabled for the customer. - EnabledAzurePlans []*AzurePlan `json:"enabledAzurePlans,omitempty"` + EnabledAzurePlans []*AzurePlan // The list of resellers for which an Azure plan is enabled for the customer. - Resellers []*Reseller `json:"resellers,omitempty"` + Resellers []*Reseller // READ-ONLY; The name of the billing profile for the invoice section. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for the invoice section. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string } // CustomersClientGetOptions contains the optional parameters for the CustomersClient.Get method. @@ -353,169 +353,169 @@ type CustomersClientListByBillingProfileOptions struct { // Department - A department. type Department struct { // A department. - Properties *DepartmentProperties `json:"properties,omitempty"` + Properties *DepartmentProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DepartmentProperties - The properties of a department. type DepartmentProperties struct { // The cost center associated with the department. - CostCenter *string `json:"costCenter,omitempty"` + CostCenter *string // The name of the department. - DepartmentName *string `json:"departmentName,omitempty"` + DepartmentName *string // Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. - EnrollmentAccounts []*EnrollmentAccount `json:"enrollmentAccounts,omitempty"` + EnrollmentAccounts []*EnrollmentAccount // The status of the department. - Status *string `json:"status,omitempty"` + Status *string } // Document - The properties of a document. type Document struct { // READ-ONLY; The type of the document. - Kind *DocumentType `json:"kind,omitempty" azure:"ro"` + Kind *DocumentType // READ-ONLY; The source of the document. ENF for Brazil and DRS for rest of the world. - Source *DocumentSource `json:"source,omitempty" azure:"ro"` + Source *DocumentSource // READ-ONLY; Document URL. - URL *string `json:"url,omitempty" azure:"ro"` + URL *string } // DownloadURL - A secure URL that can be used to download a an entity until the URL expires. type DownloadURL struct { // READ-ONLY; The time in UTC when the download URL will expire. - ExpiryTime *time.Time `json:"expiryTime,omitempty" azure:"ro"` + ExpiryTime *time.Time // READ-ONLY; The URL to the PDF file. - URL *string `json:"url,omitempty" azure:"ro"` + URL *string } // Enrollment - The properties of an enrollment. type Enrollment struct { // The end date of the enrollment. - EndDate *time.Time `json:"endDate,omitempty"` + EndDate *time.Time // The start date of the enrollment. - StartDate *time.Time `json:"startDate,omitempty"` + StartDate *time.Time // READ-ONLY; The billing cycle for the enrollment. - BillingCycle *string `json:"billingCycle,omitempty" azure:"ro"` + BillingCycle *string // READ-ONLY; The channel type of the enrollment. - Channel *string `json:"channel,omitempty" azure:"ro"` + Channel *string // READ-ONLY; The country code of the enrollment. - CountryCode *string `json:"countryCode,omitempty" azure:"ro"` + CountryCode *string // READ-ONLY; The billing currency for the enrollment. - Currency *string `json:"currency,omitempty" azure:"ro"` + Currency *string // READ-ONLY; The language for the enrollment. - Language *string `json:"language,omitempty" azure:"ro"` + Language *string // READ-ONLY; The policies for Enterprise Agreement enrollments. - Policies *EnrollmentPolicies `json:"policies,omitempty" azure:"ro"` + Policies *EnrollmentPolicies // READ-ONLY; The current status of the enrollment. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // EnrollmentAccount - An enrollment account. type EnrollmentAccount struct { // The properties of an enrollment account. - Properties *EnrollmentAccountProperties `json:"properties,omitempty"` + Properties *EnrollmentAccountProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // EnrollmentAccountContext - The enrollment account context type EnrollmentAccountContext struct { // The cost center associated with the enrollment account. - CostCenter *string `json:"costCenter,omitempty"` + CostCenter *string // The end date of the enrollment account. - EndDate *time.Time `json:"endDate,omitempty"` + EndDate *time.Time // The ID of the enrollment account. - EnrollmentAccountName *string `json:"enrollmentAccountName,omitempty"` + EnrollmentAccountName *string // The start date of the enrollment account. - StartDate *time.Time `json:"startDate,omitempty"` + StartDate *time.Time } // EnrollmentAccountListResult - Result of listing enrollment accounts. type EnrollmentAccountListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of enrollment accounts. - Value []*EnrollmentAccountSummary `json:"value,omitempty" azure:"ro"` + Value []*EnrollmentAccountSummary } // EnrollmentAccountProperties - The properties of an enrollment account. type EnrollmentAccountProperties struct { // The name of the enrollment account. - AccountName *string `json:"accountName,omitempty"` + AccountName *string // The owner of the enrollment account. - AccountOwner *string `json:"accountOwner,omitempty"` + AccountOwner *string // The enrollment account owner email address. - AccountOwnerEmail *string `json:"accountOwnerEmail,omitempty"` + AccountOwnerEmail *string // The cost center associated with the enrollment account. - CostCenter *string `json:"costCenter,omitempty"` + CostCenter *string // Associated department. By default this is not populated, unless it's specified in $expand. - Department *Department `json:"department,omitempty"` + Department *Department // The end date of the enrollment account. - EndDate *time.Time `json:"endDate,omitempty"` + EndDate *time.Time // The start date of the enrollment account. - StartDate *time.Time `json:"startDate,omitempty"` + StartDate *time.Time // The status of the enrollment account. - Status *string `json:"status,omitempty"` + Status *string } // EnrollmentAccountSummary - An enrollment account resource. type EnrollmentAccountSummary struct { // An enrollment account. - Properties *EnrollmentAccountSummaryProperties `json:"properties,omitempty"` + Properties *EnrollmentAccountSummaryProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // EnrollmentAccountSummaryProperties - The properties of the enrollment account. type EnrollmentAccountSummaryProperties struct { // READ-ONLY; The account owner's principal name. - PrincipalName *string `json:"principalName,omitempty" azure:"ro"` + PrincipalName *string } // EnrollmentAccountsClientGetOptions contains the optional parameters for the EnrollmentAccountsClient.Get method. @@ -531,100 +531,100 @@ type EnrollmentAccountsClientListOptions struct { // EnrollmentPolicies - The policies for Enterprise Agreement enrollments. type EnrollmentPolicies struct { // READ-ONLY; The policy that controls whether Account Owners can view charges. - AccountOwnerViewCharges *bool `json:"accountOwnerViewCharges,omitempty" azure:"ro"` + AccountOwnerViewCharges *bool // READ-ONLY; The policy that controls whether Department Administrators can view charges. - DepartmentAdminViewCharges *bool `json:"departmentAdminViewCharges,omitempty" azure:"ro"` + DepartmentAdminViewCharges *bool // READ-ONLY; The policy that controls whether Azure marketplace purchases are allowed in the enrollment. - MarketplaceEnabled *bool `json:"marketplaceEnabled,omitempty" azure:"ro"` + MarketplaceEnabled *bool // READ-ONLY; The policy that controls whether Azure reservation purchases are allowed in the enrollment. - ReservedInstancesEnabled *bool `json:"reservedInstancesEnabled,omitempty" azure:"ro"` + ReservedInstancesEnabled *bool } // ErrorDetails - The details of the error. type ErrorDetails struct { // READ-ONLY; Error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; The sub details of the error. - Details []*ErrorSubDetailsItem `json:"details,omitempty" azure:"ro"` + Details []*ErrorSubDetailsItem // READ-ONLY; Error message indicating why the operation failed. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The target of the particular error. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // ErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason is provided // in the error message. type ErrorResponse struct { // The details of the error. - Error *ErrorDetails `json:"error,omitempty"` + Error *ErrorDetails } type ErrorSubDetailsItem struct { // READ-ONLY; Error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; Error message indicating why the operation failed. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The target of the particular error. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // IndirectRelationshipInfo - The billing profile details of the partner of the customer for an indirect motion. type IndirectRelationshipInfo struct { // The billing account name of the partner or the customer for an indirect motion. - BillingAccountName *string `json:"billingAccountName,omitempty"` + BillingAccountName *string // The billing profile name of the partner or the customer for an indirect motion. - BillingProfileName *string `json:"billingProfileName,omitempty"` + BillingProfileName *string // The display name of the partner or customer for an indirect motion. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string } // Instruction - An instruction. type Instruction struct { // A billing instruction used during invoice generation. - Properties *InstructionProperties `json:"properties,omitempty"` + Properties *InstructionProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // InstructionListResult - The list of billing instructions used during invoice generation. type InstructionListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of billing instructions used during invoice generation. - Value []*Instruction `json:"value,omitempty" azure:"ro"` + Value []*Instruction } // InstructionProperties - A billing instruction used during invoice generation. type InstructionProperties struct { // REQUIRED; The amount budgeted for this billing instruction. - Amount *float32 `json:"amount,omitempty"` + Amount *float32 // REQUIRED; The date this billing instruction is no longer in effect. - EndDate *time.Time `json:"endDate,omitempty"` + EndDate *time.Time // REQUIRED; The date this billing instruction goes into effect. - StartDate *time.Time `json:"startDate,omitempty"` + StartDate *time.Time // The date this billing instruction was created. - CreationDate *time.Time `json:"creationDate,omitempty"` + CreationDate *time.Time } // InstructionsClientGetOptions contains the optional parameters for the InstructionsClient.Get method. @@ -646,214 +646,214 @@ type InstructionsClientPutOptions struct { // Invoice - An invoice. type Invoice struct { // An invoice. - Properties *InvoiceProperties `json:"properties,omitempty"` + Properties *InvoiceProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // InvoiceListResult - The list of invoices. type InvoiceListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of invoices. - Value []*Invoice `json:"value,omitempty" azure:"ro"` + Value []*Invoice } // InvoiceProperties - The properties of the invoice. type InvoiceProperties struct { // READ-ONLY; The amount due as of now. - AmountDue *Amount `json:"amountDue,omitempty" azure:"ro"` + AmountDue *Amount // READ-ONLY; The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. - AzurePrepaymentApplied *Amount `json:"azurePrepaymentApplied,omitempty" azure:"ro"` + AzurePrepaymentApplied *Amount // READ-ONLY; The total charges for the invoice billing period. - BilledAmount *Amount `json:"billedAmount,omitempty" azure:"ro"` + BilledAmount *Amount // READ-ONLY; The Id of the active invoice which is originally billed after this invoice was voided. This field is applicable // to the void invoices only. - BilledDocumentID *string `json:"billedDocumentId,omitempty" azure:"ro"` + BilledDocumentID *string // READ-ONLY; The name of the billing profile for which the invoice is generated. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for which the invoice is generated. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The total refund for returns and cancellations during the invoice billing period. This field is applicable to // billing accounts with agreement type Microsoft Customer Agreement. - CreditAmount *Amount `json:"creditAmount,omitempty" azure:"ro"` + CreditAmount *Amount // READ-ONLY; The Id of the invoice which got voided and this credit note was issued as a result. This field is applicable // to the credit notes only. - CreditForDocumentID *string `json:"creditForDocumentId,omitempty" azure:"ro"` + CreditForDocumentID *string // READ-ONLY; The type of the document. - DocumentType *InvoiceDocumentType `json:"documentType,omitempty" azure:"ro"` + DocumentType *InvoiceDocumentType // READ-ONLY; List of documents available to download such as invoice and tax receipt. - Documents []*Document `json:"documents,omitempty" azure:"ro"` + Documents []*Document // READ-ONLY; The due date for the invoice. - DueDate *time.Time `json:"dueDate,omitempty" azure:"ro"` + DueDate *time.Time // READ-ONLY; The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. - FreeAzureCreditApplied *Amount `json:"freeAzureCreditApplied,omitempty" azure:"ro"` + FreeAzureCreditApplied *Amount // READ-ONLY; The date when the invoice was generated. - InvoiceDate *time.Time `json:"invoiceDate,omitempty" azure:"ro"` + InvoiceDate *time.Time // READ-ONLY; The end date of the billing period for which the invoice is generated. - InvoicePeriodEndDate *time.Time `json:"invoicePeriodEndDate,omitempty" azure:"ro"` + InvoicePeriodEndDate *time.Time // READ-ONLY; The start date of the billing period for which the invoice is generated. - InvoicePeriodStartDate *time.Time `json:"invoicePeriodStartDate,omitempty" azure:"ro"` + InvoicePeriodStartDate *time.Time // READ-ONLY; Invoice type. - InvoiceType *InvoiceType `json:"invoiceType,omitempty" azure:"ro"` + InvoiceType *InvoiceType // READ-ONLY; Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to // billing accounts with agreement type Microsoft Customer Agreement. - IsMonthlyInvoice *bool `json:"isMonthlyInvoice,omitempty" azure:"ro"` + IsMonthlyInvoice *bool // READ-ONLY; List of payments. - Payments []*PaymentProperties `json:"payments,omitempty" azure:"ro"` + Payments []*PaymentProperties // READ-ONLY; An optional purchase order number for the invoice. - PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty" azure:"ro"` + PurchaseOrderNumber *string // READ-ONLY; Rebill details for an invoice. - RebillDetails map[string]*RebillDetails `json:"rebillDetails,omitempty" azure:"ro"` + RebillDetails map[string]*RebillDetails // READ-ONLY; The current status of the invoice. - Status *InvoiceStatus `json:"status,omitempty" azure:"ro"` + Status *InvoiceStatus // READ-ONLY; The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer // Agreement. - SubTotal *Amount `json:"subTotal,omitempty" azure:"ro"` + SubTotal *Amount // READ-ONLY; The ID of the subscription for which the invoice is generated. - SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` + SubscriptionID *string // READ-ONLY; The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement // type Microsoft Customer Agreement. - TaxAmount *Amount `json:"taxAmount,omitempty" azure:"ro"` + TaxAmount *Amount // READ-ONLY; The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type // Microsoft Customer Agreement. - TotalAmount *Amount `json:"totalAmount,omitempty" azure:"ro"` + TotalAmount *Amount } // InvoiceSection - An invoice section. type InvoiceSection struct { // The properties of an invoice section. - Properties *InvoiceSectionProperties `json:"properties,omitempty"` + Properties *InvoiceSectionProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // InvoiceSectionCreationRequest - The properties of the invoice section. type InvoiceSectionCreationRequest struct { // The name of the invoice section. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string } // InvoiceSectionListResult - The list of invoice sections. type InvoiceSectionListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of invoice sections. - Value []*InvoiceSection `json:"value,omitempty" azure:"ro"` + Value []*InvoiceSection } // InvoiceSectionListWithCreateSubPermissionResult - The list of invoice section properties with create subscription permission. type InvoiceSectionListWithCreateSubPermissionResult struct { // The list of invoice section properties with create subscription permission. - Value []*InvoiceSectionWithCreateSubPermission `json:"value,omitempty"` + Value []*InvoiceSectionWithCreateSubPermission // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string } // InvoiceSectionProperties - The properties of an invoice section. type InvoiceSectionProperties struct { // The name of the invoice section. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Dictionary of metadata associated with the invoice section. - Labels map[string]*string `json:"labels,omitempty"` + Labels map[string]*string // Dictionary of metadata associated with the invoice section. Maximum key/value length supported of 256 characters. Keys/value // should not empty value nor null. Keys can not contain < > % & \ ? / - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Identifies the state of an invoice section. - State *InvoiceSectionState `json:"state,omitempty" azure:"ro"` + State *InvoiceSectionState // READ-ONLY; The system generated unique identifier for an invoice section. - SystemID *string `json:"systemId,omitempty" azure:"ro"` + SystemID *string // READ-ONLY; Identifies the cloud environments that are associated with an invoice section. This is a system managed optional // field and gets updated as the invoice section gets associated with accounts in various // clouds. - TargetCloud *TargetCloud `json:"targetCloud,omitempty" azure:"ro"` + TargetCloud *TargetCloud } // InvoiceSectionWithCreateSubPermission - Invoice section properties with create subscription permission. type InvoiceSectionWithCreateSubPermission struct { // Enabled azure plans for the associated billing profile. - EnabledAzurePlans []*AzurePlan `json:"enabledAzurePlans,omitempty"` + EnabledAzurePlans []*AzurePlan // READ-ONLY; The name of the billing profile for the invoice section. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile for the invoice section. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The billing profile spending limit. - BillingProfileSpendingLimit *SpendingLimitForBillingProfile `json:"billingProfileSpendingLimit,omitempty" azure:"ro"` + BillingProfileSpendingLimit *SpendingLimitForBillingProfile // READ-ONLY; The status of the billing profile. - BillingProfileStatus *BillingProfileStatus `json:"billingProfileStatus,omitempty" azure:"ro"` + BillingProfileStatus *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. - BillingProfileStatusReasonCode *StatusReasonCodeForBillingProfile `json:"billingProfileStatusReasonCode,omitempty" azure:"ro"` + BillingProfileStatusReasonCode *StatusReasonCodeForBillingProfile // READ-ONLY; The system generated unique identifier for a billing profile. - BillingProfileSystemID *string `json:"billingProfileSystemId,omitempty" azure:"ro"` + BillingProfileSystemID *string // READ-ONLY; The name of the invoice section. - InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty" azure:"ro"` + InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section. - InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` + InvoiceSectionID *string // READ-ONLY; The system generated unique identifier for an invoice section. - InvoiceSectionSystemID *string `json:"invoiceSectionSystemId,omitempty" azure:"ro"` + InvoiceSectionSystemID *string } // InvoiceSectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the InvoiceSectionsClient.BeginCreateOrUpdate @@ -878,12 +878,12 @@ type InvoiceSectionsClientListByBillingProfileOptions struct { // it's specified in $expand. type InvoiceSectionsOnExpand struct { // The invoice sections associated to the billing profile. - Value []*InvoiceSection `json:"value,omitempty"` + Value []*InvoiceSection // READ-ONLY; Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists // a maximum of 50 invoice sections. To get all invoice sections, use the list invoice // sections API. - HasMoreResults *bool `json:"hasMoreResults,omitempty" azure:"ro"` + HasMoreResults *bool } // InvoicesClientBeginDownloadBillingSubscriptionInvoiceOptions contains the optional parameters for the InvoicesClient.BeginDownloadBillingSubscriptionInvoice @@ -951,37 +951,37 @@ type InvoicesClientListByBillingSubscriptionOptions struct { // Operation - A Billing REST API operation. type Operation struct { // The object that represents the operation. - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // READ-ONLY; Identifies if the operation is a data operation. - IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` + IsDataAction *bool // READ-ONLY; Operation name: {provider}/{resource}/{operation}. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string } // OperationDisplay - The object that represents the operation. type OperationDisplay struct { // READ-ONLY; Description of operation. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; Operation type such as read, write and delete. - Operation *string `json:"operation,omitempty" azure:"ro"` + Operation *string // READ-ONLY; Service provider: Microsoft.Billing. - Provider *string `json:"provider,omitempty" azure:"ro"` + Provider *string // READ-ONLY; Resource on which the operation is performed such as invoice and billing subscription. - Resource *string `json:"resource,omitempty" azure:"ro"` + Resource *string } // OperationListResult - The list of billing operations and a URL link to get the next set of results. type OperationListResult struct { // READ-ONLY; URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of billing operations supported by the Microsoft.Billing resource provider. - Value []*Operation `json:"value,omitempty" azure:"ro"` + Value []*Operation } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -992,77 +992,77 @@ type OperationsClientListOptions struct { // OperationsErrorDetails - The details of the error. type OperationsErrorDetails struct { // READ-ONLY; Error code. - Code *string `json:"code,omitempty" azure:"ro"` + Code *string // READ-ONLY; Error message indicating why the operation failed. - Message *string `json:"message,omitempty" azure:"ro"` + Message *string // READ-ONLY; The target of the particular error. - Target *string `json:"target,omitempty" azure:"ro"` + Target *string } // OperationsErrorResponse - Error response indicates that the service is not able to process the incoming request. The reason // is provided in the error message. type OperationsErrorResponse struct { // The details of the error. - Error *OperationsErrorDetails `json:"error,omitempty"` + Error *OperationsErrorDetails } // Participants - The details about a participant. type Participants struct { // READ-ONLY; The email address of the participant. - Email *string `json:"email,omitempty" azure:"ro"` + Email *string // READ-ONLY; The acceptance status of the participant. - Status *string `json:"status,omitempty" azure:"ro"` + Status *string // READ-ONLY; The date when the status got changed. - StatusDate *time.Time `json:"statusDate,omitempty" azure:"ro"` + StatusDate *time.Time } // PaymentProperties - The properties of a payment. type PaymentProperties struct { // The family of payment method. - PaymentMethodFamily *PaymentMethodFamily `json:"paymentMethodFamily,omitempty"` + PaymentMethodFamily *PaymentMethodFamily // READ-ONLY; The paid amount. - Amount *Amount `json:"amount,omitempty" azure:"ro"` + Amount *Amount // READ-ONLY; The date when the payment was made. - Date *time.Time `json:"date,omitempty" azure:"ro"` + Date *time.Time // READ-ONLY; The type of payment method. - PaymentMethodType *string `json:"paymentMethodType,omitempty" azure:"ro"` + PaymentMethodType *string // READ-ONLY; The type of payment. - PaymentType *string `json:"paymentType,omitempty" azure:"ro"` + PaymentType *string } // Period - A billing period resource. type Period struct { // A billing period. - Properties *PeriodProperties `json:"properties,omitempty"` + Properties *PeriodProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PeriodProperties - The properties of the billing period. type PeriodProperties struct { // READ-ONLY; The end of the date range covered by the billing period. - BillingPeriodEndDate *time.Time `json:"billingPeriodEndDate,omitempty" azure:"ro"` + BillingPeriodEndDate *time.Time // READ-ONLY; The start of the date range covered by the billing period. - BillingPeriodStartDate *time.Time `json:"billingPeriodStartDate,omitempty" azure:"ro"` + BillingPeriodStartDate *time.Time // READ-ONLY; Array of invoice ids that associated with. - InvoiceIDs []*string `json:"invoiceIds,omitempty" azure:"ro"` + InvoiceIDs []*string } // PeriodsClientGetOptions contains the optional parameters for the PeriodsClient.Get method. @@ -1087,10 +1087,10 @@ type PeriodsClientListOptions struct { // order. type PeriodsListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of billing periods. - Value []*Period `json:"value,omitempty" azure:"ro"` + Value []*Period } // PermissionsClientListByBillingAccountOptions contains the optional parameters for the PermissionsClient.NewListByBillingAccountPager @@ -1120,19 +1120,19 @@ type PermissionsClientListByInvoiceSectionsOptions struct { // PermissionsListResult - Result of list billingPermissions a caller has on a billing account. type PermissionsListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of billingPermissions a caller has on a billing account. - Value []*PermissionsProperties `json:"value,omitempty" azure:"ro"` + Value []*PermissionsProperties } // PermissionsProperties - The set of allowed action and not allowed actions a caller has on a billing account type PermissionsProperties struct { // READ-ONLY; The set of actions that the caller is allowed to perform. - Actions []*string `json:"actions,omitempty" azure:"ro"` + Actions []*string // READ-ONLY; The set of actions that the caller is not allowed to perform. - NotActions []*string `json:"notActions,omitempty" azure:"ro"` + NotActions []*string } // PoliciesClientGetByBillingProfileOptions contains the optional parameters for the PoliciesClient.GetByBillingProfile method. @@ -1158,114 +1158,114 @@ type PoliciesClientUpdateOptions struct { // Policy - A policy. type Policy struct { // The properties of a policy. - Properties *PolicyProperties `json:"properties,omitempty"` + Properties *PolicyProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PolicyProperties - The properties of a policy. type PolicyProperties struct { // The policy that controls whether Azure marketplace purchases are allowed for a billing profile. - MarketplacePurchases *MarketplacePurchasesPolicy `json:"marketplacePurchases,omitempty"` + MarketplacePurchases *MarketplacePurchasesPolicy // The policy that controls whether Azure reservation purchases are allowed for a billing profile. - ReservationPurchases *ReservationPurchasesPolicy `json:"reservationPurchases,omitempty"` + ReservationPurchases *ReservationPurchasesPolicy // The policy that controls whether users with Azure RBAC access to a subscription can view its charges. - ViewCharges *ViewChargesPolicy `json:"viewCharges,omitempty"` + ViewCharges *ViewChargesPolicy } // Product - A product. type Product struct { // The properties of a product. - Properties *ProductProperties `json:"properties,omitempty"` + Properties *ProductProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ProductProperties - The properties of a product. type ProductProperties struct { // Indicates whether auto renewal is turned on or off for a product. - AutoRenew *AutoRenew `json:"autoRenew,omitempty"` + AutoRenew *AutoRenew // The frequency at which the product will be billed. - BillingFrequency *BillingFrequency `json:"billingFrequency,omitempty"` + BillingFrequency *BillingFrequency // The current status of the product. - Status *ProductStatusType `json:"status,omitempty"` + Status *ProductStatusType // READ-ONLY; The availability of the product. - AvailabilityID *string `json:"availabilityId,omitempty" azure:"ro"` + AvailabilityID *string // READ-ONLY; The name of the billing profile to which the product is billed. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the product is billed. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerDisplayName *string `json:"customerDisplayName,omitempty" azure:"ro"` + CustomerDisplayName *string // READ-ONLY; The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerID *string `json:"customerId,omitempty" azure:"ro"` + CustomerID *string // READ-ONLY; The display name of the product. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The date when the product will be renewed or canceled. - EndDate *time.Time `json:"endDate,omitempty" azure:"ro"` + EndDate *time.Time // READ-ONLY; The name of the invoice section to which the product is billed. - InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty" azure:"ro"` + InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the product is billed. - InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` + InvoiceSectionID *string // READ-ONLY; The last month charges. - LastCharge *Amount `json:"lastCharge,omitempty" azure:"ro"` + LastCharge *Amount // READ-ONLY; The date of the last charge. - LastChargeDate *time.Time `json:"lastChargeDate,omitempty" azure:"ro"` + LastChargeDate *time.Time // READ-ONLY; The description of the type of product. - ProductType *string `json:"productType,omitempty" azure:"ro"` + ProductType *string // READ-ONLY; The ID of the type of product. - ProductTypeID *string `json:"productTypeId,omitempty" azure:"ro"` + ProductTypeID *string // READ-ONLY; The date when the product was purchased. - PurchaseDate *time.Time `json:"purchaseDate,omitempty" azure:"ro"` + PurchaseDate *time.Time // READ-ONLY; The quantity purchased for the product. - Quantity *float32 `json:"quantity,omitempty" azure:"ro"` + Quantity *float32 // READ-ONLY; Reseller for this product. - Reseller *Reseller `json:"reseller,omitempty" azure:"ro"` + Reseller *Reseller // READ-ONLY; The sku description of the product. - SKUDescription *string `json:"skuDescription,omitempty" azure:"ro"` + SKUDescription *string // READ-ONLY; The sku ID of the product. - SKUID *string `json:"skuId,omitempty" azure:"ro"` + SKUID *string // READ-ONLY; The id of the tenant in which the product is used. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + TenantID *string } // ProductsClientGetOptions contains the optional parameters for the ProductsClient.Get method. @@ -1324,126 +1324,126 @@ type ProductsClientValidateMoveOptions struct { // by purchase date. type ProductsListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of products. - Value []*Product `json:"value,omitempty" azure:"ro"` + Value []*Product } // Profile - A billing profile. type Profile struct { // The properties of the billing profile. - Properties *ProfileProperties `json:"properties,omitempty"` + Properties *ProfileProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ProfileCreationRequest - The request parameters for creating a new billing profile. type ProfileCreationRequest struct { // The address of the individual or organization that is responsible for the billing profile. - BillTo *AddressDetails `json:"billTo,omitempty"` + BillTo *AddressDetails // The name of the billing profile. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Enabled azure plans for the billing profile. - EnabledAzurePlans []*AzurePlan `json:"enabledAzurePlans,omitempty"` + EnabledAzurePlans []*AzurePlan // Flag controlling whether the invoices for the billing profile are sent through email. - InvoiceEmailOptIn *bool `json:"invoiceEmailOptIn,omitempty"` + InvoiceEmailOptIn *bool // The purchase order name that will appear on the invoices generated for the billing profile. - PoNumber *string `json:"poNumber,omitempty"` + PoNumber *string } // ProfileInfo - Details about billing profile associated with agreement and available only for specific agreements. type ProfileInfo struct { // The name of the billing profile - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + BillingProfileDisplayName *string // The unique identifier for the billing profile. - BillingProfileID *string `json:"billingProfileId,omitempty"` + BillingProfileID *string // Billing account name. This property is available for a specific type of agreement. - IndirectRelationshipOrganizationName *string `json:"indirectRelationshipOrganizationName,omitempty"` + IndirectRelationshipOrganizationName *string } // ProfileListResult - The list of billing profiles. type ProfileListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of billing profiles. - Value []*Profile `json:"value,omitempty" azure:"ro"` + Value []*Profile } // ProfileProperties - The properties of the billing profile. type ProfileProperties struct { // Billing address. - BillTo *AddressDetails `json:"billTo,omitempty"` + BillTo *AddressDetails // The name of the billing profile. - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Information about the enabled azure plans. - EnabledAzurePlans []*AzurePlan `json:"enabledAzurePlans,omitempty"` + EnabledAzurePlans []*AzurePlan // Flag controlling whether the invoices for the billing profile are sent through email. - InvoiceEmailOptIn *bool `json:"invoiceEmailOptIn,omitempty"` + InvoiceEmailOptIn *bool // The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. - InvoiceSections *InvoiceSectionsOnExpand `json:"invoiceSections,omitempty"` + InvoiceSections *InvoiceSectionsOnExpand // The purchase order name that will appear on the invoices generated for the billing profile. - PoNumber *string `json:"poNumber,omitempty"` + PoNumber *string // Tags of billing profiles. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Identifies which services and purchases are paid by a billing profile. - BillingRelationshipType *BillingRelationshipType `json:"billingRelationshipType,omitempty" azure:"ro"` + BillingRelationshipType *BillingRelationshipType // READ-ONLY; The currency in which the charges for the billing profile are billed. - Currency *string `json:"currency,omitempty" azure:"ro"` + Currency *string // READ-ONLY; Indicates whether user has read access to the billing profile. - HasReadAccess *bool `json:"hasReadAccess,omitempty" azure:"ro"` + HasReadAccess *bool // READ-ONLY; Identifies the billing profile that is linked to another billing profile in indirect purchase motion. - IndirectRelationshipInfo *IndirectRelationshipInfo `json:"indirectRelationshipInfo,omitempty" azure:"ro"` + IndirectRelationshipInfo *IndirectRelationshipInfo // READ-ONLY; The day of the month when the invoice for the billing profile is generated. - InvoiceDay *int32 `json:"invoiceDay,omitempty" azure:"ro"` + InvoiceDay *int32 // READ-ONLY; The billing profile spending limit. - SpendingLimit *SpendingLimit `json:"spendingLimit,omitempty" azure:"ro"` + SpendingLimit *SpendingLimit // READ-ONLY; The status of the billing profile. - Status *BillingProfileStatus `json:"status,omitempty" azure:"ro"` + Status *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. - StatusReasonCode *StatusReasonCode `json:"statusReasonCode,omitempty" azure:"ro"` + StatusReasonCode *StatusReasonCode // READ-ONLY; The system generated unique identifier for a billing profile. - SystemID *string `json:"systemId,omitempty" azure:"ro"` + SystemID *string // READ-ONLY; Identifies the cloud environments that are associated with a billing profile. This is a system managed optional // field and gets updated as the billing profile gets associated with accounts in various // clouds. - TargetClouds []*TargetCloud `json:"targetClouds,omitempty" azure:"ro"` + TargetClouds []*TargetCloud } // ProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.BeginCreateOrUpdate method. @@ -1469,27 +1469,27 @@ type ProfilesClientListByBillingAccountOptions struct { // specified in $expand. type ProfilesOnExpand struct { // The billing profiles associated with the billing account. - Value []*Profile `json:"value,omitempty"` + Value []*Profile // READ-ONLY; Indicates whether there are more billing profiles than the ones listed in this collection. The collection lists // a maximum of 50 billing profiles. To get all billing profiles, use the list billing // profiles API. - HasMoreResults *bool `json:"hasMoreResults,omitempty" azure:"ro"` + HasMoreResults *bool } // Property - A billing property. type Property struct { // A billing property. - Properties *PropertyProperties `json:"properties,omitempty"` + Properties *PropertyProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // PropertyClientGetOptions contains the optional parameters for the PropertyClient.Get method. @@ -1505,202 +1505,202 @@ type PropertyClientUpdateOptions struct { // PropertyProperties - The billing property. type PropertyProperties struct { // The cost center applied to the subscription. - CostCenter *string `json:"costCenter,omitempty"` + CostCenter *string // READ-ONLY; The email address on which the account admin gets all Azure notifications. - AccountAdminNotificationEmailAddress *string `json:"accountAdminNotificationEmailAddress,omitempty" azure:"ro"` + AccountAdminNotificationEmailAddress *string // READ-ONLY; The name of the billing account to which the subscription is billed. - BillingAccountDisplayName *string `json:"billingAccountDisplayName,omitempty" azure:"ro"` + BillingAccountDisplayName *string // READ-ONLY; The ID of the billing account to which the subscription is billed. - BillingAccountID *string `json:"billingAccountId,omitempty" azure:"ro"` + BillingAccountID *string // READ-ONLY; The name of the billing profile to which the subscription is billed. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the subscription is billed. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The billing profile spending limit. - BillingProfileSpendingLimit *BillingProfileSpendingLimit `json:"billingProfileSpendingLimit,omitempty" azure:"ro"` + BillingProfileSpendingLimit *BillingProfileSpendingLimit // READ-ONLY; The status of the billing profile. - BillingProfileStatus *BillingProfileStatus `json:"billingProfileStatus,omitempty" azure:"ro"` + BillingProfileStatus *BillingProfileStatus // READ-ONLY; Reason for the specified billing profile status. - BillingProfileStatusReasonCode *BillingProfileStatusReasonCode `json:"billingProfileStatusReasonCode,omitempty" azure:"ro"` + BillingProfileStatusReasonCode *BillingProfileStatusReasonCode // READ-ONLY; The Azure AD tenant ID of the billing account for the subscription. - BillingTenantID *string `json:"billingTenantId,omitempty" azure:"ro"` + BillingTenantID *string // READ-ONLY; The name of the invoice section to which the subscription is billed. - InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty" azure:"ro"` + InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the subscription is billed. - InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` + InvoiceSectionID *string // READ-ONLY; Indicates whether user is the account admin. - IsAccountAdmin *bool `json:"isAccountAdmin,omitempty" azure:"ro"` + IsAccountAdmin *bool // READ-ONLY; The product ID of the Azure plan. - ProductID *string `json:"productId,omitempty" azure:"ro"` + ProductID *string // READ-ONLY; The product name of the Azure plan. - ProductName *string `json:"productName,omitempty" azure:"ro"` + ProductName *string // READ-ONLY; The sku description of the Azure plan for the subscription. - SKUDescription *string `json:"skuDescription,omitempty" azure:"ro"` + SKUDescription *string // READ-ONLY; The sku ID of the Azure plan for the subscription. - SKUID *string `json:"skuId,omitempty" azure:"ro"` + SKUID *string } // RebillDetails - The rebill details of an invoice. type RebillDetails struct { // READ-ONLY; The ID of credit note. - CreditNoteDocumentID *string `json:"creditNoteDocumentId,omitempty" azure:"ro"` + CreditNoteDocumentID *string // READ-ONLY; The ID of invoice. - InvoiceDocumentID *string `json:"invoiceDocumentId,omitempty" azure:"ro"` + InvoiceDocumentID *string // READ-ONLY; Rebill details for an invoice. - RebillDetails map[string]*RebillDetails `json:"rebillDetails,omitempty" azure:"ro"` + RebillDetails map[string]*RebillDetails } // Reseller - Details of the reseller. type Reseller struct { // READ-ONLY; The name of the reseller. - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The MPN ID of the reseller. - ResellerID *string `json:"resellerId,omitempty" azure:"ro"` + ResellerID *string } // Reservation - The definition of the reservation. type Reservation struct { // The properties associated to this reservation - Properties *ReservationProperty `json:"properties,omitempty"` + Properties *ReservationProperty // The sku information associated to this reservation - SKU *ReservationSKUProperty `json:"sku,omitempty"` + SKU *ReservationSKUProperty // READ-ONLY; The id of the reservation. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The location of the reservation. - Location *string `json:"location,omitempty" azure:"ro"` + Location *string // READ-ONLY; The name of the reservation. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; The type of the reservation. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ReservationProperty - The property of reservation object. type ReservationProperty struct { // The array of applied scopes of a reservation. Will be null if the reservation is in Shared scope - AppliedScopes []*string `json:"appliedScopes,omitempty"` + AppliedScopes []*string // READ-ONLY; The applied scope type of the reservation. - AppliedScopeType *string `json:"appliedScopeType,omitempty" azure:"ro"` + AppliedScopeType *string // READ-ONLY; The display name of the reservation - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The provisioning state of the reservation for display, e.g. Succeeded - DisplayProvisioningState *string `json:"displayProvisioningState,omitempty" azure:"ro"` + DisplayProvisioningState *string // READ-ONLY; The effective date time of the reservation - EffectiveDateTime *string `json:"effectiveDateTime,omitempty" azure:"ro"` + EffectiveDateTime *string // READ-ONLY; The expiry date of the reservation - ExpiryDate *string `json:"expiryDate,omitempty" azure:"ro"` + ExpiryDate *string // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string // READ-ONLY; The provisioning state of the reservation, e.g. Succeeded - ProvisioningSubState *string `json:"provisioningSubState,omitempty" azure:"ro"` + ProvisioningSubState *string // READ-ONLY; The number of the reservation. - Quantity *float32 `json:"quantity,omitempty" azure:"ro"` + Quantity *float32 // READ-ONLY; The renew state of the reservation - Renew *bool `json:"renew,omitempty" azure:"ro"` + Renew *bool // READ-ONLY; The renew source of the reservation - RenewSource *string `json:"renewSource,omitempty" azure:"ro"` + RenewSource *string // READ-ONLY; The reserved source type of the reservation, e.g. virtual machine. - ReservedResourceType *string `json:"reservedResourceType,omitempty" azure:"ro"` + ReservedResourceType *string // READ-ONLY; The sku description of the reservation - SKUDescription *string `json:"skuDescription,omitempty" azure:"ro"` + SKUDescription *string // READ-ONLY; The term of the reservation, e.g. P1Y - Term *string `json:"term,omitempty" azure:"ro"` + Term *string // READ-ONLY; The applied scope type of the reservation for display, e.g. Shared - UserFriendlyAppliedScopeType *string `json:"userFriendlyAppliedScopeType,omitempty" azure:"ro"` + UserFriendlyAppliedScopeType *string // READ-ONLY; The renew state of the reservation for display, e.g. On - UserFriendlyRenewState *string `json:"userFriendlyRenewState,omitempty" azure:"ro"` + UserFriendlyRenewState *string // READ-ONLY; Reservation utilization - Utilization *ReservationPropertyUtilization `json:"utilization,omitempty" azure:"ro"` + Utilization *ReservationPropertyUtilization } // ReservationPropertyUtilization - Reservation utilization type ReservationPropertyUtilization struct { // The array of aggregates of a reservation's utilization - Aggregates []*ReservationUtilizationAggregates `json:"aggregates,omitempty"` + Aggregates []*ReservationUtilizationAggregates // READ-ONLY; The number of days trend for a reservation - Trend *string `json:"trend,omitempty" azure:"ro"` + Trend *string } // ReservationSKUProperty - The property of reservation sku object. type ReservationSKUProperty struct { // READ-ONLY; The name of the reservation sku. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string } // ReservationSummary - The roll up count summary of reservations in each state type ReservationSummary struct { // READ-ONLY; The number of reservation in Cancelled state - CancelledCount *float32 `json:"cancelledCount,omitempty" azure:"ro"` + CancelledCount *float32 // READ-ONLY; The number of reservation in Expired state - ExpiredCount *float32 `json:"expiredCount,omitempty" azure:"ro"` + ExpiredCount *float32 // READ-ONLY; The number of reservation in Expiring state - ExpiringCount *float32 `json:"expiringCount,omitempty" azure:"ro"` + ExpiringCount *float32 // READ-ONLY; The number of reservation in Failed state - FailedCount *float32 `json:"failedCount,omitempty" azure:"ro"` + FailedCount *float32 // READ-ONLY; The number of reservation in Pending state - PendingCount *float32 `json:"pendingCount,omitempty" azure:"ro"` + PendingCount *float32 // READ-ONLY; The number of reservation in Succeeded state - SucceededCount *float32 `json:"succeededCount,omitempty" azure:"ro"` + SucceededCount *float32 } // ReservationUtilizationAggregates - The aggregate values of reservation utilization type ReservationUtilizationAggregates struct { // READ-ONLY; The grain of the aggregate - Grain *float32 `json:"grain,omitempty" azure:"ro"` + Grain *float32 // READ-ONLY; The grain unit of the aggregate - GrainUnit *string `json:"grainUnit,omitempty" azure:"ro"` + GrainUnit *string // READ-ONLY; The aggregate value - Value *float32 `json:"value,omitempty" azure:"ro"` + Value *float32 // READ-ONLY; The aggregate value unit - ValueUnit *string `json:"valueUnit,omitempty" azure:"ro"` + ValueUnit *string } // ReservationsClientListByBillingAccountOptions contains the optional parameters for the ReservationsClient.NewListByBillingAccountPager @@ -1734,82 +1734,82 @@ type ReservationsClientListByBillingProfileOptions struct { // ReservationsListResult - The list of reservations and summary of roll out count of reservations in each state. type ReservationsListResult struct { // The roll out count summary of the reservations - Summary *ReservationSummary `json:"summary,omitempty"` + Summary *ReservationSummary // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of reservations. - Value []*Reservation `json:"value,omitempty" azure:"ro"` + Value []*Reservation } // Resource - The Resource model definition. type Resource struct { // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RoleAssignment - The role assignment type RoleAssignment struct { // The properties of the role assignment. - Properties *RoleAssignmentProperties `json:"properties,omitempty"` + Properties *RoleAssignmentProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RoleAssignmentListResult - The list of role assignments. type RoleAssignmentListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The list of role assignments. - Value []*RoleAssignment `json:"value,omitempty" azure:"ro"` + Value []*RoleAssignment } // RoleAssignmentProperties - The properties of the role assignment. type RoleAssignmentProperties struct { // The principal id of the user to whom the role was assigned. - PrincipalID *string `json:"principalId,omitempty"` + PrincipalID *string // The principal tenant id of the user to whom the role was assigned. - PrincipalTenantID *string `json:"principalTenantId,omitempty"` + PrincipalTenantID *string // The ID of the role definition. - RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` + RoleDefinitionID *string // The authentication type. - UserAuthenticationType *string `json:"userAuthenticationType,omitempty"` + UserAuthenticationType *string // The email address of the user. - UserEmailAddress *string `json:"userEmailAddress,omitempty"` + UserEmailAddress *string // READ-ONLY; The principal Id of the user who created the role assignment. - CreatedByPrincipalID *string `json:"createdByPrincipalId,omitempty" azure:"ro"` + CreatedByPrincipalID *string // READ-ONLY; The tenant Id of the user who created the role assignment. - CreatedByPrincipalTenantID *string `json:"createdByPrincipalTenantId,omitempty" azure:"ro"` + CreatedByPrincipalTenantID *string // READ-ONLY; The email address of the user who created the role assignment. - CreatedByUserEmailAddress *string `json:"createdByUserEmailAddress,omitempty" azure:"ro"` + CreatedByUserEmailAddress *string // READ-ONLY; The date the role assignment was created. - CreatedOn *string `json:"createdOn,omitempty" azure:"ro"` + CreatedOn *string // READ-ONLY; The scope at which the role was assigned. - Scope *string `json:"scope,omitempty" azure:"ro"` + Scope *string } // RoleAssignmentsClientDeleteByBillingAccountOptions contains the optional parameters for the RoleAssignmentsClient.DeleteByBillingAccount @@ -1869,37 +1869,37 @@ type RoleAssignmentsClientListByInvoiceSectionOptions struct { // RoleDefinition - The properties of a role definition. type RoleDefinition struct { // The properties of the a role definition. - Properties *RoleDefinitionProperties `json:"properties,omitempty"` + Properties *RoleDefinitionProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // RoleDefinitionListResult - The list of role definitions. type RoleDefinitionListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; The role definitions. - Value []*RoleDefinition `json:"value,omitempty" azure:"ro"` + Value []*RoleDefinition } // RoleDefinitionProperties - The properties of the a role definition. type RoleDefinitionProperties struct { // The billingPermissions the role has - Permissions []*PermissionsProperties `json:"permissions,omitempty"` + Permissions []*PermissionsProperties // READ-ONLY; The role description - Description *string `json:"description,omitempty" azure:"ro"` + Description *string // READ-ONLY; The name of the role - RoleName *string `json:"roleName,omitempty" azure:"ro"` + RoleName *string } // RoleDefinitionsClientGetByBillingAccountOptions contains the optional parameters for the RoleDefinitionsClient.GetByBillingAccount @@ -1941,70 +1941,70 @@ type RoleDefinitionsClientListByInvoiceSectionOptions struct { // Subscription - A billing subscription. type Subscription struct { // The billing properties of a subscription. - Properties *SubscriptionProperties `json:"properties,omitempty"` + Properties *SubscriptionProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SubscriptionProperties - The billing properties of a subscription. type SubscriptionProperties struct { // The cost center applied to the subscription. - CostCenter *string `json:"costCenter,omitempty"` + CostCenter *string // The sku ID of the Azure plan for the subscription. - SKUID *string `json:"skuId,omitempty"` + SKUID *string // The current billing status of the subscription. - SubscriptionBillingStatus *BillingSubscriptionStatusType `json:"subscriptionBillingStatus,omitempty"` + SubscriptionBillingStatus *BillingSubscriptionStatusType // READ-ONLY; The name of the billing profile to which the subscription is billed. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile to which the subscription is billed. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The name of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerDisplayName *string `json:"customerDisplayName,omitempty" azure:"ro"` + CustomerDisplayName *string // READ-ONLY; The ID of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerID *string `json:"customerId,omitempty" azure:"ro"` + CustomerID *string // READ-ONLY; The name of the subscription. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + DisplayName *string // READ-ONLY; The name of the invoice section to which the subscription is billed. - InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty" azure:"ro"` + InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section to which the subscription is billed. - InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` + InvoiceSectionID *string // READ-ONLY; The last month charges. - LastMonthCharges *Amount `json:"lastMonthCharges,omitempty" azure:"ro"` + LastMonthCharges *Amount // READ-ONLY; The current month to date charges. - MonthToDateCharges *Amount `json:"monthToDateCharges,omitempty" azure:"ro"` + MonthToDateCharges *Amount // READ-ONLY; Reseller for this subscription. - Reseller *Reseller `json:"reseller,omitempty" azure:"ro"` + Reseller *Reseller // READ-ONLY; The sku description of the Azure plan for the subscription. - SKUDescription *string `json:"skuDescription,omitempty" azure:"ro"` + SKUDescription *string // READ-ONLY; The ID of the subscription. - SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` + SubscriptionID *string // READ-ONLY; The suspension reason for a subscription. Applies only to subscriptions in Microsoft Online Services Program // billing accounts. - SuspensionReasons []*string `json:"suspensionReasons,omitempty" azure:"ro"` + SuspensionReasons []*string } // SubscriptionsClientBeginMoveOptions contains the optional parameters for the SubscriptionsClient.BeginMove method. @@ -2055,156 +2055,156 @@ type SubscriptionsClientValidateMoveOptions struct { // SubscriptionsListResult - The list of billing subscriptions. type SubscriptionsListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of billing subscriptions. - Value []*Subscription `json:"value,omitempty" azure:"ro"` + Value []*Subscription } // Transaction - A transaction. type Transaction struct { // The properties of a transaction. - Properties *TransactionProperties `json:"properties,omitempty"` + Properties *TransactionProperties // READ-ONLY; Resource Id. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TransactionListResult - The list of transactions. type TransactionListResult struct { // READ-ONLY; The link (url) to the next page of results. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + NextLink *string // READ-ONLY; Total number of records. - TotalCount *int32 `json:"totalCount,omitempty" azure:"ro"` + TotalCount *int32 // READ-ONLY; The list of transactions. - Value []*Transaction `json:"value,omitempty" azure:"ro"` + Value []*Transaction } // TransactionProperties - The properties of a transaction. type TransactionProperties struct { // The kind of transaction. Options are all or reservation. - Kind *TransactionTypeKind `json:"kind,omitempty"` + Kind *TransactionTypeKind // The type of transaction. - TransactionType *ReservationType `json:"transactionType,omitempty"` + TransactionType *ReservationType // READ-ONLY; The amount of any Azure credits automatically applied to this transaction. - AzureCreditApplied *Amount `json:"azureCreditApplied,omitempty" azure:"ro"` + AzureCreditApplied *Amount // READ-ONLY; The type of azure plan of the subscription that was used for the transaction. - AzurePlan *string `json:"azurePlan,omitempty" azure:"ro"` + AzurePlan *string // READ-ONLY; The ISO 4217 code for the currency in which this transaction is billed. - BillingCurrency *string `json:"billingCurrency,omitempty" azure:"ro"` + BillingCurrency *string // READ-ONLY; The name of the billing profile which will be billed for the transaction. - BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty" azure:"ro"` + BillingProfileDisplayName *string // READ-ONLY; The ID of the billing profile which will be billed for the transaction. - BillingProfileID *string `json:"billingProfileId,omitempty" azure:"ro"` + BillingProfileID *string // READ-ONLY; The name of the customer for which the transaction took place. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerDisplayName *string `json:"customerDisplayName,omitempty" azure:"ro"` + CustomerDisplayName *string // READ-ONLY; The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner // Agreement billing account. - CustomerID *string `json:"customerId,omitempty" azure:"ro"` + CustomerID *string // READ-ONLY; The date of transaction. - Date *time.Time `json:"date,omitempty" azure:"ro"` + Date *time.Time // READ-ONLY; The percentage discount, if any, applied to this transaction. - Discount *float32 `json:"discount,omitempty" azure:"ro"` + Discount *float32 // READ-ONLY; The price of the product after applying any discounts. - EffectivePrice *Amount `json:"effectivePrice,omitempty" azure:"ro"` + EffectivePrice *Amount // READ-ONLY; The exchange rate used to convert charged amount to billing currency, if applicable. - ExchangeRate *float32 `json:"exchangeRate,omitempty" azure:"ro"` + ExchangeRate *float32 // READ-ONLY; Invoice on which the transaction was billed or 'pending' if the transaction is not billed. - Invoice *string `json:"invoice,omitempty" azure:"ro"` + Invoice *string // READ-ONLY; The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which // are billed. - InvoiceID *string `json:"invoiceId,omitempty" azure:"ro"` + InvoiceID *string // READ-ONLY; The name of the invoice section which will be billed for the transaction. - InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty" azure:"ro"` + InvoiceSectionDisplayName *string // READ-ONLY; The ID of the invoice section which will be billed for the transaction. - InvoiceSectionID *string `json:"invoiceSectionId,omitempty" azure:"ro"` + InvoiceSectionID *string // READ-ONLY; The retail price of the product. - MarketPrice *Amount `json:"marketPrice,omitempty" azure:"ro"` + MarketPrice *Amount // READ-ONLY; The order ID of the reservation. The field is only applicable for transaction of kind reservation. - OrderID *string `json:"orderId,omitempty" azure:"ro"` + OrderID *string // READ-ONLY; The name of the reservation order. The field is only applicable for transactions of kind reservation. - OrderName *string `json:"orderName,omitempty" azure:"ro"` + OrderName *string // READ-ONLY; The ISO 4217 code for the currency in which the product is priced. - PricingCurrency *string `json:"pricingCurrency,omitempty" azure:"ro"` + PricingCurrency *string // READ-ONLY; The description of the product for which the transaction took place. - ProductDescription *string `json:"productDescription,omitempty" azure:"ro"` + ProductDescription *string // READ-ONLY; The family of the product for which the transaction took place. - ProductFamily *string `json:"productFamily,omitempty" azure:"ro"` + ProductFamily *string // READ-ONLY; The type of the product for which the transaction took place. - ProductType *string `json:"productType,omitempty" azure:"ro"` + ProductType *string // READ-ONLY; The ID of the product type for which the transaction took place. - ProductTypeID *string `json:"productTypeId,omitempty" azure:"ro"` + ProductTypeID *string // READ-ONLY; The quantity purchased in the transaction. - Quantity *int32 `json:"quantity,omitempty" azure:"ro"` + Quantity *int32 // READ-ONLY; The end date of the product term, or the end date of the month in which usage ended. - ServicePeriodEndDate *time.Time `json:"servicePeriodEndDate,omitempty" azure:"ro"` + ServicePeriodEndDate *time.Time // READ-ONLY; The date of the purchase of the product, or the start date of the month in which usage started. - ServicePeriodStartDate *time.Time `json:"servicePeriodStartDate,omitempty" azure:"ro"` + ServicePeriodStartDate *time.Time // READ-ONLY; The pre-tax charged amount for the transaction. - SubTotal *Amount `json:"subTotal,omitempty" azure:"ro"` + SubTotal *Amount // READ-ONLY; The ID of the subscription that was used for the transaction. The field is only applicable for transaction of // kind reservation. - SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` + SubscriptionID *string // READ-ONLY; The name of the subscription that was used for the transaction. The field is only applicable for transaction // of kind reservation. - SubscriptionName *string `json:"subscriptionName,omitempty" azure:"ro"` + SubscriptionName *string // READ-ONLY; The tax amount applied to the transaction. - Tax *Amount `json:"tax,omitempty" azure:"ro"` + Tax *Amount // READ-ONLY; The charge associated with the transaction. - TransactionAmount *Amount `json:"transactionAmount,omitempty" azure:"ro"` + TransactionAmount *Amount // READ-ONLY; The unit of measure used to bill for the product. For example, compute services are billed per hour. - UnitOfMeasure *string `json:"unitOfMeasure,omitempty" azure:"ro"` + UnitOfMeasure *string // READ-ONLY; The description for the unit of measure for a given product. - UnitType *string `json:"unitType,omitempty" azure:"ro"` + UnitType *string // READ-ONLY; The number of units used for a given product. - Units *float32 `json:"units,omitempty" azure:"ro"` + Units *float32 } // TransactionsClientListByInvoiceOptions contains the optional parameters for the TransactionsClient.NewListByInvoicePager @@ -2216,65 +2216,65 @@ type TransactionsClientListByInvoiceOptions struct { // TransferBillingSubscriptionRequestProperties - Request parameters to transfer billing subscription. type TransferBillingSubscriptionRequestProperties struct { // REQUIRED; The destination invoice section id. - DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` + DestinationInvoiceSectionID *string } // TransferProductRequestProperties - The properties of the product to initiate a transfer. type TransferProductRequestProperties struct { // The destination invoice section id. - DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` + DestinationInvoiceSectionID *string } // ValidateAddressResponse - Result of the address validation type ValidateAddressResponse struct { // status of the address validation. - Status *AddressValidationStatus `json:"status,omitempty"` + Status *AddressValidationStatus // The list of suggested addresses. - SuggestedAddresses []*AddressDetails `json:"suggestedAddresses,omitempty"` + SuggestedAddresses []*AddressDetails // Validation error message. - ValidationMessage *string `json:"validationMessage,omitempty"` + ValidationMessage *string } // ValidateProductTransferEligibilityError - Error details of the product transfer eligibility validation. type ValidateProductTransferEligibilityError struct { // Error code for the product transfer validation. - Code *ProductTransferValidationErrorCode `json:"code,omitempty"` + Code *ProductTransferValidationErrorCode // Detailed error message explaining the error. - Details *string `json:"details,omitempty"` + Details *string // The error message. - Message *string `json:"message,omitempty"` + Message *string } // ValidateProductTransferEligibilityResult - Result of the product transfer eligibility validation. type ValidateProductTransferEligibilityResult struct { // Validation error details. - ErrorDetails *ValidateProductTransferEligibilityError `json:"errorDetails,omitempty"` + ErrorDetails *ValidateProductTransferEligibilityError // READ-ONLY; Specifies whether the transfer is eligible or not. - IsMoveEligible *bool `json:"isMoveEligible,omitempty" azure:"ro"` + IsMoveEligible *bool } // ValidateSubscriptionTransferEligibilityError - Error details of the transfer eligibility validation type ValidateSubscriptionTransferEligibilityError struct { // Error code for the product transfer validation. - Code *SubscriptionTransferValidationErrorCode `json:"code,omitempty"` + Code *SubscriptionTransferValidationErrorCode // Detailed error message explaining the error. - Details *string `json:"details,omitempty"` + Details *string // The error message. - Message *string `json:"message,omitempty"` + Message *string } // ValidateSubscriptionTransferEligibilityResult - Result of the transfer eligibility validation. type ValidateSubscriptionTransferEligibilityResult struct { // Validation error details. - ErrorDetails *ValidateSubscriptionTransferEligibilityError `json:"errorDetails,omitempty"` + ErrorDetails *ValidateSubscriptionTransferEligibilityError // READ-ONLY; Specifies whether the subscription is eligible to be transferred. - IsMoveEligible *bool `json:"isMoveEligible,omitempty" azure:"ro"` + IsMoveEligible *bool } diff --git a/sdk/resourcemanager/billing/armbilling/periods_client_example_test.go b/sdk/resourcemanager/billing/armbilling/periods_client_example_test.go deleted file mode 100644 index 61d6d7c8d96b..000000000000 --- a/sdk/resourcemanager/billing/armbilling/periods_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsList.json -func ExamplePeriodsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPeriodsClient().NewListPager(&armbilling.PeriodsClientListOptions{Filter: nil, - Skiptoken: nil, - Top: 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.PeriodsListResult = armbilling.PeriodsListResult{ - // Value: []*armbilling.Period{ - // { - // Name: to.Ptr("201702-1"), - // Type: to.Ptr("Microsoft.Billing/billingPeriods"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702-1"), - // Properties: &armbilling.PeriodProperties{ - // BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-02-01"); return t}()), - // BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-01-01"); return t}()), - // InvoiceIDs: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-02-05-123456789"), - // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-01-05-987654321")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/preview/2018-03-01-preview/examples/BillingPeriodsGet.json -func ExamplePeriodsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPeriodsClient().Get(ctx, "201702-1", 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.Period = armbilling.Period{ - // Name: to.Ptr("201702-1"), - // Type: to.Ptr("Microsoft.Billing/billingPeriods"), - // ID: to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/billingPeriods/201702-1"), - // Properties: &armbilling.PeriodProperties{ - // BillingPeriodEndDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-02-01"); return t}()), - // BillingPeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2017-01-01"); return t}()), - // InvoiceIDs: []*string{ - // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-02-05-123456789"), - // to.Ptr("/subscriptions/subid/providers/Microsoft.Billing/invoices/2017-01-05-987654321")}, - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/permissions_client_example_test.go b/sdk/resourcemanager/billing/armbilling/permissions_client_example_test.go deleted file mode 100644 index b06527916e52..000000000000 --- a/sdk/resourcemanager/billing/armbilling/permissions_client_example_test.go +++ /dev/null @@ -1,217 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPermissionsList.json -func ExamplePermissionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPermissionsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ - // Value: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, - // NotActions: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountPermissionsList.json -func ExamplePermissionsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPermissionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ - // Value: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, - // NotActions: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionPermissionsList.json -func ExamplePermissionsClient_NewListByInvoiceSectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPermissionsClient().NewListByInvoiceSectionsPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ - // Value: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, - // NotActions: []*string{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilePermissionsList.json -func ExamplePermissionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPermissionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.PermissionsListResult = armbilling.PermissionsListResult{ - // Value: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001")}, - // NotActions: []*string{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/billing/armbilling/policies_client_example_test.go b/sdk/resourcemanager/billing/armbilling/policies_client_example_test.go deleted file mode 100644 index c45bcf7668ed..000000000000 --- a/sdk/resourcemanager/billing/armbilling/policies_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Policy.json -func ExamplePoliciesClient_GetByBillingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoliciesClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", 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.Policy = armbilling.Policy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default"), - // Properties: &armbilling.PolicyProperties{ - // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyAllAllowed), - // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyAllowed), - // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdatePolicy.json -func ExamplePoliciesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoliciesClient().Update(ctx, "{billingAccountName}", "{billingProfileName}", armbilling.Policy{ - Properties: &armbilling.PolicyProperties{ - MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyOnlyFreeAllowed), - ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyNotAllowed), - ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), - }, - }, 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.Policy = armbilling.Policy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/policies"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default"), - // Properties: &armbilling.PolicyProperties{ - // MarketplacePurchases: to.Ptr(armbilling.MarketplacePurchasesPolicyOnlyFreeAllowed), - // ReservationPurchases: to.Ptr(armbilling.ReservationPurchasesPolicyNotAllowed), - // ViewCharges: to.Ptr(armbilling.ViewChargesPolicyAllowed), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/CustomerPolicy.json -func ExamplePoliciesClient_GetByCustomer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoliciesClient().GetByCustomer(ctx, "{billingAccountName}", "{customerName}", 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.CustomerPolicy = armbilling.CustomerPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers/policies"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default"), - // Properties: &armbilling.CustomerPolicyProperties{ - // ViewCharges: to.Ptr(armbilling.ViewChargesAllowed), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateCustomerPolicy.json -func ExamplePoliciesClient_UpdateCustomer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoliciesClient().UpdateCustomer(ctx, "{billingAccountName}", "{customerName}", armbilling.CustomerPolicy{ - Properties: &armbilling.CustomerPolicyProperties{ - ViewCharges: to.Ptr(armbilling.ViewChargesNotAllowed), - }, - }, 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.CustomerPolicy = armbilling.CustomerPolicy{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/customers/policies"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default"), - // Properties: &armbilling.CustomerPolicyProperties{ - // ViewCharges: to.Ptr(armbilling.ViewChargesNotAllowed), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/products_client_example_test.go b/sdk/resourcemanager/billing/armbilling/products_client_example_test.go deleted file mode 100644 index c26268ac5e3b..000000000000 --- a/sdk/resourcemanager/billing/armbilling/products_client_example_test.go +++ /dev/null @@ -1,566 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByCustomer.json -func ExampleProductsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.ProductsListResult = armbilling.ProductsListResult{ - // TotalCount: to.Ptr[int32](2), - // Value: []*armbilling.Product{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CustomerDisplayName: to.Ptr("Customer 1"), - // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Reservation"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // Reseller: &armbilling.Reseller{ - // Description: to.Ptr("Reseller1"), - // ResellerID: to.Ptr("2c917292-b7bc-42f2-99a2-e498b9087c06"), - // }, - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CustomerDisplayName: to.Ptr("Customer 1"), - // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // DisplayName: to.Ptr("Engineering Email"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](500), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Azure subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingAccount.json -func ExampleProductsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProductsClientListByBillingAccountOptions{Filter: 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.ProductsListResult = armbilling.ProductsListResult{ - // TotalCount: to.Ptr[int32](2), - // Value: []*armbilling.Product{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Reservation"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Engineering Email"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Azure subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByBillingProfile.json -func ExampleProductsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.ProductsClientListByBillingProfileOptions{Filter: 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.ProductsListResult = armbilling.ProductsListResult{ - // TotalCount: to.Ptr[int32](2), - // Value: []*armbilling.Product{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Reservation"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Engineering Email"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Azure subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ProductsListByInvoiceSection.json -func ExampleProductsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProductsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", &armbilling.ProductsClientListByInvoiceSectionOptions{Filter: 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.ProductsListResult = armbilling.ProductsListResult{ - // TotalCount: to.Ptr[int32](2), - // Value: []*armbilling.Product{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyOneTime), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Eng Reservation (1a13s21awe)"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Reservation"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // }, - // { - // Name: to.Ptr("10000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/10000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Engineering Email"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](500), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Azure subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/Product.json -func ExampleProductsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().Get(ctx, "{billingAccountName}", "{productName}", 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.Product = armbilling.Product{ - // Name: to.Ptr("{productName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/{productName}"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("AIP Dev"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateProduct.json -func ExampleProductsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().Update(ctx, "{billingAccountName}", "{productName}", armbilling.Product{ - Properties: &armbilling.ProductProperties{ - AutoRenew: to.Ptr(armbilling.AutoRenewOff), - }, - }, 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.Product = armbilling.Product{ - // Name: to.Ptr("{productName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/products/{productName}"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOff), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("AIP Dev"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveProduct.json -func ExampleProductsClient_Move() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().Move(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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.Product = armbilling.Product{ - // Name: to.Ptr("{productName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/products"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}/products/{productName}"), - // Properties: &armbilling.ProductProperties{ - // AutoRenew: to.Ptr(armbilling.AutoRenewOn), - // AvailabilityID: to.Ptr("AvailabilityId1"), - // BillingFrequency: to.Ptr(armbilling.BillingFrequencyMonthly), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // DisplayName: to.Ptr("Test Product"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{newBillingProfileName}/invoiceSections/{newInvoiceSectionName}"), - // LastCharge: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // LastChargeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-06-15T17:32:28Z"); return t}()), - // ProductType: to.Ptr("Subscription"), - // ProductTypeID: to.Ptr("A12345"), - // PurchaseDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T17:32:28Z"); return t}()), - // Quantity: to.Ptr[float32](4), - // SKUDescription: to.Ptr("Enterprise Agreement Development"), - // SKUID: to.Ptr("0001"), - // Status: to.Ptr(armbilling.ProductStatusTypeActive), - // TenantID: to.Ptr("515a6d36-aaf8-4ca2-a5e8-c45deb0c5cce"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveFailure.json -func ExampleProductsClient_ValidateMove_subscriptionMoveValidateFailure() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().ValidateMove(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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.ValidateProductTransferEligibilityResult = armbilling.ValidateProductTransferEligibilityResult{ - // ErrorDetails: &armbilling.ValidateProductTransferEligibilityError{ - // Code: to.Ptr(armbilling.ProductTransferValidationErrorCodeProductTypeNotSupported), - // Message: to.Ptr("Product '{productName}' is not allowed to be transferred."), - // }, - // IsMoveEligible: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateProductMoveSuccess.json -func ExampleProductsClient_ValidateMove_subscriptionMoveValidateSuccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProductsClient().ValidateMove(ctx, "{billingAccountName}", "{productName}", armbilling.TransferProductRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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.ValidateProductTransferEligibilityResult = armbilling.ValidateProductTransferEligibilityResult{ - // IsMoveEligible: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/profiles_client_example_test.go b/sdk/resourcemanager/billing/armbilling/profiles_client_example_test.go deleted file mode 100644 index 1eb8c2600991..000000000000 --- a/sdk/resourcemanager/billing/armbilling/profiles_client_example_test.go +++ /dev/null @@ -1,510 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListByBillingAccount.json -func ExampleProfilesClient_NewListByBillingAccountPager_billingProfilesListByBillingAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProfilesClientListByBillingAccountOptions{Expand: 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.ProfileListResult = armbilling.ProfileListResult{ - // Value: []*armbilling.Profile{ - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // }, - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile2"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ - // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), - // DisplayName: to.Ptr("Partner1"), - // }, - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), - // Status: to.Ptr(armbilling.BillingProfileStatusActive), - // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), - // TargetClouds: []*armbilling.TargetCloud{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfilesListWithExpand.json -func ExampleProfilesClient_NewListByBillingAccountPager_billingProfilesListWithExpand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProfilesClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ProfilesClientListByBillingAccountOptions{Expand: to.Ptr("invoiceSections")}) - 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.ProfileListResult = armbilling.ProfileListResult{ - // Value: []*armbilling.Profile{ - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(false), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/invoiceSectionId1"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // TargetClouds: []*armbilling.TargetCloud{ - // }, - // }, - // }, - // { - // Name: to.Ptr("11000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeIndirectCustomer), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("BillingProfile2"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // IndirectRelationshipInfo: &armbilling.IndirectRelationshipInfo{ - // BillingAccountName: to.Ptr("30000000-0000-0000-0000-000000000001_00000000-0000-0000-0000-000000000000"), - // BillingProfileName: to.Ptr("33000000-0000-0000-0000-000000000001"), - // DisplayName: to.Ptr("Partner1"), - // }, - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(false), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000001/invoiceSections/invoiceSectionId2"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName2"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Marketing"), - // "pcCode": to.Ptr("Z223456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-22XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("2XXX-22XX-XX1-XXXX-XXX"), - // TargetClouds: []*armbilling.TargetCloud{ - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfile.json -func ExampleProfilesClient_Get_billingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armbilling.ProfilesClientGetOptions{Expand: 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.Profile = armbilling.Profile{ - // Name: to.Ptr("{billingProfileName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("Billing Profile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileWithExpand.json -func ExampleProfilesClient_Get_billingProfileWithExpand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProfilesClient().Get(ctx, "{billingAccountName}", "{billingProfileName}", &armbilling.ProfilesClientGetOptions{Expand: to.Ptr("invoiceSections")}) - 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.Profile = armbilling.Profile{ - // Name: to.Ptr("{billingProfileName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address1"), - // AddressLine2: to.Ptr("Test Address2"), - // AddressLine3: to.Ptr("Test Address3"), - // City: to.Ptr("City"), - // CompanyName: to.Ptr("Contoso"), - // Country: to.Ptr("US"), - // Email: to.Ptr("abc@contoso.com"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PhoneNumber: to.Ptr("000-000-0000"), - // PostalCode: to.Ptr("00000"), - // Region: to.Ptr("WA"), - // }, - // BillingRelationshipType: to.Ptr(armbilling.BillingRelationshipTypeDirect), - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("Billing Profile1"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // InvoiceSections: &armbilling.InvoiceSectionsOnExpand{ - // HasMoreResults: to.Ptr(false), - // Value: []*armbilling.InvoiceSection{ - // { - // Name: to.Ptr("invoiceSectionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/invoiceSectionId1"), - // Properties: &armbilling.InvoiceSectionProperties{ - // DisplayName: to.Ptr("invoiceSectionName1"), - // Labels: map[string]*string{ - // "costCategory": to.Ptr("Support"), - // "pcCode": to.Ptr("A123456"), - // }, - // State: to.Ptr(armbilling.InvoiceSectionStateActive), - // SystemID: to.Ptr("9XXX-11XX-XX1-XXXX-XXX"), - // }, - // }}, - // }, - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOn), - // Status: to.Ptr(armbilling.BillingProfileStatusWarned), - // StatusReasonCode: to.Ptr(armbilling.StatusReasonCodePastDue), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/PutBillingProfile.json -func ExampleProfilesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProfilesClient().BeginCreateOrUpdate(ctx, "{billingAccountName}", "{billingProfileName}", armbilling.Profile{ - Properties: &armbilling.ProfileProperties{ - BillTo: &armbilling.AddressDetails{ - AddressLine1: to.Ptr("Test Address 1"), - City: to.Ptr("Redmond"), - Country: to.Ptr("US"), - FirstName: to.Ptr("Test"), - LastName: to.Ptr("User"), - PostalCode: to.Ptr("12345"), - Region: to.Ptr("WA"), - }, - DisplayName: to.Ptr("Finance"), - EnabledAzurePlans: []*armbilling.AzurePlan{ - { - SKUID: to.Ptr("0001"), - }, - { - SKUID: to.Ptr("0002"), - }}, - InvoiceEmailOptIn: to.Ptr(true), - PoNumber: to.Ptr("ABC12345"), - }, - }, 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 pull 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.Profile = armbilling.Profile{ - // Name: to.Ptr("billingProfileId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/billingProfileId1"), - // Properties: &armbilling.ProfileProperties{ - // BillTo: &armbilling.AddressDetails{ - // AddressLine1: to.Ptr("Test Address 1"), - // City: to.Ptr("Redmond"), - // Country: to.Ptr("US"), - // FirstName: to.Ptr("Test"), - // LastName: to.Ptr("User"), - // PostalCode: to.Ptr("12345"), - // Region: to.Ptr("WA"), - // }, - // Currency: to.Ptr("USD"), - // DisplayName: to.Ptr("Finance"), - // EnabledAzurePlans: []*armbilling.AzurePlan{ - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // }, - // { - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // }}, - // HasReadAccess: to.Ptr(true), - // InvoiceDay: to.Ptr[int32](5), - // InvoiceEmailOptIn: to.Ptr(true), - // PoNumber: to.Ptr("ABC12345"), - // SpendingLimit: to.Ptr(armbilling.SpendingLimitOff), - // Status: to.Ptr(armbilling.BillingProfileStatusActive), - // SystemID: to.Ptr("1XXX-11XX-XX1-XXXX-XXX"), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/property_client_example_test.go b/sdk/resourcemanager/billing/armbilling/property_client_example_test.go deleted file mode 100644 index d0d394fb090c..000000000000 --- a/sdk/resourcemanager/billing/armbilling/property_client_example_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProperty.json -func ExamplePropertyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPropertyClient().Get(ctx, 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.Property = armbilling.Property{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingProperty"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default"), - // Properties: &armbilling.PropertyProperties{ - // AccountAdminNotificationEmailAddress: to.Ptr("test@contoso.com"), - // BillingAccountDisplayName: to.Ptr("My Account"), - // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), - // BillingProfileSpendingLimit: to.Ptr(armbilling.BillingProfileSpendingLimitOn), - // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), - // BillingProfileStatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), - // BillingTenantID: to.Ptr("90000000-0000-0000-0000-000000000011"), - // CostCenter: to.Ptr("1010"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoice section"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // IsAccountAdmin: to.Ptr(true), - // ProductID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000/products/44000000-0000-0000-0000-000000000000"), - // ProductName: to.Ptr("Standard Dev"), - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0001"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingProperty.json -func ExamplePropertyClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPropertyClient().Update(ctx, armbilling.Property{ - Properties: &armbilling.PropertyProperties{ - CostCenter: to.Ptr("1010"), - }, - }, 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.Property = armbilling.Property{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Billing/billingProperty"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default"), - // Properties: &armbilling.PropertyProperties{ - // AccountAdminNotificationEmailAddress: to.Ptr("test@contoso.com"), - // BillingAccountDisplayName: to.Ptr("My Account"), - // BillingAccountID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000"), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/billingProfiles/11000000-0000-0000-0000-000000000000"), - // BillingProfileSpendingLimit: to.Ptr(armbilling.BillingProfileSpendingLimitOn), - // BillingProfileStatus: to.Ptr(armbilling.BillingProfileStatusWarned), - // BillingProfileStatusReasonCode: to.Ptr(armbilling.BillingProfileStatusReasonCodePastDue), - // BillingTenantID: to.Ptr("90000000-0000-0000-0000-000000000011"), - // CostCenter: to.Ptr("1010"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoice section"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // IsAccountAdmin: to.Ptr(true), - // ProductID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-000000000000_00000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000/products/44000000-0000-0000-0000-000000000000"), - // ProductName: to.Ptr("Standard Dev"), - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0001"), - // }, - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/reservations_client_example_test.go b/sdk/resourcemanager/billing/armbilling/reservations_client_example_test.go deleted file mode 100644 index 342cec012724..000000000000 --- a/sdk/resourcemanager/billing/armbilling/reservations_client_example_test.go +++ /dev/null @@ -1,188 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingAccount.json -func ExampleReservationsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReservationsClient().NewListByBillingAccountPager("{billingAccountName}", &armbilling.ReservationsClientListByBillingAccountOptions{Filter: to.Ptr("properties/reservedResourceType eq 'VirtualMachines'"), - Orderby: to.Ptr("properties/userFriendlyAppliedScopeType asc"), - RefreshSummary: nil, - SelectedState: to.Ptr("Succeeded"), - }) - 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.ReservationsListResult = armbilling.ReservationsListResult{ - // Summary: &armbilling.ReservationSummary{ - // CancelledCount: to.Ptr[float32](0), - // ExpiredCount: to.Ptr[float32](0), - // ExpiringCount: to.Ptr[float32](0), - // FailedCount: to.Ptr[float32](0), - // PendingCount: to.Ptr[float32](0), - // SucceededCount: to.Ptr[float32](1), - // }, - // Value: []*armbilling.Reservation{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000001/00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"), - // ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), - // Location: to.Ptr("westus"), - // Properties: &armbilling.ReservationProperty{ - // AppliedScopeType: to.Ptr("Shared"), - // DisplayName: to.Ptr("VM_RI_07-21-2020_12-06"), - // DisplayProvisioningState: to.Ptr("Succeeded"), - // EffectiveDateTime: to.Ptr("0001-01-01T00:00:00"), - // ExpiryDate: to.Ptr("2023-07-21"), - // ProvisioningState: to.Ptr("Succeeded"), - // Quantity: to.Ptr[float32](2), - // Renew: to.Ptr(false), - // ReservedResourceType: to.Ptr("VirtualMachines"), - // UserFriendlyAppliedScopeType: to.Ptr("Shared"), - // UserFriendlyRenewState: to.Ptr("Off"), - // Utilization: &armbilling.ReservationPropertyUtilization{ - // Aggregates: []*armbilling.ReservationUtilizationAggregates{ - // { - // Grain: to.Ptr[float32](1), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }, - // { - // Grain: to.Ptr[float32](7), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }, - // { - // Grain: to.Ptr[float32](30), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }}, - // Trend: to.Ptr("UP"), - // }, - // }, - // SKU: &armbilling.ReservationSKUProperty{ - // Name: to.Ptr("Standard_D1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ReservationsListByBillingProfile.json -func ExampleReservationsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReservationsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", &armbilling.ReservationsClientListByBillingProfileOptions{Filter: to.Ptr("properties/reservedResourceType eq 'VirtualMachines'"), - Orderby: to.Ptr("properties/userFriendlyAppliedScopeType asc"), - RefreshSummary: nil, - SelectedState: to.Ptr("Succeeded"), - }) - 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.ReservationsListResult = armbilling.ReservationsListResult{ - // Summary: &armbilling.ReservationSummary{ - // CancelledCount: to.Ptr[float32](0), - // ExpiredCount: to.Ptr[float32](0), - // ExpiringCount: to.Ptr[float32](0), - // FailedCount: to.Ptr[float32](0), - // PendingCount: to.Ptr[float32](0), - // SucceededCount: to.Ptr[float32](1), - // }, - // Value: []*armbilling.Reservation{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000001/00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Capacity/reservationOrders/reservations"), - // ID: to.Ptr("/providers/microsoft.capacity/reservationOrders/00000000-0000-0000-0000-000000000001/reservations/00000000-0000-0000-0000-000000000000"), - // Location: to.Ptr("westus"), - // Properties: &armbilling.ReservationProperty{ - // AppliedScopeType: to.Ptr("Shared"), - // DisplayName: to.Ptr("VM_RI_07-21-2020_12-06"), - // DisplayProvisioningState: to.Ptr("Succeeded"), - // EffectiveDateTime: to.Ptr("0001-01-01T00:00:00"), - // ExpiryDate: to.Ptr("2023-07-21"), - // ProvisioningState: to.Ptr("Succeeded"), - // Quantity: to.Ptr[float32](2), - // Renew: to.Ptr(false), - // RenewSource: to.Ptr("/providers/Microsoft.Capacity/reservationorders/00000000-0000-0000-0000-000000000002/reservations/00000000-0000-0000-0000-000000000003"), - // ReservedResourceType: to.Ptr("VirtualMachines"), - // UserFriendlyAppliedScopeType: to.Ptr("Shared"), - // UserFriendlyRenewState: to.Ptr("Off"), - // Utilization: &armbilling.ReservationPropertyUtilization{ - // Aggregates: []*armbilling.ReservationUtilizationAggregates{ - // { - // Grain: to.Ptr[float32](1), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }, - // { - // Grain: to.Ptr[float32](7), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }, - // { - // Grain: to.Ptr[float32](30), - // GrainUnit: to.Ptr("days"), - // Value: to.Ptr[float32](0.05), - // ValueUnit: to.Ptr("percentage"), - // }}, - // Trend: to.Ptr("UP"), - // }, - // }, - // SKU: &armbilling.ReservationSKUProperty{ - // Name: to.Ptr("Standard_D1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/billing/armbilling/roleassignments_client_example_test.go b/sdk/resourcemanager/billing/armbilling/roleassignments_client_example_test.go deleted file mode 100644 index 6e2334be0fbf..000000000000 --- a/sdk/resourcemanager/billing/armbilling/roleassignments_client_example_test.go +++ /dev/null @@ -1,390 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignment.json -func ExampleRoleAssignmentsClient_GetByBillingAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().GetByBillingAccount(ctx, "{billingAccountName}", "{billingRoleAssignmentId}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentDelete.json -func ExampleRoleAssignmentsClient_DeleteByBillingAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().DeleteByBillingAccount(ctx, "{billingAccountName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignment.json -func ExampleRoleAssignmentsClient_GetByInvoiceSection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().GetByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentDelete.json -func ExampleRoleAssignmentsClient_DeleteByInvoiceSection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().DeleteByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignment.json -func ExampleRoleAssignmentsClient_GetByBillingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentDelete.json -func ExampleRoleAssignmentsClient_DeleteByBillingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleAssignmentsClient().DeleteByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleAssignmentName}", 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.RoleAssignment = armbilling.RoleAssignment{ - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleAssignmentList.json -func ExampleRoleAssignmentsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleAssignmentsClient().NewListByBillingAccountPager("{billingAccountName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ - // Value: []*armbilling.RoleAssignment{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), - // PrincipalID: to.Ptr("b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleAssignmentList.json -func ExampleRoleAssignmentsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleAssignmentsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ - // Value: []*armbilling.RoleAssignment{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/10000000-aaaa-bbbb-cccc-100000000000_b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleAssignmentList.json -func ExampleRoleAssignmentsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleAssignmentsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.RoleAssignmentListResult = armbilling.RoleAssignmentListResult{ - // Value: []*armbilling.RoleAssignment{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:34:12.2363515+00:00"), - // PrincipalID: to.Ptr("6fd330f6-7d26-4aff-b9cf-7bd699f965b9"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleAssignments"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/10000000-aaaa-bbbb-cccc-100000000000_00000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.RoleAssignmentProperties{ - // CreatedByPrincipalID: to.Ptr("10000000-aaaa-bbbb-cccc-3fd5ff9d6aa1"), - // CreatedByPrincipalTenantID: to.Ptr("7ca289b9-c32d-4f01-8566-7ff93261d76f"), - // CreatedOn: to.Ptr("2018-06-21T21:58:19.9073876+00:00"), - // PrincipalID: to.Ptr("b1839933-b3ac-42ca-8112-d29c43f3ab47"), - // PrincipalTenantID: to.Ptr("10000000-aaaa-bbbb-cccc-2d7cd011db47"), - // RoleDefinitionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/50000000-aaaa-bbbb-cccc-100000000002"), - // Scope: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/billing/armbilling/roledefinitions_client_example_test.go b/sdk/resourcemanager/billing/armbilling/roledefinitions_client_example_test.go deleted file mode 100644 index 77324dcf0180..000000000000 --- a/sdk/resourcemanager/billing/armbilling/roledefinitions_client_example_test.go +++ /dev/null @@ -1,508 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinition.json -func ExampleRoleDefinitionsClient_GetByBillingAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleDefinitionsClient().GetByBillingAccount(ctx, "{billingAccountName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ - // Name: to.Ptr("{billingRoleDefinitionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing account."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing acount owner"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinition.json -func ExampleRoleDefinitionsClient_GetByInvoiceSection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleDefinitionsClient().GetByInvoiceSection(ctx, "{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ - // Name: to.Ptr("{billingRoleDefinitionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the invoice section."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Invoice section owner"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinition.json -func ExampleRoleDefinitionsClient_GetByBillingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRoleDefinitionsClient().GetByBillingProfile(ctx, "{billingAccountName}", "{billingProfileName}", "{billingRoleDefinitionName}", 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.RoleDefinition = armbilling.RoleDefinition{ - // Name: to.Ptr("{billingRoleDefinitionName}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing profile."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing profile owner"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingAccountRoleDefinitionsList.json -func ExampleRoleDefinitionsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleDefinitionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ - // Value: []*armbilling.RoleDefinition{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing account."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing account owner"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the billing account."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing account contributor"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000002"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000002"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Reader role gives the user read only access to the billing account."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing account reader"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000003"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000003"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Signatory role can sign agreements on behalf of the customer."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Signatory"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/InvoiceSectionRoleDefinitionsList.json -func ExampleRoleDefinitionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleDefinitionsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ - // Value: []*armbilling.RoleDefinition{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the invoice section."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Invoice section owner"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/invoiceSections/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the invoice section."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Invoice section contributor"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingProfileRoleDefinitionsList.json -func ExampleRoleDefinitionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRoleDefinitionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.RoleDefinitionListResult = armbilling.RoleDefinitionListResult{ - // Value: []*armbilling.RoleDefinition{ - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000000"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Owner role gives the user all permissions including access management rights to the billing profile."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000000"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing profile owner"), - // }, - // }, - // { - // Name: to.Ptr("10000000-aaaa-bbbb-cccc-100000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingProfiles/billingRoleDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/10000000-aaaa-bbbb-cccc-100000000001"), - // Properties: &armbilling.RoleDefinitionProperties{ - // Description: to.Ptr("The Contributor role give the user all permissions except access management rights to the billing profile."), - // Permissions: []*armbilling.PermissionsProperties{ - // { - // Actions: []*string{ - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000008"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000003"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("10000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000009"), - // to.Ptr("20000000-aaaa-bbbb-cccc-200000000002"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000015"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000004"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000001"), - // to.Ptr("30000000-aaaa-bbbb-cccc-200000000010"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000007"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000006"), - // to.Ptr("40000000-aaaa-bbbb-cccc-200000000008")}, - // NotActions: []*string{ - // }, - // }}, - // RoleName: to.Ptr("Billing profile contributor"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/billing/armbilling/subscriptions_client_example_test.go b/sdk/resourcemanager/billing/armbilling/subscriptions_client_example_test.go deleted file mode 100644 index bdc0cd07f020..000000000000 --- a/sdk/resourcemanager/billing/armbilling/subscriptions_client_example_test.go +++ /dev/null @@ -1,606 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "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" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByCustomer.json -func ExampleSubscriptionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionsClient().NewListByCustomerPager("{billingAccountName}", "{customerName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ - // Value: []*armbilling.Subscription{ - // { - // Name: to.Ptr("billingSubscriptionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), - // Properties: &armbilling.SubscriptionProperties{ - // CostCenter: to.Ptr("ABC1234"), - // CustomerDisplayName: to.Ptr("Customer1"), - // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // DisplayName: to.Ptr("My subscription"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // Reseller: &armbilling.Reseller{ - // Description: to.Ptr("Reseller1"), - // ResellerID: to.Ptr("89e87bdf-a2a2-4687-925f-4c18b27bccfd"), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // }, - // { - // Name: to.Ptr("billingSubscriptionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), - // Properties: &armbilling.SubscriptionProperties{ - // CostCenter: to.Ptr("ABC1234"), - // CustomerDisplayName: to.Ptr("Customer1"), - // CustomerID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}"), - // DisplayName: to.Ptr("Test subscription"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](400), - // }, - // Reseller: &armbilling.Reseller{ - // Description: to.Ptr("Reseller3"), - // ResellerID: to.Ptr("3b65b5a8-bd4f-4084-90e9-e1bd667a2b19"), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan for DevTest"), - // SKUID: to.Ptr("0002"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingAccount.json -func ExampleSubscriptionsClient_NewListByBillingAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionsClient().NewListByBillingAccountPager("{billingAccountName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ - // Value: []*armbilling.Subscription{ - // { - // Name: to.Ptr("90000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // }, - // { - // Name: to.Ptr("90000000-0000-0000-0000-000000000001"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000001"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Test subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](400), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), - // }, - // }, - // { - // Name: to.Ptr("90000000-0000-0000-0000-000000000002"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/90000000-0000-0000-0000-000000000002"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Dev Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](6000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](900), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByBillingProfile.json -func ExampleSubscriptionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionsClient().NewListByBillingProfilePager("{billingAccountName}", "{billingProfileName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ - // Value: []*armbilling.Subscription{ - // { - // Name: to.Ptr("billingSubscriptionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // }, - // { - // Name: to.Ptr("billingSubscriptionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Test subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](400), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), - // }, - // }, - // { - // Name: to.Ptr("billingSubscriptionId3"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId3"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Dev Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](6000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](900), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscriptionsListByInvoiceSection.json -func ExampleSubscriptionsClient_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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubscriptionsClient().NewListByInvoiceSectionPager("{billingAccountName}", "{billingProfileName}", "{invoiceSectionName}", 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.SubscriptionsListResult = armbilling.SubscriptionsListResult{ - // Value: []*armbilling.Subscription{ - // { - // Name: to.Ptr("billingSubscriptionId1"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId1"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // }, - // { - // Name: to.Ptr("billingSubscriptionId2"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId2"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Test subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](1000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](400), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-6b96d3f2"), - // }, - // }, - // { - // Name: to.Ptr("billingSubscriptionId3"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/billinSubscriptionId3"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("Dev Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](6000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](900), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-4a9d-9008-912f-f87744185aa3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/BillingSubscription.json -func ExampleSubscriptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().Get(ctx, "{billingAccountName}", 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.Subscription = armbilling.Subscription{ - // Name: to.Ptr("{subscriptionId}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/UpdateBillingSubscription.json -func ExampleSubscriptionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().Update(ctx, "{billingAccountName}", armbilling.Subscription{ - Properties: &armbilling.SubscriptionProperties{ - CostCenter: to.Ptr("ABC1234"), - }, - }, 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.Subscription = armbilling.Subscription{ - // Name: to.Ptr("{subscriptionId}"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/billingSubscriptions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}"), - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MoveBillingSubscription.json -func ExampleSubscriptionsClient_BeginMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionsClient().BeginMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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 pull 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.Subscription = armbilling.Subscription{ - // Properties: &armbilling.SubscriptionProperties{ - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000"), - // CostCenter: to.Ptr("ABC1234"), - // DisplayName: to.Ptr("My Subscription"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/11000000-0000-0000-0000-000000000000/invoiceSections/22000000-0000-0000-0000-000000000000"), - // LastMonthCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // MonthToDateCharges: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](600), - // }, - // SKUDescription: to.Ptr("Microsoft Azure Plan"), - // SKUID: to.Ptr("0001"), - // SubscriptionBillingStatus: to.Ptr(armbilling.BillingSubscriptionStatusTypeActive), - // SubscriptionID: to.Ptr("6b96d3f2-9008-4a9d-912f-f87744185aa3"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveFailure.json -func ExampleSubscriptionsClient_ValidateMove_subscriptionMoveValidateFailure() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().ValidateMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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.ValidateSubscriptionTransferEligibilityResult = armbilling.ValidateSubscriptionTransferEligibilityResult{ - // ErrorDetails: &armbilling.ValidateSubscriptionTransferEligibilityError{ - // Code: to.Ptr(armbilling.SubscriptionTransferValidationErrorCodeSubscriptionNotActive), - // Message: to.Ptr("Invoice Sections can only be changed for active subscriptions."), - // }, - // IsMoveEligible: to.Ptr(false), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/ValidateSubscriptionMoveSuccess.json -func ExampleSubscriptionsClient_ValidateMove_subscriptionMoveValidateSuccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armbilling.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubscriptionsClient().ValidateMove(ctx, "{billingAccountName}", armbilling.TransferBillingSubscriptionRequestProperties{ - DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}"), - }, 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.ValidateSubscriptionTransferEligibilityResult = armbilling.ValidateSubscriptionTransferEligibilityResult{ - // IsMoveEligible: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/billing/armbilling/transactions_client_example_test.go b/sdk/resourcemanager/billing/armbilling/transactions_client_example_test.go deleted file mode 100644 index e4b524ce25b0..000000000000 --- a/sdk/resourcemanager/billing/armbilling/transactions_client_example_test.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armbilling_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/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("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTransactionsClient().NewListByInvoicePager("{billingAccountName}", "{invoiceName}", 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.TransactionListResult = armbilling.TransactionListResult{ - // Value: []*armbilling.Transaction{ - // { - // Name: to.Ptr("41000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.Billing/billingAccounts/transactions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/transactions/41000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.TransactionProperties{ - // AzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](2000), - // }, - // AzurePlan: to.Ptr("Microsoft Azure Plan for DevTest"), - // BillingCurrency: to.Ptr("USD"), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00Z"); return t}()), - // Discount: to.Ptr[float32](0.1), - // EffectivePrice: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](10), - // }, - // ExchangeRate: to.Ptr[float32](1), - // Invoice: to.Ptr("2344233"), - // InvoiceID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/2344233"), - // InvoiceSectionDisplayName: to.Ptr("Contoso operations invoiceSection"), - // InvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // Kind: to.Ptr(armbilling.TransactionTypeKindAll), - // MarketPrice: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](20), - // }, - // 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, "2018-09-30T00:00:00Z"); return t}()), - // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00Z"); return t}()), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](4500), - // }, - // Tax: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](500), - // }, - // TransactionAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5000), - // }, - // TransactionType: to.Ptr(armbilling.ReservationTypePurchase), - // 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/transactions"), - // ID: to.Ptr("/providers/Microsoft.Billing/BillingAccounts/{billingAccountName}/transactions/51000000-0000-0000-0000-000000000000"), - // Properties: &armbilling.TransactionProperties{ - // AzureCreditApplied: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](20), - // }, - // AzurePlan: to.Ptr("Microsoft Azure Plan for DevTest"), - // BillingCurrency: to.Ptr("USD"), - // BillingProfileDisplayName: to.Ptr("Contoso operations billing"), - // BillingProfileID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}"), - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-01T00:00:00Z"); return t}()), - // Discount: to.Ptr[float32](0.1), - // EffectivePrice: &armbilling.Amount{ - // 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/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/22000000-0000-0000-0000-000000000000"), - // Kind: to.Ptr(armbilling.TransactionTypeKindAll), - // MarketPrice: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](20), - // }, - // 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, "2018-09-30T00:00:00Z"); return t}()), - // ServicePeriodStartDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-01T00:00:00Z"); return t}()), - // SubTotal: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](45), - // }, - // Tax: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](5), - // }, - // TransactionAmount: &armbilling.Amount{ - // Currency: to.Ptr("USD"), - // Value: to.Ptr[float32](50), - // }, - // TransactionType: to.Ptr(armbilling.ReservationType("Cancel")), - // UnitOfMeasure: to.Ptr("1 Minute"), - // UnitType: to.Ptr("1 Runtime Minute"), - // Units: to.Ptr[float32](1.25), - // }, - // }}, - // } - } -}