armsaas

package module
Version: v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: MIT Imports: 13 Imported by: 5

README

Azure SaaS Module for Go

PkgGoDev

The armsaas module provides operations for working with Azure SaaS.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure SaaS module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure SaaS. 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.

Clients

Azure SaaS modules consist of one or more clients. A client groups a set of related APIs, providing access to its functionality within the specified subscription. Create one or more clients to access the APIs you require using your credential.

client, err := armsaas.NewApplicationsClient(<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,
    },
}
client, err := armsaas.NewApplicationsClient(<subscription ID>, cred, &options)

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the SaaS 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 AccessTokenResult

type AccessTokenResult struct {
	// The Publisher Offer Base Uri
	PublisherOfferBaseURI *string `json:"publisherOfferBaseUri,omitempty"`

	// The generated token
	Token *string `json:"token,omitempty"`
}

AccessTokenResult - the ISV access token result response.

type App added in v0.2.0

type App struct {
	// the resource location.
	Location *string `json:"location,omitempty"`

	// the resource name.
	Name *string `json:"name,omitempty"`

	// the resource properties.
	Properties *AppProperties `json:"properties,omitempty"`

	// the resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// the resource type.
	Type *string `json:"type,omitempty"`

	// READ-ONLY; the resource Id.
	ID *string `json:"id,omitempty" azure:"ro"`
}

App - the saasApp resource.

type AppOperation added in v0.2.0

type AppOperation struct {
	// the operation display
	Display *AppOperationDisplay `json:"display,omitempty"`

	// whether the operation is a data action or not.
	IsDataAction *bool `json:"isDataAction,omitempty"`

	// the operation name
	Name *string `json:"name,omitempty"`

	// the operation origin
	Origin *string `json:"origin,omitempty"`
}

AppOperation - saas app operations

type AppOperationDisplay added in v0.2.0

type AppOperationDisplay struct {
	// Description of the operation for display purposes
	Description *string `json:"description,omitempty"`

	// Name of the operation for display purposes
	Operation *string `json:"operation,omitempty"`

	// Name of the provider for display purposes
	Provider *string `json:"provider,omitempty"`

	// Name of the resource type for display purposes
	Resource *string `json:"resource,omitempty"`
}

AppOperationDisplay - Saas app operation display

type AppOperationsResponseWithContinuation added in v0.2.0

type AppOperationsResponseWithContinuation struct {
	// the next link to query to get the remaining results.
	NextLink *string `json:"nextLink,omitempty"`

	// the value of response.
	Value []*AppOperation `json:"value,omitempty"`
}

AppOperationsResponseWithContinuation - saas app operation response with continuation.

type AppPlan added in v0.2.0

type AppPlan struct {
	// the plan id.
	Name *string `json:"name,omitempty"`

	// the offer id.
	Product *string `json:"product,omitempty"`

	// the publisher id.
	Publisher *string `json:"publisher,omitempty"`
}

AppPlan - Saas resource plan.

type AppProperties added in v0.2.0

type AppProperties struct {
	// the resource plan details.
	SaasAppPlan *AppPlan `json:"saasAppPlan,omitempty"`

	// the Saas resource status.
	Status *SaasAppStatus `json:"status,omitempty"`
}

AppProperties - Saas resource properties.

type AppResponseWithContinuation added in v0.2.0

type AppResponseWithContinuation struct {
	// the next link to query to get the remaining results.
	NextLink *string `json:"nextLink,omitempty"`

	// the value of response.
	Value []*App `json:"value,omitempty"`
}

AppResponseWithContinuation - saas app response with continuation.

type ApplicationsClient

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

ApplicationsClient contains the methods for the Applications group. Don't use this type directly, use NewApplicationsClient() instead.

func NewApplicationsClient

func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error)

NewApplicationsClient creates a new instance of ApplicationsClient with the specified values. subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*ApplicationsClient) NewListPager added in v0.4.0

func (client *ApplicationsClient) NewListPager(resourceGroupName string, options *ApplicationsClientListOptions) *runtime.Pager[ApplicationsClientListResponse]

NewListPager - Gets all SaaS resources by subscription id and resource group name. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV1/SaaSGetApplications.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewApplicationsClient("bc6c2f82-a39d-41b8-a648-71527498a23e", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager("myResourceGroup",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type ApplicationsClientListOptions added in v0.2.0

type ApplicationsClientListOptions struct {
}

ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method.

type ApplicationsClientListResponse added in v0.2.0

type ApplicationsClientListResponse struct {
	AppResponseWithContinuation
}

ApplicationsClientListResponse contains the response from method ApplicationsClient.List.

type Client added in v0.2.0

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

Client contains the methods for the SaaS group. Don't use this type directly, use NewClient() instead.

func NewClient added in v0.2.0

func NewClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error)

NewClient creates a new instance of Client with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*Client) BeginCreateResource added in v0.2.0

func (client *Client) BeginCreateResource(ctx context.Context, parameters ResourceCreation, options *ClientBeginCreateResourceOptions) (*runtime.Poller[ClientCreateResourceResponse], error)

BeginCreateResource - Creates a SaaS resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta parameters - Parameters supplied to the create saas operation. options - ClientBeginCreateResourceOptions contains the optional parameters for the Client.BeginCreateResource method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/SaasPut.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateResource(ctx,
		armsaas.ResourceCreation{
			Properties: &armsaas.CreationProperties{
				OfferID: to.Ptr("microsofthealthcarebot"),
				PaymentChannelMetadata: map[string]*string{
					"AzureSubscriptionId": to.Ptr("155af98a-3205-47e7-883b-a2ab9db9f88d"),
				},
				PaymentChannelType: to.Ptr(armsaas.PaymentChannelTypeSubscriptionDelegated),
				PublisherID:        to.Ptr("microsoft-hcb"),
				SaasResourceName:   to.Ptr("testRunnerFromArm"),
				SKUID:              to.Ptr("free"),
				TermID:             to.Ptr("hjdtn7tfnxcy"),
			},
		},
		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)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) BeginDelete added in v0.2.0

func (client *Client) BeginDelete(ctx context.Context, resourceID string, parameters DeleteOptions, options *ClientBeginDeleteOptions) (*runtime.Poller[ClientDeleteResponse], error)

BeginDelete - Deletes the specified SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceID - The Saas resource ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) parameters - Parameters supplied to delete saas operation. options - ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/SaasDelete.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"115c3523-1fae-757f-af86-7b27cfd29805",
		armsaas.DeleteOptions{
			ReasonCode:      to.Ptr[float32](0),
			UnsubscribeOnly: to.Ptr(true),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*Client) BeginUpdateResource added in v0.2.0

func (client *Client) BeginUpdateResource(ctx context.Context, resourceID string, parameters ResourceCreation, options *ClientBeginUpdateResourceOptions) (*runtime.Poller[ClientUpdateResourceResponse], error)

BeginUpdateResource - Updates a SaaS resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceID - The Saas resource ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) parameters - Parameters supplied to the update saas operation. options - ClientBeginUpdateResourceOptions contains the optional parameters for the Client.BeginUpdateResource method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/SaasPatch.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginUpdateResource(ctx,
		"115c3523-1fae-757f-af86-7b27cfd29805",
		armsaas.ResourceCreation{
			Properties: &armsaas.CreationProperties{
				SKUID: to.Ptr("premium"),
			},
			Tags: map[string]*string{},
		},
		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)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*Client) GetResource added in v0.2.0

func (client *Client) GetResource(ctx context.Context, resourceID string, options *ClientGetResourceOptions) (ClientGetResourceResponse, error)

GetResource - Gets information about the specified SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceID - The Saas resource ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) options - ClientGetResourceOptions contains the optional parameters for the Client.GetResource method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/SaasGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.GetResource(ctx,
		"115c3523-1fae-757f-af86-7b27cfd29805",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

type ClientBeginCreateResourceOptions added in v0.2.0

type ClientBeginCreateResourceOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginCreateResourceOptions contains the optional parameters for the Client.BeginCreateResource method.

type ClientBeginDeleteOptions added in v0.2.0

type ClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginDeleteOptions contains the optional parameters for the Client.BeginDelete method.

type ClientBeginUpdateResourceOptions added in v0.2.0

type ClientBeginUpdateResourceOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ClientBeginUpdateResourceOptions contains the optional parameters for the Client.BeginUpdateResource method.

type ClientCreateResourceResponse added in v0.2.0

type ClientCreateResourceResponse struct {
	Resource
}

ClientCreateResourceResponse contains the response from method Client.CreateResource.

type ClientDeleteResponse added in v0.2.0

type ClientDeleteResponse struct {
}

ClientDeleteResponse contains the response from method Client.Delete.

type ClientGetResourceOptions added in v0.2.0

type ClientGetResourceOptions struct {
}

ClientGetResourceOptions contains the optional parameters for the Client.GetResource method.

type ClientGetResourceResponse added in v0.2.0

type ClientGetResourceResponse struct {
	Resource
}

ClientGetResourceResponse contains the response from method Client.GetResource.

type ClientUpdateResourceResponse added in v0.2.0

type ClientUpdateResourceResponse struct {
	Resource
}

ClientUpdateResourceResponse contains the response from method Client.UpdateResource.

type CreationProperties added in v0.2.0

type CreationProperties struct {
	// Whether the SaaS subscription will auto renew upon term end.
	AutoRenew *bool `json:"autoRenew,omitempty"`

	// The offer id.
	OfferID *string `json:"offerId,omitempty"`

	// The metadata about the SaaS subscription such as the AzureSubscriptionId and ResourceUri.
	PaymentChannelMetadata map[string]*string `json:"paymentChannelMetadata,omitempty"`

	// The Payment channel for the SaasSubscription.
	PaymentChannelType *PaymentChannelType `json:"paymentChannelType,omitempty"`

	// The publisher id.
	PublisherID *string `json:"publisherId,omitempty"`

	// The environment in the publisher side for this resource.
	PublisherTestEnvironment *string `json:"publisherTestEnvironment,omitempty"`

	// The seat count.
	Quantity *float32 `json:"quantity,omitempty"`

	// The plan id.
	SKUID *string `json:"skuId,omitempty"`

	// The SaaS resource name.
	SaasResourceName *string `json:"saasResourceName,omitempty"`

	// The saas session id used for dev service migration request.
	SaasSessionID *string `json:"saasSessionId,omitempty"`

	// The saas subscription id used for tenant to subscription level migration request.
	SaasSubscriptionID *string `json:"saasSubscriptionId,omitempty"`

	// The current Term id.
	TermID *string `json:"termId,omitempty"`
}

CreationProperties - properties for creation saas

func (CreationProperties) MarshalJSON added in v0.2.0

func (c CreationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CreationProperties.

type DeleteOptions

type DeleteOptions struct {
	// the feedback
	Feedback *string `json:"feedback,omitempty"`

	// The reasonCode
	ReasonCode *float32 `json:"reasonCode,omitempty"`

	// whether it is unsubscribeOnly
	UnsubscribeOnly *bool `json:"unsubscribeOnly,omitempty"`
}

DeleteOptions - delete Options

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info interface{} `json:"info,omitempty" azure:"ro"`

	// READ-ONLY; The additional info type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ErrorAdditionalInfo - The resource management error additional info.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"`

	// READ-ONLY; The error code.
	Code *string `json:"code,omitempty" azure:"ro"`

	// READ-ONLY; The error details.
	Details []*ErrorDetail `json:"details,omitempty" azure:"ro"`

	// READ-ONLY; The error message.
	Message *string `json:"message,omitempty" azure:"ro"`

	// READ-ONLY; The error target.
	Target *string `json:"target,omitempty" azure:"ro"`
}

ErrorDetail - The error detail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail `json:"error,omitempty"`
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

type MoveResource

type MoveResource struct {
	// The resource uris to move
	Resources []*string `json:"resources,omitempty"`

	// The target resource group uri for the move
	TargetResourceGroup *string `json:"targetResourceGroup,omitempty"`
}

MoveResource - Resource Move Options

func (MoveResource) MarshalJSON

func (m MoveResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type MoveResource.

type OperationClient added in v0.2.0

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

OperationClient contains the methods for the SaaSOperation group. Don't use this type directly, use NewOperationClient() instead.

func NewOperationClient added in v0.2.0

func NewOperationClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error)

NewOperationClient creates a new instance of OperationClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*OperationClient) BeginGet added in v0.2.0

BeginGet - Gets information about the specified operation progress. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta operationID - the operation Id parameter. options - OperationClientBeginGetOptions contains the optional parameters for the OperationClient.BeginGet method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/OperationResults/Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewOperationClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginGet(ctx,
		"5f35cb4c-8065-45b3-9116-5ba335462e95",
		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)
	}
	// TODO: use response item
	_ = res
}
Output:

type OperationClientBeginGetOptions added in v0.2.0

type OperationClientBeginGetOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

OperationClientBeginGetOptions contains the optional parameters for the OperationClient.BeginGet method.

type OperationClientGetResponse added in v0.2.0

type OperationClientGetResponse struct {
	Resource
}

OperationClientGetResponse contains the response from method OperationClient.Get.

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 - Gets all SaaS app operations. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV1/SaaSGetOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewOperationsClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	AppOperationsResponseWithContinuation
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type PaymentChannelType

type PaymentChannelType string

PaymentChannelType - The Payment channel for the SaasSubscription.

const (
	PaymentChannelTypeCustomerDelegated     PaymentChannelType = "CustomerDelegated"
	PaymentChannelTypeSubscriptionDelegated PaymentChannelType = "SubscriptionDelegated"
)

func PossiblePaymentChannelTypeValues

func PossiblePaymentChannelTypeValues() []PaymentChannelType

PossiblePaymentChannelTypeValues returns the possible values for the PaymentChannelType const type.

type Properties added in v0.2.0

type Properties struct {
	// Whether the current term is a Free Trial term
	IsFreeTrial *bool `json:"isFreeTrial,omitempty"`

	// The last modifier date if this resource.
	LastModified *string `json:"lastModified,omitempty"`

	// The SaaS Subscription Status.
	Status *SaasResourceStatus `json:"status,omitempty"`

	// The current Term object.
	Term *PropertiesTerm `json:"term,omitempty"`

	// READ-ONLY; The created date of this resource.
	Created *string `json:"created,omitempty" azure:"ro"`
}

Properties - saas resource properties

type PropertiesTerm added in v0.2.0

type PropertiesTerm struct {
	// The end date of the current term
	EndDate *string `json:"endDate,omitempty"`

	// The start date of the current term
	StartDate *string `json:"startDate,omitempty"`

	// The unit indicating Monthly / Yearly
	TermUnit *string `json:"termUnit,omitempty"`
}

PropertiesTerm - The current Term object.

type Resource added in v0.2.0

type Resource struct {
	// saas properties
	Properties *ResourceProperties `json:"properties,omitempty"`

	// the resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The resource uri
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; The name of the resource
	Name *string `json:"name,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

Resource - SaaS REST API resource definition.

type ResourceCreation added in v0.2.0

type ResourceCreation struct {
	// Resource location. Only value allowed for SaaS is 'global'
	Location *string `json:"location,omitempty"`

	// The resource name
	Name *string `json:"name,omitempty"`

	// Properties of the SaaS resource that are relevant for creation.
	Properties *CreationProperties `json:"properties,omitempty"`

	// the resource tags.
	Tags map[string]*string `json:"tags,omitempty"`

	// READ-ONLY; The resource uri
	ID *string `json:"id,omitempty" azure:"ro"`

	// READ-ONLY; Resource type.
	Type *string `json:"type,omitempty" azure:"ro"`
}

ResourceCreation - SaaS REST API resource definition for creation.

func (ResourceCreation) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceCreation.

type ResourceProperties added in v0.2.0

type ResourceProperties struct {
	// Whether the SaaS subscription will auto renew upon term end.
	AutoRenew *bool `json:"autoRenew,omitempty"`

	// Whether the current term is a Free Trial term
	IsFreeTrial *bool `json:"isFreeTrial,omitempty"`

	// The last modifier date if this resource.
	LastModified *string `json:"lastModified,omitempty"`

	// The offer id.
	OfferID *string `json:"offerId,omitempty"`

	// The metadata about the SaaS subscription such as the AzureSubscriptionId and ResourceUri.
	PaymentChannelMetadata map[string]*string `json:"paymentChannelMetadata,omitempty"`

	// The Payment channel for the SaasSubscription.
	PaymentChannelType *PaymentChannelType `json:"paymentChannelType,omitempty"`

	// The publisher id.
	PublisherID *string `json:"publisherId,omitempty"`

	// The environment in the publisher side for this resource.
	PublisherTestEnvironment *string `json:"publisherTestEnvironment,omitempty"`

	// The seat count.
	Quantity *float32 `json:"quantity,omitempty"`

	// The plan id.
	SKUID *string `json:"skuId,omitempty"`

	// The SaaS resource name.
	SaasResourceName *string `json:"saasResourceName,omitempty"`

	// The saas session id used for dev service migration request.
	SaasSessionID *string `json:"saasSessionId,omitempty"`

	// The saas subscription id used for tenant to subscription level migration request.
	SaasSubscriptionID *string `json:"saasSubscriptionId,omitempty"`

	// The SaaS Subscription Status.
	Status *SaasResourceStatus `json:"status,omitempty"`

	// The current Term object.
	Term *PropertiesTerm `json:"term,omitempty"`

	// The current Term id.
	TermID *string `json:"termId,omitempty"`

	// READ-ONLY; The created date of this resource.
	Created *string `json:"created,omitempty" azure:"ro"`
}

ResourceProperties - saas properties

func (ResourceProperties) MarshalJSON added in v0.2.0

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

MarshalJSON implements the json.Marshaller interface for type ResourceProperties.

type ResourceResponseWithContinuation added in v0.2.0

type ResourceResponseWithContinuation struct {
	// the next link to query to get the remaining results.
	NextLink *string `json:"nextLink,omitempty"`

	// the value of response.
	Value []*Resource `json:"value,omitempty"`
}

ResourceResponseWithContinuation - saas resources response with continuation.

type ResourcesClient added in v0.2.0

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

ResourcesClient contains the methods for the SaasResources group. Don't use this type directly, use NewResourcesClient() instead.

func NewResourcesClient added in v0.2.0

func NewResourcesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourcesClient, error)

NewResourcesClient creates a new instance of ResourcesClient with the specified values. credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*ResourcesClient) ListAccessToken added in v0.2.0

ListAccessToken - Gets the ISV access token for a SaaS resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceID - The Saas resource ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) options - ResourcesClientListAccessTokenOptions contains the optional parameters for the ResourcesClient.ListAccessToken method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/ListAccessTokenPost.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewResourcesClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListAccessToken(ctx,
		"c825645b-e31b-9cf4-1cee-2aba9e58bc7c",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*ResourcesClient) NewListPager added in v0.4.0

NewListPager - Get All Resources If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta options - ResourcesClientListOptions contains the optional parameters for the ResourcesClient.List method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasV2/SaaSGetAllResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewResourcesClient(cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

type ResourcesClientListAccessTokenOptions added in v0.2.0

type ResourcesClientListAccessTokenOptions struct {
}

ResourcesClientListAccessTokenOptions contains the optional parameters for the ResourcesClient.ListAccessToken method.

type ResourcesClientListAccessTokenResponse added in v0.2.0

type ResourcesClientListAccessTokenResponse struct {
	AccessTokenResult
}

ResourcesClientListAccessTokenResponse contains the response from method ResourcesClient.ListAccessToken.

type ResourcesClientListOptions added in v0.2.0

type ResourcesClientListOptions struct {
}

ResourcesClientListOptions contains the optional parameters for the ResourcesClient.List method.

type ResourcesClientListResponse added in v0.2.0

type ResourcesClientListResponse struct {
	ResourceResponseWithContinuation
}

ResourcesClientListResponse contains the response from method ResourcesClient.List.

type Result

type Result struct {
	// Sample property of type string
	SampleProperty *string `json:"sampleProperty,omitempty"`
}

Result - Sample result definition

type SaasAppStatus

type SaasAppStatus string

SaasAppStatus - the Saas resource status.

const (
	SaasAppStatusDeactivated  SaasAppStatus = "Deactivated"
	SaasAppStatusPending      SaasAppStatus = "Pending"
	SaasAppStatusSubscribed   SaasAppStatus = "Subscribed"
	SaasAppStatusSuspended    SaasAppStatus = "Suspended"
	SaasAppStatusUnsubscribed SaasAppStatus = "Unsubscribed"
)

func PossibleSaasAppStatusValues

func PossibleSaasAppStatusValues() []SaasAppStatus

PossibleSaasAppStatusValues returns the possible values for the SaasAppStatus const type.

type SaasResourceStatus

type SaasResourceStatus string

SaasResourceStatus - The SaaS Subscription Status.

const (
	SaasResourceStatusNotStarted              SaasResourceStatus = "NotStarted"
	SaasResourceStatusPendingFulfillmentStart SaasResourceStatus = "PendingFulfillmentStart"
	SaasResourceStatusSubscribed              SaasResourceStatus = "Subscribed"
	SaasResourceStatusSuspended               SaasResourceStatus = "Suspended"
	SaasResourceStatusUnsubscribed            SaasResourceStatus = "Unsubscribed"
)

func PossibleSaasResourceStatusValues

func PossibleSaasResourceStatusValues() []SaasResourceStatus

PossibleSaasResourceStatusValues returns the possible values for the SaasResourceStatus const type.

type SubscriptionLevelClient added in v0.2.0

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

SubscriptionLevelClient contains the methods for the SaasSubscriptionLevel group. Don't use this type directly, use NewSubscriptionLevelClient() instead.

func NewSubscriptionLevelClient added in v0.2.0

func NewSubscriptionLevelClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionLevelClient, error)

NewSubscriptionLevelClient creates a new instance of SubscriptionLevelClient with the specified values. subscriptionID - The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) credential - used to authorize requests. Usually a credential from azidentity. options - pass nil to accept the default values.

func (*SubscriptionLevelClient) BeginCreateOrUpdate added in v0.2.0

BeginCreateOrUpdate - Creates or updates a SaaS resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. parameters - Parameters supplied to the create or update subscription level saas operation. options - SubscriptionLevelClientBeginCreateOrUpdateOptions contains the optional parameters for the SubscriptionLevelClient.BeginCreateOrUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasPut.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginCreateOrUpdate(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		armsaas.ResourceCreation{
			Name:     to.Ptr("MyContosoSubscription"),
			Location: to.Ptr("global"),
			Properties: &armsaas.CreationProperties{
				OfferID: to.Ptr("contosoOffer"),
				PaymentChannelMetadata: map[string]*string{
					"AzureSubscriptionId": to.Ptr("155af98a-3205-47e7-883b-a2ab9db9f88d"),
				},
				PaymentChannelType: to.Ptr(armsaas.PaymentChannelTypeSubscriptionDelegated),
				PublisherID:        to.Ptr("microsoft-contoso"),
				SaasResourceName:   to.Ptr("MyContosoSubscription"),
				SKUID:              to.Ptr("free"),
				TermID:             to.Ptr("hjdtn7tfnxcy"),
			},
		},
		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)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionLevelClient) BeginDelete added in v0.2.0

BeginDelete - Deletes the specified SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. options - SubscriptionLevelClientBeginDeleteOptions contains the optional parameters for the SubscriptionLevelClient.BeginDelete method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginDelete(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SubscriptionLevelClient) BeginMoveResources added in v0.2.0

BeginMoveResources - Move a specified Subscription Level SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. moveResourceParameter - Object that represents the resources to move. options - SubscriptionLevelClientBeginMoveResourcesOptions contains the optional parameters for the SubscriptionLevelClient.BeginMoveResources method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/ResourceMove.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginMoveResources(ctx,
		"my-saas-rg",
		armsaas.MoveResource{
			Resources: []*string{
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas1"),
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas2"),
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas3")},
			TargetResourceGroup: to.Ptr("/subscriptions/5122d0a3-1e10-4baf-bdc5-c2a452489525/resourceGroups/new-saas-rg"),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SubscriptionLevelClient) BeginUpdate added in v0.2.0

BeginUpdate - Updates a SaaS Subscription Level resource. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. parameters - Parameters supplied to the update saas operation. options - SubscriptionLevelClientBeginUpdateOptions contains the optional parameters for the SubscriptionLevelClient.BeginUpdate method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasPatch.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginUpdate(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		armsaas.ResourceCreation{
			Properties: &armsaas.CreationProperties{
				SKUID: to.Ptr("premium"),
			},
			Tags: map[string]*string{},
		},
		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)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionLevelClient) BeginUpdateToUnsubscribed added in v0.2.0

BeginUpdateToUnsubscribed - Unsubscribe from a specified Subscription Level SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. parameters - Parameters supplied to unsubscribe saas operation. options - SubscriptionLevelClientBeginUpdateToUnsubscribedOptions contains the optional parameters for the SubscriptionLevelClient.BeginUpdateToUnsubscribed method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasUnsubscribe.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := client.BeginUpdateToUnsubscribed(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		armsaas.DeleteOptions{
			Feedback:        to.Ptr("No longer need this SaaS"),
			ReasonCode:      to.Ptr[float32](0),
			UnsubscribeOnly: to.Ptr(true),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*SubscriptionLevelClient) Get added in v0.2.0

Get - Gets information about the specified Subscription Level SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. options - SubscriptionLevelClientGetOptions contains the optional parameters for the SubscriptionLevelClient.Get method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.Get(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionLevelClient) ListAccessToken added in v0.2.0

ListAccessToken - Gets the ISV access token for a specified Subscription Level SaaS. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. resourceName - The name of the resource. options - SubscriptionLevelClientListAccessTokenOptions contains the optional parameters for the SubscriptionLevelClient.ListAccessToken method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/ListAccessTokenPost.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := client.ListAccessToken(ctx,
		"my-saas-rg",
		"MyContosoSubscription",
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// TODO: use response item
	_ = res
}
Output:

func (*SubscriptionLevelClient) NewListByAzureSubscriptionPager added in v0.4.0

NewListByAzureSubscriptionPager - Gets information about all the Subscription Level SaaS in a certain Azure subscription. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta options - SubscriptionLevelClientListByAzureSubscriptionOptions contains the optional parameters for the SubscriptionLevelClient.ListByAzureSubscription method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasGetAllInAzureSubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByAzureSubscriptionPager(nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*SubscriptionLevelClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - Gets information about all the Subscription Level SaaS in a certain resource group. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. options - SubscriptionLevelClientListByResourceGroupOptions contains the optional parameters for the SubscriptionLevelClient.ListByResourceGroup method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/SaasGetAllInResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := client.NewListByResourceGroupPager("my-saas-rg",
		nil)
	for pager.More() {
		nextResult, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range nextResult.Value {
			// TODO: use page item
			_ = v
		}
	}
}
Output:

func (*SubscriptionLevelClient) ValidateMoveResources added in v0.2.0

ValidateMoveResources - Validate whether a specified Subscription Level SaaS can be moved. If the operation fails it returns an *azcore.ResponseError type. Generated from API version 2018-03-01-beta resourceGroupName - The name of the resource group. moveResourceParameter - Object that represents the resources to move. options - SubscriptionLevelClientValidateMoveResourcesOptions contains the optional parameters for the SubscriptionLevelClient.ValidateMoveResources method.

Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/saas/resource-manager/Microsoft.SaaS/preview/2018-03-01-beta/examples/saasSubscriptionLevel/ValidateResourceMove.json

package main

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/saas/armsaas"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	client, err := armsaas.NewSubscriptionLevelClient("c825645b-e31b-9cf4-1cee-2aba9e58bc7c", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = client.ValidateMoveResources(ctx,
		"my-saas-rg",
		armsaas.MoveResource{
			Resources: []*string{
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas1"),
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas2"),
				to.Ptr("/subscriptions/c825645b-e31b-9cf4-1cee-2aba9e58bc7c/resourceGroups/my-saas-rg/providers/Microsoft.SaaS/resources/saas3")},
			TargetResourceGroup: to.Ptr("/subscriptions/5122d0a3-1e10-4baf-bdc5-c2a452489525/resourceGroups/new-saas-rg"),
		},
		nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

type SubscriptionLevelClientBeginCreateOrUpdateOptions added in v0.2.0

type SubscriptionLevelClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SubscriptionLevelClientBeginCreateOrUpdateOptions contains the optional parameters for the SubscriptionLevelClient.BeginCreateOrUpdate method.

type SubscriptionLevelClientBeginDeleteOptions added in v0.2.0

type SubscriptionLevelClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SubscriptionLevelClientBeginDeleteOptions contains the optional parameters for the SubscriptionLevelClient.BeginDelete method.

type SubscriptionLevelClientBeginMoveResourcesOptions added in v0.2.0

type SubscriptionLevelClientBeginMoveResourcesOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SubscriptionLevelClientBeginMoveResourcesOptions contains the optional parameters for the SubscriptionLevelClient.BeginMoveResources method.

type SubscriptionLevelClientBeginUpdateOptions added in v0.2.0

type SubscriptionLevelClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SubscriptionLevelClientBeginUpdateOptions contains the optional parameters for the SubscriptionLevelClient.BeginUpdate method.

type SubscriptionLevelClientBeginUpdateToUnsubscribedOptions added in v0.2.0

type SubscriptionLevelClientBeginUpdateToUnsubscribedOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SubscriptionLevelClientBeginUpdateToUnsubscribedOptions contains the optional parameters for the SubscriptionLevelClient.BeginUpdateToUnsubscribed method.

type SubscriptionLevelClientCreateOrUpdateResponse added in v0.2.0

type SubscriptionLevelClientCreateOrUpdateResponse struct {
	Resource
}

SubscriptionLevelClientCreateOrUpdateResponse contains the response from method SubscriptionLevelClient.CreateOrUpdate.

type SubscriptionLevelClientDeleteResponse added in v0.2.0

type SubscriptionLevelClientDeleteResponse struct {
}

SubscriptionLevelClientDeleteResponse contains the response from method SubscriptionLevelClient.Delete.

type SubscriptionLevelClientGetOptions added in v0.2.0

type SubscriptionLevelClientGetOptions struct {
}

SubscriptionLevelClientGetOptions contains the optional parameters for the SubscriptionLevelClient.Get method.

type SubscriptionLevelClientGetResponse added in v0.2.0

type SubscriptionLevelClientGetResponse struct {
	Resource
}

SubscriptionLevelClientGetResponse contains the response from method SubscriptionLevelClient.Get.

type SubscriptionLevelClientListAccessTokenOptions added in v0.2.0

type SubscriptionLevelClientListAccessTokenOptions struct {
}

SubscriptionLevelClientListAccessTokenOptions contains the optional parameters for the SubscriptionLevelClient.ListAccessToken method.

type SubscriptionLevelClientListAccessTokenResponse added in v0.2.0

type SubscriptionLevelClientListAccessTokenResponse struct {
	AccessTokenResult
}

SubscriptionLevelClientListAccessTokenResponse contains the response from method SubscriptionLevelClient.ListAccessToken.

type SubscriptionLevelClientListByAzureSubscriptionOptions added in v0.2.0

type SubscriptionLevelClientListByAzureSubscriptionOptions struct {
}

SubscriptionLevelClientListByAzureSubscriptionOptions contains the optional parameters for the SubscriptionLevelClient.ListByAzureSubscription method.

type SubscriptionLevelClientListByAzureSubscriptionResponse added in v0.2.0

type SubscriptionLevelClientListByAzureSubscriptionResponse struct {
	ResourceResponseWithContinuation
}

SubscriptionLevelClientListByAzureSubscriptionResponse contains the response from method SubscriptionLevelClient.ListByAzureSubscription.

type SubscriptionLevelClientListByResourceGroupOptions added in v0.2.0

type SubscriptionLevelClientListByResourceGroupOptions struct {
}

SubscriptionLevelClientListByResourceGroupOptions contains the optional parameters for the SubscriptionLevelClient.ListByResourceGroup method.

type SubscriptionLevelClientListByResourceGroupResponse added in v0.2.0

type SubscriptionLevelClientListByResourceGroupResponse struct {
	ResourceResponseWithContinuation
}

SubscriptionLevelClientListByResourceGroupResponse contains the response from method SubscriptionLevelClient.ListByResourceGroup.

type SubscriptionLevelClientMoveResourcesResponse added in v0.2.0

type SubscriptionLevelClientMoveResourcesResponse struct {
}

SubscriptionLevelClientMoveResourcesResponse contains the response from method SubscriptionLevelClient.MoveResources.

type SubscriptionLevelClientUpdateResponse added in v0.2.0

type SubscriptionLevelClientUpdateResponse struct {
	Resource
}

SubscriptionLevelClientUpdateResponse contains the response from method SubscriptionLevelClient.Update.

type SubscriptionLevelClientUpdateToUnsubscribedResponse added in v0.2.0

type SubscriptionLevelClientUpdateToUnsubscribedResponse struct {
}

SubscriptionLevelClientUpdateToUnsubscribedResponse contains the response from method SubscriptionLevelClient.UpdateToUnsubscribed.

type SubscriptionLevelClientValidateMoveResourcesOptions added in v0.2.0

type SubscriptionLevelClientValidateMoveResourcesOptions struct {
}

SubscriptionLevelClientValidateMoveResourcesOptions contains the optional parameters for the SubscriptionLevelClient.ValidateMoveResources method.

type SubscriptionLevelClientValidateMoveResourcesResponse added in v0.2.0

type SubscriptionLevelClientValidateMoveResourcesResponse struct {
}

SubscriptionLevelClientValidateMoveResourcesResponse contains the response from method SubscriptionLevelClient.ValidateMoveResources.

Jump to

Keyboard shortcuts

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