GET https://management.azure.com/subscriptions/subid/providers/Microsoft.MarketplaceOrdering/agreements/pubid/offers/offid/plans/planid?api-version=2021-01-01
import com.azure.core.util.Context;
/** Samples for MarketplaceAgreements GetAgreement. */
public final class Main {
/*
* x-ms-original-file: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/GetAgreementMarketplaceTerms.json
*/
/**
* Sample code: SetMarketplaceTerms.
*
* @param manager Entry point to MarketplaceOrderingManager.
*/
public static void setMarketplaceTerms(
com.azure.resourcemanager.marketplaceordering.MarketplaceOrderingManager manager) {
manager.marketplaceAgreements().getAgreementWithResponse("pubid", "offid", "planid", Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armmarketplaceordering_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/GetAgreementMarketplaceTerms.json
func ExampleMarketplaceAgreementsClient_GetAgreement() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmarketplaceordering.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMarketplaceAgreementsClient().GetAgreement(ctx, "pubid", "offid", "planid", 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.AgreementTerms = armmarketplaceordering.AgreementTerms{
// Name: to.Ptr("planid"),
// Type: to.Ptr("Microsoft.MarketplaceOrdering/offertypes"),
// ID: to.Ptr("id"),
// Properties: &armmarketplaceordering.AgreementProperties{
// Accepted: to.Ptr(true),
// LicenseTextLink: to.Ptr("test.licenseLink"),
// MarketplaceTermsLink: to.Ptr("test.marketplaceTermsLink"),
// Plan: to.Ptr("planid"),
// PrivacyPolicyLink: to.Ptr("test.privacyPolicyLink"),
// Product: to.Ptr("offid"),
// Publisher: to.Ptr("pubid"),
// RetrieveDatetime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T11:33:07.121Z"); return t}()),
// Signature: to.Ptr("ASDFSDAFWEFASDGWERLWER"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { MarketplaceOrderingAgreements } = require("@azure/arm-marketplaceordering");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get marketplace agreement.
*
* @summary Get marketplace agreement.
* x-ms-original-file: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/GetAgreementMarketplaceTerms.json
*/
async function setMarketplaceTerms() {
const subscriptionId = process.env["MARKETPLACEORDERING_SUBSCRIPTION_ID"] || "subid";
const publisherId = "pubid";
const offerId = "offid";
const planId = "planid";
const credential = new DefaultAzureCredential();
const client = new MarketplaceOrderingAgreements(credential, subscriptionId);
const result = await client.marketplaceAgreements.getAgreement(publisherId, offerId, planId);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.MarketplaceOrdering;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/GetAgreementMarketplaceTerms.json
// this example is just showing the usage of "MarketplaceAgreements_GetAgreement" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// get the collection of this MarketplaceAgreementResource
MarketplaceAgreementCollection collection = subscriptionResource.GetMarketplaceAgreements();
// invoke the operation
string publisherId = "pubid";
string offerId = "offid";
string planId = "planid";
bool result = await collection.ExistsAsync(publisherId, offerId, planId);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue