POST https://management.azure.com/subscriptions/subid/providers/Microsoft.MarketplaceOrdering/agreements/pubid/offers/offid/plans/planid/sign?api-version=2021-01-01
import com.azure.core.util.Context;
/** Samples for MarketplaceAgreements Sign. */
public final class Main {
/*
* x-ms-original-file: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/SignMarketplaceTerms.json
*/
/**
* Sample code: SetMarketplaceTerms.
*
* @param manager Entry point to MarketplaceOrderingManager.
*/
public static void setMarketplaceTerms(
com.azure.resourcemanager.marketplaceordering.MarketplaceOrderingManager manager) {
manager.marketplaceAgreements().signWithResponse("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/SignMarketplaceTerms.json
func ExampleMarketplaceAgreementsClient_Sign() {
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().Sign(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 Sign marketplace terms.
*
* @summary Sign marketplace terms.
* x-ms-original-file: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/SignMarketplaceTerms.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.sign(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;
// Generated from example definition: specification/marketplaceordering/resource-manager/Microsoft.MarketplaceOrdering/stable/2021-01-01/examples/SignMarketplaceTerms.json
// this example is just showing the usage of "MarketplaceAgreements_Sign" 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 MarketplaceAgreementResource created on azure
// for more information of creating MarketplaceAgreementResource, please refer to the document of MarketplaceAgreementResource
string subscriptionId = "subid";
string publisherId = "pubid";
string offerId = "offid";
string planId = "planid";
ResourceIdentifier marketplaceAgreementResourceId = MarketplaceAgreementResource.CreateResourceIdentifier(subscriptionId, publisherId, offerId, planId);
MarketplaceAgreementResource marketplaceAgreement = client.GetMarketplaceAgreementResource(marketplaceAgreementResourceId);
// invoke the operation
MarketplaceAgreementResource result = await marketplaceAgreement.SignAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
MarketplaceAgreementTermData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue