Az oldalhoz való hozzáféréshez engedély szükséges. Megpróbálhatja módosítani a címtárat.
Products - Validate Move Eligibility
Szolgáltatás:
Billing
API-verzió:
2024-04-01
Ellenőrzi, hogy egy termék díjait át lehet-e helyezni egy új számlaszakaszba. Ez a művelet csak az ismétlődő díjjal vásárolt termékek és a Microsoft Ügyfélszerződés típusú számlázási fiókok esetében támogatott.
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility?api-version=2024-04-01
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/products/6b96d3f2-9008-4a9d-912f-f87744185aa3/validateMoveEligibility?api-version=2024-04-01
{
"destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billing
# USAGE
python product_validate_move_failure.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.products.validate_move_eligibility(
billing_account_name="a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31",
product_name="6b96d3f2-9008-4a9d-912f-f87744185aa3",
parameters={
"destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"
},
)
print(response)
# x-ms-original-file: 2024-04-01/productValidateMoveFailure.json
if __name__ == "__main__":
main()
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/v2"
)
// Generated from example definition: 2024-04-01/productValidateMoveFailure.json
func ExampleProductsClient_ValidateMoveEligibility_productValidateMoveFailure() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProductsClient().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveProductRequest{
DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbilling.ProductsClientValidateMoveEligibilityResponse{
// MoveProductEligibilityResult: armbilling.MoveProductEligibilityResult{
// ErrorDetails: &armbilling.MoveProductEligibilityResultErrorDetails{
// Code: to.Ptr(armbilling.MoveValidationErrorCodeProductInactive),
// Message: to.Ptr("Invoice Sections can only be changed for active products."),
// },
// },
// }
}
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.
*
* @summary validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.
* x-ms-original-file: 2024-04-01/productValidateMoveFailure.json
*/
async function productValidateMoveFailure() {
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential);
const result = await client.products.validateMoveEligibility(
"a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31",
"6b96d3f2-9008-4a9d-912f-f87744185aa3",
{
destinationInvoiceSectionId:
"/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB",
},
);
console.log(result);
}
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/products/6b96d3f2-9008-4a9d-912f-f87744185aa3/validateMoveEligibility?api-version=2024-04-01
{
"destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.billing import BillingManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-billing
# USAGE
python product_validate_move_success.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = BillingManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.products.validate_move_eligibility(
billing_account_name="a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31",
product_name="6b96d3f2-9008-4a9d-912f-f87744185aa3",
parameters={
"destinationInvoiceSectionId": "/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"
},
)
print(response)
# x-ms-original-file: 2024-04-01/productValidateMoveSuccess.json
if __name__ == "__main__":
main()
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/v2"
)
// Generated from example definition: 2024-04-01/productValidateMoveSuccess.json
func ExampleProductsClient_ValidateMoveEligibility_productValidateMoveSuccess() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewProductsClient().ValidateMoveEligibility(ctx, "a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31", "6b96d3f2-9008-4a9d-912f-f87744185aa3", armbilling.MoveProductRequest{
DestinationInvoiceSectionID: to.Ptr("/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbilling.ProductsClientValidateMoveEligibilityResponse{
// MoveProductEligibilityResult: armbilling.MoveProductEligibilityResult{
// IsMoveEligible: to.Ptr(true),
// },
// }
}
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.
*
* @summary validates if a product's charges can be moved to a new invoice section. This operation is supported only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft Customer Agreement.
* x-ms-original-file: 2024-04-01/productValidateMoveSuccess.json
*/
async function productValidateMoveSuccess() {
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential);
const result = await client.products.validateMoveEligibility(
"a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31",
"6b96d3f2-9008-4a9d-912f-f87744185aa3",
{
destinationInvoiceSectionId:
"/providers/Microsoft.Billing/billingAccounts/a1a9c77e-4cec-4a6c-a089-867d973a6074:a80d3b1f-c626-4e5e-82ed-1173bd91c838_2019-05-31/billingProfiles/ea36e548-1505-41db-bebc-46fff3d37998/invoiceSections/Q7GV-UUVA-PJA-TGB",
},
);
console.log(result);
}