armmarketplaceordering

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 14 Imported by: 7

README

Azure Marketplace Ordering Module for Go

PkgGoDev

The armmarketplaceordering module provides operations for working with Azure Marketplace Ordering.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Marketplace Ordering module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Marketplace Ordering. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Marketplace Ordering module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armmarketplaceordering.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armmarketplaceordering.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewMarketplaceAgreementsClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Marketplace Ordering label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgreementProperties

type AgreementProperties struct {
	// If any version of the terms have been accepted, otherwise false.
	Accepted *bool

	// Link to HTML with Microsoft and Publisher terms.
	LicenseTextLink *string

	// Link to HTML with Azure Marketplace terms.
	MarketplaceTermsLink *string

	// Plan identifier string of image being deployed.
	Plan *string

	// Link to the privacy policy of the publisher.
	PrivacyPolicyLink *string

	// Offer identifier string of image being deployed.
	Product *string

	// Publisher identifier string of image being deployed.
	Publisher *string

	// Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.
	RetrieveDatetime *time.Time

	// Terms signature.
	Signature *string
}

AgreementProperties - Agreement Terms definition

func (AgreementProperties) MarshalJSON

func (a AgreementProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgreementProperties.

func (*AgreementProperties) UnmarshalJSON

func (a *AgreementProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgreementProperties.

type AgreementTerms

type AgreementTerms struct {
	// Represents the properties of the resource.
	Properties *AgreementProperties

	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; The system meta data relating to this resource.
	SystemData *SystemData

	// READ-ONLY; Resource type.
	Type *string
}

AgreementTerms - Terms properties for provided Publisher/Offer/Plan tuple

func (AgreementTerms) MarshalJSON added in v1.1.0

func (a AgreementTerms) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgreementTerms.

func (*AgreementTerms) UnmarshalJSON added in v1.1.0

func (a *AgreementTerms) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgreementTerms.

type ClientFactory added in v1.1.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.1.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewMarketplaceAgreementsClient added in v1.1.0

func (c *ClientFactory) NewMarketplaceAgreementsClient() *MarketplaceAgreementsClient

NewMarketplaceAgreementsClient creates a new instance of MarketplaceAgreementsClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type ErrorResponse

type ErrorResponse struct {
	// The details of the error.
	Error *ErrorResponseError
}

ErrorResponse - Error response indicates Microsoft.MarketplaceOrdering service is not able to process the incoming request. The reason is provided in the error message.

func (ErrorResponse) MarshalJSON added in v1.1.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type ErrorResponseError

type ErrorResponseError struct {
	// READ-ONLY; Error code.
	Code *string

	// READ-ONLY; Error message indicating why the operation failed.
	Message *string
}

ErrorResponseError - The details of the error.

func (ErrorResponseError) MarshalJSON added in v1.1.0

func (e ErrorResponseError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponseError.

func (*ErrorResponseError) UnmarshalJSON added in v1.1.0

func (e *ErrorResponseError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseError.

type MarketplaceAgreementsClient

type MarketplaceAgreementsClient struct {
	// contains filtered or unexported fields
}

MarketplaceAgreementsClient contains the methods for the MarketplaceAgreements group. Don't use this type directly, use NewMarketplaceAgreementsClient() instead.

func NewMarketplaceAgreementsClient

func NewMarketplaceAgreementsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MarketplaceAgreementsClient, error)

NewMarketplaceAgreementsClient creates a new instance of MarketplaceAgreementsClient with the specified values.

  • subscriptionID - The subscription ID that identifies an Azure subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*MarketplaceAgreementsClient) Cancel

Cancel - Cancel marketplace terms. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • publisherID - Publisher identifier string of image being deployed.
  • offerID - Offer identifier string of image being deployed.
  • planID - Plan identifier string of image being deployed.
  • options - MarketplaceAgreementsClientCancelOptions contains the optional parameters for the MarketplaceAgreementsClient.Cancel method.
Example

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/CancelMarketplaceTerms.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)

func main() {
	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().Cancel(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(false),
	// 		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"),
	// 	},
	// }
}
Output:

func (*MarketplaceAgreementsClient) Create

Create - Save marketplace terms. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • offerType - Offer Type, currently only virtualmachine type is supported.
  • publisherID - Publisher identifier string of image being deployed.
  • offerID - Offer identifier string of image being deployed.
  • planID - Plan identifier string of image being deployed.
  • parameters - Parameters supplied to the Create Marketplace Terms operation.
  • options - MarketplaceAgreementsClientCreateOptions contains the optional parameters for the MarketplaceAgreementsClient.Create method.
Example

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/SetMarketplaceTerms.json

package main

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/marketplaceordering/armmarketplaceordering"
)

func main() {
	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().Create(ctx, armmarketplaceordering.OfferTypeVirtualmachine, "pubid", "offid", "planid", armmarketplaceordering.AgreementTerms{
		Properties: &armmarketplaceordering.AgreementProperties{
			Accepted:             to.Ptr(false),
			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"),
		},
	}, 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"),
	// 	},
	// }
}
Output:

func (*MarketplaceAgreementsClient) Get

Get - Get marketplace terms. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • offerType - Offer Type, currently only virtualmachine type is supported.
  • publisherID - Publisher identifier string of image being deployed.
  • offerID - Offer identifier string of image being deployed.
  • planID - Plan identifier string of image being deployed.
  • options - MarketplaceAgreementsClientGetOptions contains the optional parameters for the MarketplaceAgreementsClient.Get method.
Example

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/GetMarketplaceTerms.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)

func main() {
	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().Get(ctx, armmarketplaceordering.OfferTypeVirtualmachine, "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"),
	// 	},
	// }
}
Output:

func (*MarketplaceAgreementsClient) GetAgreement

GetAgreement - Get marketplace agreement. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • publisherID - Publisher identifier string of image being deployed.
  • offerID - Offer identifier string of image being deployed.
  • planID - Plan identifier string of image being deployed.
  • options - MarketplaceAgreementsClientGetAgreementOptions contains the optional parameters for the MarketplaceAgreementsClient.GetAgreement method.
Example

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

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)

func main() {
	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"),
	// 	},
	// }
}
Output:

func (*MarketplaceAgreementsClient) List

List - List marketplace agreements in the subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • options - MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.List method.
Example

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/ListMarketplaceTerms.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)

func main() {
	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().List(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.AgreementTermsArray = []*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"),
	// 		},
	// }}
}
Output:

func (*MarketplaceAgreementsClient) Sign

Sign - Sign marketplace terms. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-01-01

  • publisherID - Publisher identifier string of image being deployed.
  • offerID - Offer identifier string of image being deployed.
  • planID - Plan identifier string of image being deployed.
  • options - MarketplaceAgreementsClientSignOptions contains the optional parameters for the MarketplaceAgreementsClient.Sign method.
Example

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

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/marketplaceordering/armmarketplaceordering"
)

func main() {
	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"),
	// 	},
	// }
}
Output:

type MarketplaceAgreementsClientCancelOptions added in v0.2.0

type MarketplaceAgreementsClientCancelOptions struct {
}

MarketplaceAgreementsClientCancelOptions contains the optional parameters for the MarketplaceAgreementsClient.Cancel method.

type MarketplaceAgreementsClientCancelResponse added in v0.2.0

type MarketplaceAgreementsClientCancelResponse struct {
	// Terms properties for provided Publisher/Offer/Plan tuple
	AgreementTerms
}

MarketplaceAgreementsClientCancelResponse contains the response from method MarketplaceAgreementsClient.Cancel.

type MarketplaceAgreementsClientCreateOptions added in v0.2.0

type MarketplaceAgreementsClientCreateOptions struct {
}

MarketplaceAgreementsClientCreateOptions contains the optional parameters for the MarketplaceAgreementsClient.Create method.

type MarketplaceAgreementsClientCreateResponse added in v0.2.0

type MarketplaceAgreementsClientCreateResponse struct {
	// Terms properties for provided Publisher/Offer/Plan tuple
	AgreementTerms
}

MarketplaceAgreementsClientCreateResponse contains the response from method MarketplaceAgreementsClient.Create.

type MarketplaceAgreementsClientGetAgreementOptions added in v0.2.0

type MarketplaceAgreementsClientGetAgreementOptions struct {
}

MarketplaceAgreementsClientGetAgreementOptions contains the optional parameters for the MarketplaceAgreementsClient.GetAgreement method.

type MarketplaceAgreementsClientGetAgreementResponse added in v0.2.0

type MarketplaceAgreementsClientGetAgreementResponse struct {
	// Terms properties for provided Publisher/Offer/Plan tuple
	AgreementTerms
}

MarketplaceAgreementsClientGetAgreementResponse contains the response from method MarketplaceAgreementsClient.GetAgreement.

type MarketplaceAgreementsClientGetOptions added in v0.2.0

type MarketplaceAgreementsClientGetOptions struct {
}

MarketplaceAgreementsClientGetOptions contains the optional parameters for the MarketplaceAgreementsClient.Get method.

type MarketplaceAgreementsClientGetResponse added in v0.2.0

type MarketplaceAgreementsClientGetResponse struct {
	// Terms properties for provided Publisher/Offer/Plan tuple
	AgreementTerms
}

MarketplaceAgreementsClientGetResponse contains the response from method MarketplaceAgreementsClient.Get.

type MarketplaceAgreementsClientListOptions added in v0.2.0

type MarketplaceAgreementsClientListOptions struct {
}

MarketplaceAgreementsClientListOptions contains the optional parameters for the MarketplaceAgreementsClient.List method.

type MarketplaceAgreementsClientListResponse added in v0.2.0

type MarketplaceAgreementsClientListResponse struct {
	// Array of AgreementTerms
	AgreementTermsArray []*AgreementTerms
}

MarketplaceAgreementsClientListResponse contains the response from method MarketplaceAgreementsClient.List.

type MarketplaceAgreementsClientSignOptions added in v0.2.0

type MarketplaceAgreementsClientSignOptions struct {
}

MarketplaceAgreementsClientSignOptions contains the optional parameters for the MarketplaceAgreementsClient.Sign method.

type MarketplaceAgreementsClientSignResponse added in v0.2.0

type MarketplaceAgreementsClientSignResponse struct {
	// Terms properties for provided Publisher/Offer/Plan tuple
	AgreementTerms
}

MarketplaceAgreementsClientSignResponse contains the response from method MarketplaceAgreementsClient.Sign.

type OfferType

type OfferType string
const (
	OfferTypeVirtualmachine OfferType = "virtualmachine"
)

func PossibleOfferTypeValues

func PossibleOfferTypeValues() []OfferType

PossibleOfferTypeValues returns the possible values for the OfferType const type.

type Operation

type Operation struct {
	// The object that represents the operation.
	Display *OperationDisplay

	// Operation name: {provider}/{resource}/{operation}
	Name *string
}

Operation - Microsoft.MarketplaceOrdering REST API operation

func (Operation) MarshalJSON added in v1.1.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Operation description.
	Description *string

	// Operation type: Get Agreement, Sign Agreement, Cancel Agreement etc.
	Operation *string

	// Service provider: Microsoft.MarketplaceOrdering
	Provider *string

	// Resource on which the operation is performed: Agreement, virtualmachine, etc.
	Resource *string
}

OperationDisplay - The object that represents the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// List of Microsoft.MarketplaceOrdering operations supported by the Microsoft.MarketplaceOrdering resource provider.
	Value []*Operation

	// READ-ONLY; URL to get the next set of operation list results if there are any.
	NextLink *string
}

OperationListResult - Result of the request to list MarketplaceOrdering operations. It contains a list of operations and a URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v1.1.0

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.4.0

NewListPager - Lists all of the available Microsoft.MarketplaceOrdering REST API operations.

Generated from API version 2021-01-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// Result of the request to list MarketplaceOrdering operations. It contains a list of operations and a URL link to get the
	// next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Resource

type Resource struct {
	// READ-ONLY; Resource ID.
	ID *string

	// READ-ONLY; Resource name.
	Name *string

	// READ-ONLY; Resource type.
	Type *string
}

Resource - ARM resource.

func (Resource) MarshalJSON added in v1.1.0

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL